From e88d02c9d87c18dbaaf849d8b10167e6dadf485a Mon Sep 17 00:00:00 2001
From: chenjiankun <chenjiankun1@huawei.com>
Date: Thu, 15 Dec 2016 06:02:50 +0000
Subject: Bugfix: the load_image.sh script will load a image with the same name

JIRA: YARDSTICK-471

Currently, if we execute the load_image.sh and the openstack already
have this image in the cloud,this script will load another image with
the same name.
This will make yardstick run error.
So I clean this related images before loading.

Change-Id: If5b985ef9b2e890aa10453810fac36867d320a06
Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
---
 tests/ci/clean_images.sh  | 7 +++++++
 tests/ci/yardstick-verify | 2 --
 2 files changed, 7 insertions(+), 2 deletions(-)

(limited to 'tests')

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
-- 
cgit