14
14
LOGGER = logging .getLogger (__name__ )
15
15
16
16
AGENT_ONE = "agent-one"
17
- AGENT_TWO = "agent-two "
17
+ AGENT_TWO = "node-local "
18
18
SLEEP_DURATION = get_test_env_value_int ("SLEEP_DURATION" , 2 )
19
19
20
20
@@ -77,9 +77,9 @@ def exec(ctrl: BluechiControllerMachine, nodes: Dict[str, BluechiAgentMachine]):
77
77
78
78
# Test 3: Agent-two offline
79
79
LOGGER .debug ("Stopping agent-two." )
80
- nodes [ AGENT_TWO ] .systemctl .stop_unit ("bluechi-agent" )
80
+ ctrl .systemctl .stop_unit ("bluechi-agent" )
81
81
82
- assert nodes [ AGENT_TWO ] .wait_for_unit_state_to_be ("bluechi-agent" , "inactive" )
82
+ assert ctrl .wait_for_unit_state_to_be ("bluechi-agent" , "inactive" )
83
83
84
84
monitor_result_test_three = MonitorResult ()
85
85
monitor_thread = threading .Thread (
@@ -95,15 +95,15 @@ def exec(ctrl: BluechiControllerMachine, nodes: Dict[str, BluechiAgentMachine]):
95
95
96
96
# Bring agent-two back online
97
97
LOGGER .debug ("Starting agent-two." )
98
- nodes [ AGENT_TWO ] .systemctl .start_unit ("bluechi-agent" )
98
+ ctrl .systemctl .start_unit ("bluechi-agent" )
99
99
100
100
# Test 4: Both agents offline
101
101
LOGGER .debug ("Stopping both agents." )
102
102
nodes [AGENT_ONE ].systemctl .stop_unit ("bluechi-agent" )
103
- nodes [ AGENT_TWO ] .systemctl .stop_unit ("bluechi-agent" )
103
+ ctrl .systemctl .stop_unit ("bluechi-agent" )
104
104
105
105
assert nodes [AGENT_ONE ].wait_for_unit_state_to_be ("bluechi-agent" , "inactive" )
106
- assert nodes [ AGENT_TWO ] .wait_for_unit_state_to_be ("bluechi-agent" , "inactive" )
106
+ assert ctrl .wait_for_unit_state_to_be ("bluechi-agent" , "inactive" )
107
107
108
108
monitor_result_test_four = MonitorResult ()
109
109
monitor_thread = threading .Thread (
@@ -120,7 +120,7 @@ def exec(ctrl: BluechiControllerMachine, nodes: Dict[str, BluechiAgentMachine]):
120
120
# Bring both agents back online
121
121
LOGGER .debug ("Starting both agents." )
122
122
nodes [AGENT_ONE ].systemctl .start_unit ("bluechi-agent" )
123
- nodes [ AGENT_TWO ] .systemctl .start_unit ("bluechi-agent" )
123
+ ctrl .systemctl .start_unit ("bluechi-agent" )
124
124
125
125
# Test 5: Controller offline
126
126
LOGGER .debug ("Stopping the controller." )
@@ -147,13 +147,9 @@ def test_bluechi_is_online_system_monitor(
147
147
agent_one_cfg = bluechi_node_default_config .deep_copy ()
148
148
agent_one_cfg .node_name = AGENT_ONE
149
149
150
- agent_two_cfg = bluechi_node_default_config .deep_copy ()
151
- agent_two_cfg .node_name = AGENT_TWO
152
-
153
150
bluechi_ctrl_default_config .allowed_node_names = [AGENT_ONE , AGENT_TWO ]
154
151
155
152
bluechi_test .set_bluechi_controller_config (bluechi_ctrl_default_config )
156
153
bluechi_test .add_bluechi_agent_config (agent_one_cfg )
157
- bluechi_test .add_bluechi_agent_config (agent_two_cfg )
158
154
159
155
bluechi_test .run (exec )
0 commit comments