summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/tests/openstack_tests.py
diff options
context:
space:
mode:
authorCristina Pauna <cristina.pauna@enea.com>2017-02-24 16:41:46 +0200
committerCristina Pauna <cristina.pauna@enea.com>2017-03-01 17:10:34 +0200
commit8392f34fbc479e04c9e8d803c7b5179a9070cde1 (patch)
treec4588b7ddc9868cab5da1aeafda6cfd5a9466d09 /snaps/openstack/tests/openstack_tests.py
parentc613af85630307c1c50ccd109d8c4efae5f0265b (diff)
Add support for extra properties in an image
This patch adds a new setting for images, extra_properties. This field is a dict and can be used to create a 3-part image by setting the kernel_id and the ramdisk_id of the main image. Unit tests have been added to set some generic property, for creation of the 3-part image, and for creating an instance with that 3-part image JIRA: SNAPS-32 Change-Id: Ifb53d1da1085fcd6429ddc0607c905522db5e8bb Signed-off-by: Cristina Pauna <cristina.pauna@enea.com>
Diffstat (limited to 'snaps/openstack/tests/openstack_tests.py')
-rw-r--r--snaps/openstack/tests/openstack_tests.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/snaps/openstack/tests/openstack_tests.py b/snaps/openstack/tests/openstack_tests.py
index dab2ea2..a1b7881 100644
--- a/snaps/openstack/tests/openstack_tests.py
+++ b/snaps/openstack/tests/openstack_tests.py
@@ -92,9 +92,10 @@ def get_credentials(os_env_file=None, proxy_settings_str=None, ssh_proxy_cmd=Non
return os_creds
-def cirros_url_image(name):
- return ImageSettings(name=name, image_user='cirros', img_format='qcow2',
- url='http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img')
+def cirros_url_image(name, url=None):
+ if not url:
+ url='http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img'
+ return ImageSettings(name=name, image_user='cirros', img_format='qcow2', url=url)
def file_image_test_settings(name, file_path):
@@ -102,16 +103,17 @@ def file_image_test_settings(name, file_path):
image_file=file_path)
-def centos_url_image(name):
- return ImageSettings(name=name, image_user='centos', img_format='qcow2',
- url='http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2',
- nic_config_pb_loc='./provisioning/ansible/centos-network-setup/playbooks/configure_host.yml')
+def centos_url_image(name, url=None):
+ if not url:
+ url='http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2'
+ return ImageSettings(name=name, image_user='centos', img_format='qcow2', url=url,
+ nic_config_pb_loc='./provisioning/ansible/centos-network-setup/playbooks/configure_host.yml')
-def ubuntu_url_image(name):
- return ImageSettings(
- name=name, image_user='ubuntu', img_format='qcow2',
- url='http://uec-images.ubuntu.com/releases/trusty/14.04/ubuntu-14.04-server-cloudimg-amd64-disk1.img',
+def ubuntu_url_image(name, url=None):
+ if not url:
+ url='http://uec-images.ubuntu.com/releases/trusty/14.04/ubuntu-14.04-server-cloudimg-amd64-disk1.img'
+ return ImageSettings(name=name, image_user='ubuntu', img_format='qcow2', url=url,
nic_config_pb_loc='./provisioning/ansible/ubuntu-network-setup/playbooks/configure_host.yml')