aetherscale

[unmaintained] code for a cloud provider tutorial
Log | Files | Refs | README | LICENSE

commit 4b9c40e8aaef97db3bbbfab0fb43d03f7d63c0f8
parent f3c639bdb0a2ff1cbc6d5999940fcb86ccd60222
Author: Stefan Koch <programming@stefan-koch.name>
Date:   Sat, 30 Jan 2021 12:42:17 +0100

don't use br0 in unit tests, exists on many systems

Diffstat:
Mtests/test_networking.py | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/test_networking.py b/tests/test_networking.py @@ -40,17 +40,17 @@ def test_ip_address_validation(): def test_iproute2_networking_scripts(): iproute = networking.Iproute2Network() - iproute.bridged_network('br0', 'eth0', '10.0.0.2/24', '10.0.0.1') - iproute.tap_device('tap0', 'myuser', 'br0') + iproute.bridged_network('unittestbr0', 'eth0', '10.0.0.2/24', '10.0.0.1') + iproute.tap_device('tap0', 'myuser', 'unittestbr0') setup_script = iproute.setup_script() teardown_script = iproute.teardown_script() - assert 'link add br0 type bridge' in setup_script - assert 'set eth0 master br0' in setup_script - assert 'addr add 10.0.0.2/24 dev br0' in setup_script + assert 'link add unittestbr0 type bridge' in setup_script + assert 'set eth0 master unittestbr0' in setup_script + assert 'addr add 10.0.0.2/24 dev unittestbr0' in setup_script assert 'tuntap add dev tap0' in setup_script - assert 'link del br0' in teardown_script + assert 'link del unittestbr0' in teardown_script assert 'link del tap0' in teardown_script assert 'addr add 10.0.0.2/24 dev eth0' in teardown_script @@ -58,9 +58,9 @@ def test_iproute2_networking_scripts(): @mock.patch('aetherscale.execution.run_command_chain') def test_iproute2_networking_direct_execution(command_chain): iproute = networking.Iproute2Network() - iproute.bridged_network('br0', 'eth0') + iproute.bridged_network('unittestbr0', 'eth0') iproute.setup() - bridge_command = ['sudo', 'ip', 'link', 'add', 'br0', 'type', 'bridge'] + bridge_command = ['sudo', 'ip', 'link', 'add', 'unittestbr0', 'type', 'bridge'] assert bridge_command in command_chain.call_args[0][0]