Browse Source

Add test_contrail_services_status_after_restart_master_node

Change-Id: Ibd63b226b71c316785e2e8f012af25fb393a26c1
Georgy Dyuldin 2 years ago
parent
commit
3f104cfc1f
2 changed files with 32 additions and 0 deletions
  1. 3
    0
      plugin_test/vapor/vapor/settings.py
  2. 29
    0
      plugin_test/vapor/vapor/tests/test_smoke.py

+ 3
- 0
plugin_test/vapor/vapor/settings.py View File

@@ -53,6 +53,9 @@ CONTRAIL_AGENT_CLEANUP_TIMEOUT = 20 * 60
53 53
 # Time to wait for contrail agent vna vm list to contain server uuid
54 54
 CONTRAIL_AGENT_VNA_VM_LIST_TIMEOUT = 3 * 60
55 55
 
56
+# Time to wait for contrail to be operable after reset node
57
+CONTRAIL_NODE_RESET_TIMEOUT = 5 * 60
58
+
56 59
 ROLE_CONTRAIL_CONTROLLER = 'contrail-controller'
57 60
 ROLE_CONTRAIL_ANALYTICS = 'contrail-analytics'
58 61
 ROLE_CONTRAIL_DB = 'contrail-db'

+ 29
- 0
plugin_test/vapor/vapor/tests/test_smoke.py View File

@@ -16,6 +16,7 @@ import jmespath
16 16
 import pycontrail.types as types
17 17
 import pytest
18 18
 from stepler.third_party import utils
19
+from stepler.third_party import waiter
19 20
 
20 21
 from vapor.helpers import contrail_status
21 22
 from vapor.helpers import asserts
@@ -175,3 +176,31 @@ def test_contrail_alarms_is_empty(client_contrail_analytics):
175 176
 def test_zookeeper_status(znodes_list):
176 177
     expected_znodes_list = settings.ZOOKEEPER_NODES
177 178
     assert_that(znodes_list, contains_inanyorder(*expected_znodes_list))
179
+
180
+
181
+@pytest.mark.requires('contrail_control_nodes_count >= 2')
182
+def test_contrail_services_status_after_restart_master_node(os_faults_steps):
183
+    """Verify contrail services status after master node restart.
184
+
185
+    Steps:
186
+        #. Restart node with contrail-schema (active)
187
+        #. Wait some time
188
+        #. Check that contrail services statuses is correct
189
+    """
190
+    services_statuses = contrail_status.get_services_statuses(os_faults_steps)
191
+    master_node_fqdn = None
192
+    for fqdn, services in services_statuses.items():
193
+        for service in services:
194
+            if (service['name'] == 'contrail-schema' and
195
+                    service['status'] == contrail_status.STATUS_ACTIVE):
196
+                master_node_fqdn = fqdn
197
+                break
198
+    assert master_node_fqdn is not None, "Can't find master node"
199
+    master_node = os_faults_steps.get_node(fqdns=[master_node_fqdn])
200
+    os_faults_steps.reset_nodes(master_node)
201
+
202
+    waiter.wait(
203
+        contrail_status.check_services_statuses,
204
+        args=(os_faults_steps),
205
+        expected_exceptions=AssertionError,
206
+        timeout=settings.CONTRAIL_NODE_RESET_TIMEOUT)

Loading…
Cancel
Save