summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-11-01 13:31:25 +0000
committerGerrit Code Review <review@openstack.org>2016-11-01 13:31:25 +0000
commit4a4dfb537fbbd55114691f2649f087cff013be33 (patch)
tree7e2d9520d851ad2d6857203ceb55500144a0d8ae
parent2e7445e92b1ab16ebf369205416e01cf0582df36 (diff)
parenta1f1304fba7e1c053c6d919d29c69c96fee198fd (diff)
Merge "Rollback multiple times a daemonset using updateStrategy type: RollingUpdate and --to-revision=0 arg"
-rw-r--r--fuel_ccp_tests/tests/system/test_daemonsets.py84
1 files changed, 84 insertions, 0 deletions
diff --git a/fuel_ccp_tests/tests/system/test_daemonsets.py b/fuel_ccp_tests/tests/system/test_daemonsets.py
index 489ec3b..3a0c062 100644
--- a/fuel_ccp_tests/tests/system/test_daemonsets.py
+++ b/fuel_ccp_tests/tests/system/test_daemonsets.py
@@ -650,3 +650,87 @@ class TestDaemonsetsUpdates():
650 self.to_nginx_image_1_12), 650 self.to_nginx_image_1_12),
651 timeout=2 * 60 651 timeout=2 * 60
652 ) 652 )
653
654 @pytest.mark.revert_snapshot(ext.SNAPSHOT.k8s_deployed)
655 @pytest.mark.fail_snapshot
656 @pytest.mark.snapshot_needed
657 def test_daemonset_multirollout_rollingupdate_default(self, underlay,
658 k8scluster,
659 config,
660 show_step):
661 """Rollback multiple times a daemonset using updateStrategy type:
662 RollingUpdate --to-revision=0
663
664 Scenario:
665 1. Deploy k8s using fuel-ccp-installer
666 2. Create a DaemonSet for nginx with image version 1_10 and
667 update strategy RollingUpdate
668 3. Wait until nginx pods are created and become 'ready'
669 4. Check that the image version in the nginx pods is 1_10
670 Check that the image version in the nginx daemonset is 1_10
671 5. Change nginx image version to 1_11 using YAML
672 6. Wait for 10 seconds (needs to check that there were
673 no auto updates of the nginx pods)
674 7. Check that the image version in the nginx daemonset
675 is updated to 1_11
676 Wait for ~120 sec that the image version
677 in the nginx pods is changed to 1_11
678 8. Rollback the nginx daemonset:
679 kubectl rollout undo daemonset/nginx
680 9. Check that the image version in the nginx daemonset is
681 downgraded to 1_10
682 Wait for ~120 sec that the image version
683 in the nginx pods is downgraded to 1_10
684 10. Rollback the nginx daemonset:
685 kubectl rollout undo daemonset/nginx --to-revision=0
686 11. Check that the image version in the nginx daemonset
687 is updated to 1_11
688 Wait for ~120 sec that the image version
689 in the nginx pods is changed to 1_11
690 12. Rollback the nginx daemonset:
691 kubectl rollout undo daemonset/nginx --to-revision=0
692 13. Check that the image version in the nginx daemonset is
693 downgraded to 1_10
694 Wait for ~120 sec that the image version
695 in the nginx pods is downgraded to 1_10
696
697 Duration: 3000 seconds
698 """
699
700 self.test_daemonset_rollout_rollingupdate(underlay, k8scluster,
701 config, show_step)
702 k8sclient = k8scluster.api
703
704 # STEP #10
705 show_step(10)
706 cmd = "kubectl rollout undo daemonset/nginx --to-revision=0"
707 underlay.check_call(cmd,
708 host=config.k8s.kube_host)
709
710 # STEP #11
711 show_step(11)
712 self.check_nginx_ds_image(k8sclient, self.to_nginx_image)
713 # Pods should have new image version
714 helpers.wait_pass(
715 lambda: self.check_nginx_pods_image(
716 k8sclient,
717 self.to_nginx_image),
718 timeout=2 * 60
719 )
720
721 # STEP #12
722 show_step(12)
723 cmd = "kubectl rollout undo daemonset/nginx --to-revision=0"
724 underlay.check_call(cmd,
725 host=config.k8s.kube_host)
726
727 # STEP #13
728 show_step(13)
729 self.check_nginx_ds_image(k8sclient, self.from_nginx_image)
730 # Pods should have new image version
731 helpers.wait_pass(
732 lambda: self.check_nginx_pods_image(
733 k8sclient,
734 self.from_nginx_image),
735 timeout=2 * 60
736 )