Skip to content

Commit 2176458

Browse files
committed
test: exclude qemu interfaces from dhcp
When running tests with a qemu managed node, the dhcp used by qemu interferes with the dhcp used in the test, which can cause the test to hang. Exclude the qemu interfaces from using the test dhcp. Note that this only affects the qemu tests - testing farm and other tests with "real" machines will have a different mac address - the mac addresses used below are specific to qemu virtual devices. Also, just in case tests still timeout, add a tests/ansible.cfg with a 240 second task timeout to ensure any hung tasks are killed. This will cause the playbook to exit with an error. Signed-off-by: Rich Megginson <[email protected]>
1 parent f75b203 commit 2176458

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

tests/ansible.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[defaults]
2+
task_timeout=240

tests/tasks/create_test_interfaces_with_dhcp.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,19 @@
127127
fi
128128
done
129129
fi
130+
# NOTE: When running tests with a qemu managed node, the dhcp
131+
# used by qemu interferes with the dhcp used in the test, which
132+
# can cause the test to hang. Exclude the qemu interfaces from
133+
# using the test dhcp. Note that this only affects the qemu tests -
134+
# testing farm and other tests with "real" machines will have a
135+
# different mac address - the mac addresses used below are specific
136+
# to qemu virtual devices.
130137
dnsmasq \
131138
--pid-file=/run/dhcp_testbr.pid \
132139
--dhcp-leasefile=/run/dhcp_testbr.lease \
133140
--dhcp-range=192.0.2.1,192.0.2.254,240 \
134141
--dhcp-range=2001:DB8::10,2001:DB8::1FF,slaac,64,240 \
135-
--enable-ra --interface=testbr --bind-interfaces
142+
--enable-ra --interface=testbr --bind-interfaces \
143+
--dhcp-host 52:54:00:12:34:56,ignore --dhcp-host 52:54:00:12:34:57,ignore
136144
fi
137145
changed_when: false

0 commit comments

Comments
 (0)