Topology performance test related updates
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 759e4fd..76c7e87 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -907,6 +907,45 @@
main.cleanup()
main.exit()
+ def topology_events_metrics(self, json_format=True):
+ '''
+ Description:Returns topology metrics
+ Optional:
+ * json_format: enable json formatting of output
+ '''
+ try:
+ if json_format:
+ self.handle.sendline("topology-events-metrics -j")
+ self.handle.expect("topology-events-metrics -j")
+ self.handle.expect("onos>")
+
+ handle = self.handle.before
+
+ #Some color thing that we want to escape
+ ansi_escape = re.compile(r'\r\r\n\x1b[^m]*m')
+ handle = ansi_escape.sub('', handle)
+
+ else:
+ self.handle.sendline("topology-events-metrics")
+ self.handle.expect("topology-events-metrics")
+ self.handle.expect("onos>")
+
+ handle = self.handle.before
+
+ return handle
+
+ except pexpect.EOF:
+ main.log.error(self.name + ": EOF exception found")
+ main.log.error(self.name + ": " + self.handle.before)
+ main.cleanup()
+ main.exit()
+ except:
+ main.log.info(self.name+" ::::::")
+ main.log.error( traceback.print_exc())
+ main.log.info(self.name+" ::::::")
+ main.cleanup()
+ main.exit()
+
#Wrapper functions ****************
#Wrapper functions use existing driver
#functions and extends their use case.
diff --git a/TestON/tests/TopoPerfNext/TopoPerfNext.params b/TestON/tests/TopoPerfNext/TopoPerfNext.params
index 23b470b..463ec02 100644
--- a/TestON/tests/TopoPerfNext/TopoPerfNext.params
+++ b/TestON/tests/TopoPerfNext/TopoPerfNext.params
@@ -13,11 +13,11 @@
<CTRL>
<user>admin</user>
- <ip1>10.128.20.11</ip1>
+ <ip1>10.128.174.1</ip1>
<port1>6633</port1>
- <ip2>10.128.20.12</ip2>
+ <ip2>10.128.174.2</ip2>
<port2>6633</port2>
- <ip3>10.128.20.13</ip3>
+ <ip3>10.128.174.3</ip3>
<port3>6633</port3>
</CTRL>
diff --git a/TestON/tests/TopoPerfNext/TopoPerfNext.py b/TestON/tests/TopoPerfNext/TopoPerfNext.py
index 8e36c95..eb49669 100644
--- a/TestON/tests/TopoPerfNext/TopoPerfNext.py
+++ b/TestON/tests/TopoPerfNext/TopoPerfNext.py
@@ -62,6 +62,21 @@
main.step("Starting ONOS service")
start_result = main.ONOSbench.onos_start(ONOS1_ip)
+ main.step("Set cell for ONOS cli env")
+ main.ONOS1cli.set_cell(cell_name)
+ main.ONOS2cli.set_cell(cell_name)
+ main.ONOS3cli.set_cell(cell_name)
+
+ main.step("Start onos cli")
+ main.ONOS1cli.start_onos_cli(ONOS1_ip)
+ main.ONOS2cli.start_onos_cli(ONOS2_ip)
+ main.ONOS3cli.start_onos_cli(ONOS3_ip)
+
+ main.step("Enable metrics feature")
+ main.ONOS1cli.feature_install("onos-app-metrics-topology")
+ main.ONOS2cli.feature_install("onos-app-metrics-topology")
+ main.ONOS3cli.feature_install("onos-app-metrics-topology")
+
utilities.assert_equals(expect=main.TRUE,
actual= cell_file_result and cell_apply_result and\
verify_cell_result and checkout_result and\
@@ -128,7 +143,7 @@
#Wait and ensure switch is assigned
#before stopping tshark
- time.sleep(20)
+ time.sleep(30)
main.ONOS1.stop_tshark()
@@ -147,7 +162,7 @@
main.log.info("Object read in from TCP capture: "+
str(temp_text))
- if len(temp_text) > 0:
+ if len(temp_text) > 1:
t0_tcp = int(float(temp_text[1])*1000)
else:
main.log.error("Tshark output file for TCP"+
@@ -175,7 +190,7 @@
main.log.info("Object read in from OFP capture: "+
str(line_ofp))
- if len(line_ofp) > 0:
+ if len(line_ofp) > 1:
t0_ofp = int(float(obj[1])*1000)
else:
main.log.error("Tshark output file for OFP"+
@@ -188,7 +203,23 @@
#TODO:
#Get json object from all 3 ONOS instances
-
+ json_str_1 = main.ONOS1cli.topology_events_metrics()
+ json_str_2 = main.ONOS2cli.topology_events_metrics()
+ json_str_3 = main.ONOS3cli.topology_events_metrics()
+
+ #TESTING:
+ main.log.info(json_str_1)
+ main.log.info(json_str_2)
+ main.log.info(json_str_3)
+
+ json_obj_1 = json.loads(json_str_1)
+ json_obj_2 = json.loads(json_str_2)
+ json_obj_3 = json.loads(json_str_3)
+
+ main.log.info(json_obj_1)
+ main.log.info(json_obj_2)
+ main.log.info(json_obj_3)
+
#TODO:
#Parse json object for timestamp
topo_timestamp_1 = 0
diff --git a/TestON/tests/TopoPerfNext/TopoPerfNext.topo b/TestON/tests/TopoPerfNext/TopoPerfNext.topo
index 72fbd07..9ff8136 100644
--- a/TestON/tests/TopoPerfNext/TopoPerfNext.topo
+++ b/TestON/tests/TopoPerfNext/TopoPerfNext.topo
@@ -10,17 +10,35 @@
<COMPONENTS> </COMPONENTS>
</ONOSbench>
- <ONOScli>
+ <ONOS1cli>
<host>10.128.20.10</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosCliDriver</type>
<connect_order>2</connect_order>
<COMPONENTS> </COMPONENTS>
- </ONOScli>
+ </ONOS1cli>
+
+ <ONOS2cli>
+ <host>10.128.20.10</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS2cli>
+
+ <ONOS3cli>
+ <host>10.128.20.10</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS3cli>
<ONOS1>
- <host>10.128.20.11</host>
+ <host>10.128.174.1</host>
<user>admin</user>
<password>onos_test</password>
<type>OnosDriver</type>