aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests
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/tests
parentfec5f179377a891117c4f3f3665df47063a1e1bd (diff)
Add VnfOnBoarding Abstraction
JIRA: FUNCTEST-535 Change-Id: Idfa3dfd64554472aaac3f26a504e1f74d2f42926 Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'functest/tests')
-rw-r--r--functest/tests/unit/core/test_vnf_base.py52
1 files changed, 52 insertions, 0 deletions
diff --git a/functest/tests/unit/core/test_vnf_base.py b/functest/tests/unit/core/test_vnf_base.py
new file mode 100644
index 000000000..e27f2164b
--- /dev/null
+++ b/functest/tests/unit/core/test_vnf_base.py
@@ -0,0 +1,52 @@
+#!/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 logging
+import unittest
+
+from functest.core import vnf_base
+
+
+class VnfBaseTesting(unittest.TestCase):
+
+ logging.disable(logging.CRITICAL)
+
+ def setUp(self):
+ self.test = vnf_base.VnfOnBoardingBase(project='functest',
+ case='aaa')
+ self.test.project = "functest"
+ self.test.case_name = "aaa"
+ self.test.start_time = "1"
+ self.test.stop_time = "5"
+ self.test.criteria = ""
+ self.test.details = {"orchestrator": {"status": "PASS",
+ "result": "",
+ "duration": 20},
+ "vnf": {"status": "PASS",
+ "result": "",
+ "duration": 15},
+ "test_vnf": {"status": "FAIL",
+ "result": "",
+ "duration": 5}}
+
+ def test_deploy_vnf_unimplemented(self):
+ with self.assertRaises(Exception) as context:
+ self.test.deploy_vnf()
+ self.assertTrue('VNF not deployed' in context.exception)
+
+ def test_test_vnf_unimplemented(self):
+ with self.assertRaises(Exception) as context:
+ self.test.test_vnf()()
+ self.assertTrue('VNF not tested' in context.exception)
+
+ def test_parse_results(self):
+ self.assertNotEqual(self.test.parse_results(), 0)
+
+if __name__ == "__main__":
+ unittest.main(verbosity=2)