summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Redondo Marchena <francisco.marchena@codethink.co.uk>2015-06-17 11:09:29 +0000
committerFrancisco Redondo Marchena <francisco.marchena@codethink.co.uk>2015-06-17 15:35:41 +0000
commit4580683f158b9f9419793dc89e63d3e7b7abc52f (patch)
tree7b86cfaffbe9033c31f93fc0004c94206c24d6fe
parentc3c07c6a287711d34bb4ff0a75d5ab453b253012 (diff)
downloaddefinitions-4580683f158b9f9419793dc89e63d3e7b7abc52f.tar.gz
Create custom flavor for running tempest test in VM
tempest requires to have an alternative flavor and the m1.small flavor by default is very big in terms of RAM and disk for a test VM. Adding the possibility to set a smaller custom flavor gives the possibility to run tempests test for onenode in a VM without having memory or disk allocation problems with libvirt. Change-Id: I14bfb5b8c1cca820e00877649f664fb921f2ec1f
-rwxr-xr-xinstall-files/openstack/etc/tempest/set_openstack_to_run_tempest.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/install-files/openstack/etc/tempest/set_openstack_to_run_tempest.sh b/install-files/openstack/etc/tempest/set_openstack_to_run_tempest.sh
index 5a74dfcf..30539488 100755
--- a/install-files/openstack/etc/tempest/set_openstack_to_run_tempest.sh
+++ b/install-files/openstack/etc/tempest/set_openstack_to_run_tempest.sh
@@ -95,6 +95,19 @@ create_image_for_user(){
fi
}
+create_tempest_custom_flavor(){
+ # Set the credential for admin
+ source "${admin_username}_env"
+ # In order to run tests in VMs we need a alternative flavor
+ # smaller than the small and bigger than the tiny flavor.
+ # So we create a flavor with the following features:
+ # name=m1.tempest_tests ID=6 Memory_MB=1024 Disk=1 Ephemeral=0 VCPUS=1
+ echo "Creating custom small flavor for tempest tests and set it as alt_flavor in tempest.conf"
+ nova flavor-create m1.tempest_tests 6 1024 1 1
+ sed -r -i "s/[#]?flavor_ref_alt =.*/flavor_ref_alt = 6/" tempest.conf
+}
+
# Configure Openstack for running tempest tests.
create_admin_user_env
create_image_for_user "$admin_username" "$admin_test_image"
+create_tempest_custom_flavor