diff options
-rw-r--r-- | api/resources/env_action.py | 10 | ||||
-rwxr-xr-x | tests/ci/clean_images.sh | 7 | ||||
-rwxr-xr-x | tests/ci/yardstick-verify | 2 | ||||
-rw-r--r-- | yardstick/common/constants.py | 2 |
4 files changed, 19 insertions, 2 deletions
diff --git a/api/resources/env_action.py b/api/resources/env_action.py index fa0f95d90..c2c93f1eb 100644 --- a/api/resources/env_action.py +++ b/api/resources/env_action.py @@ -195,6 +195,8 @@ def _prepare_env_daemon(): # update the external_network _source_file(rc_file) + _clean_images() + _load_images() @@ -251,6 +253,14 @@ def _append_external_network(rc_file): raise +def _clean_images(): + cmd = [config.CLEAN_IMAGES_SCRIPT] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, + cwd=config.YARDSTICK_REPOS_DIR) + output = p.communicate()[0] + logger.debug('The result is: %s', output) + + def _load_images(): cmd = [config.LOAD_IMAGES_SCRIPT] p = subprocess.Popen(cmd, stdout=subprocess.PIPE, diff --git a/tests/ci/clean_images.sh b/tests/ci/clean_images.sh index 5d661283d..fa4a54df6 100755 --- a/tests/ci/clean_images.sh +++ b/tests/ci/clean_images.sh @@ -27,3 +27,10 @@ cleanup() openstack flavor delete yardstick-flavor &> /dev/null || true } + +main() +{ + cleanup +} + +main diff --git a/tests/ci/yardstick-verify b/tests/ci/yardstick-verify index 46b32cc2c..f9d98a4da 100755 --- a/tests/ci/yardstick-verify +++ b/tests/ci/yardstick-verify @@ -320,8 +320,6 @@ main() source $YARDSTICK_REPO_DIR/tests/ci/clean_images.sh - cleanup - trap "error_exit" EXIT SIGTERM source $YARDSTICK_REPO_DIR/tests/ci/load_images.sh diff --git a/yardstick/common/constants.py b/yardstick/common/constants.py index 443b3e810..6993c41b9 100644 --- a/yardstick/common/constants.py +++ b/yardstick/common/constants.py @@ -31,6 +31,8 @@ RELENG_DIR = '/home/opnfv/repos/releng' OS_FETCH_SCRIPT = 'utils/fetch_os_creds.sh' +CLEAN_IMAGES_SCRIPT = 'tests/ci/clean_images.sh' + LOAD_IMAGES_SCRIPT = 'tests/ci/load_images.sh' OPENSTACK_RC_FILE = os.path.join(YARDSTICK_CONFIG_DIR, 'openstack.creds') |