f-70: e2e: corrections après la campagne du lab (arrêt ACPI, ebtables nft, DHCPACK, disques SCSI, multi-NIC) #70

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-10-17 22:08:21 +02:00
commit 362f26644e
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
13 changed files with 65 additions and 36 deletions

View file

@ -36,7 +36,7 @@ api_state () {
wait_state () {
local path="${1}" want="${2}" i s
for i in $(seq 1 90); do
for i in $(seq 1 180); do
s=$(api_state "${path}")
[ "${s}" = "${want}" ] && return 0
[ "${want}" = deleted ] && [ -z "${s}" ] && return 0

View file

@ -33,7 +33,7 @@ host_state () {
echo "## iptables"; iptables-save | grep -v '^#' | sed 's/ \[[0-9]*:[0-9]*\]$//'
echo "## frr"; vtysh -c 'show running-config' | grep -v '^Building\|^Current configuration\|^!'
echo "## frr.conf"; sha256sum /etc/frr/frr.conf | cut -d' ' -f1
echo "## fichiers"; find /run/two /etc/dnsmasq.d "${VOLUMES}" -mindepth 1 2>/dev/null | sort
echo "## fichiers"; find /run/two /etc/dnsmasq.d "${VOLUMES}" -mindepth 1 ! -type d ! -path '/run/two/dhcp/*.sock' 2>/dev/null | sort
echo "## unités"; systemctl list-units --all --plain --no-legend 'two-vm-*' | awk '{print $1}'
echo "## processus"; pgrep -a dnsmasq | cut -d' ' -f2- | sort; echo "qemu: $(pgrep -c qemu-system)"
}

View file

@ -187,7 +187,7 @@ ebt_rules () {
}
ebt_confined () {
ebt_rules "${1}" "${2}" | grep -ci -- "-s $(ebt_mac "${3}") .*DROP"
ebt_rules "${1}" "${2}" | grep -ciE -- "-s ($(ebt_mac "${3}")|${3}) .*DROP"
}
ebt_arp_drop () {

View file

@ -142,21 +142,20 @@ wait_reboot () {
return 1
}
lease_mtime () {
vm_ssh "${1}" "${2}" "sudo stat -c %Y /run/systemd/netif/leases/\$(cat /sys/class/net/${3:-ens3}/ifindex)"
dhcp_acks () {
journalctl --since "@${1}" --no-pager -o cat -u 'dhcp@*' -u 'dnsmasq@*' | grep -cE "\"type\":5,\"ip\":\"${2}\"|DHCPACK\([^)]*\) ${2} "
}
lease_renewed () {
local before after i
before=$(lease_mtime "${1}" "${2}") || return 1
sleep 2
local t0 i
t0=$(date +%s)
sleep 1
vm_ssh "${1}" "${2}" "sudo networkctl renew ${3:-ens3}" || return 1
for i in $(seq 1 15); do
after=$(lease_mtime "${1}" "${2}")
[ -n "${after}" ] && [ "${after}" != "${before}" ] && return 0
[ "$(dhcp_acks "${t0}" "${2}")" -gt 0 ] && return 0
sleep 2
done
echo "${2} : bail non renouvelé (fichier inchangé depuis ${before})" >&2
echo "${2} : aucun DHCPACK du serveur depuis la demande de renouvellement" >&2
return 1
}