summaryrefslogtreecommitdiff
path: root/tests/integration_tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/integration_tests')
-rw-r--r--tests/integration_tests/modules/test_hotplug.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/integration_tests/modules/test_hotplug.py b/tests/integration_tests/modules/test_hotplug.py
index 88cd8c16..f5abc86f 100644
--- a/tests/integration_tests/modules/test_hotplug.py
+++ b/tests/integration_tests/modules/test_hotplug.py
@@ -49,10 +49,13 @@ def test_hotplug_add_remove(client: IntegrationInstance):
ips_before = _get_ip_addr(client)
log = client.read_from_file('/var/log/cloud-init.log')
assert 'Exiting hotplug handler' not in log
+ assert client.execute(
+ 'test -f /etc/udev/rules.d/10-cloud-init-hook-hotplug.rules'
+ ).ok
# Add new NIC
added_ip = client.instance.add_network_interface()
- _wait_till_hotplug_complete(client, expected_runs=2)
+ _wait_till_hotplug_complete(client, expected_runs=1)
ips_after_add = _get_ip_addr(client)
new_addition = [ip for ip in ips_after_add if ip.ip4 == added_ip][0]
@@ -67,7 +70,7 @@ def test_hotplug_add_remove(client: IntegrationInstance):
# Remove new NIC
client.instance.remove_network_interface(added_ip)
- _wait_till_hotplug_complete(client, expected_runs=4)
+ _wait_till_hotplug_complete(client, expected_runs=2)
ips_after_remove = _get_ip_addr(client)
assert len(ips_after_remove) == len(ips_before)
assert added_ip not in [ip.ip4 for ip in ips_after_remove]
@@ -86,12 +89,14 @@ def test_no_hotplug_in_userdata(client: IntegrationInstance):
ips_before = _get_ip_addr(client)
log = client.read_from_file('/var/log/cloud-init.log')
assert 'Exiting hotplug handler' not in log
+ assert client.execute(
+ 'test -f /etc/udev/rules.d/10-cloud-init-hook-hotplug.rules'
+ ).failed
# Add new NIC
client.instance.add_network_interface()
- _wait_till_hotplug_complete(client)
log = client.read_from_file('/var/log/cloud-init.log')
- assert "Event Denied: scopes=['network'] EventType=hotplug" in log
+ assert 'hotplug-hook' not in log
ips_after_add = _get_ip_addr(client)
if len(ips_after_add) == len(ips_before) + 1: