Skip to content
Snippets Groups Projects
Commit 1d5fbb6e authored by Martin Kletzander's avatar Martin Kletzander :flag_cz:
Browse files

nwfilter/220-no-ip-spoofing.t: Update for newer guest distro


Commit 7a332e94 bumped the guest image from Fedora 38 to 40 and
roughly since then our integration tests started failing.  The test
which check that denying IP spoofing works counts with the fact that IP
address for the interface is updated using dhclient, but that is no
longer the case.  So instead of killing dhclient use nmcli to set the IP
address and restore it properly.

Signed-off-by: default avatarMartin Kletzander <mkletzan@redhat.com>
parent b8b25a4a
Branches master
No related tags found
1 merge request!56No ip spoofing fix
Pipeline #1611197401 passed
......@@ -100,16 +100,12 @@ my $cmdfile = <<EOF;
echo "DEV=\\\$(ip link | head -3 | tail -1 | awk '{print \\\$2}' | sed -e 's/://')
MASK=\\\$(ip addr show \\\$DEV | grep 'inet ' | awk '{print \\\$2}' | sed -e 's/.*\\///;q')
ip addr show \\\$DEV
kill \\\$(pidof dhclient)
ip addr flush dev \\\$DEV
ip addr add ${spoofipaddr}/\\\$MASK dev \\\$DEV
nmcli device modify \\\$DEV ipv4.method manual ipv4.addr ${spoofipaddr}/\\\$MASK
sleep 1
ip addr show \\\$DEV
sleep 1
ping -c 1 ${networkipaddr}
ip link set \\\$DEV down
ip addr flush dev \\\$DEV
ip addr add ${guestip}/\\\$MASK dev \\\$DEV
ip link set \\\$DEV up
nmcli device modify \\\$DEV ipv4.method auto
ip addr show \\\$DEV" > /test.sh
EOF
diag $cmdfile;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment