From cd2cad9ce7948b918b07ed050e081ed52d1c39fc Mon Sep 17 00:00:00 2001 From: Martial COULIBALY Date: Fri, 27 Jul 2018 14:15:22 +0200 Subject: [PATCH] fix karaf launch error from tox Add a karaf launch option 'server' in python nose files. This option disables the karaf local console. (OPTS="-Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true") Change-Id: Iac160454fa6a74aa31813dacbb74a94dce417592 Signed-off-by: Martial COULIBALY --- tests/transportpce_tests/test_pce.py | 2 +- tests/transportpce_tests/test_portmapping.py | 16 ++++++++-------- tests/transportpce_tests/test_servicehandler.py | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/transportpce_tests/test_pce.py b/tests/transportpce_tests/test_pce.py index a83f7b786..05b23c59d 100644 --- a/tests/transportpce_tests/test_pce.py +++ b/tests/transportpce_tests/test_pce.py @@ -42,7 +42,7 @@ class TransportPCEtesting(unittest.TestCase): executable = "../karaf/target/assembly/bin/karaf" with open('odl.log', 'w') as outfile: cls.odl_process = subprocess.Popen( - ["bash", executable], stdout=outfile, + ["bash", executable, "server"], stdout=outfile, stdin=open(os.devnull)) @classmethod diff --git a/tests/transportpce_tests/test_portmapping.py b/tests/transportpce_tests/test_portmapping.py index 296b7963c..9e30fd614 100644 --- a/tests/transportpce_tests/test_portmapping.py +++ b/tests/transportpce_tests/test_portmapping.py @@ -36,13 +36,13 @@ class TransportPCEPortMappingTesting(unittest.TestCase): cls.testtools_process1 = subprocess.Popen( ["java", "-jar", executable, "--schemas-dir", "schemas", "--initial-config-xml", "sample_configs/ord_1.2.1/sample-config-ROADM.xml", - "--starting-port","17830"], + "--starting-port", "17830"], stdout=outfile) with open('testtools2.log', 'w') as outfile: cls.testtools_process2 = subprocess.Popen( ["java", "-jar", executable, "--schemas-dir", "schemas", "--initial-config-xml", "sample_configs/ord_1.2.1/sample-config-XPDR.xml", - "--starting-port","17831"], + "--starting-port", "17831"], stdout=outfile) @classmethod @@ -50,7 +50,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase): executable = "../karaf/target/assembly/bin/karaf" with open('odl.log', 'w') as outfile: cls.odl_process = subprocess.Popen( - ["bash", executable], stdout=outfile, + ["bash", executable, "server"], stdout=outfile, stdin=open(os.devnull)) @classmethod @@ -94,7 +94,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase): self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( - {"error-type":"application","error-tag":"data-missing", + {"error-type":"application", "error-tag":"data-missing", "error-message":"Request could not be completed because the relevant data model content does not exist "}, res['errors']['error']) @@ -255,7 +255,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase): self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( - {"error-type":"application","error-tag":"data-missing", + {"error-type":"application", "error-tag":"data-missing", "error-message":"Request could not be completed because the relevant data model content does not exist "}, res['errors']['error']) @@ -269,7 +269,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase): self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( - {"error-type":"application","error-tag":"data-missing", + {"error-type":"application", "error-tag":"data-missing", "error-message":"Request could not be completed because the relevant data model content does not exist "}, res['errors']['error']) @@ -293,7 +293,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase): self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( - {"error-type":"application","error-tag":"data-missing", + {"error-type":"application", "error-tag":"data-missing", "error-message":"Request could not be completed because the relevant data model content does not exist "}, res['errors']['error']) @@ -306,7 +306,7 @@ class TransportPCEPortMappingTesting(unittest.TestCase): self.assertEqual(response.status_code, requests.codes.not_found) res = response.json() self.assertIn( - {"error-type":"application","error-tag":"data-missing", + {"error-type":"application", "error-tag":"data-missing", "error-message":"Request could not be completed because the relevant data model content does not exist "}, res['errors']['error']) diff --git a/tests/transportpce_tests/test_servicehandler.py b/tests/transportpce_tests/test_servicehandler.py index 48e597890..9e3dffdec 100644 --- a/tests/transportpce_tests/test_servicehandler.py +++ b/tests/transportpce_tests/test_servicehandler.py @@ -37,7 +37,7 @@ class TransportPCEtesting(unittest.TestCase): executable = "../karaf/target/assembly/bin/karaf" with open('odl.log', 'w') as outfile: cls.odl_process = subprocess.Popen( - ["bash", executable], stdout=outfile, + ["bash", executable, "server"], stdout=outfile, stdin=open(os.devnull)) @classmethod -- 2.36.6