diff --git a/fuel_ccp_tests/tests/system/test_daemonsets.py b/fuel_ccp_tests/tests/system/test_daemonsets.py index f9682ed..069da2e 100644 --- a/fuel_ccp_tests/tests/system/test_daemonsets.py +++ b/fuel_ccp_tests/tests/system/test_daemonsets.py @@ -389,3 +389,85 @@ class TestDaemonsetsUpdates(): show_step(15) # Pods should have the old image version self.check_nginx_pods_image(k8sclient, self.from_nginx_image) + + @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed) + @pytest.mark.fail_snapshot + @pytest.mark.snapshot_needed + def test_daemonset_multirollout_rollingupdate(self, underlay, k8scluster, + config, show_step): + """Rollback multiple times a daemonset using updateStrategy type: + RollingUpdate + + Scenario: + 1. Deploy k8s using fuel-ccp-installer + 2. Create a DaemonSet for nginx with image version 1_10 and + update strategy RollingUpdate + 3. Wait until nginx pods are created and become 'ready' + 4. Check that the image version in the nginx pods is 1_10 + Check that the image version in the nginx daemonset is 1_10 + 5. Change nginx image version to 1_11 using YAML + 6. Wait for 10 seconds (needs to check that there were + no auto updates of the nginx pods) + 7. Check that the image version in the nginx daemonset + is updated to 1_11 + Wait for ~120 sec that the image version + in the nginx pods is changed to 1_11 + 8. Rollback the nginx daemonset: + kubectl rollout undo daemonset/nginx + 9. Check that the image version in the nginx daemonset is + downgraded to 1_10 + Wait for ~120 sec that the image version + in the nginx pods is downgraded to 1_10 + 10. Rollback the nginx daemonset: + kubectl rollout undo daemonset/nginx + 11. Check that the image version in the nginx daemonset + is updated to 1_11 + Wait for ~120 sec that the image version + in the nginx pods is changed to 1_11 + 12. Rollback the nginx daemonset: + kubectl rollout undo daemonset/nginx + 13. Check that the image version in the nginx daemonset is + downgraded to 1_10 + Wait for ~120 sec that the image version + in the nginx pods is downgraded to 1_10 + + Duration: 3000 seconds + """ + + self.test_daemonset_rollout_rollingupdate(underlay, k8scluster, + config, show_step) + k8sclient = k8scluster.api + + # STEP #10 + show_step(10) + cmd = "kubectl rollout undo daemonset/nginx" + underlay.check_call(cmd, + host=config.k8s.kube_host) + + # STEP #11 + show_step(11) + self.check_nginx_ds_image(k8sclient, self.to_nginx_image) + # Pods should have new image version + helpers.wait_pass( + lambda: self.check_nginx_pods_image( + k8sclient, + self.to_nginx_image), + timeout=2 * 60 + ) + + # STEP #12 + show_step(12) + cmd = "kubectl rollout undo daemonset/nginx" + underlay.check_call(cmd, + host=config.k8s.kube_host) + + # STEP #13 + show_step(13) + self.check_nginx_ds_image(k8sclient, self.from_nginx_image) + # Pods should have new image version + helpers.wait_pass( + lambda: self.check_nginx_pods_image( + k8sclient, + self.from_nginx_image), + timeout=2 * 60 + )