Support to archive also partition data along with logs for ONOS.
Used by clusterTest based on a new ARCHIVE_PARTITION config in clusterTest.json.
After every test iteration, the partition data would also be archived in setup/test_logs if set to true.
It defaults to false and can be enabled if required.
Change-Id: Iaeddea30e6a6ad8dacce134228959e2b4ded4ef1
diff --git a/src/test/cluster/clusterTest.json b/src/test/cluster/clusterTest.json
index 4780b62..0c05484 100644
--- a/src/test/cluster/clusterTest.json
+++ b/src/test/cluster/clusterTest.json
@@ -1,5 +1,6 @@
{
"V_INF1" : "veth0",
"TLS_TIMEOUT" : 100,
- "ITERATIONS" : 10
+ "ITERATIONS" : 10,
+ "ARCHIVE_PARTITION" : false
}
diff --git a/src/test/cluster/clusterTest.py b/src/test/cluster/clusterTest.py
index 6d27955..88a9915 100644
--- a/src/test/cluster/clusterTest.py
+++ b/src/test/cluster/clusterTest.py
@@ -65,6 +65,7 @@
testcaseLoggers = ('test_cluster_controller_restarts', 'test_cluster_graceful_controller_restarts',
'test_cluster_single_controller_restarts', 'test_cluster_restarts')
ITERATIONS = int(os.getenv('ITERATIONS', 10))
+ ARCHIVE_PARTITION = False
def setUp(self):
if self._testMethodName not in self.testcaseLoggers:
@@ -377,7 +378,8 @@
log.error('Test failed on ITERATION %d' %iteration)
CordLogger.archive_results(self._testMethodName,
controllers = controllers,
- iteration = 'FAILED')
+ iteration = 'FAILED',
+ archive_partition = self.ARCHIVE_PARTITION)
assert_equal(len(failed), 0)
return controller
@@ -393,7 +395,8 @@
log.error('Test failed on ITERATION %d' %iteration)
CordLogger.archive_results(self._testMethodName,
controllers = controllers,
- iteration = 'FAILED')
+ iteration = 'FAILED',
+ archive_partition = self.ARCHIVE_PARTITION)
assert_equal(len(failed), 0)
if st is False:
log.info('No storage exception and ONOS cluster was not formed successfully')
@@ -429,7 +432,8 @@
#first archive the test case logs for this run
CordLogger.archive_results(self._testMethodName,
controllers = controllers,
- iteration = 'iteration_{}'.format(num+1))
+ iteration = 'iteration_{}'.format(num+1),
+ archive_partition = self.ARCHIVE_PARTITION)
next_controller = check_exception(num, controller = controller)
def test_cluster_controller_restarts(self):
@@ -476,7 +480,8 @@
log.error('Test failed on ITERATION %d' %iteration)
CordLogger.archive_results('test_cluster_single_controller_restarts',
controllers = controllers,
- iteration = 'FAILED')
+ iteration = 'FAILED',
+ archive_partition = self.ARCHIVE_PARTITION)
assert_equal(len(failed), 0)
return controller
@@ -518,7 +523,8 @@
#archive the logs for this run
CordLogger.archive_results('test_cluster_single_controller_restarts',
controllers = controllers,
- iteration = 'iteration_{}'.format(num+1))
+ iteration = 'iteration_{}'.format(num+1),
+ archive_partition = self.ARCHIVE_PARTITION)
check_exception(num, controller, inclusive = True)
def test_cluster_restarts(self):
@@ -555,7 +561,8 @@
log.error('Test failed on ITERATION %d' %iteration)
CordLogger.archive_results('test_cluster_restarts',
controllers = controllers,
- iteration = 'FAILED')
+ iteration = 'FAILED',
+ archive_partition = self.ARCHIVE_PARTITION)
assert_equal(len(failed), 0)
return
@@ -568,7 +575,8 @@
log.error('Test failed on ITERATION %d' %iteration)
CordLogger.archive_results('test_cluster_restarts',
controllers = controllers,
- iteration = 'FAILED')
+ iteration = 'FAILED',
+ archive_partition = self.ARCHIVE_PARTITION)
assert_equal(len(ips), len(controllers))
tries = self.ITERATIONS
@@ -587,7 +595,8 @@
#archive the logs for this run before verification
CordLogger.archive_results('test_cluster_restarts',
controllers = controllers,
- iteration = 'iteration_{}'.format(num+1))
+ iteration = 'iteration_{}'.format(num+1),
+ archive_partition = self.ARCHIVE_PARTITION)
#check for exceptions on the adjacent nodes
check_exception(num)