allowing cord-tester setup to skip onoscord configuration and adding onf manifest
Change-Id: I6817491b9c876585fb5c47a802a1c3490223b726
diff --git a/src/test/setup/cord-test.py b/src/test/setup/cord-test.py
index 81854d4..4838e49 100755
--- a/src/test/setup/cord-test.py
+++ b/src/test/setup/cord-test.py
@@ -873,7 +873,7 @@
if not synchronizer:
print('Specify synchronizer to use for the ONOS cord instance. Eg: vtn, fabric, cord')
sys.exit(1)
- onos_cord = OnosCord(onos_ip, onos_cord_loc, service_profile, synchronizer)
+ onos_cord = OnosCord(onos_ip, onos_cord_loc, service_profile, synchronizer, skip = test_manifest.skip_onos_restart)
try:
test_server = cord_test_server_start(daemonize = False, cord_test_host = test_host, cord_test_port = test_port,
@@ -1168,7 +1168,7 @@
if not synchronizer:
print('Specify synchronizer to use for the ONOS cord instance. Eg: vtn, fabric, cord')
sys.exit(1)
- onos_cord = OnosCord(onos_ip, onos_cord_loc, service_profile, synchronizer)
+ onos_cord = OnosCord(onos_ip, onos_cord_loc, service_profile, synchronizer, skip = test_manifest.skip_onos_restart)
Container.IMAGE_PREFIX = test_manifest.image_prefix
#don't spawn onos if the user had started it externally
@@ -1236,17 +1236,18 @@
ctlr_addr = ','.join(onos_ips)
print('Onos IP %s' %ctlr_addr)
- if onos_ip is not None:
- print('Installing ONOS cord apps')
- try:
- Onos.install_cord_apps(onos_ip = onos_ip)
- except: pass
+ if not test_manifest.skip_onos_restart:
+ if onos_ip is not None:
+ print('Installing ONOS cord apps')
+ try:
+ Onos.install_cord_apps(onos_ip = onos_ip)
+ except: pass
- print('Installing cord tester ONOS app %s' %args.app)
- try:
- for ip in onos_ips:
- OnosCtrl.install_app(args.app, onos_ip = ip)
- except: pass
+ print('Installing cord tester ONOS app %s' %args.app)
+ try:
+ for ip in onos_ips:
+ OnosCtrl.install_app(args.app, onos_ip = ip)
+ except: pass
if voltha_loc:
#start voltha
@@ -1396,7 +1397,7 @@
if args.onos_cord:
#try restoring the onos cord instance
try:
- onos_cord = OnosCord(args.onos_ip, args.onos_cord, args.service_profile, args.synchronizer, start = False)
+ onos_cord = OnosCord(args.onos_ip, args.onos_cord, args.service_profile, args.synchronizer, start = False, skip = test_manifest.skip_onos_restart)
onos_cord.restore(force = True)
except Exception as e:
print(e)
@@ -1628,6 +1629,8 @@
parser_run.add_argument('-expose-port', '--expose-port', action='store_true',
help='Start ONOS by exposing the controller ports to the host.'
'Add +1 for every other onos/cluster instance when running more than 1 ONOS instances')
+ parser_run.add_argument('-skip-onos-restart', '--skip-onos-restart', action='store_true',
+ help = 'Skips restarting/configuring of onoscord')
parser_run.set_defaults(func=runTest)
parser_setup = subparser.add_parser('setup', help='Setup cord tester environment')
@@ -1683,6 +1686,8 @@
parser_setup.add_argument('-expose-port', '--expose-port', action='store_true',
help='Start ONOS by exposing the controller ports to the host.'
'Add +1 for every other onos/cluster instance when running more than 1 ONOS instances')
+ parser_setup.add_argument('-skip-onos-restart', '--skip-onos-restart', action='store_true',
+ help = 'Skips restarting/configuring of onoscord')
parser_setup.set_defaults(func=setupCordTester)
parser_xos = subparser.add_parser('xos', help='Building xos into cord tester environment')
@@ -1736,6 +1741,8 @@
parser_cleanup.add_argument('-m', '--manifest', default='', type=str, help='Provide test manifest')
parser_cleanup.add_argument('-voltha-loc', '--voltha-loc', default='', type=str,
help='Specify the voltha location')
+ parser_cleanup.add_argument('-skip-onos-restart', '--skip-onos-restart', action='store_true',
+ help = 'Skips restarting/configuring of onoscord')
parser_cleanup.set_defaults(func=cleanupTests)
c = Client(**(kwargs_from_env()))
diff --git a/src/test/setup/manifest-onf-cord.json b/src/test/setup/manifest-onf-cord.json
new file mode 100644
index 0000000..b8445e2
--- /dev/null
+++ b/src/test/setup/manifest-onf-cord.json
@@ -0,0 +1,15 @@
+{
+ "onos_instances": 1,
+ "olt": true,
+ "start_switch": true,
+ "onos_image": "onosproject/onos:latest",
+ "onos" : "172.21.0.2",
+ "onos_cord" : "/opt/onos_cord",
+ "service_profile" : "rcord",
+ "synchronizer" : "vtn",
+ "docker_network" : "onoscord_default",
+ "log_level" : "INFO",
+ "jvm_heap_size" : "1G",
+ "karaf_version" : "3.0.8",
+ "skip_onos_restart": "true"
+}
diff --git a/src/test/setup/olt_config.json b/src/test/setup/olt_config.json
index e744293..35ab577 100644
--- a/src/test/setup/olt_config.json
+++ b/src/test/setup/olt_config.json
@@ -8,13 +8,13 @@
"port" : "fabric", "type" : "reserved", "s_tag" : 222, "c_tag" : 111
},
{
- "port" : "fabric", "type" : "dhcp", "s_tag" : 304, "c_tag" : 304
+ "port" : "fabric", "type" : "reserved", "s_tag" : 333, "c_tag" : 888
},
{
- "port" : "fabric", "type" : "dhcp", "s_tag" : 304, "c_tag" : 305
+ "port" : "fabric", "type" : "reserved", "s_tag" : 555, "c_tag" : 999
},
{
- "port" : "fabric", "type" : "dhcp", "s_tag" : 304, "c_tag" : 306
+ "port" : "fabric", "type" : "reserved", "s_tag" : 666, "c_tag" : 661
},
{
"port" : "fabric", "type" : "dhcp", "s_tag" : 304, "c_tag" : 307