@@ -56,117 +56,109 @@ def toggle_lower_tor_pdu(lower_tor_host, get_pdu_controller): # noqa F811
5656
5757
5858@pytest .mark .enable_active_active
59- @pytest .mark .disable_loganalyzer
6059def test_active_tor_reboot_upstream (
6160 upper_tor_host , lower_tor_host , send_server_to_t1_with_action , # noqa F811
6261 toggle_all_simulator_ports_to_upper_tor , toggle_upper_tor_pdu , # noqa F811
6362 wait_for_device_reachable , wait_for_mux_container , cable_type , # noqa F811
64- wait_for_pmon_container # noqa F811
63+ wait_for_pmon_container , setup_loganalyzer # noqa F811
6564):
6665 """
6766 Send upstream traffic and reboot the active ToR. Confirm switchover
6867 occurred and disruption lasts < 1 second
6968 """
70- with LogAnalyzer (ansible_host = lower_tor_host ,
71- marker_prefix = "test_active_tor_reboot_upstream" ):
72- send_server_to_t1_with_action (
73- upper_tor_host , verify = True , delay = MUX_SIM_ALLOWED_DISRUPTION_SEC ,
74- action = toggle_upper_tor_pdu , stop_after = 60
75- )
76- wait_for_device_reachable (upper_tor_host )
77- wait_for_mux_container (upper_tor_host )
78- wait_for_pmon_container (upper_tor_host )
69+ setup_loganalyzer (upper_tor_host , collect_only = True )
70+ send_server_to_t1_with_action (
71+ upper_tor_host , verify = True , delay = MUX_SIM_ALLOWED_DISRUPTION_SEC ,
72+ action = toggle_upper_tor_pdu , stop_after = 60
73+ )
74+ wait_for_device_reachable (upper_tor_host )
75+ wait_for_mux_container (upper_tor_host )
76+ wait_for_pmon_container (upper_tor_host )
7977
80- if cable_type == CableType .active_standby :
81- verify_tor_states (
82- expected_active_host = lower_tor_host ,
83- expected_standby_host = upper_tor_host
84- )
85- elif cable_type == CableType .active_active :
86- verify_tor_states (
87- expected_active_host = [upper_tor_host , lower_tor_host ],
88- expected_standby_host = None ,
89- cable_type = cable_type ,
90- verify_db_timeout = 60
91- )
78+ if cable_type == CableType .active_standby :
79+ verify_tor_states (
80+ expected_active_host = lower_tor_host ,
81+ expected_standby_host = upper_tor_host
82+ )
83+ elif cable_type == CableType .active_active :
84+ verify_tor_states (
85+ expected_active_host = [upper_tor_host , lower_tor_host ],
86+ expected_standby_host = None ,
87+ cable_type = cable_type ,
88+ verify_db_timeout = 60
89+ )
9290
9391
94- @pytest .mark .disable_loganalyzer
9592def test_active_tor_reboot_downstream_standby (
9693 upper_tor_host , lower_tor_host , send_t1_to_server_with_action , # noqa F811
9794 toggle_all_simulator_ports_to_upper_tor , toggle_upper_tor_pdu , # noqa F811
9895 wait_for_device_reachable , wait_for_mux_container , # noqa F811
99- wait_for_pmon_container # noqa F811
96+ wait_for_pmon_container , setup_loganalyzer # noqa F811
10097):
10198 """
10299 Send downstream traffic to the standby ToR and reboot the active ToR.
103100 Confirm switchover occurred and disruption lasts < 1 second
104101 """
105- with LogAnalyzer (ansible_host = lower_tor_host ,
106- marker_prefix = "test_active_tor_reboot_downstream_standby" ):
107- send_t1_to_server_with_action (
108- lower_tor_host , verify = True , delay = MUX_SIM_ALLOWED_DISRUPTION_SEC ,
109- action = toggle_upper_tor_pdu , stop_after = 60
110- )
111- wait_for_device_reachable (upper_tor_host )
112- wait_for_mux_container (upper_tor_host )
113- wait_for_pmon_container (upper_tor_host )
114- verify_tor_states (
115- expected_active_host = lower_tor_host ,
116- expected_standby_host = upper_tor_host
117- )
102+ setup_loganalyzer (upper_tor_host , collect_only = True )
103+ send_t1_to_server_with_action (
104+ lower_tor_host , verify = True , delay = MUX_SIM_ALLOWED_DISRUPTION_SEC ,
105+ action = toggle_upper_tor_pdu , stop_after = 60
106+ )
107+ wait_for_device_reachable (upper_tor_host )
108+ wait_for_mux_container (upper_tor_host )
109+ wait_for_pmon_container (upper_tor_host )
110+ verify_tor_states (
111+ expected_active_host = lower_tor_host ,
112+ expected_standby_host = upper_tor_host
113+ )
118114
119115
120- @pytest .mark .disable_loganalyzer
121116def test_standby_tor_reboot_upstream (
122117 upper_tor_host , lower_tor_host , send_server_to_t1_with_action , # noqa F811
123118 toggle_all_simulator_ports_to_upper_tor , toggle_lower_tor_pdu , # noqa F811
124119 wait_for_device_reachable , wait_for_mux_container , # noqa F811
125- wait_for_pmon_container # noqa F811
120+ wait_for_pmon_container , setup_loganalyzer # noqa F811
126121):
127122 """
128123 Send upstream traffic and reboot the standby ToR. Confirm no switchover
129124 occurred and no disruption
130125 """
131- with LogAnalyzer (ansible_host = upper_tor_host ,
132- marker_prefix = "test_standby_tor_reboot_upstream" ):
133- send_server_to_t1_with_action (
134- upper_tor_host , verify = True ,
135- action = toggle_lower_tor_pdu , stop_after = 60
136- )
137- wait_for_device_reachable (lower_tor_host )
138- wait_for_mux_container (lower_tor_host )
139- wait_for_pmon_container (lower_tor_host )
140- verify_tor_states (
141- expected_active_host = upper_tor_host ,
142- expected_standby_host = lower_tor_host
143- )
126+ setup_loganalyzer (lower_tor_host , collect_only = True )
127+ send_server_to_t1_with_action (
128+ upper_tor_host , verify = True ,
129+ action = toggle_lower_tor_pdu , stop_after = 60
130+ )
131+ wait_for_device_reachable (lower_tor_host )
132+ wait_for_mux_container (lower_tor_host )
133+ wait_for_pmon_container (lower_tor_host )
134+ verify_tor_states (
135+ expected_active_host = upper_tor_host ,
136+ expected_standby_host = lower_tor_host
137+ )
144138
145139
146- @pytest .mark .disable_loganalyzer
147140def test_standby_tor_reboot_downstream_active (
148141 upper_tor_host , lower_tor_host , send_t1_to_server_with_action , # noqa F811
149142 toggle_all_simulator_ports_to_upper_tor , toggle_lower_tor_pdu , # noqa F811
150143 wait_for_device_reachable , wait_for_mux_container , # noqa F811
151- wait_for_pmon_container # noqa F811
144+ wait_for_pmon_container , setup_loganalyzer # noqa F811
152145):
153146 """
154147 Send downstream traffic to the active ToR and reboot the standby ToR.
155148 Confirm no switchover occurred and no disruption
156149 """
157- with LogAnalyzer (ansible_host = upper_tor_host ,
158- marker_prefix = "test_standby_tor_reboot_downstream_active" ):
159- send_t1_to_server_with_action (
160- upper_tor_host , verify = True ,
161- action = toggle_lower_tor_pdu , stop_after = 60
162- )
163- wait_for_device_reachable (lower_tor_host )
164- wait_for_mux_container (lower_tor_host )
165- wait_for_pmon_container (lower_tor_host )
166- verify_tor_states (
167- expected_active_host = upper_tor_host ,
168- expected_standby_host = lower_tor_host
169- )
150+ setup_loganalyzer (lower_tor_host , collect_only = True )
151+ send_t1_to_server_with_action (
152+ upper_tor_host , verify = True ,
153+ action = toggle_lower_tor_pdu , stop_after = 60
154+ )
155+ wait_for_device_reachable (lower_tor_host )
156+ wait_for_mux_container (lower_tor_host )
157+ wait_for_pmon_container (lower_tor_host )
158+ verify_tor_states (
159+ expected_active_host = upper_tor_host ,
160+ expected_standby_host = lower_tor_host
161+ )
170162
171163
172164@pytest .mark .enable_active_active
0 commit comments