Exemple #1
0
 def test_check_env_variables_with_ci_debug(self, mock_logger_warn,
                                            mock_logger_info):
     CONST.CI_DEBUG = mock.Mock()
     prepare_env.check_env_variables()
     mock_logger_info.assert_any_call("Checking environment variables"
                                      "...")
     mock_logger_info.assert_any_call(test_utils.
                                      SubstrMatch("    CI_DEBUG="))
Exemple #2
0
 def test_check_env_variables_missing_inst_type(self, mock_logger_warn,
                                                mock_logger_info):
     CONST.INSTALLER_TYPE = None
     prepare_env.check_env_variables()
     mock_logger_info.assert_any_call("Checking environment variables"
                                      "...")
     mock_logger_warn.assert_any_call("The env variable 'INSTALLER_TYPE'"
                                      " is not defined.")
Exemple #3
0
 def test_check_env_variables_with_scenario(self, mock_logger_warn,
                                            mock_logger_info):
     CONST.DEPLOY_SCENARIO = mock.Mock()
     prepare_env.check_env_variables()
     mock_logger_info.assert_any_call("Checking environment variables"
                                      "...")
     mock_logger_info.assert_any_call(test_utils.
                                      SubstrMatch("DEPLOY_SCENARIO="))
Exemple #4
0
 def test_check_env_variables_with_inst_ip(self, mock_logger_warn,
                                           mock_logger_info):
     CONST.INSTALLER_IP = mock.Mock()
     prepare_env.check_env_variables()
     mock_logger_info.assert_any_call("Checking environment variables"
                                      "...")
     mock_logger_info.assert_any_call(test_utils.
                                      SubstrMatch("    INSTALLER_IP="))
Exemple #5
0
 def test_check_env_variables_with_node(self, mock_logger_warn,
                                        mock_logger_info):
     CONST.NODE_NAME = mock.Mock()
     prepare_env.check_env_variables()
     mock_logger_info.assert_any_call("Checking environment variables"
                                      "...")
     mock_logger_info.assert_any_call(test_utils.
                                      SubstrMatch("    NODE_NAME="))
Exemple #6
0
 def test_check_env_variables_missing_scenario(self, mock_logger_warn,
                                               mock_logger_info):
     CONST.DEPLOY_SCENARIO = None
     prepare_env.check_env_variables()
     mock_logger_info.assert_any_call("Checking environment variables"
                                      "...")
     mock_logger_warn.assert_any_call("The env variable"
                                      " 'DEPLOY_SCENARIO' is not defined"
                                      ". Setting CI_SCENARIO=undefined.")
Exemple #7
0
    def test_check_env_variables_with_is_ci_run(self, mock_logger_warn,
                                                mock_logger_info):
        CONST.IS_CI_RUN = mock.Mock()
        prepare_env.check_env_variables()
        mock_logger_info.assert_any_call("Checking environment variables"
                                         "...")

        mock_logger_info.assert_any_call(test_utils.
                                         SubstrMatch("    IS_CI_RUN="))
Exemple #8
0
    def test_check_env_variables_with_build_tag(self, mock_logger_warn,
                                                mock_logger_info):
        CONST.BUILD_TAG = mock.Mock()
        prepare_env.check_env_variables()
        mock_logger_info.assert_any_call("Checking environment variables"
                                         "...")

        mock_logger_info.assert_any_call(test_utils.
                                         SubstrMatch("    BUILD_TAG="))
Exemple #9
0
 def test_check_env_variables_missing_inst_ip(self, mock_logger_warn,
                                              mock_logger_info):
     CONST.__setattr__('INSTALLER_IP', None)
     prepare_env.check_env_variables()
     mock_logger_info.assert_any_call("Checking environment variables"
                                      "...")
     mock_logger_warn.assert_any_call(
         "The env variable 'INSTALLER_IP' is not defined. It is recommended"
         " to extract some information from the deployment")
Exemple #10
0
 def test_check_env_variables_missing_inst_ip(self, mock_logger_warn,
                                              mock_logger_info):
     CONST.INSTALLER_IP = None
     prepare_env.check_env_variables()
     mock_logger_info.assert_any_call("Checking environment variables"
                                      "...")
     mock_logger_warn.assert_any_call("The env variable 'INSTALLER_IP'"
                                      " is not defined. It is needed to"
                                      " fetch the OpenStack credentials."
                                      " If the credentials are not"
                                      " provided to the container as a"
                                      " volume, please add this env"
                                      " variable to the 'docker run'"
                                      " command.")