Browse Source

Merge "Rollout a daemonset using updateStrategy type: Noop"

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

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

@@ -321,3 +321,71 @@ class TestDaemonsetsUpdates():
321 321
                 self.from_nginx_image),
322 322
             timeout=2 * 60
323 323
         )
324
+
325
+    @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
326
+    @pytest.mark.fail_snapshot
327
+    @pytest.mark.snapshot_needed
328
+    def test_daemonset_rollout_noop(self, underlay,
329
+                                    k8scluster, config, show_step):
330
+        """Rollback a daemonset using updateStrategy type: Noop
331
+
332
+        Scenario:
333
+            1. Deploy k8s using fuel-ccp-installer
334
+            2. Create a DaemonSet for nginx with image version 1_10 and
335
+               update strategy Noop
336
+            3. Wait until nginx pods are created and become 'ready'
337
+            4. Check that the image version in the nginx pods is 1_10
338
+               Check that the image version in the nginx daemonset is 1_10
339
+            5. Change nginx image version to 1_11 using YAML
340
+            6. Wait for 10 seconds (needs to check that there were
341
+               no auto updates of the nginx pods)
342
+            7. Check that the image version in the nginx pods is still 1_10
343
+               Check that the image version in the nginx daemonset
344
+               is updated to 1_11
345
+            8. Kill all nginx pods that are belong to the nginx daemonset
346
+            9. Wait until nginx pods are created and become 'ready'
347
+           10. Check that the image version in the nginx pods
348
+               is updated to 1_11
349
+           11. Rollout the daemonset to a previous revision:
350
+                kubectl rollout undo daemonset/nginx
351
+           12. Check that the image version in the nginx pods is still 1_11
352
+               Check that the image version in the nginx daemonset
353
+               is changed to 1_10
354
+           13. Kill all nginx pods that are belong to the nginx daemonset
355
+           14. Wait until nginx pods are created and become 'ready'
356
+           15. Check that the image version in the nginx pods
357
+               is changed to 1_10
358
+
359
+
360
+        Duration: 3000 seconds
361
+        """
362
+
363
+        self.test_daemonset_rollingupdate_noop(k8scluster, show_step)
364
+
365
+        k8sclient = k8scluster.api
366
+
367
+        # STEP #11
368
+        show_step(11)
369
+        cmd = "kubectl rollout undo daemonset/nginx"
370
+        underlay.check_call(cmd,
371
+                            host=config.k8s.kube_host)
372
+
373
+        # STEP #12
374
+        show_step(12)
375
+        # Pods should still have the new image version
376
+        self.check_nginx_pods_image(k8sclient, self.to_nginx_image)
377
+        # DaemonSet should have the old image version
378
+        self.check_nginx_ds_image(k8sclient, self.from_nginx_image)
379
+
380
+        # STEP #13
381
+        show_step(13)
382
+        self.delete_nginx_pods(k8sclient)
383
+
384
+        # STEP #14
385
+        show_step(14)
386
+        self.wait_nginx_pods_ready(k8sclient)
387
+
388
+        # STEP #15
389
+        show_step(15)
390
+        # Pods should have the old image version
391
+        self.check_nginx_pods_image(k8sclient, self.from_nginx_image)

Loading…
Cancel
Save