aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/vnf/aaa
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2017-01-06 16:16:20 +0100
committerMorgan Richomme <morgan.richomme@orange.com>2017-01-18 10:30:09 +0100
commit3e921f50fb71ef93b441054c0444da5a4fa64b44 (patch)
treebfb42bc08c61fc65048c60a038354160aae74fc6 /functest/opnfv_tests/vnf/aaa
parentfec5f179377a891117c4f3f3665df47063a1e1bd (diff)
Add VnfOnBoarding Abstraction
JIRA: FUNCTEST-535 Change-Id: Idfa3dfd64554472aaac3f26a504e1f74d2f42926 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'functest/opnfv_tests/vnf/aaa')
-rw-r--r--functest/opnfv_tests/vnf/aaa/__init__.py0
-rw-r--r--functest/opnfv_tests/vnf/aaa/aaa.py71
2 files changed, 71 insertions, 0 deletions
diff --git a/functest/opnfv_tests/vnf/aaa/__init__.py b/functest/opnfv_tests/vnf/aaa/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/functest/opnfv_tests/vnf/aaa/__init__.py
diff --git a/functest/opnfv_tests/vnf/aaa/aaa.py b/functest/opnfv_tests/vnf/aaa/aaa.py
new file mode 100644
index 00000000..8898b9fc
--- /dev/null
+++ b/functest/opnfv_tests/vnf/aaa/aaa.py
@@ -0,0 +1,71 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2016 Orange and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+
+import sys
+
+import argparse
+
+import functest.core.testcase_base as testcase_base
+import functest.core.vnf_base as vnf_base
+import functest.utils.functest_logger as ft_logger
+
+
+class AaaVnf(vnf_base.VnfOnBoardingBase):
+
+ logger = ft_logger.Logger("VNF AAA").getLogger()
+
+ def __init__(self):
+ super(AaaVnf, self).__init__()
+ self.case_name = "aaa"
+
+ def deploy_orchestrator(self):
+ self.logger.info("No VNFM needed to deploy a free radius here")
+ return None
+
+# TODO see how to use build in exception form releng module
+ def deploy_vnf(self):
+ self.logger.info("Freeradius VNF deployment")
+ # TODO apt-get update + config tuning
+ deploy_vnf = {}
+ deploy_vnf['status'] = "PASS"
+ deploy_vnf['result'] = {}
+ return deploy_vnf
+
+ def test_vnf(self):
+ self.logger.info("Run test towards freeradius")
+ # TODO: once the freeradius is deployed..make some tests
+ test_vnf = {}
+ test_vnf['status'] = "PASS"
+ test_vnf['result'] = {}
+ return test_vnf
+
+ def main(self, **kwargs):
+ self.logger.info("AAA VNF onboarding")
+ self.execute()
+ if self.criteria is "PASS":
+ return self.EX_OK
+ else:
+ return self.EX_RUN_ERROR
+
+ def run(self):
+ kwargs = {}
+ return self.main(**kwargs)
+
+if __name__ == '__main__':
+ parser = argparse.ArgumentParser()
+ args = vars(parser.parse_args())
+ aaa_vnf = AaaVnf()
+ try:
+ result = aaa_vnf.main(**args)
+ if result != testcase_base.TestcaseBase.EX_OK:
+ sys.exit(result)
+ if args['pushtodb']:
+ sys.exit(aaa_vnf.push_to_db())
+ except Exception:
+ sys.exit(testcase_base.TestcaseBase.EX_RUN_ERROR)