fix topology files relative paths in PCE functest 20/90520/4
authorguillaume.lambert <guillaume.lambert@orange.com>
Fri, 19 Jun 2020 14:56:48 +0000 (16:56 +0200)
committerguillaume.lambert <guillaume.lambert@orange.com>
Mon, 22 Jun 2020 08:09:10 +0000 (10:09 +0200)
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I2e46402a1200129f68009994b37d59eadfb39a89

tests/transportpce_tests/1.2.1/test_pce.py

index 5375dabc7e75c216f305ef20e29e6b7808627842..61f3b2ab63357da633a990d61d53ecbc878fae76 100644 (file)
@@ -30,15 +30,18 @@ class TransportPCEtesting(unittest.TestCase):
 
     @classmethod
     def _get_file(cls):
-        topo_bi_dir_file = "sample_configs/honeynode-topo.xml"
+        topo_bi_dir_file = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+                                        "..", "..", "sample_configs", "honeynode-topo.xml")
         if os.path.isfile(topo_bi_dir_file):
             with open(topo_bi_dir_file, 'r') as topo_bi_dir:
                 cls.simple_topo_bi_dir_data = topo_bi_dir.read()
-        topo_uni_dir_file = "sample_configs/NW-simple-topology.xml"
+        topo_uni_dir_file = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+                                         "..", "..", "sample_configs", "NW-simple-topology.xml")
         if os.path.isfile(topo_uni_dir_file):
             with open(topo_uni_dir_file, 'r') as topo_uni_dir:
                 cls.simple_topo_uni_dir_data = topo_uni_dir.read()
-        topo_uni_dir_complex_file = "sample_configs/NW-for-test-5-4.xml"
+        topo_uni_dir_complex_file = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+                                                 "..", "..", "sample_configs", "NW-for-test-5-4.xml")
         if os.path.isfile(topo_uni_dir_complex_file):
             with open(topo_uni_dir_complex_file, 'r') as topo_uni_dir_complex:
                 cls.complex_topo_uni_dir_data = topo_uni_dir_complex.read()