summaryrefslogtreecommitdiff
path: root/tests/integration_tests/bugs
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2021-02-18 11:17:26 -0500
committerGitHub <noreply@github.com>2021-02-18 11:17:26 -0500
commit5a9008e53d7cf987b5cfb78964d2bd987d180993 (patch)
tree91227d5a71d103500b2b8bc4f4bba12739ba5fdb /tests/integration_tests/bugs
parent6056ccd4d4a8a1a314ab8cd6d2bebdf8ae39b35c (diff)
downloadvyos-cloud-init-5a9008e53d7cf987b5cfb78964d2bd987d180993.tar.gz
vyos-cloud-init-5a9008e53d7cf987b5cfb78964d2bd987d180993.zip
integration_tests: use unique MAC addresses for tests (#813)
Using the same MAC address results in strange test behaviour if more than one such instance is up: traffic gets routed to an arbitrary interface with the given MAC address. This can happen if running tests in parallel, or on a system which retains test instances from previous runs. The introduction of tests/integration_tests/__init__.py means that pylint now checks the integration tests: this commit also addresses those failures.
Diffstat (limited to 'tests/integration_tests/bugs')
-rw-r--r--tests/integration_tests/bugs/test_gh626.py3
-rw-r--r--tests/integration_tests/bugs/test_gh668.py3
-rw-r--r--tests/integration_tests/bugs/test_lp1898997.py3
3 files changed, 6 insertions, 3 deletions
diff --git a/tests/integration_tests/bugs/test_gh626.py b/tests/integration_tests/bugs/test_gh626.py
index 7b0df6eb..dba01b34 100644
--- a/tests/integration_tests/bugs/test_gh626.py
+++ b/tests/integration_tests/bugs/test_gh626.py
@@ -7,11 +7,12 @@ in the /etc/network/interfaces or netplan config.
import pytest
import yaml
+from tests.integration_tests import random_mac_address
from tests.integration_tests.clouds import ImageSpecification
from tests.integration_tests.instances import IntegrationInstance
-MAC_ADDRESS = "de:ad:be:ef:12:34"
+MAC_ADDRESS = random_mac_address()
NETWORK_CONFIG = """\
version: 2
ethernets:
diff --git a/tests/integration_tests/bugs/test_gh668.py b/tests/integration_tests/bugs/test_gh668.py
index 66ee302e..72fe0afc 100644
--- a/tests/integration_tests/bugs/test_gh668.py
+++ b/tests/integration_tests/bugs/test_gh668.py
@@ -7,12 +7,13 @@ for all network configuration outputs.
import pytest
+from tests.integration_tests import random_mac_address
from tests.integration_tests.instances import IntegrationInstance
DESTINATION_IP = "172.16.0.10"
GATEWAY_IP = "10.0.0.100"
-MAC_ADDRESS = "de:ad:be:ef:12:34"
+MAC_ADDRESS = random_mac_address()
NETWORK_CONFIG = """\
version: 2
diff --git a/tests/integration_tests/bugs/test_lp1898997.py b/tests/integration_tests/bugs/test_lp1898997.py
index 54c88d82..90dc17da 100644
--- a/tests/integration_tests/bugs/test_lp1898997.py
+++ b/tests/integration_tests/bugs/test_lp1898997.py
@@ -10,8 +10,9 @@ network configuration, and confirms that the bridge can be used to ping the
default gateway.
"""
import pytest
+from tests.integration_tests import random_mac_address
-MAC_ADDRESS = "de:ad:be:ef:12:34"
+MAC_ADDRESS = random_mac_address()
NETWORK_CONFIG = """\