t='cgit 1.2.3-korg'/>
summaryrefslogtreecommitdiffstats
path: root/tests/ci/clean_images.sh
blob: fa4a54df68ba93b525c17aa5f63a0b29d8ed8e88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/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 ! openstack image list; then
        return
    fi

    for image in $(openstack image list | grep -e cirros-0.3.3 -e yardstick-image -e Ubuntu-14.04 \
        -e yardstick-vivid-kernel | awk '{print $2}'); do
        echo "Deleting image $image..."
        openstack image delete $image || true
    done

    openstack flavor delete yardstick-flavor &> /dev/null || true
}

main()
{
    cleanup
}

main