Created
June 19, 2019 14:18
-
-
Save cathay4t/981d7691295fa6c6ae6a7035c1c3fda8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tests/integration/linux_bridge_test.py b/tests/integration/linux_bridge_test.py | |
index 9609c88..15eae7a 100644 | |
--- a/tests/integration/linux_bridge_test.py | |
+++ b/tests/integration/linux_bridge_test.py | |
@@ -17,6 +17,7 @@ | |
from contextlib import contextmanager | |
from copy import deepcopy | |
+import time | |
import pytest | |
import yaml | |
@@ -61,10 +62,6 @@ stp-priority: 32 | |
def bridge0_with_port0(eth1_up): | |
bridge_name = TEST_BRIDGE0 | |
bridge_state = _create_bridge_subtree_config(('eth1',)) | |
- # Disable STP to avoid topology changes and the consequence link change. | |
- options_subtree = bridge_state[LinuxBridge.OPTIONS_SUBTREE] | |
- options_subtree[LinuxBridge.STP_SUBTREE][LinuxBridge.STP_ENABLED] = False | |
- | |
with _linux_bridge(bridge_name, bridge_state) as desired_state: | |
yield deepcopy(desired_state) | |
@@ -98,9 +95,16 @@ def test_create_and_remove_linux_bridge_with_two_ports(eth1_up, eth2_up): | |
assertlib.assert_absent(bridge_name) | |
-@ip_monitor_assert_stable_link_up(TEST_BRIDGE0) | |
-def test_add_port_to_existing_bridge(bridge0_with_port0): | |
[email protected] | |
+def bridge0_with_port0_wait_online(bridge0_with_port0): | |
desired_state = bridge0_with_port0 | |
+ time.sleep(31) | |
+ yield desired_state | |
+ | |
+ | |
+@ip_monitor_assert_stable_link_up(TEST_BRIDGE0) | |
+def test_add_port_to_existing_bridge(bridge0_with_port0_wait_online): | |
+ desired_state = bridge0_with_port0_wait_online | |
bridge_iface_state = desired_state[Interface.KEY][0] | |
bridge_state = bridge_iface_state[LinuxBridge.CONFIG_SUBTREE] | |
_add_port_to_bridge(bridge_state, 'eth2') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment