Пример #1
0
class TestInstall(BaseTest):
    @pytest.fixture
    def new_controller_configuration(self, request) -> BaseNodeConfig:
        """
        Creates the controller configuration object according to the platform.
        Override this fixture in your test class to provide a custom configuration object
        :rtype: new node controller configuration
        """
        if global_variables.platform == consts.Platforms.VSPHERE:
            config = VSphereControllerConfig()
        else:
            config = TerraformConfig()

        with suppress(FixtureLookupError):
            operators = request.getfixturevalue("olm_operators")
            self.update_olm_configuration(config, operators)

        return config

    @pytest.fixture
    def new_cluster_configuration(self, request: FixtureRequest):
        # Overriding the default BaseTest.new_cluster_configuration fixture to set custom configs.
        config = ClusterConfig()

        for fixture_name in ["openshift_version", "network_type", "is_static_ip", "olm_operators"]:
            with suppress(FixtureLookupError):
                if hasattr(config, fixture_name):
                    config.set_value(fixture_name, request.getfixturevalue(fixture_name))
                else:
                    raise AttributeError(f"No attribute name {fixture_name} in ClusterConfig object type")
        config.trigger(get_default_triggers())
        return config

    @JunitTestSuite()
    @pytest.mark.parametrize("openshift_version", get_available_openshift_versions())
    def test_install(self, cluster, openshift_version):
        cluster.prepare_for_installation()
        cluster.start_install_and_wait_for_installed()

    @JunitTestSuite()
    @pytest.mark.parametrize("openshift_version", get_available_openshift_versions())
    def test_infra_env_install(self, infra_env, openshift_version):
        infra_env.prepare_for_installation()

    @JunitTestSuite()
    @pytest.mark.parametrize("is_static_ip", [False, True])
    @pytest.mark.parametrize("network_type", [consts.NetworkType.OpenShiftSDN, consts.NetworkType.OVNKubernetes])
    def test_networking(self, cluster, network_type, is_static_ip):
        cluster.prepare_for_installation()
        cluster.start_install_and_wait_for_installed()

    @JunitTestSuite()
    @pytest.mark.parametrize("olm_operators", sorted(global_variables.get_api_client().get_supported_operators()))
    def test_olm_operator(self, cluster, olm_operators):
        cluster.prepare_for_installation()
        cluster.start_install_and_wait_for_installed()
Пример #2
0
class TestInstall(BaseTest):
    @pytest.fixture
    def new_cluster_configuration(self, request: FixtureRequest):
        # Overriding the default BaseTest.new_cluster_configuration fixture to set custom configs.
        config = ClusterConfig()

        for fixture_name in [
                "openshift_version", "network_type", "is_static_ip"
        ]:
            with suppress(FixtureLookupError):
                setattr(config, fixture_name,
                        request.getfixturevalue(fixture_name))

        config.trigger()
        return config

    @JunitTestSuite()
    @pytest.mark.parametrize("openshift_version",
                             get_available_openshift_versions())
    def test_install(self, cluster, openshift_version):
        cluster.prepare_for_installation()
        cluster.start_install_and_wait_for_installed()

    @JunitTestSuite()
    @pytest.mark.parametrize("openshift_version",
                             get_available_openshift_versions())
    def test_infra_env_install(self, infra_env, openshift_version):
        infra_env.prepare_for_installation()

    @JunitTestSuite()
    @pytest.mark.parametrize("is_static_ip", [False, True])
    @pytest.mark.parametrize(
        "network_type", [NetworkType.OpenShiftSDN, NetworkType.OVNKubernetes])
    def test_networking(self, cluster, network_type, is_static_ip):
        cluster.prepare_for_installation()
        cluster.start_install_and_wait_for_installed()

    @JunitTestSuite()
    @pytest.mark.parametrize(
        "operators",
        sorted(global_variables.get_api_client().get_supported_operators()))
    def test_olm_operator(self, configs, get_nodes, get_cluster, operators,
                          update_olm_config):
        cluster_config, tf_config = configs
        update_olm_config(tf_config=tf_config,
                          cluster_config=cluster_config,
                          operators=operators)

        new_cluster = get_cluster(get_nodes(tf_config, cluster_config),
                                  cluster_config)
        new_cluster.prepare_for_installation()
        new_cluster.start_install_and_wait_for_installed()
        assert new_cluster.is_operator_in_status(operators,
                                                 OperatorStatus.AVAILABLE)
Пример #3
0
class TestInstall(BaseTest):
    @JunitTestSuite()
    @pytest.mark.parametrize("openshift_version",
                             sorted(get_available_openshift_versions()))
    def test_install(self, get_nodes, get_cluster, openshift_version):
        new_cluster = get_cluster(
            cluster_config=ClusterConfig(openshift_version=openshift_version),
            nodes=get_nodes())
        new_cluster.prepare_for_installation()
        new_cluster.start_install_and_wait_for_installed()

    @JunitTestSuite()
    @pytest.mark.parametrize("operators",
                             sorted(get_api_client().get_supported_operators())
                             )
    def test_olm_operator(self, get_nodes, get_cluster, operators,
                          update_olm_config):
        new_cluster = get_cluster(
            cluster_config=ClusterConfig(olm_operators=[operators]),
            nodes=get_nodes(
                update_olm_config(config=TerraformConfig(),
                                  operators=operators)))
        new_cluster.prepare_for_installation()
        new_cluster.start_install_and_wait_for_installed()
        assert new_cluster.is_operator_in_status(operators,
                                                 OperatorStatus.AVAILABLE)
class TestInstall(BaseTest):

    @JunitTestSuite()
    @pytest.mark.parametrize("openshift_version", get_available_openshift_versions())
    def test_install(self, configs: Tuple[ClusterConfig, TerraformConfig], get_nodes, get_cluster, openshift_version):
        cluster_config, tf_config = configs
        cluster_config.openshift_version = openshift_version
        new_cluster = get_cluster(get_nodes(tf_config, cluster_config), cluster_config)
        new_cluster.prepare_for_installation()
        new_cluster.start_install_and_wait_for_installed()

    @JunitTestSuite()
    @pytest.mark.parametrize("sleep_time", [1, 60])
    def test_dummy(self, configs: Tuple[ClusterConfig, TerraformConfig], get_nodes, get_cluster, sleep_time):
        cluster_config, tf_config = configs
        new_cluster = get_cluster(get_nodes(tf_config, cluster_config), cluster_config)
        new_cluster.prepare_for_installation()
        time.sleep(sleep_time)

    @JunitTestSuite()
    @pytest.mark.parametrize("operators", sorted(get_api_client().get_supported_operators()))
    def test_olm_operator(self, configs, get_nodes, get_cluster, operators, update_olm_config):
        cluster_config, tf_config = configs
        update_olm_config(tf_config=tf_config, cluster_config=cluster_config, operators=operators)

        new_cluster = get_cluster(get_nodes(tf_config, cluster_config), cluster_config)
        new_cluster.prepare_for_installation()
        new_cluster.start_install_and_wait_for_installed()
        assert new_cluster.is_operator_in_status(operators, OperatorStatus.AVAILABLE)
Пример #5
0
class TestInstall(BaseTest):

    @JunitTestSuite()
    @pytest.mark.parametrize("openshift_version", get_available_openshift_versions())
    def test_install(self, nodes, cluster, openshift_version):
        new_cluster = cluster(openshift_version=openshift_version)
        new_cluster.prepare_for_install(nodes=nodes)
        new_cluster.start_install_and_wait_for_installed()
class TestInstall(BaseTest):
    @JunitTestSuite()
    @pytest.mark.parametrize("openshift_version", get_available_openshift_versions())
    def test_install(self, cluster, openshift_version):
        cluster.prepare_for_installation()
        cluster.start_install_and_wait_for_installed()

    @JunitTestSuite()
    @pytest.mark.parametrize("openshift_version", get_available_openshift_versions())
    def test_infra_env_install(self, infra_env, openshift_version):
        infra_env.prepare_for_installation()

    @JunitTestSuite()
    @pytest.mark.parametrize("network_type", [consts.NetworkType.OpenShiftSDN, consts.NetworkType.OVNKubernetes])
    def test_networking(self, cluster, network_type):
        cluster.prepare_for_installation()
        cluster.start_install_and_wait_for_installed()

    @JunitTestSuite()
    @pytest.mark.parametrize("olm_operators", get_supported_operators())
    def test_olm_operator(self, cluster, olm_operators):
        cluster.prepare_for_installation()
        cluster.start_install_and_wait_for_installed()
class TestInstall(BaseTest):

    @JunitTestSuite()
    @pytest.mark.parametrize("openshift_version", get_available_openshift_versions())
    def test_install(self, get_nodes, get_cluster, openshift_version):
        new_cluster = get_cluster(cluster_config=ClusterConfig(openshift_version=openshift_version), nodes=get_nodes())
        new_cluster.prepare_for_installation()
        new_cluster.start_install_and_wait_for_installed()

    @JunitTestSuite()
    # TODO: Fix OCS
    # @pytest.mark.parametrize("olm_operator", get_api_client().get_supported_operators())
    @pytest.mark.parametrize("olm_operator", ["lso", "cnv"])
    def test_olm_operator(self, get_nodes, get_cluster, olm_operator):
        new_cluster = get_cluster(cluster_config=ClusterConfig(olm_operators=[olm_operator]),
                                  nodes=get_nodes(TerraformConfig(olm_operators=[olm_operator])))
        new_cluster.prepare_for_installation()
        new_cluster.start_install_and_wait_for_installed()