summaryrefslogtreecommitdiffstats
path: root/testing/robot/lib/FDSLibrary.py
diff options
context:
space:
mode:
authorJuraj Linkeš <jlinkes@cisco.com>2017-03-14 13:31:26 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-03-14 13:31:26 +0000
commitc11c0660c51dab7450a776cbb63381ad74cfacad (patch)
tree3d5d4c556661038198eb774f2847d40f468029ca /testing/robot/lib/FDSLibrary.py
parent457756281a82c99d6e1ae261e8a6356eb01aa7f2 (diff)
parenta717a49967f77ede476da582b6d3bb2c6359da1b (diff)
Merge "Check for a flavor with hugepages"
Diffstat (limited to 'testing/robot/lib/FDSLibrary.py')
-rw-r--r--testing/robot/lib/FDSLibrary.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/testing/robot/lib/FDSLibrary.py b/testing/robot/lib/FDSLibrary.py
index 32c18eb..0d0929e 100644
--- a/testing/robot/lib/FDSLibrary.py
+++ b/testing/robot/lib/FDSLibrary.py
@@ -36,12 +36,17 @@ class FDSLibrary():
logger.debug("Initializing nova client.")
self.nova_client = nova.Client('2', session=session.Session(auth=auth_obj))
- def check_flavor_exists(self, flavor):
- flavor_list_names = [x.name for x in self.nova_client.flavors.list()]
- return flavor in flavor_list_names
+ def check_flavor_exists(self):
+ flavor_names = [x for x in self.nova_client.flavors.list(min_ram=760)]
+ for flavor in flavor_names:
+ for key in flavor.get_keys():
+ if "mem_page_size" in key:
+ logger.info("Found flavor with memory-setting: " + flavor.name)
+ return flavor.name
def create_flavor(self, name, ram, vcpus="1", disk="0"):
response = self.nova_client.flavors.create(name, ram, vcpus, disk)
+ response.set_keys({'hw:mem_page_size': 'large'})
return response
def check_image_exists(self, image):