Browse Source

Rollout a daemonset using updateStrategy type: RollingUpdate

Change-Id: I43b5f96082dcea1fb474c1bb48eae49594a5e5a6
Artem Grechanichenko 2 years ago
parent
commit
c60b9e3bb7
1 changed files with 51 additions and 0 deletions
  1. 51
    0
      fuel_ccp_tests/tests/system/test_daemonsets.py

+ 51
- 0
fuel_ccp_tests/tests/system/test_daemonsets.py View File

@@ -270,3 +270,54 @@ class TestDaemonsetsUpdates():
270 270
                 k8sclient,
271 271
                 self.to_nginx_image),
272 272
             timeout=2 * 60)
273
+
274
+    @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
275
+    @pytest.mark.fail_snapshot
276
+    @pytest.mark.snapshot_needed
277
+    def test_daemonset_rollout_rollingupdate(self, underlay,
278
+                                             k8scluster, config, show_step):
279
+        """Rollback a daemonset using updateStrategy type: RollingUpdate
280
+
281
+        Scenario:
282
+            1. Deploy k8s using fuel-ccp-installer
283
+            2. Create a DaemonSet for nginx with image version 1_10 and
284
+               update strategy RollingUpdate
285
+            3. Wait until nginx pods are created and become 'ready'
286
+            4. Check that the image version in the nginx pods is 1_10
287
+               Check that the image version in the nginx daemonset is 1_10
288
+            5. Change nginx image version to 1_11 using YAML
289
+            6. Wait for 10 seconds (needs to check that there were
290
+               no auto updates of the nginx pods)
291
+            7. Check that the image version in the nginx daemonset
292
+               is updated to 1_11
293
+               Wait for ~120 sec that the image version
294
+               in the nginx pods is changed to 1_11
295
+            8. Rollback the nginx daemonset:
296
+               kubectl rollout undo daemonset/nginx
297
+            9. Check that the image version in the nginx daemonset is
298
+               downgraded to 1_10
299
+               Wait for ~120 sec that the image version
300
+               in the nginx pods is downgraded to 1_10
301
+
302
+        Duration: 3000 seconds
303
+        """
304
+
305
+        self.test_daemonset_rollingupdate(k8scluster, show_step)
306
+
307
+        k8sclient = k8scluster.api
308
+
309
+        show_step(8)
310
+        cmd = "kubectl rollout undo daemonset/nginx"
311
+        underlay.check_call(cmd,
312
+                            host=config.k8s.kube_host)
313
+
314
+        # STEP #9
315
+        show_step(9)
316
+        self.check_nginx_ds_image(k8sclient, self.from_nginx_image)
317
+        # Pods should have new image version
318
+        helpers.wait_pass(
319
+            lambda: self.check_nginx_pods_image(
320
+                k8sclient,
321
+                self.from_nginx_image),
322
+            timeout=2 * 60
323
+        )

Loading…
Cancel
Save