summaryrefslogtreecommitdiffstats
path: root/tests/ci/clean_images.sh
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2016-09-26 02:59:21 +0000
committerxudan <xudan16@huawei.com>2016-09-26 04:11:16 +0000
commit23277dc71fdac8a151184da13881bdab551db72f (patch)
tree0a7503cc3f91e092595c716293d67d9e625ad377 /tests/ci/clean_images.sh
parent090d493c2247ee63c9f9509191b011d2ecfa921f (diff)
Decoupling yardstick_verify.sh
JIRA: YARDSTICK-360 Change-Id: I9f0b44041a50d3538ffa7fb2941d847808b220ff Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to 'tests/ci/clean_images.sh')
-rwxr-xr-xtests/ci/clean_images.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/ci/clean_images.sh b/tests/ci/clean_images.sh
new file mode 100755
index 000000000..05f68a7ed
--- /dev/null
+++ b/tests/ci/clean_images.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+##############################################################################
+# Copyright (c) 2015 Ericsson AB, Huawei Technologies Co.,Ltd and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+# Clean the images and flavor before running yardstick test suites.
+
+cleanup()
+{
+ echo
+ echo "========== Cleanup =========="
+
+ if ! glance image-list; then
+ return
+ fi
+
+ for image in $(glance image-list | grep -e cirros-0.3.3 -e yardstick-trusty-server -e Ubuntu-14.04 \
+ -e yardstick-vivid-kernel | awk '{print $2}'); do
+ echo "Deleting image $image..."
+ glance image-delete $image || true
+ done
+
+ nova flavor-delete yardstick-flavor &> /dev/null || true
+}