diff options
-rw-r--r-- | INFO | 2 | ||||
-rw-r--r-- | docker/Dockerfile | 3 | ||||
-rw-r--r-- | docker/Dockerfile.aarch64 | 3 | ||||
-rw-r--r-- | docker/thirdparty-requirements.txt | 2 | ||||
-rwxr-xr-x | functest/ci/check_os.sh | 24 | ||||
-rwxr-xr-x | functest/ci/prepare_env.py | 6 | ||||
-rw-r--r-- | functest/tests/unit/ci/test_prepare_env.py | 8 | ||||
-rw-r--r-- | functest/utils/openstack_utils.py | 12 |
8 files changed, 29 insertions, 31 deletions
@@ -20,9 +20,9 @@ Juha Kosonen <juha.kosonen@nokia.com> Valentin Boucher <valentin.boucher@orange.com> Viktor Tikkanen <viktor.tikkanen@nokia.com> Mei Mei <meimei@huawei.com> +Linda Wang <wangwulin@huawei.com> Additional contributors: -Linda Wang <wangwulin@huawei.com> Georgios Paraskevopoulos <georgepar.91@gmail.com> Romanos Skiadas <rom.skiad@gmail.com> Michael Polenchuk <mpolenchuk@mirantis.com> diff --git a/docker/Dockerfile b/docker/Dockerfile index c13fc82e..4c3c76b8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -102,6 +102,7 @@ RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/securityscanning ${REPOS RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/opera ${REPOS_DIR}/opera # other repositories +RUN git clone --depth 1 -b $TEMPEST_TAG https://github.com/openstack/tempest.git ${REPOS_DIR}/tempest RUN git clone --depth 1 -b $ODL_TAG https://git.opendaylight.org/gerrit/p/integration/test.git ${REPOS_DIR}/odl_test RUN git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test ${REPOS_VNFS_DIR}/vims-test RUN git clone --depth 1 -b $VROUTER_TAG https://github.com/oolorg/opnfv-functest-vrouter.git ${REPOS_VNFS_DIR}/vrouter @@ -127,7 +128,7 @@ RUN find -L ${FUNCTEST_REPO_DIR} -name "*.py" \ RUN /bin/bash ${REPOS_DIR}/parser/tests/parser_install.sh ${REPOS_DIR} RUN wget -q https://raw.githubusercontent.com/openstack/rally/${RALLY_TAG}/install_rally.sh \ - && bash install_rally.sh --yes && rm install_rally.sh + && bash install_rally.sh --branch ${RALLY_TAG} --yes && rm install_rally.sh RUN add_images.sh diff --git a/docker/Dockerfile.aarch64 b/docker/Dockerfile.aarch64 index 7014d33f..272cf1fa 100644 --- a/docker/Dockerfile.aarch64 +++ b/docker/Dockerfile.aarch64 @@ -95,6 +95,7 @@ RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/securityscanning ${REPOS RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/opera ${REPOS_DIR}/opera # other repositories +RUN git clone --depth 1 -b $TEMPEST_TAG https://github.com/openstack/tempest.git ${REPOS_DIR}/tempest RUN git clone --depth 1 -b $ODL_TAG https://git.opendaylight.org/gerrit/p/integration/test.git ${REPOS_DIR}/odl_test RUN git clone --depth 1 -b $VIMS_TAG https://github.com/boucherv-orange/clearwater-live-test ${REPOS_VNFS_DIR}/vims-test RUN git clone --depth 1 https://github.com/wuwenbin2/OnosSystemTest.git ${REPOS_DIR}/onos @@ -117,7 +118,7 @@ RUN find -L ${FUNCTEST_REPO_DIR} -name "*.py" \ RUN /bin/bash ${REPOS_DIR}/parser/tests/parser_install.sh ${REPOS_DIR} RUN wget -q https://raw.githubusercontent.com/openstack/rally/${RALLY_TAG}/install_rally.sh \ - && bash install_rally.sh --yes && rm install_rally.sh + && bash install_rally.sh --branch ${RALLY_TAG} --yes && rm install_rally.sh RUN add_images.sh diff --git a/docker/thirdparty-requirements.txt b/docker/thirdparty-requirements.txt index d9ad368e..064b5185 100644 --- a/docker/thirdparty-requirements.txt +++ b/docker/thirdparty-requirements.txt @@ -2,5 +2,5 @@ git+https://gerrit.opnfv.org/gerrit/barometer#egg=baro_tests networking-bgpvpn kingbird rally -tempest>=12.1.0 # Apache-2.0 +tempest>=15.0.0 # Apache-2.0 git+https://github.com/openstack/refstack-client#egg=refstack-client diff --git a/functest/ci/check_os.sh b/functest/ci/check_os.sh index ce0bc20c..7b66f3da 100755 --- a/functest/ci/check_os.sh +++ b/functest/ci/check_os.sh @@ -6,12 +6,18 @@ # jose.lausuch@ericsson.com # +if [[ ${OS_INSECURE,,} == "true" ]]; then + options='--insecure' +else + options='' +fi + declare -A service_cmd_array -service_cmd_array['nova']='openstack server list' -service_cmd_array['neutron']='openstack network list' -service_cmd_array['keystone']='openstack endpoint list' -service_cmd_array['cinder']='openstack volume list' -service_cmd_array['glance']='openstack image list' +service_cmd_array['nova']="openstack $options server list" +service_cmd_array['neutron']="openstack $options network list" +service_cmd_array['keystone']="openstack $options endpoint list" +service_cmd_array['cinder']="openstack $options volume list" +service_cmd_array['glance']="openstack $options image list" MANDATORY_SERVICES='nova neutron keystone glance' OPTIONAL_SERVICES='cinder' @@ -41,7 +47,7 @@ check_service() { required=$2 fi echo ">>Checking ${service} service..." - if ! openstack service list | grep -i ${service} > /dev/null; then + if ! openstack $options service list | grep -i ${service} > /dev/null; then if [ "$required" == 'false' ]; then echo "WARN: Optional Service ${service} is not enabled!" return @@ -67,7 +73,7 @@ fi echo "Checking OpenStack endpoints:" -publicURL=$(openstack catalog show identity |awk '/public/ {print $4}') +publicURL=$(openstack $options catalog show identity |awk '/public/ {print $4}') publicIP=$(echo $publicURL|sed 's/^.*http.*\:\/\///'|sed 's/.[^:]*$//') publicPort=$(echo $publicURL|grep -Po '(?<=:)\d+') https_enabled=$(echo $publicURL | grep 'https') @@ -99,11 +105,11 @@ for service in $OPTIONAL_SERVICES; do done echo "Checking External network..." -networks=($(neutron net-list -F id | tail -n +4 | head -n -1 | awk '{print $2}')) +networks=($(neutron $options net-list -F id | tail -n +4 | head -n -1 | awk '{print $2}')) is_external=False for net in "${networks[@]}" do - is_external=$(neutron net-show $net|grep "router:external"|awk '{print $4}') + is_external=$(neutron $options net-show $net|grep "router:external"|awk '{print $4}') if [ $is_external == "True" ]; then echo "External network found: $net" break diff --git a/functest/ci/prepare_env.py b/functest/ci/prepare_env.py index fd1f5dbf..64fcc925 100755 --- a/functest/ci/prepare_env.py +++ b/functest/ci/prepare_env.py @@ -251,8 +251,8 @@ def update_db_url(): def verify_deployment(): print_separator() logger.info("Verifying OpenStack services...") - cmd = ("sh %s" % pkg_resources.resource_filename( - 'functest', 'ci/check_os.sh')) + cmd = ("%s" % pkg_resources.resource_filename( + 'functest', 'ci/check_os.sh')) logger.debug("Executing command: %s" % cmd) p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) @@ -366,7 +366,6 @@ def main(**kwargs): elif kwargs['action'] == "start": logger.info("######### Preparing Functest environment #########\n") check_env_variables() - get_deployment_handler() create_directories() source_rc_file() update_config_file() @@ -377,7 +376,6 @@ def main(**kwargs): with open(CONST.__getattribute__('env_active'), "w") as env_file: env_file.write("1") check_environment() - print_deployment_info() elif kwargs['action'] == "check": check_environment() except Exception as e: diff --git a/functest/tests/unit/ci/test_prepare_env.py b/functest/tests/unit/ci/test_prepare_env.py index f3e15a01..69abd643 100644 --- a/functest/tests/unit/ci/test_prepare_env.py +++ b/functest/tests/unit/ci/test_prepare_env.py @@ -424,7 +424,6 @@ class PrepareEnvTesting(unittest.TestCase): mock_logger_info.assert_any_call("Functest environment" " is installed.") - @mock.patch('functest.ci.prepare_env.print_deployment_info') @mock.patch('functest.ci.prepare_env.check_environment') @mock.patch('functest.ci.prepare_env.create_flavor') @mock.patch('functest.ci.prepare_env.install_tempest') @@ -433,21 +432,19 @@ class PrepareEnvTesting(unittest.TestCase): @mock.patch('functest.ci.prepare_env.update_config_file') @mock.patch('functest.ci.prepare_env.source_rc_file') @mock.patch('functest.ci.prepare_env.create_directories') - @mock.patch('functest.ci.prepare_env.get_deployment_handler') @mock.patch('functest.ci.prepare_env.check_env_variables') @mock.patch('functest.ci.prepare_env.logger.info') - def test_main_start(self, mock_logger_info, mock_env_var, mock_dep_handler, + def test_main_start(self, mock_logger_info, mock_env_var, mock_create_dir, mock_source_rc, mock_update_config, mock_verify_depl, mock_install_rally, mock_install_temp, mock_create_flavor, - mock_check_env, mock_print_info): + mock_check_env): with mock.patch("__builtin__.open", mock.mock_open()) as m: args = {'action': 'start'} self.assertEqual(prepare_env.main(**args), 0) mock_logger_info.assert_any_call("######### Preparing Functest " "environment #########\n") self.assertTrue(mock_env_var.called) - self.assertTrue(mock_dep_handler.called) self.assertTrue(mock_create_dir.called) self.assertTrue(mock_source_rc.called) self.assertTrue(mock_update_config.called) @@ -458,7 +455,6 @@ class PrepareEnvTesting(unittest.TestCase): m.assert_called_once_with( CONST.__getattribute__('env_active'), "w") self.assertTrue(mock_check_env.called) - self.assertTrue(mock_print_info.called) @mock.patch('functest.ci.prepare_env.check_environment') def test_main_check(self, mock_check_env): diff --git a/functest/utils/openstack_utils.py b/functest/utils/openstack_utils.py index f155449d..a8966264 100644 --- a/functest/utils/openstack_utils.py +++ b/functest/utils/openstack_utils.py @@ -181,14 +181,10 @@ def get_endpoint(service_type, endpoint_type='publicURL'): def get_session(other_creds={}): auth = get_session_auth(other_creds) - cacert = os.getenv('OS_CACERT') - if cacert is not None: - if not os.path.isfile(cacert): - raise Exception("The 'OS_CACERT' environment" - "variable is set to %s but the file" - "does not exist.", cacert) - - return session.Session(auth=auth, verify=cacert) + https_cacert = os.getenv('OS_CACERT', '') + https_insecure = os.getenv('OS_INSECURE', '').lower() == 'true' + return session.Session(auth=auth, + verify=(https_cacert or not https_insecure)) # ********************************************* |