mirror of
https://github.com/rancher/os.git
synced 2025-09-01 14:48:55 +00:00
test_rancher_network - wip
This commit is contained in:
@@ -5,9 +5,9 @@ rancher:
|
|||||||
FLANNEL_NETWORK: 10.244.0.0/16
|
FLANNEL_NETWORK: 10.244.0.0/16
|
||||||
network:
|
network:
|
||||||
interfaces:
|
interfaces:
|
||||||
eth0:
|
eth1:
|
||||||
address: 10.0.2.15/24
|
address: 10.10.2.17/24
|
||||||
gateway: 10.0.2.2
|
gateway: 10.10.2.2
|
||||||
mtu: 1500
|
mtu: 1500
|
||||||
ssh_authorized_keys:
|
ssh_authorized_keys:
|
||||||
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUlsWAL5Rf0Wis/A7k7Tlqx0fZS60VzCZrPZYbP/wkL95jv0XzCx8bd1rZHeybblHPDNpND3BLv4qPY5DxRyexF4seGuzcJI/pOvGUGjQondeMPgDTFEo5w939gSdeTZcfXzQ0wAVhzwDbgH4zPfMzbdoo8Aiu9jkKljXw8IFju0gh+t6iKkGZCIjKT9o7zza1vGfkodhvi2V3VzPdNO28gaxZaRNtmBYUoVnGyR6nXN1Q3CJaVuh5o6GPCOqrhHNbYOFZKBpDiHbxPhVpxHQD2+8yUSGTG7WW75FfZePja5y8d0c/O5L37ZYx4AZAd3KgQYDBT2XCEJGQNawNbfpt
|
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUlsWAL5Rf0Wis/A7k7Tlqx0fZS60VzCZrPZYbP/wkL95jv0XzCx8bd1rZHeybblHPDNpND3BLv4qPY5DxRyexF4seGuzcJI/pOvGUGjQondeMPgDTFEo5w939gSdeTZcfXzQ0wAVhzwDbgH4zPfMzbdoo8Aiu9jkKljXw8IFju0gh+t6iKkGZCIjKT9o7zza1vGfkodhvi2V3VzPdNO28gaxZaRNtmBYUoVnGyR6nXN1Q3CJaVuh5o6GPCOqrhHNbYOFZKBpDiHbxPhVpxHQD2+8yUSGTG7WW75FfZePja5y8d0c/O5L37ZYx4AZAd3KgQYDBT2XCEJGQNawNbfpt
|
||||||
|
@@ -11,7 +11,8 @@ cloud_config_path = './tests/integration/assets/cloud-config-01.yml'
|
|||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
def qemu(request):
|
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")
|
@pytest.fixture(scope="module")
|
||||||
@@ -44,7 +45,8 @@ def test_rancher_network(qemu, cloud_config_01):
|
|||||||
u.wait_for_ssh(ssh_command)
|
u.wait_for_ssh(ssh_command)
|
||||||
|
|
||||||
v = subprocess.check_output(
|
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)
|
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']
|
||||||
|
Reference in New Issue
Block a user