From 217645869a2cd11252fb5177e796a522cf3bb142 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Mon, 21 Apr 2025 15:05:59 -0600 Subject: [PATCH] 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 --- tests/ansible.cfg | 2 ++ tests/tasks/create_test_interfaces_with_dhcp.yml | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/ansible.cfg diff --git a/tests/ansible.cfg b/tests/ansible.cfg new file mode 100644 index 0000000..d17a746 --- /dev/null +++ b/tests/ansible.cfg @@ -0,0 +1,2 @@ +[defaults] +task_timeout=240 diff --git a/tests/tasks/create_test_interfaces_with_dhcp.yml b/tests/tasks/create_test_interfaces_with_dhcp.yml index 6567f56..28d8eef 100644 --- a/tests/tasks/create_test_interfaces_with_dhcp.yml +++ b/tests/tasks/create_test_interfaces_with_dhcp.yml @@ -127,11 +127,19 @@ fi done fi + # NOTE: 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. dnsmasq \ --pid-file=/run/dhcp_testbr.pid \ --dhcp-leasefile=/run/dhcp_testbr.lease \ --dhcp-range=192.0.2.1,192.0.2.254,240 \ --dhcp-range=2001:DB8::10,2001:DB8::1FF,slaac,64,240 \ - --enable-ra --interface=testbr --bind-interfaces + --enable-ra --interface=testbr --bind-interfaces \ + --dhcp-host 52:54:00:12:34:56,ignore --dhcp-host 52:54:00:12:34:57,ignore fi changed_when: false