Merge "Refactored test - Add test information - Chenge database path - Added link down and up driver - Added checkIntentSummary driver - Modified checkFlowsState driver to be more efficient - Refactored pushTestIntents driver - Modified sendline driver to handle pexpect timeout - Modify CASE20 and delete CASE21. Now Reroute part will in CASE20 - Modify checkFlowsState drive function, make sure other tests can use it - Add a param, to control reroute or not - Change batch size, min_Intents, Max_Intents, and check_interval in params file"
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 1f74984..002fc17 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -1800,14 +1800,13 @@
def intents( self, jsonFormat = True, summary = False, **intentargs):
"""
- Optional:
- * jsonFormat: enable output formatting in json
- * summary: whether only output the intent summary
- * type: only output a certain type of intent
- This options is valid only when jsonFormat is true and summary is
- true
Description:
- Obtain intents
+ Obtain intents from the ONOS cli.
+ Optional:
+ * jsonFormat: Enable output formatting in json, default to True
+ * summary: Whether only output the intent summary, defaults to False
+ * type: Only output a certain type of intent. This options is valid
+ only when jsonFormat is True and summary is True.
"""
try:
cmdStr = "intents"
@@ -1818,19 +1817,20 @@
handle = self.sendline( cmdStr )
args = utilities.parse_args( [ "TYPE" ], **intentargs )
if "TYPE" in args.keys():
- type = args[ "TYPE" ]
+ intentType = args[ "TYPE" ]
else:
- type = ""
- if jsonFormat and summary and ( type != "" ):
+ intentType = ""
+ # IF we want the summary of a specific intent type
+ if jsonFormat and summary and ( intentType != "" ):
jsonResult = json.loads( handle )
- if type in jsonResult.keys():
- return jsonResult[ type ]
+ if intentType in jsonResult.keys():
+ return jsonResult[ intentType ]
else:
- main.log.error( "unknown TYPE, return all types of intents" )
+ main.log.error( "unknown TYPE, returning all types of intents" )
return handle
else:
+ main.log.error( handle )
return handle
-
except TypeError:
main.log.exception( self.name + ": Object not as expected" )
return None
@@ -1844,7 +1844,6 @@
main.cleanup()
main.exit()
-
def getIntentState(self, intentsId, intentsJson=None):
"""
Check intent state.
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index b526a99..ed6e538 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -359,8 +359,6 @@
"""
try:
- # main.log.info( self.name + ": Stopping ONOS" )
- # self.stop()
self.handle.sendline( "cd " + self.home )
self.handle.expect( self.home + "\$" )
cmd = "git pull"
@@ -384,10 +382,6 @@
'Please, commit your changes before you can merge.',
pexpect.TIMEOUT ],
timeout=300 )
- # debug
- # main.log.report( self.name +": DEBUG: \n"+
- # "git pull response: " +
- # str( self.handle.before ) + str( self.handle.after ) )
if i == 0:
main.log.error( self.name + ": Git pull had some issue" )
output = self.handle.after
diff --git a/TestON/tests/HAclusterRestart/HAclusterRestart.py b/TestON/tests/HAclusterRestart/HAclusterRestart.py
index f9ab800..58b113c 100644
--- a/TestON/tests/HAclusterRestart/HAclusterRestart.py
+++ b/TestON/tests/HAclusterRestart/HAclusterRestart.py
@@ -182,10 +182,11 @@
# index = The number of the graph under plot name
job = "HAclusterRestart"
plotName = "Plot-HA"
+ index = "1"
graphs = '<ac:structured-macro ac:name="html">\n'
graphs += '<ac:plain-text-body><![CDATA[\n'
graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
- '/plot/' + plotName + '/getPlot?index=0' +\
+ '/plot/' + plotName + '/getPlot?index=' + index +\
'&width=500&height=300"' +\
'noborder="0" width="500" height="300" scrolling="yes" ' +\
'seamless="seamless"></iframe>\n'
diff --git a/TestON/tests/HAkillNodes/HAkillNodes.py b/TestON/tests/HAkillNodes/HAkillNodes.py
index 94323e3..d31cd30 100644
--- a/TestON/tests/HAkillNodes/HAkillNodes.py
+++ b/TestON/tests/HAkillNodes/HAkillNodes.py
@@ -187,10 +187,11 @@
# index = The number of the graph under plot name
job = "HAkillNodes"
plotName = "Plot-HA"
+ index = "1"
graphs = '<ac:structured-macro ac:name="html">\n'
graphs += '<ac:plain-text-body><![CDATA[\n'
graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
- '/plot/' + plotName + '/getPlot?index=0' +\
+ '/plot/' + plotName + '/getPlot?index=' + index +\
'&width=500&height=300"' +\
'noborder="0" width="500" height="300" scrolling="yes" ' +\
'seamless="seamless"></iframe>\n'
diff --git a/TestON/tests/HAkillNodes/dependencies/onos-gen-partitions b/TestON/tests/HAkillNodes/dependencies/onos-gen-partitions
index cb0d826..06c5ec9 100755
--- a/TestON/tests/HAkillNodes/dependencies/onos-gen-partitions
+++ b/TestON/tests/HAkillNodes/dependencies/onos-gen-partitions
@@ -27,24 +27,30 @@
node = lambda k: { 'id': k, 'ip': k, 'port': port }
return [ node(environ[v]) for v in vars ]
-def generate_permutations(nodes, k):
+def generate_base_partition(nodes):
+ return {
+ 'id': 0,
+ 'members': nodes
+ }
+
+def generate_extended_partitions(nodes, k):
l = deque(nodes)
perms = []
for i in range(1, len(nodes)+1):
part = {
- 'name': 'p%d' % i,
+ 'id': i,
'members': list(l)[:k]
}
perms.append(part)
l.rotate(-1)
return perms
-def generate_permutations2(nodes, k):
+def generate_extended_partitions_HA(nodes, k):
l = deque(nodes)
perms = []
for i in range(1, (len(nodes) + 1) / 2 + 1):
part = {
- 'name': 'p%d' % i,
+ 'id': i,
'members': list(l)[:k]
}
perms.append(part)
@@ -54,10 +60,14 @@
if __name__ == '__main__':
vars = get_OC_vars()
nodes = get_nodes(vars)
- partitions = generate_permutations2([v.get('id') for v in nodes], 3)
+ base_partition = generate_base_partition([v.get('id') for v in nodes])
+ extended_partitions = generate_extended_partitions_HA([v.get('id') for v in nodes], 3)
+ partitions = []
+ partitions.append(base_partition)
+ partitions.extend(extended_partitions)
name = 0
for node in nodes:
- name = name ^ hash(node['ip'])
+ name = name ^ hash(node['ip'])
data = {
'name': name,
'nodes': nodes,
diff --git a/TestON/tests/HAsanity/HAsanity.py b/TestON/tests/HAsanity/HAsanity.py
index 70609d3..ed37e33 100644
--- a/TestON/tests/HAsanity/HAsanity.py
+++ b/TestON/tests/HAsanity/HAsanity.py
@@ -178,10 +178,11 @@
# index = The number of the graph under plot name
job = "HAsanity"
plotName = "Plot-HA"
+ index = "1"
graphs = '<ac:structured-macro ac:name="html">\n'
graphs += '<ac:plain-text-body><![CDATA[\n'
graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
- '/plot/' + plotName + '/getPlot?index=0' +\
+ '/plot/' + plotName + '/getPlot?index=' + index +\
'&width=500&height=300"' +\
'noborder="0" width="500" height="300" scrolling="yes" ' +\
'seamless="seamless"></iframe>\n'
diff --git a/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py b/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
index 2f2b01b..2f7f922 100644
--- a/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
+++ b/TestON/tests/HAsingleInstanceRestart/HAsingleInstanceRestart.py
@@ -159,10 +159,11 @@
# index = The number of the graph under plot name
job = "HAsingleInstanceRestart"
plotName = "Plot-HA"
+ index = "1"
graphs = '<ac:structured-macro ac:name="html">\n'
graphs += '<ac:plain-text-body><![CDATA[\n'
graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
- '/plot/' + plotName + '/getPlot?index=0' +\
+ '/plot/' + plotName + '/getPlot?index=' + index +\
'&width=500&height=300"' +\
'noborder="0" width="500" height="300" scrolling="yes" ' +\
'seamless="seamless"></iframe>\n'
diff --git a/TestON/tests/HAstopNodes/HAstopNodes.py b/TestON/tests/HAstopNodes/HAstopNodes.py
index b3a2fd8..b7f1e77 100644
--- a/TestON/tests/HAstopNodes/HAstopNodes.py
+++ b/TestON/tests/HAstopNodes/HAstopNodes.py
@@ -180,10 +180,11 @@
# index = The number of the graph under plot name
job = "HAstopNodes"
plotName = "Plot-HA"
+ index = "1"
graphs = '<ac:structured-macro ac:name="html">\n'
graphs += '<ac:plain-text-body><![CDATA[\n'
graphs += '<iframe src="https://onos-jenkins.onlab.us/job/' + job +\
- '/plot/' + plotName + '/getPlot?index=0' +\
+ '/plot/' + plotName + '/getPlot?index=' + index +\
'&width=500&height=300"' +\
'noborder="0" width="500" height="300" scrolling="yes" ' +\
'seamless="seamless"></iframe>\n'
diff --git a/TestON/tests/HAstopNodes/dependencies/onos-gen-partitions b/TestON/tests/HAstopNodes/dependencies/onos-gen-partitions
index cb0d826..06c5ec9 100755
--- a/TestON/tests/HAstopNodes/dependencies/onos-gen-partitions
+++ b/TestON/tests/HAstopNodes/dependencies/onos-gen-partitions
@@ -27,24 +27,30 @@
node = lambda k: { 'id': k, 'ip': k, 'port': port }
return [ node(environ[v]) for v in vars ]
-def generate_permutations(nodes, k):
+def generate_base_partition(nodes):
+ return {
+ 'id': 0,
+ 'members': nodes
+ }
+
+def generate_extended_partitions(nodes, k):
l = deque(nodes)
perms = []
for i in range(1, len(nodes)+1):
part = {
- 'name': 'p%d' % i,
+ 'id': i,
'members': list(l)[:k]
}
perms.append(part)
l.rotate(-1)
return perms
-def generate_permutations2(nodes, k):
+def generate_extended_partitions_HA(nodes, k):
l = deque(nodes)
perms = []
for i in range(1, (len(nodes) + 1) / 2 + 1):
part = {
- 'name': 'p%d' % i,
+ 'id': i,
'members': list(l)[:k]
}
perms.append(part)
@@ -54,10 +60,14 @@
if __name__ == '__main__':
vars = get_OC_vars()
nodes = get_nodes(vars)
- partitions = generate_permutations2([v.get('id') for v in nodes], 3)
+ base_partition = generate_base_partition([v.get('id') for v in nodes])
+ extended_partitions = generate_extended_partitions_HA([v.get('id') for v in nodes], 3)
+ partitions = []
+ partitions.append(base_partition)
+ partitions.extend(extended_partitions)
name = 0
for node in nodes:
- name = name ^ hash(node['ip'])
+ name = name ^ hash(node['ip'])
data = {
'name': name,
'nodes': nodes,