Fixes for Onos cord instance wrapper restart case.
Add a exception marker for logs with exceptions.
Change-Id: Ic68f15ba777768ab040c89985d7044cdf1867ef7
diff --git a/src/test/utils/CordContainer.py b/src/test/utils/CordContainer.py
index 5f1ea2c..d1db4ff 100644
--- a/src/test/utils/CordContainer.py
+++ b/src/test/utils/CordContainer.py
@@ -352,7 +352,7 @@
self.start()
def start(self, restart = False, network_cfg = None):
- if network_cfg:
+ if network_cfg is not None:
json_data = json.dumps(network_cfg, indent=4)
with open('{}/network-cfg.json'.format(self.onos_config_dir), 'w') as f:
f.write(json_data)
diff --git a/src/test/utils/CordTestServer.py b/src/test/utils/CordTestServer.py
index 1359850..c302d8c 100644
--- a/src/test/utils/CordTestServer.py
+++ b/src/test/utils/CordTestServer.py
@@ -37,7 +37,7 @@
def __restart_onos(self, node = None, config = None, timeout = 10):
if self.onos_cord:
- onos_config = '{}/network-cfg.json'.format(OnosCord.onos_config_dir)
+ onos_config = '{}/network-cfg.json'.format(self.onos_cord.onos_config_dir)
else:
onos_config = '{}/network-cfg.json'.format(Onos.host_config_dir)
if config is None:
diff --git a/src/test/utils/OnosLog.py b/src/test/utils/OnosLog.py
index a5e0fa7..0a31b80 100644
--- a/src/test/utils/OnosLog.py
+++ b/src/test/utils/OnosLog.py
@@ -53,7 +53,9 @@
if t == 'Exception':
exception_map[t] = lines[i+1:i+1+10]
output = '\n'.join(match_lines)
- output += '\n'.join(exception_map['Exception'])
+ if len(exception_map['Exception']) > 0:
+ output += '\nException:\n'
+ output += '\n'.join(exception_map['Exception'])
#update the last snapshot
if cache_result is True: