2 ##############################################################################
3 # Copyright (c) 2015 Ericsson AB, Huawei Technologies Co.,Ltd and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
11 # Clean the images and flavor before running yardstick test suites.
16 echo "========== Cleanup =========="
18 if ! openstack image list; then
22 for image in $(openstack image list | grep -e cirros-0.3.3 -e yardstick-image -e Ubuntu-14.04 \
23 -e yardstick-vivid-kernel | awk '{print $2}'); do
24 echo "Deleting image $image..."
25 openstack image delete $image || true
28 openstack flavor delete yardstick-flavor &> /dev/null || true