Browse Source

Merge "Rollout multiple times a daemonset using updateStrategy type: RollingUpdate"

Jenkins 2 years ago
parent
commit
6466a5d08b
1 changed files with 82 additions and 0 deletions
  1. 82
    0
      fuel_ccp_tests/tests/system/test_daemonsets.py

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

@@ -389,3 +389,85 @@ class TestDaemonsetsUpdates():
389 389
         show_step(15)
390 390
         # Pods should have the old image version
391 391
         self.check_nginx_pods_image(k8sclient, self.from_nginx_image)
392
+
393
+    @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
394
+    @pytest.mark.fail_snapshot
395
+    @pytest.mark.snapshot_needed
396
+    def test_daemonset_multirollout_rollingupdate(self, underlay, k8scluster,
397
+                                                  config, show_step):
398
+        """Rollback multiple times a daemonset using updateStrategy type:
399
+           RollingUpdate
400
+
401
+        Scenario:
402
+            1. Deploy k8s using fuel-ccp-installer
403
+            2. Create a DaemonSet for nginx with image version 1_10 and
404
+               update strategy RollingUpdate
405
+            3. Wait until nginx pods are created and become 'ready'
406
+            4. Check that the image version in the nginx pods is 1_10
407
+               Check that the image version in the nginx daemonset is 1_10
408
+            5. Change nginx image version to 1_11 using YAML
409
+            6. Wait for 10 seconds (needs to check that there were
410
+               no auto updates of the nginx pods)
411
+            7. Check that the image version in the nginx daemonset
412
+               is updated to 1_11
413
+               Wait for ~120 sec that the image version
414
+               in the nginx pods is changed to 1_11
415
+            8. Rollback the nginx daemonset:
416
+               kubectl rollout undo daemonset/nginx
417
+            9. Check that the image version in the nginx daemonset is
418
+               downgraded to 1_10
419
+               Wait for ~120 sec that the image version
420
+               in the nginx pods is downgraded to 1_10
421
+            10. Rollback the nginx daemonset:
422
+               kubectl rollout undo daemonset/nginx
423
+            11. Check that the image version in the nginx daemonset
424
+               is updated to 1_11
425
+               Wait for ~120 sec that the image version
426
+               in the nginx pods is changed to 1_11
427
+            12. Rollback the nginx daemonset:
428
+               kubectl rollout undo daemonset/nginx
429
+            13. Check that the image version in the nginx daemonset is
430
+               downgraded to 1_10
431
+               Wait for ~120 sec that the image version
432
+               in the nginx pods is downgraded to 1_10
433
+
434
+        Duration: 3000 seconds
435
+        """
436
+
437
+        self.test_daemonset_rollout_rollingupdate(underlay, k8scluster,
438
+                                                  config, show_step)
439
+        k8sclient = k8scluster.api
440
+
441
+        # STEP #10
442
+        show_step(10)
443
+        cmd = "kubectl rollout undo daemonset/nginx"
444
+        underlay.check_call(cmd,
445
+                            host=config.k8s.kube_host)
446
+
447
+        # STEP #11
448
+        show_step(11)
449
+        self.check_nginx_ds_image(k8sclient, self.to_nginx_image)
450
+        # Pods should have new image version
451
+        helpers.wait_pass(
452
+            lambda: self.check_nginx_pods_image(
453
+                k8sclient,
454
+                self.to_nginx_image),
455
+            timeout=2 * 60
456
+        )
457
+
458
+        # STEP #12
459
+        show_step(12)
460
+        cmd = "kubectl rollout undo daemonset/nginx"
461
+        underlay.check_call(cmd,
462
+                            host=config.k8s.kube_host)
463
+
464
+        # STEP #13
465
+        show_step(13)
466
+        self.check_nginx_ds_image(k8sclient, self.from_nginx_image)
467
+        # Pods should have new image version
468
+        helpers.wait_pass(
469
+            lambda: self.check_nginx_pods_image(
470
+                k8sclient,
471
+                self.from_nginx_image),
472
+            timeout=2 * 60
473
+        )

Loading…
Cancel
Save