Cord-tester manifest file support to setup or run the tests.
One can configure onos instances, external onos_ip/radius_ip,etc. in the manifest file
that can be used to setup cord-tester and run.
An example being:
sudo ./cord-test.py setup --manifest=manifest.json
sudo ./cord-test.py run --manifest=manifest.json -c cord-tester1 -t tls
Change-Id: I0d6ad8b5c4d9f7ad34f46481ee6fd1023a57e55d
diff --git a/src/test/utils/TestManifest.py b/src/test/utils/TestManifest.py
index 2156972..de7c72a 100644
--- a/src/test/utils/TestManifest.py
+++ b/src/test/utils/TestManifest.py
@@ -1,12 +1,12 @@
-#
+#
# Copyright 2016-present Ciena Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
+#
# http://www.apache.org/licenses/LICENSE-2.0
-#
+#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,13 +16,35 @@
import json
import os
import shutil
+import platform
class TestManifest(object):
- def __init__(self, manifest):
+ def __init__(self, manifest = None, args = None):
self.manifest = manifest
- with open(self.manifest, 'r') as fd:
- data = json.load(fd)
- self.onos_ip = data.get('onos', None)
- self.radius_ip = data.get('radius', None)
- self.head_node = data.get('head_node', None)
+ if args is not None and manifest is None:
+ self.onos_ip = None
+ self.radius_ip = None
+ self.head_node = platform.node()
+ self.log_level = args.log_level.upper()
+ self.onos_instances = args.onos_instances
+ self.async_mode = args.async_mode
+ self.shared_volume = args.shared_volume
+ self.olt = args.olt
+ self.start_switch = args.start_switch
+ self.image_prefix = args.prefix
+ self.onos_image = args.onos
+ else:
+ with open(self.manifest, 'r') as fd:
+ data = json.load(fd)
+ self.onos_ip = data.get('onos', None)
+ self.radius_ip = data.get('radius', None)
+ self.head_node = data.get('head_node', platform.node())
+ self.log_level = data.get('log_level', 'INFO').upper()
+ self.onos_instances = data.get('onos_instances', 1)
+ self.shared_volume = data.get('shared_volume', True)
+ self.async_mode = True if self.onos_instances > 1 else False
+ self.olt = data.get('olt', True)
+ self.start_switch = data.get('start_switch', self.olt)
+ self.image_prefix = data.get('image_prefix', '')
+ self.onos_image = data.get('onos_image', 'onosproject/onos:latest')