diff --git a/tests/integration/assets/cloud-config-01.yml b/tests/integration/assets/cloud-config-01.yml index 88f81e3c..a4752b55 100644 --- a/tests/integration/assets/cloud-config-01.yml +++ b/tests/integration/assets/cloud-config-01.yml @@ -5,9 +5,9 @@ rancher: FLANNEL_NETWORK: 10.244.0.0/16 network: interfaces: - eth0: - address: 10.0.2.15/24 - gateway: 10.0.2.2 + eth1: + address: 10.10.2.17/24 + gateway: 10.10.2.2 mtu: 1500 ssh_authorized_keys: - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUlsWAL5Rf0Wis/A7k7Tlqx0fZS60VzCZrPZYbP/wkL95jv0XzCx8bd1rZHeybblHPDNpND3BLv4qPY5DxRyexF4seGuzcJI/pOvGUGjQondeMPgDTFEo5w939gSdeTZcfXzQ0wAVhzwDbgH4zPfMzbdoo8Aiu9jkKljXw8IFju0gh+t6iKkGZCIjKT9o7zza1vGfkodhvi2V3VzPdNO28gaxZaRNtmBYUoVnGyR6nXN1Q3CJaVuh5o6GPCOqrhHNbYOFZKBpDiHbxPhVpxHQD2+8yUSGTG7WW75FfZePja5y8d0c/O5L37ZYx4AZAd3KgQYDBT2XCEJGQNawNbfpt diff --git a/tests/integration/rancherostest/test_01_cloud_config.py b/tests/integration/rancherostest/test_01_cloud_config.py index a28be2e8..7faf0753 100644 --- a/tests/integration/rancherostest/test_01_cloud_config.py +++ b/tests/integration/rancherostest/test_01_cloud_config.py @@ -11,7 +11,8 @@ cloud_config_path = './tests/integration/assets/cloud-config-01.yml' @pytest.fixture(scope="module") def qemu(request): - return u.run_qemu(request, ['--cloud-config', cloud_config_path]) + return u.run_qemu(request, ['--cloud-config', cloud_config_path, + '-net', 'nic,vlan=1,model=virtio', '-net', 'user,vlan=1,net=10.10.2.0/24']) @pytest.fixture(scope="module") @@ -44,7 +45,8 @@ def test_rancher_network(qemu, cloud_config_01): u.wait_for_ssh(ssh_command) v = subprocess.check_output( - ssh_command + ['ip', 'route', 'get', 'to', '10.10.10.10'], + ssh_command + ['ip', 'route', 'get', 'to', '10.10.2.120'], stderr=subprocess.STDOUT, universal_newlines=True) - assert v.split(' ')[2] == cloud_config_01['rancher']['network']['interfaces']['eth0']['gateway'] + assert v.split(' ')[2] == 'eth1' + assert v.split(' ')[5] + '/24' == cloud_config_01['rancher']['network']['interfaces']['eth1']['address']