diff --git a/fuel_ccp_tests/settings.py b/fuel_ccp_tests/settings.py index 8213e3b..c745c38 100644 --- a/fuel_ccp_tests/settings.py +++ b/fuel_ccp_tests/settings.py @@ -58,7 +58,6 @@ KUBE_VERSION = os.environ.get("KUBE_VERSION", "v1.3.5") KUBE_NETWORK_PLUGIN = os.environ.get("KUBE_NETWORK_PLUGIN", "calico") KUBE_PROXY_MODE = os.environ.get("KUBE_PROXY_MODE", "iptables") -IPIP_USAGE = get_var_as_bool('IPIP_USAGE', True) DOCKER_VERSION = float(os.environ.get("DOCKER_VERSION", "1.12")) HYPERKUBE_IMAGE_REPO = os.environ.get('HYPERKUBE_IMAGE_REPO', @@ -91,7 +90,6 @@ DEFAULT_CUSTOM_YAML = { "etcd_deployment_type": ETCD_DEPLOYMENT_TYPE, "hyperkube_image_tag": HYPERKUBE_IMAGE_TAG, "hyperkube_image_repo": HYPERKUBE_IMAGE_REPO, - "ipip": IPIP_USAGE, "kube_version": KUBE_VERSION, "use_hyperkube_cni": str("true"), "searchdomains": SEARCH_DOMAINS, @@ -106,10 +104,11 @@ CALICO = { "calico_cni_ipam_download_url": os.environ.get( 'CALICO_CNI_IPAM_DOWNLOAD_URL'), "calico_cni_ipam_checksum": os.environ.get('CALICO_CNI_IPAM_CHECKSUM'), + "ipip": get_var_as_bool('IPIP_USAGE', None), } for key, val in CALICO.items(): - if val: + if val is not None: DEFAULT_CUSTOM_YAML[key] = val DEPLOY_CONFIG = '/tmp/ccp-globals.yaml' diff --git a/fuel_ccp_tests/settings_oslo.py b/fuel_ccp_tests/settings_oslo.py index 0552d38..55ecf8f 100644 --- a/fuel_ccp_tests/settings_oslo.py +++ b/fuel_ccp_tests/settings_oslo.py @@ -68,7 +68,7 @@ underlay_opts = [ # KUBE_ADMIN_PASS = os.environ.get('KUBE_ADMIN_PASS', 'changeme') # KUBE_HOST = os.environ.get('KUBE_HOST', None) # KUBE_VERSION = os.environ.get("KUBE_VERSION", "v1.3.0") -# IPIP_USAGE = get_var_as_bool('IPIP_USAGE', True) +# IPIP_USAGE = get_var_as_bool('IPIP_USAGE', None) # DEPLOY_SCRIPT = os.environ.get("DEPLOY_SCRIPT", None) # Deploy options for a new K8S cluster @@ -76,7 +76,7 @@ k8s_deploy_opts = [ ct.Cfg('kube_version', ct.String(), help="", default="v1.3.5"), ct.Cfg('ipip_usage', ct.Boolean(), - help="", default=True), + help="", default=False), ct.Cfg('deploy_script', ct.String(), help="", default=None), ct.Cfg('kube_settings', ct.JSONDict(), diff --git a/fuel_ccp_tests/tests/system/test_ccp_install_k8s.py b/fuel_ccp_tests/tests/system/test_ccp_install_k8s.py index 3089661..6c6cd48 100644 --- a/fuel_ccp_tests/tests/system/test_ccp_install_k8s.py +++ b/fuel_ccp_tests/tests/system/test_ccp_install_k8s.py @@ -11,6 +11,8 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. +import copy + import pytest import base_test @@ -139,8 +141,6 @@ class TestFuelCCPInstaller(base_test.SystemBaseTest, self.check_number_kube_nodes(underlay, k8sclient) self.check_list_required_images(underlay, required_images=required_images) - if kube_settings['ipip']: - self.calico_ipip_exists(underlay) self.check_etcd_health(underlay) nginx = self.get_nginx_spec() pod = k8s_actions.check_pod_create(body=nginx) @@ -182,8 +182,6 @@ class TestFuelCCPInstaller(base_test.SystemBaseTest, self.check_number_kube_nodes(underlay, k8sclient) self.check_list_required_images(underlay, required_images=required_images) - if kube_settings['ipip']: - self.calico_ipip_exists(underlay) self.check_etcd_health(underlay) nginx = self.get_nginx_spec() pod = k8s_actions.check_pod_create(body=nginx) @@ -225,6 +223,48 @@ class TestFuelCCPInstaller(base_test.SystemBaseTest, self.check_nginx_pod_is_reached(underlay, pod.status.pod_ip) k8s_actions.check_pod_delete(pod) + @pytest.mark.test_k8s_installed_with_ipip + @pytest.mark.revert_snapshot(ext.SNAPSHOT.underlay) + @pytest.mark.fail_snapshot + def test_k8s_installed_with_ipip(self, underlay, k8s_actions, show_step): + """Test for deploying an k8s environment with IPIP tunnels for Calico + and check it + + Scenario: + 1. Enable 'ipip' in the settings + 2. Install k8s. + 3. Check Calico IPIP tunnels exist + 4. Basic check of running containers on nodes. + 5. Create nginx pod. + 6. Check created pod is reached + 7. Delete pod. + + Duration: 1200 + """ + show_step(1) + custom_yaml = copy.deepcopy(self.kube_settings) + custom_yaml['ipip'] = True + + show_step(2) + k8s_actions.install_k8s(custom_yaml=custom_yaml) + + show_step(3) + self.calico_ipip_exists(underlay) + + show_step(4) + self.check_list_required_images( + underlay, required_images=self.base_images) + + show_step(5) + nginx = self.get_nginx_spec() + pod = k8s_actions.check_pod_create(body=nginx) + + show_step(6) + self.check_nginx_pod_is_reached(underlay, pod.status.pod_ip) + + show_step(7) + k8s_actions.check_pod_delete(pod) + @pytest.mark.fuel_ccp_installer_idempotency @pytest.mark.system