Add test_utils ODL startup opt-out support 79/104179/7
authorguillaume.lambert <guillaume.lambert@orange.com>
Thu, 26 Jan 2023 19:16:52 +0000 (20:16 +0100)
committerguillaume.lambert <guillaume.lambert@orange.com>
Sun, 29 Jan 2023 09:09:09 +0000 (10:09 +0100)
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I28b94e6ff6cf94c4bc9643992aef6c0ff68ba41a

tests/transportpce_tests/common/test_utils.py
tests/transportpce_tests/tapi/test01_abstracted_topology.py
tests/transportpce_tests/tapi/test02_full_topology.py
tests/transportpce_tests/tapi/test03_tapi_device_change_notifications.py
tests/transportpce_tests/with_docker/test02_nbinotifications.py
tests/transportpce_tests/with_docker/test03_tapi_nbinotifications.py
tox.ini

index fb1c39faad949643f1df79291017dc6cb2d834e5..3ff03545c1be7ecf8df6750162991c04a3c31019 100644 (file)
@@ -153,6 +153,9 @@ def start_sims(sims_list):
 
 
 def start_tpce():
+    if 'NO_ODL_STARTUP' in os.environ:
+        print('No OpenDaylight instance to start!')
+        return []
     print('starting OpenDaylight...')
     if 'USE_LIGHTY' in os.environ and os.environ['USE_LIGHTY'] == 'True':
         process = start_lighty()
index 9f33dd822f3c9825818f96411a212d06ae0d57c2..3e3d99d002471dc2fb80e92aaa0a9d868eb01cbd 100644 (file)
@@ -147,7 +147,7 @@ class TransportTapitesting(unittest.TestCase):
         os.environ['JAVA_MAX_MEM'] = '4096M'
         cls.processes = test_utils.start_tpce()
         # TAPI feature is not installed by default in Karaf
-        if "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
+        if "NO_ODL_STARTUP" not in os.environ or "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
             print("installing tapi feature...")
             result = test_utils.install_karaf_feature("odl-transportpce-tapi")
             if result.returncode != 0:
index 64ddc4394aaf18ebb88f6ba268ba8b65b6dd6c38..10ec7bf07bf3892ece459150e9fd220e54e0574e 100644 (file)
@@ -104,7 +104,7 @@ class TransportPCEtesting(unittest.TestCase):
         os.environ['JAVA_MAX_MEM'] = '4096M'
         cls.processes = test_utils.start_tpce()
         # TAPI feature is not installed by default in Karaf
-        if "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
+        if "NO_ODL_STARTUP" not in os.environ or "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
             print("installing tapi feature...")
             result = test_utils.install_karaf_feature("odl-transportpce-tapi")
             if result.returncode != 0:
index 2a4f3f2925851ee1dc588861eb8ab7db9c89c81a..13a68b209a361ea300d1baf85ecb0513e51b1440 100644 (file)
@@ -113,7 +113,7 @@ class TransportPCEFulltesting(unittest.TestCase):
         os.environ['JAVA_MAX_MEM'] = '4096M'
         cls.processes = test_utils.start_tpce()
         # TAPI feature is not installed by default in Karaf
-        if "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
+        if "NO_ODL_STARTUP" not in os.environ or "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
             print("installing tapi feature...")
             result = test_utils.install_karaf_feature("odl-transportpce-tapi")
             if result.returncode != 0:
index f7dd69e95ee5200e39e9ec9c6bf81aec64e87cc4..41eb33b5f97194120ce8db15b63da1d5a8bb5aa9 100644 (file)
@@ -85,7 +85,7 @@ class TransportNbiNotificationstesting(unittest.TestCase):
         cls.init_failed = False
         cls.processes = test_utils.start_tpce()
         # NBI notification feature is not installed by default in Karaf
-        if "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
+        if "NO_ODL_STARTUP" not in os.environ or "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
             print("installing NBI notification feature...")
             result = test_utils.install_karaf_feature("odl-transportpce-nbinotifications")
             if result.returncode != 0:
index b9537caf5da703a461974b1cc434a95dcf48374f..6b93e2173396340674c7eec2488a145be0768aa1 100644 (file)
@@ -147,7 +147,7 @@ class TransportNbiNotificationstesting(unittest.TestCase):
         os.environ['JAVA_MAX_MEM'] = '4096M'
         cls.processes = test_utils.start_tpce()
         # NBI notification feature is not installed by default in Karaf
