1
0
mirror of https://github.com/rancher/os.git synced 2025-08-30 21:26:09 +00:00

test_rancher_network - wip

This commit is contained in:
Ivan Mikushin 2015-05-08 20:02:08 +05:00
parent 4d594b768f
commit 54ff0850f6
2 changed files with 8 additions and 6 deletions

View File

@ -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

View File

@ -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']