Bump lighty.io core and add tests support for it
[transportpce.git] / tests / transportpce_tests / 1.2.1 / test_utils.py
1 import os
2 import subprocess
3
4 def start_xpdra_honeynode():
5     executable = ("./honeynode/2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
6                   "/honeynode-distribution-1.18.01/honeycomb-tpce")
7     if os.path.isfile(executable):
8         with open('honeynode1.log', 'w') as outfile:
9             return subprocess.Popen(
10                 [executable, "17830", "sample_configs/openroadm/2.1/oper-XPDRA.xml"],
11                 stdout=outfile)
12
13 def start_roadma_full_honeynode():
14     executable = ("./honeynode/2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
15                   "/honeynode-distribution-1.18.01/honeycomb-tpce")
16     if os.path.isfile(executable):
17         with open('honeynode2.log', 'w') as outfile:
18             return subprocess.Popen(
19                 [executable, "17821", "sample_configs/openroadm/2.1/oper-ROADMA-full.xml"],
20                 stdout=outfile)
21
22 def start_roadma_honeynode():
23     executable = ("./honeynode/2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
24                   "/honeynode-distribution-1.18.01/honeycomb-tpce")
25     if os.path.isfile(executable):
26         with open('honeynode2.log', 'w') as outfile:
27             return subprocess.Popen(
28                 [executable, "17831", "sample_configs/openroadm/2.1/oper-ROADMA.xml"],
29                 stdout=outfile)
30
31 def start_roadmb_honeynode():
32     executable = ("./honeynode/2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
33                   "/honeynode-distribution-1.18.01/honeycomb-tpce")
34     if os.path.isfile(executable):
35         with open('honeynode3.log', 'w') as outfile:
36             return subprocess.Popen(
37                 [executable, "17832", "sample_configs/openroadm/2.1/oper-ROADMB.xml"],
38                 stdout=outfile)
39
40 def start_roadmc_full_honeynode():
41     executable = ("./honeynode/2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
42                   "/honeynode-distribution-1.18.01/honeycomb-tpce")
43     if os.path.isfile(executable):
44         with open('honeynode3.log', 'w') as outfile:
45             return subprocess.Popen(
46                 [executable, "17823", "sample_configs/openroadm/2.1/oper-ROADMC-full.xml"],
47                 stdout=outfile)
48
49 def start_roadmc_honeynode():
50     executable = ("./honeynode/2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
51                   "/honeynode-distribution-1.18.01/honeycomb-tpce")
52     if os.path.isfile(executable):
53         with open('honeynode4.log', 'w') as outfile:
54             return subprocess.Popen(
55                 [executable, "17833", "sample_configs/openroadm/2.1/oper-ROADMC.xml"],
56                 stdout=outfile)
57
58 def start_xpdrc_honeynode():
59     executable = ("./honeynode/2.1/honeynode-distribution/target/honeynode-distribution-1.18.01-hc"
60                   "/honeynode-distribution-1.18.01/honeycomb-tpce")
61     if os.path.isfile(executable):
62         with open('honeynode4.log', 'w') as outfile:
63             return subprocess.Popen(
64                 [executable, "17834", "sample_configs/openroadm/2.1/oper-XPDRC.xml"],
65                 stdout=outfile)
66
67 def start_tpce():
68     if "USE_LIGHTY" in os.environ and os.environ['USE_LIGHTY'] == 'True':
69         print ("starting LIGHTY.IO TransportPCE build...")
70         executable = "../lighty/target/lighty-transportpce-12.0.0-SNAPSHOT/clean-start-controller.sh"
71         with open('odl.log', 'w') as outfile:
72             return subprocess.Popen(
73                 ["bash", executable], stdout=outfile,
74                 stdin=open(os.devnull))
75     else:
76         print ("starting KARAF TransportPCE build...")
77         executable = "../karaf/target/assembly/bin/karaf"
78         with open('odl.log', 'w') as outfile:
79             return subprocess.Popen(
80                 ["bash", executable, "server"], stdout=outfile,
81                 stdin=open(os.devnull))