Add odl configurations for odl testcase in daisy environment
authorAlex Yang <yangyang1@zte.com.cn>
Tue, 11 Jul 2017 09:03:52 +0000 (17:03 +0800)
committerAlex Yang <yangyang1@zte.com.cn>
Wed, 12 Jul 2017 07:25:11 +0000 (15:25 +0800)
To support odl testcase in the environment deployed by daisy installer.

Change-Id: I70bc668520cf28385fcff8489c773b880e7b4080
Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
functest/opnfv_tests/sdn/odl/odl.py
functest/tests/unit/odl/test_odl.py

index 67bf66e..ede0fc5 100644 (file)
@@ -235,6 +235,10 @@ class ODLTests(testcase.TestCase):
                 kwargs['odlip'] = os.environ['SDN_CONTROLLER']
             elif installer_type == 'compass':
                 kwargs['odlwebport'] = '8181'
+            elif installer_type == 'daisy':
+                kwargs['odlip'] = os.environ['SDN_CONTROLLER_IP']
+                kwargs['odlwebport'] = '8181'
+                kwargs['odlrestconfport'] = '8087'
             else:
                 kwargs['odlip'] = os.environ['SDN_CONTROLLER_IP']
         except KeyError as ex:
index 070a8d2..8c8a6ce 100644 (file)
@@ -513,6 +513,21 @@ class ODLRunTesting(ODLTesting):
         self._test_run(testcase.TestCase.EX_OK,
                        odlip=self._neutron_ip, odlwebport='8181')
 
+    def test_daisy_no_controller_ip(self):
+        with mock.patch('functest.utils.openstack_utils.get_endpoint',
+                        return_value="http://{}:9696".format(
+                            ODLTesting._neutron_ip)):
+            os.environ["INSTALLER_TYPE"] = "daisy"
+            self.assertEqual(self.test.run(),
+                             testcase.TestCase.EX_RUN_ERROR)
+
+    def test_daisy(self):
+        os.environ["SDN_CONTROLLER_IP"] = self._sdn_controller_ip
+        os.environ["INSTALLER_TYPE"] = "daisy"
+        self._test_run(testcase.TestCase.EX_OK,
+                       odlip=self._sdn_controller_ip, odlwebport='8181',
+                       odlrestconfport='8087')
+
 
 class ODLArgParserTesting(ODLTesting):