-        if "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
+        if "NO_ODL_STARTUP" not in os.environ or "USE_LIGHTY" not in os.environ or os.environ['USE_LIGHTY'] != 'True':
             print("installing NBI notification feature...")
             result = test_utils.install_karaf_feature("odl-transportpce-nbinotifications")
             if result.returncode != 0:
diff --git a/tox.ini b/tox.ini
index deea5646d773c6f368544028e8dbf826d6a65faf..b2976bf5eb1803117aab016d9eb28eba70211eba 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -14,7 +14,7 @@ skipsdist = true
 setupdir = tests/
 
 [testenv]
-passenv = USE_LIGHTY http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY OLM_TIMER1 OLM_TIMER2
+passenv = USE_LIGHTY NO_ODL_STARTUP http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY OLM_TIMER1 OLM_TIMER2
 setenv =
 #    USE_LIGHTY=True
     OLM_TIMER1=3000
@@ -67,7 +67,7 @@ deps =
   setuptools>=7.0
   gnpy4tpce==2.4.7
 whitelist_externals = launch_tests.sh
-passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
+passenv = LAUNCHER USE_LIGHTY NO_ODL_STARTUP USE_ODL_RESTCONF_VERSION
 basepython = python3
 commands =
   ./launch_tests.sh pce {posargs:}
@@ -88,7 +88,7 @@ commands =
 depends = buildcontroller,build_karaf_tests121,sims121,testsPCE
 # testsPCE dependency is only here to chain tests in the gate and avoid resources starvation
 whitelist_externals = launch_tests.sh
-passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
+passenv = LAUNCHER USE_LIGHTY NO_ODL_STARTUP USE_ODL_RESTCONF_VERSION
 setenv =
 #    USE_LIGHTY=True
 #    USE_ODL_RESTCONF_VERSION=draft-bierman02
@@ -121,7 +121,7 @@ commands =
 depends = buildcontroller,build_karaf_tests221,sims221,tests71
 # tests71 dependency is only here to chain tests in the gate and avoid ressources starvation
 whitelist_externals = launch_tests.sh
-passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
+passenv = LAUNCHER USE_LIGHTY NO_ODL_STARTUP USE_ODL_RESTCONF_VERSION
 setenv =
 #    USE_LIGHTY=True
 #    USE_ODL_RESTCONF_VERSION=draft-bierman02
@@ -145,7 +145,7 @@ commands =
 [testenv:tests71]
 depends = buildcontroller,build_karaf_tests71,sims71,tests_tapi
 whitelist_externals = launch_tests.sh
-passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
+passenv = LAUNCHER USE_LIGHTY NO_ODL_STARTUP USE_ODL_RESTCONF_VERSION
 setenv =
 #    USE_LIGHTY=True
 #    USE_ODL_RESTCONF_VERSION=draft-bierman02
@@ -169,7 +169,7 @@ commands =
 depends = buildcontroller,build_karaf_tests_hybrid,sims121,sims221,sims71,tests121,tests221,tests71
 #the last dependency is to avoid temporarily concurrent ressources problem in parallel mode
 whitelist_externals = launch_tests.sh
-passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION
+passenv = LAUNCHER USE_LIGHTY NO_ODL_STARTUP USE_ODL_RESTCONF_VERSION
 setenv =
 #    USE_LIGHTY=True
 #    USE_ODL_RESTCONF_VERSION=draft-bierman02
@@ -182,7 +182,7 @@ commands =
 [testenv:tests_tapi]
 depends = buildcontroller,build_karaf_tests221,sims221
 whitelist_externals = launch_tests.sh add_tapi_feature_to_tests221.sh
-passenv = LAUNCHER USE_LIGHTY OLM_TIMER1 OLM_TIMER2 USE_ODL_RESTCONF_VERSION
+passenv = LAUNCHER USE_LIGHTY NO_ODL_STARTUP OLM_TIMER1 OLM_TIMER2 USE_ODL_RESTCONF_VERSION
 setenv =
 #    USE_LIGHTY=True
 #    USE_ODL_RESTCONF_VERSION=draft-bierman02
@@ -200,7 +200,7 @@ commands =
 depends = buildcontroller,sims221
 whitelist_externals = launch_tests.sh
                       dockercmd.sh
-passenv = LAUNCHER USE_LIGHTY USE_ODL_RESTCONF_VERSION OLM_TIMER1 OLM_TIMER2
+passenv = LAUNCHER USE_LIGHTY NO_ODL_STARTUP USE_ODL_RESTCONF_VERSION OLM_TIMER1 OLM_TIMER2
 setenv =
     OLM_TIMER1=3000
     OLM_TIMER2=2000