Add netvirt to odl tests
authorNikolas Hermanns <nikolas.hermanns@ericsson.com>
Tue, 24 Jan 2017 13:43:51 +0000 (14:43 +0100)
committerCédric Ollivier <cedric.ollivier@orange.com>
Fri, 3 Feb 2017 08:53:55 +0000 (09:53 +0100)
For the odl test the default odl port is 8080. In netvirt this is the
same as apex.

Change-Id: I949510e4f7fb57bcf8ec01f69f7941c5d55c98e7
Signed-off-by: Nikolas Hermanns <nikolas.hermanns@ericsson.com>
functest/ci/exec_test.sh
functest/opnfv_tests/sdn/odl/odl.py
functest/tests/unit/odl/test_odl.py

index b288fe3..6a2b55a 100755 (executable)
@@ -54,6 +54,10 @@ function odl_tests(){
         odl_ip=$SDN_CONTROLLER_IP
         odl_port=8081
         odl_restport=8081
+    elif [ "$INSTALLER_TYPE" == "netvirt" ]; then
+        odl_ip=$SDN_CONTROLLER_IP
+        odl_port=8081
+        odl_restport=8081
     elif [ "$INSTALLER_TYPE" == "joid" ]; then
         odl_ip=$SDN_CONTROLLER
     elif [ "$INSTALLER_TYPE" == "compass" ]; then
index 9502be9..2507595 100755 (executable)
@@ -164,7 +164,7 @@ class ODLTests(testcase_base.TestcaseBase):
             kwargs['ospassword'] = os.environ['OS_PASSWORD']
             if installer_type == 'fuel':
                 kwargs['odlwebport'] = '8282'
-            elif installer_type == 'apex':
+            elif installer_type == 'apex' or installer_type == 'netvirt':
                 kwargs['odlip'] = os.environ['SDN_CONTROLLER_IP']
                 kwargs['odlwebport'] = '8081'
                 kwargs['odlrestconfport'] = '8081'
index 810b359..8f2a5d7 100644 (file)
@@ -443,6 +443,20 @@ class ODLTesting(unittest.TestCase):
                        odlip=self._sdn_controller_ip, odlwebport='8081',
                        odlrestconfport='8081')
 
+    def test_run_netvirt_missing_sdn_controller_ip(self):
+        with mock.patch('functest.utils.openstack_utils.get_endpoint',
+                        side_effect=self._fake_url_for):
+            os.environ["INSTALLER_TYPE"] = "netvirt"
+            self.assertEqual(self.test.run(),
+                             testcase_base.TestcaseBase.EX_RUN_ERROR)
+
+    def test_run_netvirt(self):
+        os.environ["SDN_CONTROLLER_IP"] = self._sdn_controller_ip
+        os.environ["INSTALLER_TYPE"] = "netvirt"
+        self._test_run(testcase_base.TestcaseBase.EX_OK,
+                       odlip=self._sdn_controller_ip, odlwebport='8081',
+                       odlrestconfport='8081')
+
     def test_run_joid_missing_sdn_controller(self):
         with mock.patch('functest.utils.openstack_utils.get_endpoint',
                         side_effect=self._fake_url_for):