aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2017-09-08 11:32:01 -0700
committerEdward MacGillivray <edward.s.macgillivray@intel.com>2017-09-18 16:13:09 -0700
commitb84509793a3bc776220de892fd715dbced04da4e (patch)
treea37f655c0b079911633b7a1f40662d596df0f7a2 /yardstick
parent468aeaf9fe6a5cd0d350f566ed7b9216efc752b6 (diff)
Heat: use pkey from string instead of key_filename
Instead of using a key_filename for Heat, we can read the key as a string directly using pkg_resources.resource_string() This will enable us to save Heat stacks as pod.yaml, because we can embedded the key into the pod.yaml directly. Change-Id: I16baaba17dab845ee0846f97678733bae33cb463 Signed-off-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Edward MacGillivray <edward.s.macgillivray@intel.com>
Diffstat (limited to 'yardstick')
-rw-r--r--yardstick/benchmark/contexts/heat.py6
-rw-r--r--yardstick/benchmark/scenarios/networking/vnf_generic.py11
2 files changed, 14 insertions, 3 deletions
diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py
index c7586abf4..374be0b1b 100644
--- a/yardstick/benchmark/contexts/heat.py
+++ b/yardstick/benchmark/contexts/heat.py
@@ -413,9 +413,9 @@ class HeatContext(Context):
attr_name: either a name for a server created by yardstick or a dict
with attribute name mapping when using external heat templates
"""
- key_filename = pkg_resources.resource_filename(
+ pkey = pkg_resources.resource_string(
'yardstick.resources',
- h_join('files/yardstick_key', get_short_key_uuid(self.key_uuid)))
+ h_join('files/yardstick_key', get_short_key_uuid(self.key_uuid))).decode('utf-8')
if isinstance(attr_name, collections.Mapping):
node_name, cname = self.split_name(attr_name['name'])
@@ -436,7 +436,7 @@ class HeatContext(Context):
result = {
"user": server.context.user,
- "key_filename": key_filename,
+ "pkey": pkey,
"private_ip": server.private_ip,
"interfaces": server.interfaces,
"routing_table": self.generate_routing_table(server),
diff --git a/yardstick/benchmark/scenarios/networking/vnf_generic.py b/yardstick/benchmark/scenarios/networking/vnf_generic.py
index f381186de..5af98b1d7 100644
--- a/yardstick/benchmark/scenarios/networking/vnf_generic.py
+++ b/yardstick/benchmark/scenarios/networking/vnf_generic.py
@@ -470,6 +470,10 @@ printf "%s/driver:" $1 ; basename $(readlink -s $1/device/driver); } \
ext_intfs = vnfd["vdu"][0]["external-interface"] = []
# have to sort so xe0 goes first
for intf_name, intf in sorted(node['interfaces'].items()):
+ # only interfaces with vld_id are added.
+ # Thus there are two layers of filters, only intefaces with vld_id
+ # show up in interfaces, and only interfaces with traffic profiles
+ # are used by the generators
if intf.get('vld_id'):
# force dpkd_port_num to int so we can do reverse lookup
try:
@@ -511,6 +515,13 @@ printf "%s/driver:" $1 ; basename $(readlink -s $1/device/driver); } \
vnfd = vnfdgen.generate_vnfd(vnf_model, node)
# TODO: here add extra context_cfg["nodes"] regardless of template
vnfd = vnfd["vnfd:vnfd-catalog"]["vnfd"][0]
+ # force inject pkey if it exists
+ # we want to standardize Heat using pkey as a string so we don't rely
+ # on the filesystem
+ try:
+ vnfd['mgmt-interface']['pkey'] = node['pkey']
+ except KeyError:
+ pass
self.create_interfaces_from_node(vnfd, node)
vnf_impl = self.get_vnf_impl(vnfd['id'])
vnf_instance = vnf_impl(node_name, vnfd)