summaryrefslogtreecommitdiffstats
path: root/vnftest/onap/steps
diff options
context:
space:
mode:
Diffstat (limited to 'vnftest/onap/steps')
-rw-r--r--vnftest/onap/steps/__init__.py0
-rw-r--r--vnftest/onap/steps/validation/__init__.py0
-rw-r--r--vnftest/onap/steps/validation/aai_get_vf_module.yaml25
-rw-r--r--vnftest/onap/steps/validation/vf_module_validator.py63
4 files changed, 88 insertions, 0 deletions
diff --git a/vnftest/onap/steps/__init__.py b/vnftest/onap/steps/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vnftest/onap/steps/__init__.py
diff --git a/vnftest/onap/steps/validation/__init__.py b/vnftest/onap/steps/validation/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/vnftest/onap/steps/validation/__init__.py
diff --git a/vnftest/onap/steps/validation/aai_get_vf_module.yaml b/vnftest/onap/steps/validation/aai_get_vf_module.yaml
new file mode 100644
index 0000000..e57ba15
--- /dev/null
+++ b/vnftest/onap/steps/validation/aai_get_vf_module.yaml
@@ -0,0 +1,25 @@
+##############################################################################
+# Copyright 2018 EuropeanSoftwareMarketingLtd.
+# ===================================================================
+# Licensed under the ApacheLicense, Version2.0 (the"License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# software distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and limitations under
+# the License
+##############################################################################
+
+---
+method: GET
+
+url: http://{{aai_ip}}:30232/aai/v11/network/generic-vnfs/generic-vnf/{{vnf_instance_id}}/vf-modules/vf-module/{{vf_module_instance_id}}
+headers:
+ Content-Type: application/json
+ Accept: application/json
+ Authorization: Basic QUFJOkFBSQ==
+ X-FromAppId: AAI
+
+body:
diff --git a/vnftest/onap/steps/validation/vf_module_validator.py b/vnftest/onap/steps/validation/vf_module_validator.py
new file mode 100644
index 0000000..63caf58
--- /dev/null
+++ b/vnftest/onap/steps/validation/vf_module_validator.py
@@ -0,0 +1,63 @@
+##############################################################################
+# Copyright 2018 EuropeanSoftwareMarketingLtd.
+# ===================================================================
+# Licensed under the ApacheLicense, Version2.0 (the"License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# software distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and limitations under
+# the License
+##############################################################################
+
+from __future__ import absolute_import
+
+from vnftest.common import openstack_utils, utils
+
+from vnftest.onap.onap_api_call import OnapApiCall
+import logging
+
+from vnftest.steps import base
+
+LOG = logging.getLogger(__name__)
+
+
+class VfModuleValidator(base.Step):
+ __step_type__ = "VfModuleValidator"
+
+ def __init__(self, step_cfg, context, input_params):
+ self.validation_cfg = step_cfg
+ self.context = context
+ self.input_params = input_params
+ self.vnf_instance_id = None
+ self.vf_module_instance_id = None
+
+ def setup(self):
+ options = self.validation_cfg['options']
+ vnf_instance_id_def = options.get("vnf_instance_id")
+ self.vnf_instance_id = utils.format(vnf_instance_id_def, self.input_params)
+ vf_module_instance_id_def = options.get("vf_module_instance_id")
+ self.vf_module_instance_id = utils.format(vf_module_instance_id_def, self.input_params)
+
+ def run(self, result):
+ heat_stack_id = self.get_heat_stack_id()
+ vm_resources = openstack_utils.get_stack_vms(heat_stack_id)
+ for resource in vm_resources:
+ assert resource.resource_status == 'CREATE_COMPLETE', "Unexpected VM status: " + str(resource.resource_status)
+
+ # Get the heat stack id from AAI
+ def get_heat_stack_id(self):
+ step_conf = {}
+ step_conf['file'] = "aai_get_vf_module.yaml"
+ step_conf['input'] = [{'parameter_name': 'vnf_instance_id',
+ 'value': self.vnf_instance_id},
+ {'parameter_name': 'vf_module_instance_id',
+ 'value': self.vf_module_instance_id}
+ ]
+ step_conf['output'] = {'heat_stack_id': '[heat-stack-id]'}
+ onap_api_call = OnapApiCall(step_conf, self.context, self.input_params)
+ output = onap_api_call.run({})
+ return output['heat_stack_id']
+