summaryrefslogtreecommitdiffstats
path: root/vnftest/contexts
diff options
context:
space:
mode:
authorMoshe <moshehoa@amdocs.com>2018-03-20 10:51:42 +0200
committerMoshe <moshehoa@amdocs.com>2018-03-20 10:55:28 +0200
commit05acf08ad5ed275e41402115acf177f8c49764f8 (patch)
tree4fed9f3bc6a30004ae395749d669d64598d8865f /vnftest/contexts
parent99663bada7fccdd87d74541d2de2e414b3e61fce (diff)
New test case - instantiate vnf
Issue-ID: VNFSDK-181 Change-Id: Ic160a125452473a228d8861ecc457e3c021a2dfb Signed-off-by: Moshe <moshehoa@amdocs.com>
Diffstat (limited to 'vnftest/contexts')
-rw-r--r--vnftest/contexts/base.py13
-rw-r--r--vnftest/contexts/csar.py8
2 files changed, 12 insertions, 9 deletions
diff --git a/vnftest/contexts/base.py b/vnftest/contexts/base.py
index ac1591c..6cb90e9 100644
--- a/vnftest/contexts/base.py
+++ b/vnftest/contexts/base.py
@@ -13,6 +13,8 @@
##############################################################################
import abc
import six
+from vnftest.common import openstack_utils
+
import vnftest.common.utils as utils
import yaml
@@ -39,10 +41,17 @@ class Context(object):
def __init__(self):
Context.list.append(self)
+ self.context_params = None
- @abc.abstractmethod
def init(self, attrs):
- """Initiate context."""
+ self.context_params = {}
+ for key, value in Context.vnf_descriptor.iteritems():
+ key = "context|vnf_descriptor|" + key
+ self.context_params[key] = value
+
+ for key, value in openstack_utils.get_credentials().iteritems():
+ key = "context|creds|" + key
+ self.context_params[key] = value
@staticmethod
def get_cls(context_type):
diff --git a/vnftest/contexts/csar.py b/vnftest/contexts/csar.py
index 2dd4fa4..c3e91e9 100644
--- a/vnftest/contexts/csar.py
+++ b/vnftest/contexts/csar.py
@@ -25,16 +25,10 @@ class CSARContext(Context):
__context_type__ = "CSAR"
def __init__(self):
- self.csar_name = None
- self.csar_id = None
- self.csar_package_location = None
super(CSARContext, self).__init__()
def init(self, attrs):
- """initializes itself from the supplied arguments"""
- self.csar_name = attrs.get("csar_name")
- self.csar_id = attrs.get("csar_id")
- self.csar_package_location = attrs.get("csar_package_location")
+ super(CSARContext, self).init(attrs)
def deploy(self):
"""no need to deploy"""