Remove old tests and add lost gerrit changes
Change-Id: Ia0a1c7ea55512febf30385d1aeb4c5715f2d3721
diff --git a/TestON/config/teston.cfg b/TestON/config/teston.cfg
index 52950ec..558a1a1 100644
--- a/TestON/config/teston.cfg
+++ b/TestON/config/teston.cfg
@@ -1,18 +1,18 @@
<config>
<parser>
- <file>/home/admin/TestON/core/xmlparser.py </file>
+ <file>~/OnosSystemTest/TestON/core/xmlparser.py </file>
<class>xmlparser</class>
</parser>
- <mail_to>sean@onlab.us</mail_to>
+ <mail_to>hari@onlab.us</mail_to>
<logger>
- <file>/home/admin/TestON/core/logger.py </file>
+ <file>~/OnosSystemTest/TestON/core/logger.py </file>
<class>Logger</class>
</logger>
<responseparser>
- <file>/home/admin/TestON/core/jsonparser.py </file>
+ <file>~/OnosSystemTest/TestON/core/jsonparser.py </file>
<class>JsonParser</class>
</responseparser>
</config>
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index 5de8e2e..c4e9149 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -604,7 +604,7 @@
~/<self.home>/tools/test/cells/
"""
# Variable initialization
- cellDirectory = self.home + "/tools/test/cells/"
+ cellDirectory = os.environ["ONOS_ROOT"] + "/tools/test/cells/"
# We want to create the cell file in the dependencies directory
# of TestON first, then copy over to ONOS bench
tempDirectory = "/tmp/"
diff --git a/TestON/tests/CbenchBM/CbenchBM.params b/TestON/tests/CbenchBM/CbenchBM.params
deleted file mode 100644
index 33dc069..0000000
--- a/TestON/tests/CbenchBM/CbenchBM.params
+++ /dev/null
@@ -1,60 +0,0 @@
-<PARAMS>
-
- <testcases>1,2</testcases>
-
- <SCALE>1</SCALE>
- <availableNodes>7</availableNodes>
-
- <ENV>
- <cellName>CbenchBMcell</cellName>
- </ENV>
-
- <TEST>
- <skipCleanInstall>yes</skipCleanInstall>
- <mode>t</mode> #t throughput
- </TEST>
-
- <GIT>
- <autopull>off</autopull>
- <checkout>master</checkout>
- </GIT>
-
- <CTRL>
- <USER>admin</USER>
-
- <ip1>10.254.1.207</ip1>
- <port1>6633</port1>
-
- <ip2>10.254.1.202</ip2>
- <port2>6633</port2>
-
- <ip3>10.254.1.203</ip3>
- <port3>6633</port3>
-
- <ip4>10.254.1.204</ip4>
- <port4>6633</port4>
-
- <ip5>10.128.5.205</ip5>
- <port5>6633</port5>
-
- <ip6>10.128.5.206</ip6>
- <port6>6633</port6>
-
- <ip7>10.128.5.201</ip7>
- <port7>6633</port7>
-
- </CTRL>
-
- <MN>
- <ip1>10.254.1.200</ip1>
- </MN>
-
- <BENCH>
- <user>admin</user>
- <ip1>10.254.1.200</ip1>
- </BENCH>
-
- <JSON>
- </JSON>
-
-</PARAMS>
diff --git a/TestON/tests/CbenchBM/CbenchBM.topo b/TestON/tests/CbenchBM/CbenchBM.topo
deleted file mode 100644
index 7b39c4e..0000000
--- a/TestON/tests/CbenchBM/CbenchBM.topo
+++ /dev/null
@@ -1,144 +0,0 @@
-<TOPOLOGY>
-
- <COMPONENT>
-
- <ONOSbench>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS><home>~/onos</home></COMPONENTS>
- </ONOSbench>
-
- <ONOS1cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1cli>
-
- <ONOS2cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2cli>
-
- <ONOS3cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3cli>
-
- <ONOS4cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4cli>
-
- <ONOS5cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5cli>
-
- <ONOS6cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6cli>
-
- <ONOS7cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7cli>
-
- <ONOS1>
- <host>10.254.1.201</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.254.1.202</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>10</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.254.1.203</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>11</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
- <ONOS4>
- <host>10.254.1.204</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>12</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4>
-
-
- <ONOS5>
- <host>10.254.1.205</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>13</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5>
-
- <ONOS6>
- <host>10.254.1.206</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>14</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6>
-
- <ONOS7>
- <host>10.254.1.207</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>15</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7>
-
- </COMPONENT>
-
-</TOPOLOGY>
-
diff --git a/TestON/tests/CbenchBM/__init__.py b/TestON/tests/CbenchBM/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/CbenchBM/__init__.py
+++ /dev/null
diff --git a/TestON/tests/FuncIntent/Dependency/FuncIntentFunction.py b/TestON/tests/FuncIntent/Dependency/FuncIntentFunction.py
deleted file mode 100644
index b8598e4..0000000
--- a/TestON/tests/FuncIntent/Dependency/FuncIntentFunction.py
+++ /dev/null
@@ -1,1121 +0,0 @@
-"""
- Wrapper functions for FuncIntent
- This functions include Onosclidriver and Mininetclidriver driver functions
- Author: kelvin@onlab.us
-"""
-def __init__( self ):
- self.default = ''
-
-def hostIntent( main,
- name,
- host1,
- host2,
- onosNode=0,
- host1Id="",
- host2Id="",
- mac1="",
- mac2="",
- vlan1="-1",
- vlan2="-1",
- sw1="",
- sw2="",
- expectedLink=0 ):
- """
- Description:
- Verify add-host-intent
- Steps:
- - Discover hosts
- - Add host intents
- - Check intents
- - Verify flows
- - Ping hosts
- - Reroute
- - Link down
- - Verify flows
- - Check topology
- - Ping hosts
- - Link up
- - Verify flows
- - Check topology
- - Ping hosts
- - Remove intents
- Required:
- name - Type of host intent to add eg. IPV4 | VLAN | Dualstack
- host1 - Name of first host
- host2 - Name of second host
- Optional:
- host1Id - ONOS id of the first host eg. 00:00:00:00:00:01/-1
- host2Id - ONOS id of the second host
- mac1 - Mac address of first host
- mac2 - Mac address of the second host
- vlan1 - Vlan tag of first host, defaults to -1
- vlan2 - Vlan tag of second host, defaults to -1
- sw1 - First switch to bring down & up for rerouting purpose
- sw2 - Second switch to bring down & up for rerouting purpose
- expectedLink - Expected link when the switches are down, it should
- be two links lower than the links before the two
- switches are down
- """
- import time
-
- # Assert variables
- assert main, "There is no main variable"
- assert name, "variable name is empty"
- assert host1 and host2, "You must specify hosts"
-
- global itemName
- itemName = name
- h1Id = host1Id
- h2Id = host2Id
- h1Mac = mac1
- h2Mac = mac2
- vlan1 = vlan1
- vlan2 = vlan2
- hostNames = [ host1 , host2 ]
- intentsId = []
- stepResult = main.TRUE
- pingResult = main.TRUE
- intentResult = main.TRUE
- removeIntentResult = main.TRUE
- flowResult = main.TRUE
- topoResult = main.TRUE
- linkDownResult = main.TRUE
- linkUpResult = main.TRUE
- onosNode = int( onosNode )
-
- if main.hostsData:
- if not h1Mac:
- h1Mac = main.hostsData[ host1 ][ 'mac' ]
- if not h2Mac:
- h2Mac = main.hostsData[ host2 ][ 'mac' ]
- if main.hostsData[ host1 ][ 'vlan' ] != '-1':
- vlan1 = main.hostsData[ host1 ][ 'vlan' ]
- if main.hostsData[ host2 ][ 'vlan' ] != '-1':
- vlan2 = main.hostsData[ host2 ][ 'vlan' ]
- if not h1Id:
- h1Id = main.hostsData[ host1 ][ 'id' ]
- if not h2Id:
- h2Id = main.hostsData[ host2 ][ 'id' ]
-
- assert h1Id and h2Id, "You must specify host IDs"
- if not ( h1Id and h2Id ):
- main.log.info( "There are no host IDs" )
- return main.FALSE
-
- # Discover hosts using arping
- if not main.hostsData:
- main.log.info( itemName + ": Discover host using arping" )
- main.Mininet1.arping( host=host1 )
- main.Mininet1.arping( host=host2 )
- host1 = main.CLIs[ 0 ].getHost( mac=h1Mac )
- host2 = main.CLIs[ 0 ].getHost( mac=h2Mac )
-
- # Check flows count in each node
- checkFlowsCount( main )
-
- # Checking connectivity before installing intents
- main.log.info( itemName + ": Check hosts connection before adding intents" )
- checkPing = pingallHosts( main, hostNames )
- if not checkPing:
- main.log.info( itemName + ": Ping did not go through " +
- "before adding intents" )
- else:
- main.log.debug( itemName + ": Pinged successful before adding " +
- "intents,please check fwd app if it is activated" )
-
- # Adding host intents
- main.log.info( itemName + ": Adding host intents" )
- intent1 = main.CLIs[ onosNode ].addHostIntent( hostIdOne=h1Id,
- hostIdTwo=h2Id )
- intentsId.append( intent1 )
- time.sleep( 5 )
-
- # Check intents state
- time.sleep( 30 )
- intentResult = checkIntentState( main, intentsId )
- checkFlowsCount( main )
-
- # Check intents state again if first check fails...
- if not intentResult:
- intentResult = checkIntentState( main, intentsId )
-
- # Check flows count in each node
- checkFlowsCount( main )
- # Verify flows
- checkFlowsState( main )
-
- # Ping hosts
- firstPingResult = pingallHosts( main, hostNames )
- if not firstPingResult:
- main.log.debug( "First ping failed, there must be" +
- " something wrong with ONOS performance" )
-
- # Ping hosts again...
- pingResult = pingResult and pingallHosts( main, hostNames )
- time.sleep( 5 )
-
- # Test rerouting if these variables exist
- if sw1 and sw2 and expectedLink:
- # link down
- linkDownResult = link( main, sw1, sw2, "down" )
- intentResult = intentResult and checkIntentState( main, intentsId )
-
- # Check flows count in each node
- checkFlowsCount( main )
- # Verify flows
- checkFlowsState( main )
-
- # Check OnosTopology
- topoResult = checkTopology( main, expectedLink )
-
- # Ping hosts
- pingResult = pingResult and pingallHosts( main, hostNames )
-
- intentResult = checkIntentState( main, intentsId )
-
- # Checks ONOS state in link down
- if linkDownResult and topoResult and pingResult and intentResult:
- main.log.info( itemName + ": Successfully brought link down" )
- else:
- main.log.error( itemName + ": Failed to bring link down" )
-
- # link up
- linkUpResult = link( main, sw1, sw2, "up" )
- time.sleep( 5 )
-
- # Check flows count in each node
- checkFlowsCount( main )
- # Verify flows
- checkFlowsState( main )
-
- # Check OnosTopology
- topoResult = checkTopology( main, main.numLinks )
-
- # Ping hosts
- pingResult = pingResult and pingallHosts( main, hostNames )
-
- intentResult = checkIntentState( main, intentsId )
-
- # Checks ONOS state in link up
- if linkUpResult and topoResult and pingResult and intentResult:
- main.log.info( itemName + ": Successfully brought link back up" )
- else:
- main.log.error( itemName + ": Failed to bring link back up" )
-
- # Remove all intents
- removeIntentResult = removeAllIntents( main, intentsId )
-
- stepResult = pingResult and linkDownResult and linkUpResult \
- and intentResult and removeIntentResult
-
- return stepResult
-
-def pointIntent( main,
- name,
- host1,
- host2,
- onosNode=0,
- deviceId1="",
- deviceId2="",
- port1="",
- port2="",
- ethType="",
- mac1="",
- mac2="",
- bandwidth="",
- lambdaAlloc=False,
- ipProto="",
- ip1="",
- ip2="",
- tcp1="",
- tcp2="",
- sw1="",
- sw2="",
- expectedLink=0 ):
-
- """
- Description:
- Verify add-point-intent
- Steps:
- - Get device ids | ports
- - Add point intents
- - Check intents
- - Verify flows
- - Ping hosts
- - Reroute
- - Link down
- - Verify flows
- - Check topology
- - Ping hosts
- - Link up
- - Verify flows
- - Check topology
- - Ping hosts
- - Remove intents
- Required:
- name - Type of point intent to add eg. IPV4 | VLAN | Dualstack
- host1 - Name of first host
- host2 - Name of second host
- Optional:
- deviceId1 - ONOS device id of the first switch, the same as the
- location of the first host eg. of:0000000000000001/1,
- located at device 1 port 1
- deviceId2 - ONOS device id of the second switch
- port1 - The port number where the first host is attached
- port2 - The port number where the second host is attached
- ethType - Ethernet type eg. IPV4, IPV6
- mac1 - Mac address of first host
- mac2 - Mac address of the second host
- bandwidth - Bandwidth capacity
- lambdaAlloc - Allocate lambda, defaults to False
- ipProto - IP protocol
- ip1 - IP address of first host
- ip2 - IP address of second host
- tcp1 - TCP port of first host
- tcp2 - TCP port of second host
- sw1 - First switch to bring down & up for rerouting purpose
- sw2 - Second switch to bring down & up for rerouting purpose
- expectedLink - Expected link when the switches are down, it should
- be two links lower than the links before the two
- switches are down
- """
-
- import time
- assert main, "There is no main variable"
- assert name, "variable name is empty"
- assert host1 and host2, "You must specify hosts"
-
- global itemName
- itemName = name
- host1 = host1
- host2 = host2
- hostNames = [ host1, host2 ]
- intentsId = []
-
- pingResult = main.TRUE
- intentResult = main.TRUE
- removeIntentResult = main.TRUE
- flowResult = main.TRUE
- topoResult = main.TRUE
- linkDownResult = main.TRUE
- linkUpResult = main.TRUE
- onosNode = int( onosNode )
-
- # Checking connectivity before installing intents
- main.log.info( itemName + ": Check hosts connection before adding intents" )
- checkPing = pingallHosts( main, hostNames )
- if not checkPing:
- main.log.info( itemName + ": Ping did not go through " +
- "before adding intents" )
- else:
- main.log.debug( itemName + ": Pinged successful before adding " +
- "intents,please check fwd app if it is activated" )
-
- # Adding bidirectional point intents
- main.log.info( itemName + ": Adding point intents" )
- intent1 = main.CLIs[ onosNode ].addPointIntent( ingressDevice=deviceId1,
- egressDevice=deviceId2,
- portIngress=port1,
- portEgress=port2,
- ethType=ethType,
- ethSrc=mac1,
- ethDst=mac2,
- bandwidth=bandwidth,
- lambdaAlloc=lambdaAlloc,
- ipProto=ipProto,
- ipSrc=ip1,
- ipDst=ip2,
- tcpSrc=tcp1,
- tcpDst=tcp2 )
-
- intentsId.append( intent1 )
- time.sleep( 5 )
- intent2 = main.CLIs[ onosNode ].addPointIntent( ingressDevice=deviceId2,
- egressDevice=deviceId1,
- portIngress=port2,
- portEgress=port1,
- ethType=ethType,
- ethSrc=mac2,
- ethDst=mac1,
- bandwidth=bandwidth,
- lambdaAlloc=lambdaAlloc,
- ipProto=ipProto,
- ipSrc=ip2,
- ipDst=ip1,
- tcpSrc=tcp2,
- tcpDst=tcp1 )
- intentsId.append( intent2 )
-
- # Check intents state
- time.sleep( 30 )
- intentResult = checkIntentState( main, intentsId )
- # Check flows count in each node
- checkFlowsCount( main )
-
- # Check intents state again if first check fails...
- if not intentResult:
- intentResult = checkIntentState( main, intentsId )
-
- # Check flows count in each node
- checkFlowsCount( main )
- # Verify flows
- checkFlowsState( main )
-
- # Ping hosts
- firstPingResult = pingallHosts( main, hostNames )
- if not firstPingResult:
- main.log.debug( "First ping failed, there must be" +
- " something wrong with ONOS performance" )
-
- # Ping hosts again...
- pingResult = pingResult and pingallHosts( main, hostNames )
- time.sleep( 5 )
-
- # Test rerouting if these variables exist
- if sw1 and sw2 and expectedLink:
- # link down
- linkDownResult = link( main, sw1, sw2, "down" )
- intentResult = intentResult and checkIntentState( main, intentsId )
-
- # Check flows count in each node
- checkFlowsCount( main )
- # Verify flows
- checkFlowsState( main )
-
- # Check OnosTopology
- topoResult = checkTopology( main, expectedLink )
-
- # Ping hosts
- pingResult = pingResult and pingallHosts( main, hostNames )
-
- intentResult = checkIntentState( main, intentsId )
-
- # Checks ONOS state in link down
- if linkDownResult and topoResult and pingResult and intentResult:
- main.log.info( itemName + ": Successfully brought link down" )
- else:
- main.log.error( itemName + ": Failed to bring link down" )
-
- # link up
- linkUpResult = link( main, sw1, sw2, "up" )
- time.sleep( 5 )
-
- # Check flows count in each node
- checkFlowsCount( main )
- # Verify flows
- checkFlowsState( main )
-
- # Check OnosTopology
- topoResult = checkTopology( main, main.numLinks )
-
- # Ping hosts
- pingResult = pingResult and pingallHosts( main, hostNames )
-
- intentResult = checkIntentState( main, intentsId )
-
- # Checks ONOS state in link up
- if linkUpResult and topoResult and pingResult and intentResult:
- main.log.info( itemName + ": Successfully brought link back up" )
- else:
- main.log.error( itemName + ": Failed to bring link back up" )
-
- # Remove all intents
- removeIntentResult = removeAllIntents( main, intentsId )
-
- stepResult = pingResult and linkDownResult and linkUpResult \
- and intentResult and removeIntentResult
-
- return stepResult
-
-def singleToMultiIntent( main,
- name,
- hostNames,
- onosNode=0,
- devices="",
- ports=None,
- ethType="",
- macs=None,
- bandwidth="",
- lambdaAlloc=False,
- ipProto="",
- ipAddresses="",
- tcp="",
- sw1="",
- sw2="",
- expectedLink=0 ):
- """
- Verify Single to Multi Point intents
- NOTE:If main.hostsData is not defined, variables data should be passed in the
- same order index wise. All devices in the list should have the same
- format, either all the devices have its port or it doesn't.
- eg. hostName = [ 'h1', 'h2' ,.. ]
- devices = [ 'of:0000000000000001', 'of:0000000000000002', ...]
- ports = [ '1', '1', ..]
- ...
- Description:
- Verify add-single-to-multi-intent iterates through the list of given
- host | devices and add intents
- Steps:
- - Get device ids | ports
- - Add single to multi point intents
- - Check intents
- - Verify flows
- - Ping hosts
- - Reroute
- - Link down
- - Verify flows
- - Check topology
- - Ping hosts
- - Link up
- - Verify flows
- - Check topology
- - Ping hosts
- - Remove intents
- Required:
- name - Type of point intent to add eg. IPV4 | VLAN | Dualstack
- hostNames - List of host names
- Optional:
- devices - List of device ids in the same order as the hosts
- in hostNames
- ports - List of port numbers in the same order as the device in
- devices
- ethType - Ethernet type eg. IPV4, IPV6
- macs - List of hosts mac address in the same order as the hosts in
- hostNames
- bandwidth - Bandwidth capacity
- lambdaAlloc - Allocate lambda, defaults to False
- ipProto - IP protocol
- ipAddresses - IP addresses of host in the same order as the hosts in
- hostNames
- tcp - TCP ports in the same order as the hosts in hostNames
- sw1 - First switch to bring down & up for rerouting purpose
- sw2 - Second switch to bring down & up for rerouting purpose
- expectedLink - Expected link when the switches are down, it should
- be two links lower than the links before the two
- switches are down
- """
-
- import time
- import copy
- assert main, "There is no main variable"
- assert hostNames, "You must specify hosts"
- assert devices or main.hostsData, "You must specify devices"
-
- global itemName
- itemName = name
- tempHostsData = {}
- intentsId = []
- onosNode = int( onosNode )
-
- macsDict = {}
- ipDict = {}
- if hostNames and devices:
- if len( hostNames ) != len( devices ):
- main.log.debug( "hosts and devices does not have the same length" )
- #print "len hostNames = ", len( hostNames )
- #print "len devices = ", len( devices )
- return main.FALSE
- if ports:
- if len( ports ) != len( devices ):
- main.log.error( "Ports and devices does " +
- "not have the same length" )
- #print "len devices = ", len( devices )
- #print "len ports = ", len( ports )
- return main.FALSE
- else:
- main.log.info( "Device Ports are not specified" )
- if macs:
- for i in range( len( devices ) ):
- macsDict[ devices[ i ] ] = macs[ i ]
-
- elif hostNames and not devices and main.hostsData:
- devices = []
- main.log.info( "singleToMultiIntent function is using main.hostsData" )
- for host in hostNames:
- devices.append( main.hostsData.get( host ).get( 'location' ) )
- macsDict[ main.hostsData.get( host ).get( 'location' ) ] = \
- main.hostsData.get( host ).get( 'mac' )
- ipDict[ main.hostsData.get( host ).get( 'location' ) ] = \
- main.hostsData.get( host ).get( 'ipAddresses' )
- #print main.hostsData
-
- #print 'host names = ', hostNames
- #print 'devices = ', devices
- #print "macsDict = ", macsDict
-
- pingResult = main.TRUE
- intentResult = main.TRUE
- removeIntentResult = main.TRUE
- flowResult = main.TRUE
- topoResult = main.TRUE
- linkDownResult = main.TRUE
- linkUpResult = main.TRUE
-
- devicesCopy = copy.copy( devices )
- if ports:
- portsCopy = copy.copy( ports )
- main.log.info( itemName + ": Adding single point to multi point intents" )
-
- # Check flows count in each node
- checkFlowsCount( main )
-
- # Checking connectivity before installing intents
- main.log.info( itemName + ": Check hosts connection before adding intents" )
- checkPing = pingallHosts( main, hostNames )
- if not checkPing:
- main.log.info( itemName + ": Ping did not go through " +
- "before adding intents" )
- else:
- main.log.debug( itemName + ": Pinged successful before adding " +
- "intents,please check fwd app if it is activated" )
-
- # Adding bidirectional point intents
- for i in range( len( devices ) ):
- ingressDevice = devicesCopy[ i ]
- egressDeviceList = copy.copy( devicesCopy )
- egressDeviceList.remove( ingressDevice )
- if ports:
- portIngress = portsCopy[ i ]
- portEgressList = copy.copy( portsCopy )
- del portEgressList[ i ]
- else:
- portIngress = ""
- portEgressList = None
- if not macsDict:
- srcMac = ""
- else:
- srcMac = macsDict[ ingressDevice ]
- if srcMac == None:
- main.log.debug( "There is no MAC in device - " + ingressDevice )
- srcMac = ""
-
- intentsId.append(
- main.CLIs[ onosNode ].addSinglepointToMultipointIntent(
- ingressDevice=ingressDevice,
- egressDeviceList=egressDeviceList,
- portIngress=portIngress,
- portEgressList=portEgressList,
- ethType=ethType,
- ethSrc=srcMac,
- bandwidth=bandwidth,
- lambdaAlloc=lambdaAlloc,
- ipProto=ipProto,
- ipSrc="",
- ipDst="",
- tcpSrc="",
- tcpDst="" ) )
-
- # Wait some time for the flow to go through when using multi instance
- time.sleep( 10 )
- pingResult = pingallHosts( main, hostNames )
-
- # Check intents state
- time.sleep( 30 )
- intentResult = checkIntentState( main, intentsId )
-
- # Check intents state again if first check fails...
- if not intentResult:
- intentResult = checkIntentState( main, intentsId )
-
- # Check flows count in each node
- checkFlowsCount( main )
- # Verify flows
- checkFlowsState( main )
-
- # Ping hosts
- pingResult = pingResult and pingallHosts( main, hostNames )
- # Ping hosts again...
- pingResult = pingResult and pingallHosts( main, hostNames )
- time.sleep( 5 )
-
- # Test rerouting if these variables exist
- if sw1 and sw2 and expectedLink:
- # link down
- linkDownResult = link( main, sw1, sw2, "down" )
- intentResult = intentResult and checkIntentState( main, intentsId )
-
- # Check flows count in each node
- checkFlowsCount( main )
- # Verify flows
- checkFlowsState( main )
-
- # Check OnosTopology
- topoResult = checkTopology( main, expectedLink )
-
- # Ping hosts
- pingResult = pingResult and pingallHosts( main, hostNames )
-
- intentResult = checkIntentState( main, intentsId )
-
- # Checks ONOS state in link down
- if linkDownResult and topoResult and pingResult and intentResult:
- main.log.info( itemName + ": Successfully brought link down" )
- else:
- main.log.error( itemName + ": Failed to bring link down" )
-
- # link up
- linkUpResult = link( main, sw1, sw2, "up" )
- time.sleep( 5 )
-
- # Check flows count in each node
- checkFlowsCount( main )
- # Verify flows
- checkFlowsState( main )
-
- # Check OnosTopology
- topoResult = checkTopology( main, main.numLinks )
-
- # Ping hosts
- pingResult = pingResult and pingallHosts( main, hostNames )
-
- intentResult = checkIntentState( main, intentsId )
-
- # Checks ONOS state in link up
- if linkUpResult and topoResult and pingResult and intentResult:
- main.log.info( itemName + ": Successfully brought link back up" )
- else:
- main.log.error( itemName + ": Failed to bring link back up" )
-
- # Remove all intents
- removeIntentResult = removeAllIntents( main, intentsId )
-
- stepResult = pingResult and linkDownResult and linkUpResult \
- and intentResult and removeIntentResult
-
- return stepResult
-
-def multiToSingleIntent( main,
- name,
- hostNames,
- onosNode=0,
- devices="",
- ports=None,
- ethType="",
- macs=None,
- bandwidth="",
- lambdaAlloc=False,
- ipProto="",
- ipAddresses="",
- tcp="",
- sw1="",
- sw2="",
- expectedLink=0 ):
- """
- Verify Single to Multi Point intents
- NOTE:If main.hostsData is not defined, variables data should be passed in the
- same order index wise. All devices in the list should have the same
- format, either all the devices have its port or it doesn't.
- eg. hostName = [ 'h1', 'h2' ,.. ]
- devices = [ 'of:0000000000000001', 'of:0000000000000002', ...]
- ports = [ '1', '1', ..]
- ...
- Description:
- Verify add-multi-to-single-intent
- Steps:
- - Get device ids | ports
- - Add multi to single point intents
- - Check intents
- - Verify flows
- - Ping hosts
- - Reroute
- - Link down
- - Verify flows
- - Check topology
- - Ping hosts
- - Link up
- - Verify flows
- - Check topology
- - Ping hosts
- - Remove intents
- Required:
- name - Type of point intent to add eg. IPV4 | VLAN | Dualstack
- hostNames - List of host names
- Optional:
- devices - List of device ids in the same order as the hosts
- in hostNames
- ports - List of port numbers in the same order as the device in
- devices
- ethType - Ethernet type eg. IPV4, IPV6
- macs - List of hosts mac address in the same order as the hosts in
- hostNames
- bandwidth - Bandwidth capacity
- lambdaAlloc - Allocate lambda, defaults to False
- ipProto - IP protocol
- ipAddresses - IP addresses of host in the same order as the hosts in
- hostNames
- tcp - TCP ports in the same order as the hosts in hostNames
- sw1 - First switch to bring down & up for rerouting purpose
- sw2 - Second switch to bring down & up for rerouting purpose
- expectedLink - Expected link when the switches are down, it should
- be two links lower than the links before the two
- switches are down
- """
-
- import time
- import copy
- assert main, "There is no main variable"
- assert hostNames, "You must specify hosts"
- assert devices or main.hostsData, "You must specify devices"
-
- global itemName
- itemName = name
- tempHostsData = {}
- intentsId = []
- onosNode = int( onosNode )
-
- macsDict = {}
- ipDict = {}
- if hostNames and devices:
- if len( hostNames ) != len( devices ):
- main.log.debug( "hosts and devices does not have the same length" )
- #print "len hostNames = ", len( hostNames )
- #print "len devices = ", len( devices )
- return main.FALSE
- if ports:
- if len( ports ) != len( devices ):
- main.log.error( "Ports and devices does " +
- "not have the same length" )
- #print "len devices = ", len( devices )
- #print "len ports = ", len( ports )
- return main.FALSE
- else:
- main.log.info( "Device Ports are not specified" )
- if macs:
- for i in range( len( devices ) ):
- macsDict[ devices[ i ] ] = macs[ i ]
- elif hostNames and not devices and main.hostsData:
- devices = []
- main.log.info( "multiToSingleIntent function is using main.hostsData" )
- for host in hostNames:
- devices.append( main.hostsData.get( host ).get( 'location' ) )
- macsDict[ main.hostsData.get( host ).get( 'location' ) ] = \
- main.hostsData.get( host ).get( 'mac' )
- ipDict[ main.hostsData.get( host ).get( 'location' ) ] = \
- main.hostsData.get( host ).get( 'ipAddresses' )
- #print main.hostsData
-
- #print 'host names = ', hostNames
- #print 'devices = ', devices
- #print "macsDict = ", macsDict
-
- pingResult = main.TRUE
- intentResult = main.TRUE
- removeIntentResult = main.TRUE
- flowResult = main.TRUE
- topoResult = main.TRUE
- linkDownResult = main.TRUE
- linkUpResult = main.TRUE
-
- devicesCopy = copy.copy( devices )
- if ports:
- portsCopy = copy.copy( ports )
- main.log.info( itemName + ": Adding multi point to single point intents" )
-
- # Check flows count in each node
- checkFlowsCount( main )
-
- # Checking connectivity before installing intents
- main.log.info( itemName + ": Check hosts connection before adding intents" )
- checkPing = pingallHosts( main, hostNames )
- if not checkPing:
- main.log.info( itemName + ": Ping did not go through " +
- "before adding intents" )
- else:
- main.log.debug( itemName + ": Pinged successful before adding " +
- "intents,please check fwd app if it is activated" )
-
- # Adding bidirectional point intents
- for i in range( len( devices ) ):
- egressDevice = devicesCopy[ i ]
- ingressDeviceList = copy.copy( devicesCopy )
- ingressDeviceList.remove( egressDevice )
- if ports:
- portEgress = portsCopy[ i ]
- portIngressList = copy.copy( portsCopy )
- del portIngressList[ i ]
- else:
- portEgress = ""
- portIngressList = None
- if not macsDict:
- dstMac = ""
- else:
- dstMac = macsDict[ egressDevice ]
- if dstMac == None:
- main.log.debug( "There is no MAC in device - " + egressDevice )
- dstMac = ""
-
- intentsId.append(
- main.CLIs[ onosNode ].addMultipointToSinglepointIntent(
- ingressDeviceList=ingressDeviceList,
- egressDevice=egressDevice,
- portIngressList=portIngressList,
- portEgress=portEgress,
- ethType=ethType,
- ethDst=dstMac,
- bandwidth=bandwidth,
- lambdaAlloc=lambdaAlloc,
- ipProto=ipProto,
- ipSrc="",
- ipDst="",
- tcpSrc="",
- tcpDst="" ) )
-
- pingResult = pingallHosts( main, hostNames )
-
- # Check intents state
- time.sleep( 30 )
- intentResult = checkIntentState( main, intentsId )
-
- # Check intents state again if first check fails...
- if not intentResult:
- intentResult = checkIntentState( main, intentsId )
-
- # Check flows count in each node
- checkFlowsCount( main )
- # Verify flows
- checkFlowsState( main )
-
- # Ping hosts
- pingResult = pingResult and pingallHosts( main, hostNames )
- # Ping hosts again...
- pingResult = pingResult and pingallHosts( main, hostNames )
- time.sleep( 5 )
-
- # Test rerouting if these variables exist
- if sw1 and sw2 and expectedLink:
- # link down
- linkDownResult = link( main, sw1, sw2, "down" )
- intentResult = intentResult and checkIntentState( main, intentsId )
-
- # Check flows count in each node
- checkFlowsCount( main )
- # Verify flows
- checkFlowsState( main )
-
- # Check OnosTopology
- topoResult = checkTopology( main, expectedLink )
-
- # Ping hosts
- pingResult = pingResult and pingallHosts( main, hostNames )
-
- intentResult = checkIntentState( main, intentsId )
-
- # Checks ONOS state in link down
- if linkDownResult and topoResult and pingResult and intentResult:
- main.log.info( itemName + ": Successfully brought link down" )
- else:
- main.log.error( itemName + ": Failed to bring link down" )
-
- # link up
- linkUpResult = link( main, sw1, sw2, "up" )
- time.sleep( 5 )
-
- # Check flows count in each node
- checkFlowsCount( main )
- # Verify flows
- checkFlowsState( main )
-
- # Check OnosTopology
- topoResult = checkTopology( main, main.numLinks )
-
- # Ping hosts
- pingResult = pingResult and pingallHosts( main, hostNames )
-
- intentResult = checkIntentState( main, intentsId )
-
- # Checks ONOS state in link up
- if linkUpResult and topoResult and pingResult and intentResult:
- main.log.info( itemName + ": Successfully brought link back up" )
- else:
- main.log.error( itemName + ": Failed to bring link back up" )
-
- # Remove all intents
- removeIntentResult = removeAllIntents( main, intentsId )
-
- stepResult = pingResult and linkDownResult and linkUpResult \
- and intentResult and removeIntentResult
-
- return stepResult
-
-def pingallHosts( main, hostList, pingType="ipv4" ):
- # Ping all host in the hosts list variable
- print "Pinging : ", hostList
- pingResult = main.TRUE
- pingResult = main.Mininet1.pingallHosts( hostList, pingType )
- return pingResult
-
-def getHostsData( main ):
- """
- Use fwd app and pingall to discover all the hosts
- """
- import json
- activateResult = main.TRUE
- appCheck = main.TRUE
- getDataResult = main.TRUE
- main.log.info( "Activating reactive forwarding app " )
- activateResult = main.CLIs[ 0 ].activateApp( "org.onosproject.fwd" )
-
- for i in range( main.numCtrls ):
- appCheck = appCheck and main.CLIs[ i ].appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.CLIs[ i ].apps() )
- main.log.warn( main.CLIs[ i ].appIDs() )
-
- pingResult = main.Mininet1.pingall()
- hostsJson = json.loads( main.CLIs[ 0 ].hosts() )
- hosts = main.Mininet1.getHosts().keys()
- # TODO: Make better use of new getHosts function
- for host in hosts:
- main.hostsData[ host ] = {}
- main.hostsData[ host ][ 'mac' ] = \
- main.Mininet1.getMacAddress( host ).upper()
- for hostj in hostsJson:
- if main.hostsData[ host ][ 'mac' ] == hostj[ 'mac' ]:
- main.hostsData[ host ][ 'id' ] = hostj[ 'id' ]
- main.hostsData[ host ][ 'vlan' ] = hostj[ 'vlan' ]
- main.hostsData[ host ][ 'location' ] = \
- hostj[ 'location' ][ 'elementId' ] + '/' + \
- hostj[ 'location' ][ 'port' ]
- main.hostsData[ host ][ 'ipAddresses' ] = hostj[ 'ipAddresses' ]
-
- main.log.info( "Deactivating reactive forwarding app " )
- deactivateResult = main.CLIs[ 0 ].deactivateApp( "org.onosproject.fwd" )
- if activateResult and deactivateResult and main.hostsData:
- main.log.info( "Successfully used fwd app to discover hosts " )
- getDataResult = main.TRUE
- else:
- main.log.info( "Failed to use fwd app to discover hosts " )
- getDataResult = main.FALSE
-
- print main.hostsData
-
- return getDataResult
-
-def checkTopology( main, expectedLink ):
- statusResult = main.TRUE
- # Check onos topology
- main.log.info( itemName + ": Checking ONOS topology " )
-
- for i in range( main.numCtrls ):
- topologyResult = main.CLIs[ i ].topology()
- statusResult = main.ONOSbench.checkStatus( topologyResult,
- main.numSwitch,
- expectedLink )\
- and statusResult
- if not statusResult:
- main.log.error( itemName + ": Topology mismatch" )
- else:
- main.log.info( itemName + ": Topology match" )
- return statusResult
-
-def checkIntentState( main, intentsId ):
- """
- This function will check intent state to make sure all the intents
- are in INSTALLED state
- """
-
- intentResult = main.TRUE
- results = []
-
- main.log.info( itemName + ": Checking intents state" )
- # First check of intents
- for i in range( main.numCtrls ):
- tempResult = main.CLIs[ i ].checkIntentState( intentsId=intentsId )
- results.append( tempResult )
-
- expectedState = [ 'INSTALLED', 'INSTALLING' ]
-
- if all( result == main.TRUE for result in results ):
- main.log.info( itemName + ": Intents are installed correctly" )
- else:
- # Wait for at least 5 second before checking the intents again
- time.sleep( 5 )
- results = []
- # Second check of intents since some of the intents may be in
- # INSTALLING state, they should be in INSTALLED at this time
- for i in range( main.numCtrls ):
- tempResult = main.CLIs[ i ].checkIntentState(
- intentsId=intentsId )
- results.append( tempResult )
- if all( result == main.TRUE for result in results ):
- main.log.info( itemName + ": Intents are installed correctly" )
- else:
- main.log.error( itemName + ": Intents are NOT installed correctly" )
- intentResult = main.FALSE
-
- return intentResult
-
-def checkFlowsState( main ):
-
- main.log.info( itemName + ": Check flows state" )
- checkFlowsResult = main.CLIs[ 0 ].checkFlowsState()
- return checkFlowsResult
-
-def link( main, sw1, sw2, option):
-
- # link down
- main.log.info( itemName + ": Bring link " + option + "between " +
- sw1 + " and " + sw2 )
- linkResult = main.Mininet1.link( end1=sw1, end2=sw2, option=option )
- return linkResult
-
-def removeAllIntents( main, intentsId ):
- """
- Remove all intents in the intentsId
- """
- import time
- intentsRemaining = []
- removeIntentResult = main.TRUE
- # Remove intents
- for intent in intentsId:
- main.CLIs[ 0 ].removeIntent( intentId=intent, purge=True )
-
- time.sleep( 5 )
- # Checks if there is remaining intents using intents()
- intentsRemaining = main.CLIs[ 0 ].intents( jsonFormat=False )
- # If there is remianing intents then remove intents should fail
-
- if intentsRemaining:
- main.log.info( itemName + ": There are " +
- str( len( intentsRemaining ) ) + " intents remaining, "
- + "failed to remove all the intents " )
- removeIntentResult = main.FALSE
- main.log.info( intentsRemaining )
- else:
- main.log.info( itemName + ": There are no intents remaining, " +
- "successfully removed all the intents." )
- removeIntentResult = main.TRUE
- return removeIntentResult
-
-def checkFlowsCount( main ):
- """
- Check flows count in each node
- """
- import json
-
- flowsCount = []
- main.log.info( itemName + ": Checking flows count in each ONOS node" )
- for i in range( main.numCtrls ):
- summaryResult = main.CLIs[ i ].summary()
- if not summaryResult:
- main.log.error( itemName + ": There is something wrong with " +
- "summary command" )
- return main.FALSE
- else:
- summaryJson = json.loads( summaryResult )
- flowsCount.append( summaryJson.get( 'flows' ) )
-
- if flowsCount:
- if all( flows==flowsCount[ 0 ] for flows in flowsCount ):
- main.log.info( itemName + ": There are " + str( flowsCount[ 0 ] ) +
- " flows in all ONOS node" )
- else:
- for i in range( main.numCtrls ):
- main.log.debug( itemName + ": ONOS node " + str( i ) + " has " +
- flowsCount[ i ] + " flows" )
- else:
- main.log.error( "Checking flows count failed, check summary command" )
- return main.FALSE
-
- return main.TRUE
-
diff --git a/TestON/tests/FuncIntent/Dependency/__init__.py b/TestON/tests/FuncIntent/Dependency/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/FuncIntent/Dependency/__init__.py
+++ /dev/null
diff --git a/TestON/tests/FuncIntent/FuncIntent.params b/TestON/tests/FuncIntent/FuncIntent.params
deleted file mode 100644
index e7c8b40..0000000
--- a/TestON/tests/FuncIntent/FuncIntent.params
+++ /dev/null
@@ -1,34 +0,0 @@
-<PARAMS>
-
- <testcases>10,11,12,13,1003</testcases>
-
- <SCALE>1,3</SCALE>
- <availableNodes>3</availableNodes>
- <ENV>
- <cellName>functionality</cellName>
- <cellApps>drivers,openflow,proxyarp,mobility</cellApps>
- </ENV>
- <GIT>
- <pull>False</pull>
- <branch>master</branch>
- </GIT>
- <CTRL>
- <num>3</num>
- <ip1>OC1</ip1>
- <port1>6633</port1>
- <ip2>OC2</ip2>
- <port2>6633</port2>
- <ip3>OC3</ip3>
- <port3>6633</port3>
- </CTRL>
- <BENCH>
- <user>admin</user>
- <ip1>OCN</ip1>
- </BENCH>
- <MININET>
- <switch>7</switch>
- <links>20</links>
- <topo>~/mininet/custom/newFuncTopo.py</topo>
- </MININET>
-
-</PARAMS>
diff --git a/TestON/tests/FuncIntent/FuncIntent.py b/TestON/tests/FuncIntent/FuncIntent.py
deleted file mode 100644
index 3a716ee..0000000
--- a/TestON/tests/FuncIntent/FuncIntent.py
+++ /dev/null
@@ -1,836 +0,0 @@
-
-# Testing the basic functionality of ONOS Next
-# For sanity and driver functionality excercises only.
-
-import time
-import json
-
-class FuncIntent:
-
- def __init__( self ):
- self.default = ''
-
- def CASE10( self, main ):
- import time
- import os
- import imp
- """
- Startup sequence:
- cell <name>
- onos-verify-cell
- onos-remove-raft-log
- git pull
- mvn clean install
- onos-package
- onos-install -f
- onos-wait-for-start
- """
- global init
- global globalONOSip
- try:
- if type(init) is not bool:
- init = False
- except NameError:
- init = False
-
- main.wrapper = imp.load_source( 'FuncIntentFunction',
- '/home/admin/ONLabTest/TestON/tests/' +
- 'FuncIntent/Dependency/' +
- 'FuncIntentFunction.py' )
- #Local variables
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- apps = main.params[ 'ENV' ][ 'cellApps' ]
- gitBranch = main.params[ 'GIT' ][ 'branch' ]
- benchIp = os.environ[ 'OCN' ]
- benchUser = main.params[ 'BENCH' ][ 'user' ]
- topology = main.params[ 'MININET' ][ 'topo' ]
- main.numSwitch = int( main.params[ 'MININET' ][ 'switch' ] )
- main.numLinks = int( main.params[ 'MININET' ][ 'links' ] )
- main.numCtrls = main.params[ 'CTRL' ][ 'num' ]
- main.ONOSport = []
- main.hostsData = {}
- PULLCODE = False
- if main.params[ 'GIT' ][ 'pull' ] == 'True':
- PULLCODE = True
- main.case( "Setting up test environment" )
- main.CLIs = []
- for i in range( 1, int( main.numCtrls ) + 1 ):
- main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
- main.ONOSport.append( main.params[ 'CTRL' ][ 'port' + str( i ) ] )
-
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
- init = True
-
- main.scale = ( main.params[ 'SCALE' ] ).split( "," )
- main.numCtrls = int( main.scale[ 0 ] )
-
- if PULLCODE:
- main.step( "Git checkout and pull " + gitBranch )
- main.ONOSbench.gitCheckout( gitBranch )
- gitPullResult = main.ONOSbench.gitPull()
- if gitPullResult == main.ERROR:
- main.log.error( "Error pulling git branch" )
- main.step( "Using mvn clean & install" )
- cleanInstallResult = main.ONOSbench.cleanInstall()
- stepResult = cleanInstallResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully compiled " +
- "latest ONOS",
- onfail="Failed to compile " +
- "latest ONOS" )
- else:
- main.log.warn( "Did not pull new code so skipping mvn " +
- "clean install" )
-
- globalONOSip = main.ONOSbench.getOnosIps()
-
- maxNodes = ( len(globalONOSip) - 2 )
-
- main.numCtrls = int( main.scale[ 0 ] )
- main.scale.remove( main.scale[ 0 ] )
-
- main.ONOSip = []
- for i in range( maxNodes ):
- main.ONOSip.append( globalONOSip[i] )
-
- #kill off all onos processes
- main.log.info( "Safety check, killing all ONOS processes" +
- " before initiating enviornment setup" )
- for i in range(maxNodes):
- main.ONOSbench.onosDie( globalONOSip[ i ] )
-
- print "NODE COUNT = ", main.numCtrls
- main.log.info( "Creating cell file" )
- cellIp = []
- for i in range( main.numCtrls ):
- cellIp.append( str( main.ONOSip[ i ] ) )
- print cellIp
- main.ONOSbench.createCellFile( benchIp, cellName, "",
- str( apps ), *cellIp )
-
- main.step( "Apply cell to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
- stepResult = cellResult and verifyResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully applied cell to " + \
- "environment",
- onfail="Failed to apply cell to environment " )
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
- stepResult = packageResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully created ONOS package",
- onfail="Failed to create ONOS package" )
-
- main.step( "Uninstalling ONOS package" )
- onosUninstallResult = main.TRUE
- for i in range( main.numCtrls ):
- onosUninstallResult = onosUninstallResult and \
- main.ONOSbench.onosUninstall( nodeIp=main.ONOSip[ i ] )
- stepResult = onosUninstallResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully uninstalled ONOS package",
- onfail="Failed to uninstall ONOS package" )
- time.sleep( 5 )
- main.step( "Installing ONOS package" )
- onosInstallResult = main.TRUE
- for i in range( main.numCtrls ):
- onosInstallResult = onosInstallResult and \
- main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
- stepResult = onosInstallResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully installed ONOS package",
- onfail="Failed to install ONOS package" )
-
- time.sleep( 20 )
- main.step( "Starting ONOS service" )
- stopResult = main.TRUE
- startResult = main.TRUE
- onosIsUp = main.TRUE
- for i in range( main.numCtrls ):
- onosIsUp = onosIsUp and main.ONOSbench.isup( main.ONOSip[ i ] )
- if onosIsUp == main.TRUE:
- main.log.report( "ONOS instance is up and ready" )
- else:
- main.log.report( "ONOS instance may not be up, stop and " +
- "start ONOS again " )
- for i in range( main.numCtrls ):
- stopResult = stopResult and \
- main.ONOSbench.onosStop( main.ONOSip[ i ] )
- for i in range( main.numCtrls ):
- startResult = startResult and \
- main.ONOSbench.onosStart( main.ONOSip[ i ] )
- stepResult = onosIsUp and stopResult and startResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="ONOS service is ready",
- onfail="ONOS service did not start properly" )
-
- main.step( "Start ONOS cli" )
- cliResult = main.TRUE
- for i in range( main.numCtrls ):
- cliResult = cliResult and \
- main.CLIs[i].startOnosCli( main.ONOSip[ i ] )
- stepResult = cliResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully start ONOS cli",
- onfail="Failed to start ONOS cli" )
-
- def CASE9( self, main ):
- '''
- Report errors/warnings/exceptions
- '''
- main.log.info( "Error report: \n" )
- main.ONOSbench.logReport( globalONOSip[0],
- [ "INFO", "FOLLOWER", "WARN", "flow", "ERROR" , "Except" ],
- "s" )
- #main.ONOSbench.logReport( globalONOSip[1], [ "INFO" ], "d" )
-
- def CASE11( self, main ):
- """
- Start mininet
- """
- main.log.report( "Start Mininet topology" )
- main.log.case( "Start Mininet topology" )
-
- main.step( "Starting Mininet Topology" )
- topoResult = main.Mininet1.startNet( topoFile=topology )
- stepResult = topoResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully loaded topology",
- onfail="Failed to load topology" )
- # Exit if topology did not load properly
- if not topoResult:
- main.cleanup()
- main.exit()
-
- def CASE12( self, main ):
- """
- Assign mastership to controllers
- """
- import re
-
- main.case( "Assign switches to controllers" )
- main.step( "Assigning switches to controllers" )
- assignResult = main.TRUE
- switchList = []
-
- # Creates a list switch name, use getSwitch() function later...
- for i in range( 1, ( main.numSwitch + 1 ) ):
- switchList.append( 's' + str( i ) )
-
- assignResult = main.Mininet1.assignSwController( sw=switchList,
- ip=main.ONOSip,
- port=main.ONOSport )
- if not assignResult:
- main.cleanup()
- main.exit()
-
- for i in range( 1, ( main.numSwitch + 1 ) ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + main.ONOSip[ 0 ], response ):
- assignResult = assignResult and main.TRUE
- else:
- assignResult = main.FALSE
- stepResult = assignResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully assigned switches" +
- "to controller",
- onfail="Failed to assign switches to " +
- "controller" )
- def CASE13( self, main ):
- """
- Discover all hosts and store its data to a dictionary
- """
- main.case( "Discover all hosts" )
-
- stepResult = main.TRUE
- main.step( "Discover all hosts using pingall " )
- stepResult = main.wrapper.getHostsData( main )
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully discovered hosts",
- onfail="Failed to discover hosts" )
-
- def CASE14( self, main ):
- """
- Stop mininet
- """
- main.log.report( "Stop Mininet topology" )
- main.log.case( "Stop Mininet topology" )
-
- main.step( "Stopping Mininet Topology" )
- topoResult = main.Mininet1.stopNet( )
- stepResult = topoResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully stop mininet",
- onfail="Failed to stop mininet" )
- # Exit if topology did not load properly
- if not topoResult:
- main.cleanup()
- main.exit()
-
- def CASE1001( self, main ):
- """
- Add host intents between 2 host:
- - Discover hosts
- - Add host intents
- - Check intents
- - Verify flows
- - Ping hosts
- - Reroute
- - Link down
- - Verify flows
- - Check topology
- - Ping hosts
- - Link up
- - Verify flows
- - Check topology
- - Ping hosts
- - Remove intents
- """
- import time
- import json
- import re
-
- # Assert variables - These variable's name|format must be followed
- # if you want to use the wrapper function
- assert main, "There is no main"
- assert main.CLIs, "There is no main.CLIs"
- assert main.Mininet1, "Mininet handle should be named Mininet1"
- assert main.numSwitch, "Placed the total number of switch topology in \
- main.numSwitch"
-
- main.case( "Add host intents between 2 host" )
-
- stepResult = main.TRUE
- main.step( "IPV4: Add host intents between h1 and h9" )
- stepResult = main.wrapper.hostIntent( main,
- onosNode='0',
- name='IPV4',
- host1='h1',
- host2='h9',
- host1Id='00:00:00:00:00:01/-1',
- host2Id='00:00:00:00:00:09/-1',
- sw1='s5',
- sw2='s2',
- expectedLink=18 )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="IPV4: Add host intent successful",
- onfail="IPV4: Add host intent failed" )
-
- stepResult = main.TRUE
- main.step( "DUALSTACK1: Add host intents between h3 and h11" )
- stepResult = main.wrapper.hostIntent( main,
- name='DUALSTACK',
- host1='h3',
- host2='h11',
- host1Id='00:00:00:00:00:03/-1',
- host2Id='00:00:00:00:00:0B/-1',
- sw1='s5',
- sw2='s2',
- expectedLink=18 )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="DUALSTACK1: Add host intent" +
- " successful",
- onfail="DUALSTACK1: Add host intent failed" )
-
- stepResult = main.TRUE
- main.step( "DUALSTACK2: Add host intents between h1 and h11" )
- stepResult = main.wrapper.hostIntent( main,
- name='DUALSTACK2',
- host1='h1',
- host2='h11',
- sw1='s5',
- sw2='s2',
- expectedLink=18 )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="DUALSTACK2: Add host intent" +
- " successful",
- onfail="DUALSTACK2: Add host intent failed" )
-
- stepResult = main.TRUE
- main.step( "1HOP: Add host intents between h1 and h3" )
- stepResult = main.wrapper.hostIntent( main,
- name='1HOP',
- host1='h1',
- host2='h3' )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="1HOP: Add host intent" +
- " successful",
- onfail="1HOP: Add host intent failed" )
-
- stepResult = main.TRUE
- main.step( "VLAN1: Add vlan host intents between h4 and h12" )
- stepResult = main.wrapper.hostIntent( main,
- name='VLAN1',
- host1='h4',
- host2='h12',
- host1Id='00:00:00:00:00:04/100',
- host2Id='00:00:00:00:00:0C/100',
- sw1='s5',
- sw2='s2',
- expectedLink=18 )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="VLAN1: Add vlan host" +
- " intent successful",
- onfail="VLAN1: Add vlan host intent failed" )
-
- stepResult = main.TRUE
- main.step( "VLAN2: Add inter vlan host intents between h13 and h20" )
- stepResult = main.wrapper.hostIntent( main,
- name='VLAN2',
- host1='h13',
- host2='h20' )
-
- utilities.assert_equals( expect=main.FALSE,
- actual=stepResult,
- onpass="VLAN2: Add inter vlan host" +
- " intent successful",
- onfail="VLAN2: Add inter vlan host" +
- " intent failed" )
-
- def CASE1002( self, main ):
- """
- Add point intents between 2 hosts:
- - Get device ids | ports
- - Add point intents
- - Check intents
- - Verify flows
- - Ping hosts
- - Reroute
- - Link down
- - Verify flows
- - Check topology
- - Ping hosts
- - Link up
- - Verify flows
- - Check topology
- - Ping hosts
- - Remove intents
- """
- import time
- import json
- import re
-
- # Assert variables - These variable's name|format must be followed
- # if you want to use the wrapper function
- assert main, "There is no main"
- assert main.CLIs, "There is no main.CLIs"
- assert main.Mininet1, "Mininet handle should be named Mininet1"
- assert main.numSwitch, "Placed the total number of switch topology in \
- main.numSwitch"
-
- main.case( "Add point intents between 2 devices" )
-
- stepResult = main.TRUE
- # No option point intents
- main.step( "NOOPTION: Add point intents between h1 and h9" )
- stepResult = main.wrapper.pointIntent(
- main,
- name="NOOPTION",
- host1="h1",
- host2="h9",
- deviceId1="of:0000000000000005/1",
- deviceId2="of:0000000000000006/1",
- sw1="s5",
- sw2="s2",
- expectedLink=18 )
-
- stepResult = main.TRUE
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="NOOPTION: Add point intent successful",
- onfail="NOOPTION: Add point intent failed" )
-
- stepResult = main.TRUE
- stepResult = main.wrapper.pointIntent(
- main,
- name="IPV4",
- host1="h1",
- host2="h9",
- deviceId1="of:0000000000000005/1",
- deviceId2="of:0000000000000006/1",
- port1="",
- port2="",
- ethType="IPV4",
- mac1="00:00:00:00:00:01",
- mac2="00:00:00:00:00:09",
- bandwidth="",
- lambdaAlloc=False,
- ipProto="",
- ip1="",
- ip2="",
- tcp1="",
- tcp2="",
- sw1="s5",
- sw2="s2",
- expectedLink=18 )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="IPV4: Add point intent successful",
- onfail="IPV4: Add point intent failed" )
-
- stepResult = main.TRUE
- stepResult = main.wrapper.pointIntent(
- main,
- name="IPV4_2",
- host1="h1",
- host2="h9",
- deviceId1="of:0000000000000005/1",
- deviceId2="of:0000000000000006/1",
- ipProto=1,
- ip1="",
- ip2="",
- tcp1="",
- tcp2="",
- sw1="s5",
- sw2="s2",
- expectedLink=18 )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="IPV4_2: Add point intent successful",
- onfail="IPV4_2: Add point intent failed" )
-
- stepResult = main.TRUE
- main.step( "DUALSTACK1: Add point intents between h1 and h9" )
- stepResult = main.wrapper.pointIntent(
- main,
- name="DUALSTACK1",
- host1="h3",
- host2="h11",
- deviceId1="of:0000000000000005",
- deviceId2="of:0000000000000006",
- port1="3",
- port2="3",
- ethType="IPV4",
- mac1="00:00:00:00:00:03",
- mac2="00:00:00:00:00:0B",
- bandwidth="",
- lambdaAlloc=False,
- ipProto="",
- ip1="",
- ip2="",
- tcp1="",
- tcp2="",
- sw1="s5",
- sw2="s2",
- expectedLink=18 )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="DUALSTACK1: Add point intent" +
- " successful",
- onfail="DUALSTACK1: Add point intent failed" )
- stepResult = main.TRUE
- main.step( "VLAN: Add point intents between h5 and h21" )
- stepResult = main.wrapper.pointIntent(
- main,
- name="VLAN",
- host1="h5",
- host2="h21",
- deviceId1="of:0000000000000005/5",
- deviceId2="of:0000000000000007/5",
- port1="",
- port2="",
- ethType="IPV4",
- mac1="00:00:00:00:00:05",
- mac2="00:00:00:00:00:15",
- bandwidth="",
- lambdaAlloc=False,
- ipProto="",
- ip1="",
- ip2="",
- tcp1="",
- tcp2="",
- sw1="s5",
- sw2="s2",
- expectedLink=18 )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="VLAN: Add point intent successful",
- onfail="VLAN: Add point intent failed" )
-
- stepResult = main.TRUE
- main.step( "1HOP: Add point intents between h1 and h3" )
- stepResult = main.wrapper.hostIntent( main,
- name='1HOP',
- host1='h1',
- host2='h3' )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="1HOP: Add point intent" +
- " successful",
- onfail="1HOP: Add point intent failed" )
-
- def CASE1003( self, main ):
- """
- Add single point to multi point intents
- - Get device ids
- - Add single point to multi point intents
- - Check intents
- - Verify flows
- - Ping hosts
- - Reroute
- - Link down
- - Verify flows
- - Check topology
- - Ping hosts
- - Link up
- - Verify flows
- - Check topology
- - Ping hosts
- - Remove intents
- """
- assert main, "There is no main"
- assert main.CLIs, "There is no main.CLIs"
- assert main.Mininet1, "Mininet handle should be named Mininet1"
- assert main.numSwitch, "Placed the total number of switch topology in \
- main.numSwitch"
-
- main.case( "Add single point to multi point intents between devices" )
-
- stepResult = main.TRUE
- hostNames = [ 'h8', 'h16', 'h24' ]
- devices = [ 'of:0000000000000005/8', 'of:0000000000000006/8', \
- 'of:0000000000000007/8' ]
- macs = [ '00:00:00:00:00:08', '00:00:00:00:00:10', '00:00:00:00:00:18' ]
-
- main.step( "NOOPTION: Add single point to multi point intents" )
- stepResult = main.wrapper.singleToMultiIntent(
- main,
- name="NOOPTION",
- hostNames=hostNames,
- devices=devices,
- sw1="s5",
- sw2="s2",
- expectedLink=18 )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="NOOPTION: Successfully added single "
- + " point to multi point intents",
- onfail="NOOPTION: Failed to add single point" +
- " to multi point intents" )
-
- stepResult = main.TRUE
- main.step( "IPV4: Add single point to multi point intents" )
- stepResult = main.wrapper.singleToMultiIntent(
- main,
- name="IPV4",
- hostNames=hostNames,
- devices=devices,
- ports=None,
- ethType="IPV4",
- macs=macs,
- bandwidth="",
- lambdaAlloc=False,
- ipProto="",
- ipAddresses="",
- tcp="",
- sw1="s5",
- sw2="s2",
- expectedLink=18 )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="IPV4: Successfully added single point"
- + " to multi point intents",
- onfail="IPV4: Failed to add single point" +
- " to multi point intents" )
-
- stepResult = main.TRUE
- main.step( "IPV4_2: Add single point to multi point intents" )
- hostNames = [ 'h8', 'h16', 'h24' ]
- stepResult = main.wrapper.singleToMultiIntent(
- main,
- name="IPV4",
- hostNames=hostNames,
- ethType="IPV4",
- lambdaAlloc=False )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="IPV4_2: Successfully added single "
- + " point to multi point intents",
- onfail="IPV4_2: Failed to add single point" +
- " to multi point intents" )
- stepResult = main.TRUE
- main.step( "VLAN: Add single point to multi point intents" )
- hostNames = [ 'h4', 'h12', 'h20' ]
- devices = [ 'of:0000000000000005/4', 'of:0000000000000006/4', \
- 'of:0000000000000007/4' ]
- macs = [ '00:00:00:00:00:04', '00:00:00:00:00:0C', '00:00:00:00:00:14' ]
- stepResult = main.wrapper.singleToMultiIntent(
- main,
- name="VLAN",
- hostNames=hostNames,
- devices=devices,
- ports=None,
- ethType="IPV4",
- macs=macs,
- bandwidth="",
- lambdaAlloc=False,
- ipProto="",
- ipAddresses="",
- tcp="",
- sw1="s5",
- sw2="s2",
- expectedLink=18 )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="VLAN: Successfully added single point"
- + " to multi point intents",
- onfail="VLAN: Failed to add single point" +
- " to multi point intents" )
-
- def CASE1004( self, main ):
- """
- Add multi point to single point intents
- - Get device ids
- - Add multi point to single point intents
- - Check intents
- - Verify flows
- - Ping hosts
- - Reroute
- - Link down
- - Verify flows
- - Check topology
- - Ping hosts
- - Link up
- - Verify flows
- - Check topology
- - Ping hosts
- - Remove intents
- """
- assert main, "There is no main"
- assert main.CLIs, "There is no main.CLIs"
- assert main.Mininet1, "Mininet handle should be named Mininet1"
- assert main.numSwitch, "Placed the total number of switch topology in \
- main.numSwitch"
-
- main.case( "Add multi point to single point intents between devices" )
-
- stepResult = main.TRUE
- hostNames = [ 'h8', 'h16', 'h24' ]
- devices = [ 'of:0000000000000005/8', 'of:0000000000000006/8', \
- 'of:0000000000000007/8' ]
- macs = [ '00:00:00:00:00:08', '00:00:00:00:00:10', '00:00:00:00:00:18' ]
-
- main.step( "NOOPTION: Add multi point to single point intents" )
- stepResult = main.wrapper.multiToSingleIntent(
- main,
- name="NOOPTION",
- hostNames=hostNames,
- devices=devices,
- sw1="s5",
- sw2="s2",
- expectedLink=18 )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="NOOPTION: Successfully added multi "
- + " point to single point intents",
- onfail="NOOPTION: Failed to add multi point" +
- " to single point intents" )
-
- stepResult = main.TRUE
- main.step( "IPV4: Add multi point to single point intents" )
- stepResult = main.wrapper.multiToSingleIntent(
- main,
- name="IPV4",
- hostNames=hostNames,
- devices=devices,
- ports=None,
- ethType="IPV4",
- macs=macs,
- bandwidth="",
- lambdaAlloc=False,
- ipProto="",
- ipAddresses="",
- tcp="",
- sw1="s5",
- sw2="s2",
- expectedLink=18 )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="IPV4: Successfully added multi point"
- + " to single point intents",
- onfail="IPV4: Failed to add multi point" +
- " to single point intents" )
-
- stepResult = main.TRUE
- main.step( "IPV4_2: Add multi point to single point intents" )
- hostNames = [ 'h8', 'h16', 'h24' ]
- stepResult = main.wrapper.multiToSingleIntent(
- main,
- name="IPV4",
- hostNames=hostNames,
- ethType="IPV4",
- lambdaAlloc=False )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="IPV4_2: Successfully added multi point"
- + " to single point intents",
- onfail="IPV4_2: Failed to add multi point" +
- " to single point intents" )
-
- stepResult = main.TRUE
- main.step( "VLAN: Add multi point to single point intents" )
- hostNames = [ 'h5', 'h13', 'h21' ]
- devices = [ 'of:0000000000000005/5', 'of:0000000000000006/5', \
- 'of:0000000000000007/5' ]
- macs = [ '00:00:00:00:00:05', '00:00:00:00:00:0D', '00:00:00:00:00:15' ]
- stepResult = main.wrapper.multiToSingleIntent(
- main,
- name="VLAN",
- hostNames=hostNames,
- devices=devices,
- ports=None,
- ethType="IPV4",
- macs=macs,
- bandwidth="",
- lambdaAlloc=False,
- ipProto="",
- ipAddresses="",
- tcp="",
- sw1="s5",
- sw2="s2",
- expectedLink=18 )
-
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="VLAN: Successfully added multi point"
- + " to single point intents",
- onfail="VLAN: Failed to add multi point" +
- " to single point intents" )
diff --git a/TestON/tests/FuncIntent/FuncIntent.topo b/TestON/tests/FuncIntent/FuncIntent.topo
deleted file mode 100755
index e6613de..0000000
--- a/TestON/tests/FuncIntent/FuncIntent.topo
+++ /dev/null
@@ -1,52 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS>
- <home>~/ONOS</home>
- </COMPONENTS>
- </ONOSbench>
-
- <ONOScli1>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli1>
-
- <ONOScli2>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli2>
-
- <ONOScli3>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli3>
-
- <Mininet1>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </Mininet1>
-
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/FuncIntent/__init__.py b/TestON/tests/FuncIntent/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/FuncIntent/__init__.py
+++ /dev/null
diff --git a/TestON/tests/FuncPlatform/Dependency/App.py b/TestON/tests/FuncPlatform/Dependency/App.py
deleted file mode 100644
index 5410c32..0000000
--- a/TestON/tests/FuncPlatform/Dependency/App.py
+++ /dev/null
@@ -1,68 +0,0 @@
-"""
-Methods related to application interaction
-
-"""
-
-
-def __init__( self ):
- self.ip = '127.0.0.1'
-
-def activate( apps, nodeToActivateFrom=0 ):
- """
- Activate specified applications from node specified
-
- Ex) apps = ['metrics', 'fwd']
- nodeToActivateFrom = range( 0, nodes )
- """
- if isinstance( apps, ( int, basestring ) ):
- main.log.error( 'Please pass in a list of strings for args' )
- return main.FALSE
-
- if not isinstance( nodeToActivateFrom, ( int ) ) or \
- nodeToActivateFrom < 0:
- main.log.error( 'Incorrect node specified' )
- return main.FALSE
-
- # TODO: Start log capture and listen for exceptions
- # and errors. Also investigate possible keywords
- # to listen for when activating applications
-
-
- for app in apps:
- # Check if app str in appList is in the main scope
- # definition main.appList
- if app not in main.appList:
- main.log.error( 'Invalid app name given' )
- return main.FALSE
-
- try:
- # NOTE: assumes node 1 is always activating application
- appOutput = main.CLIs[nodeToActivateFrom].activateApp(
- main.appList[app] )
- except KeyError:
- main.log.error( 'There was an error with the key '+
- str(app) + '. Check the appList dictionary' )
- return main.FALSE
- except Exception:
- main.log.error( 'Uncaught exception error while ' +
- 'activating applications: ' + str(app) )
- return main.FALSE
-
- return main.TRUE
-
-def deactivate( apps, nodeToDeactivateFrom=0 ):
- """
- Deactivate specified applications from node specified
-
- """
- main.log.report( 'deactivate implment me' )
-
-def isAppInstallSuccess():
- """
- Check the app list across clusters to determine
- that apps have been installed successfully
-
- """
-
- main.log.report( 'isAppInstallSuccess implement me' )
-
diff --git a/TestON/tests/FuncPlatform/Dependency/Logger.py b/TestON/tests/FuncPlatform/Dependency/Logger.py
deleted file mode 100644
index 22d3f61..0000000
--- a/TestON/tests/FuncPlatform/Dependency/Logger.py
+++ /dev/null
@@ -1,57 +0,0 @@
-
-def __init__( self ):
- self.ip = '127.0.0.1'
-
-def checkOnosLog( nodeIp, option='',
- outputType=0):
- """
- Listens to the log for any Errors and Exceptions.
-
- Runs 'onos-check-logs <option>'
- This script only returns if there are any errors
- or exceptions
-
- outputType
- 0: Return output of log
- 1: Return (#Errors, #Exceptions, #Warn)
-
- """
- if not isinstance( option, basestring ):
- main.log.error( 'Incorrect grep format specified' )
- return main.FALSE
-
- try:
- main.log.info( 'Starting Onos-log listening for '+
- str(option) )
- cmd = 'onos-check-logs ' + str(nodeIp) + ' old'
- if outputType == 0:
- main.ONOSbench.handle.sendline( cmd )
- main.ONOSbench.handle.expect( cmd )
- main.ONOSbench.handle.expect('\$')
- logResult = main.ONOSbench.handle.before
- return logResult
- elif outputType == 1:
- # Important in assertion criteria
- # to determine how much warn / error is
- # acceptable
- return 'Implement option 1'
- else:
- main.log.error( 'Incorrect outputType specified' )
- return main.FALSE
-
- except Exception:
- main.log.exception( self.name + ': Uncaught exception' )
- main.cleanup()
- main.exit()
-
-def setLogLevel( level ):
- """
- Set the log level of onos
- """
- main.log.info( 'setLogLevel implement me' )
-
-def getLogReport( nodeIp, searchTerms ):
- """
- Refer to CLI driver for 'logReport'
- """
- main.log.info( 'getLogReport - implement me!' )
diff --git a/TestON/tests/FuncPlatform/Dependency/Shutdown.py b/TestON/tests/FuncPlatform/Dependency/Shutdown.py
deleted file mode 100644
index ba77bbd..0000000
--- a/TestON/tests/FuncPlatform/Dependency/Shutdown.py
+++ /dev/null
@@ -1,19 +0,0 @@
-
-def __init__( self ):
- self.ip = '127.0.0.1'
-
-def killOnosNodes( nodeIps ):
- """
- Kill all components of Onos on
- given list of ips
-
- Ex) nodeIps = ['10.0.0.1', '10.0.0.2']
- """
- killResult = main.TRUE
-
- for node in nodeIps:
- killResult = killResult and main.ONOSbench.onosDie( node )
- if killResult == main.TRUE:
- main.log.info( str(node) + ' was killed' )
-
- return killResult
diff --git a/TestON/tests/FuncPlatform/Dependency/Startup.py b/TestON/tests/FuncPlatform/Dependency/Startup.py
deleted file mode 100644
index f3f90a9..0000000
--- a/TestON/tests/FuncPlatform/Dependency/Startup.py
+++ /dev/null
@@ -1,219 +0,0 @@
-
-"""
-Startup related methods for ONOS
-
-Guidelines:
- * Group sequential functionalities together
- * Methods should not be dependent on platform
- * Return main.TRUE on success or comprehensive error message
- on failure (TBD)
- * All methods should be consistent in expected behavior
-"""
-import time
-import json
-
-def __init__( self ):
- self.ip = '127.0.0.1'
-
-def gitPullAndMci( branchName, commitLog=False ):
- """
- Pull from branch repository specified and compile changes
- If commitLog is True, report commit information
-
- Any errors / warnings will be handled by respective
- driver function calls
- """
- co = main.ONOSbench.gitCheckout( branchName )
- gp = main.ONOSbench.gitPull()
- ci = main.ONOSbench.cleanInstall()
-
- if co and gp and ci == main.TRUE:
- if commitLog:
- main.log.report( 'Commit information - ' )
- main.ONOSbench.getVersion(report=True)
-
- return main.TRUE
-
- else:
- # TODO: Comprehensive error message
- return 'git pull and mci failed'
-
-def initOnosStartupSequence( cellName, appStr, benchIp, mnIp, onosIps ):
- """
- Startup sequence includes the following:
- * Create cell file
- * Set cell variables on ONOS bench
- * Verify cell
- * Create ONOS package
- * Force install ONOS package
- * Start ONOS service
- * Start ONOS cli
-
- Also verifies that Onos is up and running by
- 'isup' driver function which executs
- 'onos-wait-for-start'
- """
-
- # NOTE: leave out create cell file until bug addressed
- #cf = main.ONOSbench.createCellFile( benchIp, cellName, mnIp,
- # str(appStr), *onosIps )
- numNodes = len(onosIps)
-
- sc = main.ONOSbench.setCell( cellName )
- vc = main.ONOSbench.verifyCell()
- op = main.ONOSbench.onosPackage()
- for addr in onosIps:
- oi = main.ONOSbench.onosInstall( node = addr )
-
- time.sleep( 5 )
-
- iu = main.TRUE
- for node in onosIps:
- iu = iu and main.ONOSbench.isup( node )
-
- cli = main.TRUE
- for node in range( 0, numNodes ):
- cli = cli and main.CLIs[node].startOnosCli( onosIps[node] )
-
- # Check if all nodes are discovered correctly using
- # 'nodes' command in Onos Cli
- na = main.TRUE
- try:
- nodeCmdJson = json.loads( main.CLIs[0].nodes() )
- for node in nodeCmdJson:
- if node['state'] != 'ACTIVE':
- main.log.warn( str( node['id'] ) +
- ' Node is not in ACTIVE state.' )
- na = main.FALSE
- if na != main.FALSE:
- main.log.info( 'All nodes discovered successfully' )
- except Exception:
- main.log.error( 'nodes command did not execute properly' )
- return main.FALSE
-
- if sc and vc and op and oi and iu and cli and na == main.TRUE:
- return main.TRUE
- else:
- return main.FALSE
-
-def installOnosFromTar( wgetAddr, nodeIps ):
- """
- Install Onos directly from tar.gz file.
- Due to the nature of the specific steps required
- to startup Onos in this fashion, all commands
- required to start Onos from tar.gz will be
- grouped in this method.
-
- 1) wget latest onos tar.gz on onos node
- 2) untar package
- 3) specify onos-config cluster
- 4) start onos via onos-service
- 5) form onos cluster using onos-form-cluster
- 6) check for successful startup
-
- Specify the download link for the tar.gz.
- Provide a list of nodeIps
-
- Ex) wgetAddr = 'https://mytargzdownload.com/file.tar.gz'
- nodeIps = ['10.0.0.1', '10.0.0.2']
- """
- if isinstance( nodeIps, ( int, basestring ) ):
- main.log.error( 'Please pass in a list of string nodes' )
- return main.FALSE
-
- # Obtain filename from provided address
- # assumes that filename is separated by '/' character
- f_name = ''
- addr = str( wgetAddr ).split('/')
- for phrase in addr:
- if 'tar.gz' in phrase:
- f_name = str( phrase )
- main.log.info( 'Using ' + f_name + ' as file' )
-
- clusterCount = len( nodeIps )
-
- main.log.info( 'Initiating Onos installation sequence ' +
- 'using tar.gz ... This may take a few minutes' )
-
- for node in range( 0, clusterCount ):
- # Use the wgetAddr to download a new tar.gz from server
- try:
- main.ONOSnode[node].handle.sendline( 'wget ' + wgetAddr )
- main.ONOSnode[node].handle.expect( 'saved' )
- main.ONOSnode[node].handle.expect( '\$' )
- main.log.info( 'Successfully downloaded tar.gz ' +
- 'on node: ' + str( main.ONOSips[node] ) )
- except Exception:
- # NOTE: Additional exception may be appropriate
- main.log.error( 'Uncaught exception while ' +
- 'downloading Onos tar.gz: ' +
- main.ONOSnode[node].handle.before )
- return main.FALSE
-
- for node in range( 0, clusterCount ):
- # Untar files on all nodes, then enter the
- # newly created directory
- try:
- main.ONOSnode[node].handle.sendline( 'tar zxvf ' + f_name )
- # Verbose output of tar will contain some onos returns
- main.ONOSnode[node].handle.expect( 'onos' )
- main.ONOSnode[node].handle.expect( '\$' )
- # NOTE: Making an assumption here:
- # the directory created by tar file has a name that
- # starts with 'onos-' followed by version number
- # '1.2.0'. If this is NOT true, this method must
- # be changed to enter the correct directory.
- # The directory name is currently dynamic
- # and depends on the day at which you downloaded
- # the tar file
- # Enter onos- wildcard to disregard its version / date
- # suffix
- main.ONOSnode[node].handle.sendline( 'cd onos-*' )
- main.ONOSnode[node].handle.expect( '\$' )
-
- main.ONOSnode[node].handle.sendline( 'pwd' )
- main.ONOSnode[node].handle.expect( 'pwd' )
- main.ONOSnode[node].handle.expect( '\$' )
- pwd = main.ONOSnode[node].handle.before
- if 'onos' in str(pwd):
- main.log.info( 'tar zxvf ' + f_name + ' successful ' +
- 'on node ' + str( main.ONOSips[node] ) )
-
- except Exception:
- main.log.error( 'Uncaught exception while executing ' +
- 'tar zxvf of ' + f_name + ': ' +
- main.ONOSnode[node].handle.before +
- main.ONOSnode[node].handle.after)
- return main.FALSE
-
- for node in range( 0, clusterCount ):
- try:
- main.ONOSnode[node].handle.sendline( 'bin/onos-service '+
- 'server &' )
- # Send some extra characters to run the process
- main.ONOSnode[node].handle.sendline( '' )
- main.ONOSnode[node].handle.sendline( '' )
- main.ONOSnode[node].handle.expect( '\$' )
- except Exception:
- main.log.error( 'Uncaught exception while executing ' +
- 'onos-service server command ' +
- str( main.ONOSnode[node].handle.before ) )
- return main.FALSE
-
- iu = main.TRUE
- for node in nodeIps:
- iu = iu and main.ONOSbench.isup( node )
-
- if iu == main.TRUE:
- return main.TRUE
- else:
- return main.FALSE
-
-def addAndStartOnosNode( nodeIps ):
- """
- A scale-out scenario that adds specified list of
- nodes and starts those instances.
-
- Ex) nodeIps = ['10.0.0.2', '10.0.0.3', 10.0.0.4']
- """
- main.log.info( 'addAndStartOnosNode implement me!' )
diff --git a/TestON/tests/FuncPlatform/FuncPlatform.params b/TestON/tests/FuncPlatform/FuncPlatform.params
deleted file mode 100644
index 3895660..0000000
--- a/TestON/tests/FuncPlatform/FuncPlatform.params
+++ /dev/null
@@ -1,63 +0,0 @@
-<PARAMS>
- <testcases>1,2,3,4</testcases>
- <DEP>
- <startupSrc>
- /home/admin/ONLabTest/TestON/tests/FuncPlatform/Dependency/Startup.py
- </startupSrc>
- <startupClassName>
- Startup
- </startupClassName>
-
- <appSrc>
- /home/admin/ONLabTest/TestON/tests/FuncPlatform/Dependency/App.py
- </appSrc>
- <appClassName>
- App
- </appClassName>
-
- <logSrc>
- /home/admin/ONLabTest/TestON/tests/FuncPlatform/Dependency/Logger.py
- </logSrc>
- <logClassName>
- Log
- </logClassName>
-
- <shutdownSrc>
- /home/admin/ONLabTest/TestON/tests/FuncPlatform/Dependency/Shutdown.py
- </shutdownSrc>
- <shutdownClassName>
- Shutdown
- </shutdownClassName>
-
- <targz>
- http://downloads.onosproject.org/nightly/onos-1.2.0.latest-NIGHTLY.tar.gz
- </targz>
- </DEP>
-
- <CTRL>
- <num>3</num>
- <port>6633</port>
- <ip1>10.128.174.1</ip1>
- <ip2>10.128.174.2</ip2>
- <ip3>10.128.174.3</ip3>
- </CTRL>
-
- <MN>
- <ip>10.128.10.90</ip>
- </MN>
-
- <BENCH>
- <ip>10.128.174.10</ip>
- </BENCH>
-
- <CELL>
- <name>func_plat</name>
- <appStr>"drivers,openflow"</appStr>
- </CELL>
-
- <GIT>
- <branchName>master</branchName>
- <pull>off</pull>
- </GIT>
-
-</PARAMS>
diff --git a/TestON/tests/FuncPlatform/FuncPlatform.py b/TestON/tests/FuncPlatform/FuncPlatform.py
deleted file mode 100644
index 60b1aa0..0000000
--- a/TestON/tests/FuncPlatform/FuncPlatform.py
+++ /dev/null
@@ -1,194 +0,0 @@
-"""
-FuncPlatform
-
-A functional test designed to test the environment and
-gather information on startup -> shutdown related issues.
-
-Future works may also include security mode startup /
-shutdown check and cfg get and set.
-
-Abstracting the collection of commands that go hand in hand
-should allow easy rearrangement of steps to replicate or
-create scenarios.
-For example:
- CASE N - Represents a particular scenario
- Steps - Represents abstraction methods called from
- dependency
- 1. Bring ONOS 1 up
- 2. Activate application X
- 3. Activate application Y
- 4. Deactivate application X
-
-The ideal platform test script should have incredible
-robustness to possible exceptions and report the most
-useful error messages.
-
-contributers to contact for help:
-andrew@onlab.us
-"""
-
-class FuncPlatform:
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- """
- Main scope initialization case
- Must include to run any other test cases
- """
- import imp
-
- # NOTE: Hardcoded application name subject to change
- # closely monitor and make changes when necessary
- # (or implement ways to dynamically get names)
- main.appList = {
- 'bgprouter' : 'org.onosproject.bgprouter',
- 'config' : 'org.onosproject.config',
- 'cordfabric' : 'org.onosproject.cordfabric',
- 'demo' : 'org.onosproject.demo',
- 'distributedprimitives' : 'org.onosproject.distributedprimitives',
- 'election' : 'org.onosproject.election',
- 'flowrule' : 'org.onosproject.flowrule',
- 'fwd' : 'org.onosproject.fwd',
- 'intentperf' : 'org.onosproject.intentperf',
- 'messagingperf' : 'org.onosproject.messagingperf',
- 'metrics' : 'org.onosproject.metrics',
- 'mobility' : 'org.onosproject.mobility',
- 'netconf' : 'org.onosproject.netconf',
- 'null' : 'org.onosproject.null',
- 'optical' : 'org.onosproject.optical',
- 'pcep' : 'org.onosproject.pcep',
- 'proxyarp' : 'org.onosproject.proxyarp',
- 'reactive.routing' : 'org.onosproject.reactive.routing',
- 'sdnip' : 'org.onosproject.sdnip',
- 'segmentrouting' : 'org.onosproject.segmentrouting',
- 'tunnel' : 'org.onosproject.tunnel',
- 'virtualbng' : 'org.onosproject.virtualbng',
- 'xosintegration' : 'org.onosproject.xosintegration'
- }
- # List of ONOS ip's specififed in params
- main.ONOSips = []
- main.CLIs = []
- main.ONOSnode = []
-
- for node in range( 0, int(main.params['CTRL']['num']) ):
- main.ONOSips.append( main.params['CTRL']['ip'+str(node+1)] )
- main.CLIs.append(
- getattr( main, 'ONOS' + str(node+1) + 'cli' ) )
- main.ONOSnode.append(
- getattr( main, 'ONOS' + str(node+1) ) )
-
- # Application source and name definitions
- startupSrc = main.params['DEP']['startupSrc']
- startupClassName = main.params['DEP']['startupClassName']
-
- appClassName = main.params['DEP']['appClassName']
- appSrc = main.params['DEP']['appSrc']
-
- logClassName = main.params['DEP']['logClassName']
- logSrc = main.params['DEP']['logSrc']
-
- shutdownClassName = main.params['DEP']['shutdownClassName']
- shutdownSrc = main.params['DEP']['shutdownSrc']
-
- # Importing dependency class(es)
- # Refer to source files in Dependency folder to
- # make changes to its respective methods
- # Be weary of naming collisions
- try:
- main.startup = imp.load_source( startupClassName, startupSrc )
- main.app = imp.load_source( appClassName, appSrc )
- main.onosLog = imp.load_source( logClassName, logSrc )
- main.shutdown = imp.load_source( shutdownClassName, shutdownSrc )
- except ImportError:
- main.log.error( 'Error importing class file(s). Please ' +
- 'check file location' )
- main.cleanup()
- main.exit()
-
- def CASE2( self, main ):
- import time
-
- cellName = main.params['CELL']['name']
- appStr = main.params['CELL']['appStr']
- benchIp = main.params['BENCH']['ip']
- branchName = main.params['GIT']['branchName']
- gitPull = main.params['GIT']['pull']
- mnIp = main.params['MN']['ip']
-
- main.case( 'Setup environment and install ONOS' )
- if gitPull == 'on':
- main.step( 'Git pull and clean install' )
- gitPullResult = main.startup.gitPullAndMci( branchName )
- utilities.assert_equals( expect=main.TRUE,
- actual=gitPullResult,
- onpass='Git pull and install successful',
- onfail='Git pull and install failed: ' +
- str(gitPullResult) )
-
- main.step( 'Initiate ONOS startup sequence' )
- startupResult = main.startup.initOnosStartupSequence(
- cellName, appStr, benchIp, mnIp, main.ONOSips )
- utilities.assert_equals( expect=main.TRUE,
- actual=startupResult,
- onpass='ONOS startup sequence successful',
- onfail='ONOS startup sequence failed: ' +
- str(startupResult) )
-
- def CASE3( self, main ):
- import time
-
- main.case( 'Activate applications and check installation' )
-
- # NOTE: Test only
- # Unceremoniously kill onos 2
- main.ONOSbench.onosDie( '10.128.174.2' )
-
- time.sleep( 30 )
-
- main.step( 'Sample Onos log check' )
- logResult = main.onosLog.checkOnosLog( main.ONOSips[0] )
- main.log.info( logResult )
- # TODO: Define pass criteria
- utilities.assert_equals( expect=main.TRUE,
- actual=main.TRUE,
- onpass= 'Logging successful',
- onfail= 'Logging failed ' )
-
- # Sample app activation
- main.step( 'Activating applications metrics and fwd' )
- appList = ['metrics', 'fwd']
- appResult = main.app.activate( appList )
- utilities.assert_equals( expect=main.TRUE,
- actual=appResult,
- onpass= 'App activation of ' + str(appList) + ' successful',
- onfail= 'App activation failed ' + str(appResult) )
-
- def CASE4( self, main ):
- """
- Download ONOS tar.gz built from latest nightly
- (following tutorial on wiki) and run ONOS directly on the
- instance
- """
- import imp
-
- targz = main.params['DEP']['targz']
- clusterCount = main.params['CTRL']['num']
-
- main.case( 'Install ONOS from onos.tar.gz file' )
-
- main.step( 'Killing all ONOS instances previous started' )
- killResult = main.shutdown.killOnosNodes( main.ONOSips )
- utilities.assert_equals( expect=main.TRUE,
- actual = killResult,
- onpass = 'All Onos nodes successfully killed',
- onfail = 'Onos nodes were not successfully killed' )
-
- main.step( 'Starting ONOS using tar.gz on all nodes' )
- installResult = main.startup.installOnosFromTar( targz, main.ONOSips )
- utilities.assert_equals( expect=main.TRUE,
- actual = installResult,
- onpass= 'Onos tar.gz installation successful',
- onfail= 'Onos tar.gz installation failed' )
-
-
diff --git a/TestON/tests/FuncPlatform/FuncPlatform.topo b/TestON/tests/FuncPlatform/FuncPlatform.topo
deleted file mode 100644
index f19e8f8..0000000
--- a/TestON/tests/FuncPlatform/FuncPlatform.topo
+++ /dev/null
@@ -1,82 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.128.174.10</host>
- <user>admin</user>
- <password></password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOS1>
- <host>10.128.174.1</host>
- <user>admin</user>
- <password></password>
- <type>OnosDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.128.174.2</host>
- <user>admin</user>
- <password></password>
- <type>OnosDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.128.174.3</host>
- <user>admin</user>
- <password></password>
- <type>OnosDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
- <ONOS1cli>
- <host>10.128.174.10</host>
- <user>admin</user>
- <password></password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1cli>
-
- <ONOS2cli>
- <host>10.128.174.10</host>
- <user>admin</user>
- <password></password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2cli>
-
- <ONOS3cli>
- <host>10.128.174.10</host>
- <user>admin</user>
- <password></password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3cli>
-
- <MininetOvs>
- <host>10.128.10.90</host>
- <user>admin</user>
- <password></password>
- <type>MininetCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS>
- <arg1> --custom topo-perf-2sw.py </arg1>
- <arg2> --arp --mac --topo mytopo </arg2>
- <arg3> </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </MininetOvs>
-
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/FuncTopo/Dependency/FuncTopoFunction.py b/TestON/tests/FuncTopo/Dependency/FuncTopoFunction.py
deleted file mode 100644
index 41b3258..0000000
--- a/TestON/tests/FuncTopo/Dependency/FuncTopoFunction.py
+++ /dev/null
@@ -1,344 +0,0 @@
-"""
- Wrapper function for FuncTopo
- Includes onosclidriver and mininetclidriver functions
-"""
-import time
-import json
-import re
-
-def __init__( self ):
- self.default = ''
-
-def testTopology( main, topoFile='', args='', mnCmd='', clean=True ):
- """
- Description:
- This function combines different wrapper functions in this module
- to simulate a topology test
- Test Steps:
- - Load topology
- - Discover topology
- - Compare topology
- - pingall
- - Bring links down
- - Compare topology
- - pingall
- - Bring links up
- - Compare topology
- - pingall
- Options:
- clean: Does sudo mn -c to clean mininet residue
- Please read mininetclidriver.py >> startNet( .. ) function for details
- Returns:
- Returns main.TRUE if the test is successful, main.FALSE otherwise
- """
- testTopoResult = main.TRUE
- compareTopoResult = main.TRUE
- topoObjectResult = main.TRUE
- stopResult = main.TRUE
-
- if clean:
- # Cleans minient
- stopResult = stopMininet( main )
-
- # Restart ONOS to clear hosts test new mininet topology
- restartONOSResult = restartONOS( main )
-
- # Starts topology
- startResult = startNewTopology( main, topoFile, args, mnCmd )
-
- # Gets list of switches in mininet
- assignSwitch( main )
-
- # This function activates fwd app then does pingall as well as store
- # hosts data in a variable main.hostsData
- getHostsResult = getHostsData( main )
-
- # Create topology object using sts
- topoObjectResult = createTopoObject( main )
-
- # Compare Topology
- compareTopoResult = compareTopo( main )
-
- testTopoResult = startResult and topoObjectResult and \
- compareTopoResult and getHostsResult
-
-
- return testTopoResult
-
-def startNewTopology( main, topoFile='', args='', mnCmd='' ):
- """
- Description:
- This wrapper function starts new topology
- Options:
- Please read mininetclidriver.py >> startNet( .. ) function for details
- Return:
- Returns main.TRUE if topology is successfully created by mininet,
- main.FALSE otherwise
- NOTE:
- Assumes Mininet1 is the name of the handler
- """
- assert main, "There is no main variable"
- assert main.Mininet1, "Mininet 1 is not created"
- result = main.TRUE
-
- main.log.info( main.topoName + ": Starting new Mininet topology" )
-
- # log which method is being used
- if topoFile:
- main.log.info( main.topoName + ": Starting topology with " +
- topoFile + "topology file" )
- elif not topoFile and not mnCmd:
- main.log.info( main.topoName + ": Starting topology using" +
- " the topo file" )
- elif topoFile and mnCmd:
- main.log.error( main.topoName + ": You can only use one " +
- "method to start a topology" )
- elif mnCmd:
- main.log.info( main.topoName + ": Starting topology with '" +
- mnCmd + "' Mininet command" )
-
-
- result = main.Mininet1.startNet( topoFile=topoFile,
- args=args,
- mnCmd=mnCmd )
-
- return result
-
-def stopMininet( main ):
- """
- Stops current topology and execute mn -c basically triggers
- stopNet in mininetclidrivers
-
- NOTE: Mininet should be running when issuing this command other wise
- the this function will cause the test to stop
- """
- stopResult = main.TRUE
- stopResult = main.Mininet1.stopNet()
- time.sleep( 30 )
- if not stopResult:
- main.log.info( main.topoName + ": Did not stop Mininet topology" )
- return stopResult
-
-def createTopoObject( main ):
- """
- Creates topology object using sts module
- """
- from sts.topology.teston_topology import TestONTopology
- global MNTopo
- try:
- ctrls = []
- main.log.info( main.topoName + ": Creating topology object" +
- " from mininet" )
- for node in main.nodes:
- temp = ( node, node.name, node.ip_address, 6633 )
- ctrls.append( temp )
- MNTopo = TestONTopology( main.Mininet1, ctrls )
- except Exception:
- objResult = main.FALSE
- else:
- objResult = main.TRUE
-
- return objResult
-
-def compareTopo( main ):
- """
- Compare topology( devices, links, ports, hosts ) between ONOS and
- mininet using sts
- """
- assert MNTopo, "There is no MNTopo object"
- devices = []
- links = []
- ports = []
- hosts = []
- switchResult = []
- linksResult = []
- portsResult = []
- hostsResult = []
- compareTopoResult = main.TRUE
-
- for i in range( main.numCtrls ):
- devices.append( json.loads( main.CLIs[ i ].devices() ) )
- links.append( json.loads( main.CLIs[ i ].links() ) )
- ports.append( json.loads( main.CLIs[ i ].ports() ) )
- hosts.append( json.loads( main.CLIs[ i ].hosts() ) )
-
- # Comparing switches
- main.log.info( main.topoName + ": Comparing switches in each ONOS nodes" +
- " with Mininet" )
- for i in range( main.numCtrls ):
- tempResult = main.Mininet1.compareSwitches( MNTopo, devices[ i ] )
- switchResult.append( tempResult )
- if tempResult == main.FALSE:
- main.log.error( main.topoName + ": ONOS-" + str( i + 1 ) +
- " switch view is incorrect " )
-
- if all( result == main.TRUE for result in switchResult ):
- main.log.info( main.topoName + ": Switch view in all ONOS nodes "+
- "are correct " )
- else:
- compareTopoResult = main.FALSE
-
- # Comparing ports
- main.log.info( main.topoName + ": Comparing ports in each ONOS nodes" +
- " with Mininet" )
- for i in range( main.numCtrls ):
- tempResult = main.Mininet1.comparePorts( MNTopo, ports[ i ] )
- portsResult.append( tempResult )
- if tempResult == main.FALSE:
- main.log.error( main.topoName + ": ONOS-" + str( i + 1 ) +
- " ports view are incorrect " )
-
- if all( result == main.TRUE for result in portsResult ):
- main.log.info( main.topoName + ": Ports view in all ONOS nodes "+
- "are correct " )
- else:
- compareTopoResult = main.FALSE
-
- # Comparing links
- main.log.info( main.topoName + ": Comparing links in each ONOS nodes" +
- " with Mininet" )
- for i in range( main.numCtrls ):
- tempResult = main.Mininet1.compareLinks( MNTopo, links[ i ] )
- linksResult.append( tempResult )
- if tempResult == main.FALSE:
- main.log.error( main.topoName + ": ONOS-" + str( i + 1 ) +
- " links view are incorrect " )
-
- if all( result == main.TRUE for result in linksResult ):
- main.log.info( main.topoName + ": Links view in all ONOS nodes "+
- "are correct " )
- else:
- compareTopoResult = main.FALSE
-
- # Comparing hosts
- main.log.info( main.topoName + ": Comparing hosts in each ONOS nodes" +
- " with Mininet" )
- for i in range( main.numCtrls ):
- tempResult = main.Mininet1.compareHosts( MNTopo, hosts[ i ] )
- hostsResult.append( tempResult )
- if tempResult == main.FALSE:
- main.log.error( main.topoName + ": ONOS-" + str( i + 1 ) +
- " hosts view are incorrect " )
-
- if all( result == main.TRUE for result in hostsResult ):
- main.log.info( main.topoName + ": Hosts view in all ONOS nodes "+
- "are correct " )
- else:
- compareTopoResult = main.FALSE
-
- return compareTopoResult
-
-def assignSwitch( main ):
- """
- Returns switch list using getSwitch in Mininet driver
- """
- switchList = []
- assignResult = main.TRUE
- switchList = main.Mininet1.getSwitch()
- assignResult = main.Mininet1.assignSwController( sw=switchList,
- ip=main.ONOSip[ 0 ],
- port=6633 )
-
- for sw in switchList:
- response = main.Mininet1.getSwController( sw )
- if re.search( "tcp:" + main.ONOSip[ 0 ], response ):
- assignResult = assignResult and main.TRUE
- else:
- assignResult = main.FALSE
-
- return switchList
-
-def getHostsData( main ):
- """
- Use fwd app and pingall to discover all the hosts
- """
- activateResult = main.TRUE
- appCheck = main.TRUE
- getDataResult = main.TRUE
- main.log.info( main.topoName + ": Activating reactive forwarding app " )
- activateResult = main.CLIs[ 0 ].activateApp( "org.onosproject.fwd" )
- if main.hostsData:
- main.hostsData = {}
- for i in range( main.numCtrls ):
- appCheck = appCheck and main.CLIs[ i ].appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.CLIs[ i ].apps() )
- main.log.warn( main.CLIs[ i ].appIDs() )
-
- pingResult = main.Mininet1.pingall( timeout=900 )
- hostsJson = json.loads( main.CLIs[ 0 ].hosts() )
- hosts = main.Mininet1.getHosts()
- for host in hosts:
- main.hostsData[ host ] = {}
- main.hostsData[ host ][ 'mac' ] = \
- main.Mininet1.getMacAddress( host ).upper()
- for hostj in hostsJson:
- if main.hostsData[ host ][ 'mac' ] == hostj[ 'mac' ]:
- main.hostsData[ host ][ 'id' ] = hostj[ 'id' ]
- main.hostsData[ host ][ 'vlan' ] = hostj[ 'vlan' ]
- main.hostsData[ host ][ 'location' ] = \
- hostj[ 'location' ][ 'elementId' ] + '/' + \
- hostj[ 'location' ][ 'port' ]
- main.hostsData[ host ][ 'ipAddresses' ] = hostj[ 'ipAddresses' ]
-
- if activateResult and main.hostsData:
- main.log.info( main.topoName + ": Successfully used fwd app" +
- " to discover hosts " )
- getDataResult = main.TRUE
- else:
- main.log.info( main.topoName + ": Failed to use fwd app" +
- " to discover hosts " )
- getDataResult = main.FALSE
-
- # This data can be use later for intents
- print main.hostsData
-
- return getDataResult
-
-def restartONOS( main ):
- """
- Description:
- Stop and start ONOS that clears hosts,devices etc. in order to test
- new mininet topology
- Return:
- Retruns main.TRUE for a successful restart, main.FALSE otherwise.
- """
- stopResult = []
- startResult = []
- restartResult = main.TRUE
-
- main.log.info( main.topoName + ": Stopping ONOS cluster" )
- for node in main.nodes:
- startResult.append( main.ONOSbench.onosStop( nodeIp=node.ip_address ) )
-
- if all( result == main.TRUE for result in stopResult ):
- main.log.info( main.topoName + ": Successfully stopped ONOS cluster" )
- else:
- restartResult = main.FALSE
- main.log.error( main.topoName + ": Failed to stop ONOS cluster" )
-
- time.sleep( 15 )
-
- main.log.info( main.topoName + ": Starting ONOS cluster" )
- for node in main.nodes:
- startResult.append( main.ONOSbench.onosStart( nodeIp=node.ip_address ) )
-
- if all( result == main.TRUE for result in startResult ):
- main.log.info( main.topoName + ": Successfully start ONOS cluster" )
- else:
- restartResult = main.FALSE
- main.log.error( main.topoName + ": Failed to start ONOS cluster" )
-
- # Start ONOS CLIs again
- main.log.info( main.topoName + ": Starting ONOS CLI" )
- cliResult = main.TRUE
- for i in range( main.numCtrls ):
- cliResult = cliResult and \
- main.CLIs[ i ].startOnosCli( main.ONOSip[ i ] )
-
- time.sleep( 15 )
-
- return restartResult
-
-
-
diff --git a/TestON/tests/FuncTopo/FuncTopo.py b/TestON/tests/FuncTopo/FuncTopo.py
deleted file mode 100644
index b2e2a6a..0000000
--- a/TestON/tests/FuncTopo/FuncTopo.py
+++ /dev/null
@@ -1,218 +0,0 @@
-
-# Testing the basic functionality of ONOS Next
-# For sanity and driver functionality excercises only.
-
-import time
-import json
-
-class FuncTopo:
-
- def __init__( self ):
- self.default = ''
-
- def CASE10( self, main ):
- import time
- import os
- import imp
- """
- Startup sequence:
- cell <name>
- onos-verify-cell
- onos-remove-raft-log
- git pull
- mvn clean install
- onos-package
- onos-install -f
- onos-wait-for-start
- """
- global init
- global globalONOSip
- try:
- if type(init) is not bool:
- init = False
- except NameError:
- init = False
-
- main.wrapper = imp.load_source( 'FuncTopoFunction', '/home/admin/' +
- 'TestON/tests/FuncTopo/Dependency/' +
- 'FuncTopoFunction.py')
-
- #Local variables
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- apps = main.params[ 'ENV' ][ 'cellApps' ]
- gitBranch = main.params[ 'GIT' ][ 'branch' ]
- benchIp = os.environ[ 'OCN' ]
- benchUser = main.params[ 'BENCH' ][ 'user' ]
- topology = main.params[ 'MININET' ][ 'topo' ]
- main.numSwitch = int( main.params[ 'MININET' ][ 'switch' ] )
- main.numLinks = int( main.params[ 'MININET' ][ 'links' ] )
- main.numCtrls = main.params[ 'CTRL' ][ 'num' ]
- main.ONOSport = []
- main.hostsData = {}
- main.topoName = " "
- PULLCODE = False
- if main.params[ 'GIT' ][ 'pull' ] == 'True':
- PULLCODE = True
- main.case( "Setting up test environment" )
- main.CLIs = []
- main.nodes = []
- for i in range( 1, int( main.numCtrls ) + 1 ):
- main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
- main.nodes.append( getattr( main, 'ONOS' + str( i ) ) )
- main.ONOSport.append( main.params[ 'CTRL' ][ 'port' + str( i ) ] )
-
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
- init = True
-
- main.scale = ( main.params[ 'SCALE' ] ).split( "," )
- main.numCtrls = int( main.scale[ 0 ] )
-
- if PULLCODE:
- main.step( "Git checkout and pull " + gitBranch )
- main.ONOSbench.gitCheckout( gitBranch )
- gitPullResult = main.ONOSbench.gitPull()
- if gitPullResult == main.ERROR:
- main.log.error( "Error pulling git branch" )
- main.step( "Using mvn clean & install" )
- cleanInstallResult = main.ONOSbench.cleanInstall()
- stepResult = cleanInstallResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully compiled " +
- "latest ONOS",
- onfail="Failed to compile " +
- "latest ONOS" )
- else:
- main.log.warn( "Did not pull new code so skipping mvn " +
- "clean install" )
-
- globalONOSip = main.ONOSbench.getOnosIps()
- maxNodes = ( len(globalONOSip) - 2 )
-
- main.numCtrls = int( main.scale[ 0 ] )
- main.scale.remove( main.scale[ 0 ] )
-
- main.ONOSip = []
- for i in range( maxNodes ):
- main.ONOSip.append( globalONOSip[i] )
-
- #kill off all onos processes
- main.log.info( "Safety check, killing all ONOS processes" +
- " before initiating enviornment setup" )
- for i in range(maxNodes):
- main.ONOSbench.onosDie( globalONOSip[ i ] )
-
- print "NODE COUNT = ", main.numCtrls
- main.log.info( "Creating cell file" )
- cellIp = []
- for i in range( main.numCtrls ):
- cellIp.append( str( main.ONOSip[ i ] ) )
- print cellIp
- main.ONOSbench.createCellFile( benchIp, cellName, "",
- str( apps ), *cellIp )
-
- main.step( "Apply cell to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
- stepResult = cellResult and verifyResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully applied cell to " + \
- "environment",
- onfail="Failed to apply cell to environment " )
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
- stepResult = packageResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully created ONOS package",
- onfail="Failed to create ONOS package" )
-
- main.step( "Uninstalling ONOS package" )
- onosUninstallResult = main.TRUE
- for i in range( main.numCtrls ):
- onosUninstallResult = onosUninstallResult and \
- main.ONOSbench.onosUninstall( nodeIp=main.ONOSip[ i ] )
- stepResult = onosUninstallResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully uninstalled ONOS package",
- onfail="Failed to uninstall ONOS package" )
- time.sleep( 5 )
- main.step( "Installing ONOS package" )
- onosInstallResult = main.TRUE
- for i in range( main.numCtrls ):
- onosInstallResult = onosInstallResult and \
- main.ONOSbench.onosInstall( node=main.ONOSip[ i ] )
- stepResult = onosInstallResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Successfully installed ONOS package",
- onfail="Failed to install ONOS package" )
-
- time.sleep( 10 )
- main.step( "Starting ONOS service" )
- stopResult = main.TRUE
- startResult = main.TRUE
- onosIsUp = main.TRUE
- for i in range( main.numCtrls ):
- onosIsUp = onosIsUp and main.ONOSbench.isup( main.ONOSip[ i ] )
- if onosIsUp == main.TRUE:
- main.log.report( "ONOS instance is up and ready" )
- else:
- main.log.report( "ONOS instance may not be up, stop and " +
- "start ONOS again " )
- for i in range( main.numCtrls ):
- stopResult = stopResult and \
- main.ONOSbench.onosStop( main.ONOSip[ i ] )
- for i in range( main.numCtrls ):
- startResult = startResult and \
- main.ONOSbench.onosStart( main.ONOSip[ i ] )
- stepResult = onosIsUp and stopResult and startResult
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="ONOS service is ready",
- onfail="ONOS service did not start properly" )
-
- def CASE9( self, main ):
- '''
- Report errors/warnings/exceptions
- '''
- main.log.info("Error report: \n")
- main.ONOSbench.logReport( globalONOSip[0],
- [ "INFO","FOLLOWER","WARN",
- "flow","ERROR","Except" ],
- "s" )
- #main.ONOSbench.logReport( globalONOSip[1], [ "INFO" ], "d" )
-
- def CASE1001( self, main ):
- """
- Test topology discovery
- """
- main.case( "Topology discovery test" )
-
-
- main.step( "Torus 5-5 topology" )
- main.topoName = "TORUS5-5"
- mnCmd = "mn --topo=torus,5,5 --mac"
- stepResult = main.wrapper.testTopology( main,
- mnCmd=mnCmd,
- clean=False )
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Torus 5-5 topology successful",
- onfail="Torus 5-5 topology failed" )
-
- main.topoName = "TREE3-3"
- stepResult = main.TRUE
- main.step( "Tree 3-3 topology" )
- mnCmd = "mn --topo=tree,3,3 --mac"
- stepResult = main.wrapper.testTopology( main,
- mnCmd=mnCmd,
- clean=True )
- utilities.assert_equals( expect=main.TRUE,
- actual=stepResult,
- onpass="Tree 3-3 topology successful",
- onfail="Tree 3-3 topology failed" )
diff --git a/TestON/tests/FuncTopo/__init__.py b/TestON/tests/FuncTopo/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/FuncTopo/__init__.py
+++ /dev/null
diff --git a/TestON/tests/HATestClusterRestart/HATestClusterRestart.params b/TestON/tests/HATestClusterRestart/HATestClusterRestart.params
deleted file mode 100644
index 207e693..0000000
--- a/TestON/tests/HATestClusterRestart/HATestClusterRestart.params
+++ /dev/null
@@ -1,71 +0,0 @@
-<PARAMS>
- <testcases>1,2,8,3,8,4,5,14,16,17,[6],8,3,7,4,15,17,9,8,4,10,8,4,11,8,4,12,8,4,13</testcases>
- <ENV>
- <cellName>HA</cellName>
- </ENV>
- <Git> False </Git>
- <branch> master </branch>
- <num_controllers> 7 </num_controllers>
- <tcpdump> False </tcpdump>
-
- <CTRL>
- <ip1>10.128.30.11</ip1>
- <port1>6633</port1>
-
- <ip2>10.128.30.12</ip2>
- <port2>6633</port2>
-
- <ip3>10.128.30.13</ip3>
- <port3>6633</port3>
-
- <ip4>10.128.30.14</ip4>
- <port4>6633</port4>
-
- <ip5>10.128.30.15</ip5>
- <port5>6633</port5>
-
- <ip6>10.128.30.16</ip6>
- <port6>6633</port6>
-
- <ip7>10.128.30.17</ip7>
- <port7>6633</port7>
- </CTRL>
- <TESTONUSER>admin</TESTONUSER>
- <TESTONIP>10.128.30.9</TESTONIP>
- <PING>
- <source1>h8</source1>
- <source2>h9</source2>
- <source3>h10</source3>
- <source4>h11</source4>
- <source5>h12</source5>
- <source6>h13</source6>
- <source7>h14</source7>
- <source8>h15</source8>
- <source9>h16</source9>
- <source10>h17</source10>
- <target1>10.0.0.18</target1>
- <target2>10.0.0.19</target2>
- <target3>10.0.0.20</target3>
- <target4>10.0.0.21</target4>
- <target5>10.0.0.22</target5>
- <target6>10.0.0.23</target6>
- <target7>10.0.0.24</target7>
- <target8>10.0.0.25</target8>
- <target9>10.0.0.26</target9>
- <target10>10.0.0.27</target10>
- </PING>
- <timers>
- <LinkDiscovery>.2</LinkDiscovery>
- <SwitchDiscovery>.2</SwitchDiscovery>
- </timers>
- <kill>
- <switch> s5 </switch>
- <dpid> 0000000000005000 </dpid>
- <links> h5 s2 s1 s6 </links>
- </kill>
- <MNtcpdump>
- <intf>eth0</intf>
- <port> </port>
- <folder>~/packet_captures/</folder>
- </MNtcpdump>
-</PARAMS>
diff --git a/TestON/tests/HATestClusterRestart/HATestClusterRestart.py b/TestON/tests/HATestClusterRestart/HATestClusterRestart.py
deleted file mode 100644
index 4ecc271..0000000
--- a/TestON/tests/HATestClusterRestart/HATestClusterRestart.py
+++ /dev/null
@@ -1,3999 +0,0 @@
-"""
-Description: This test is to determine if ONOS can handle
- all of it's nodes restarting
-
-List of test cases:
-CASE1: Compile ONOS and push it to the test machines
-CASE2: Assign devices to controllers
-CASE21: Assign mastership to controllers
-CASE3: Assign intents
-CASE4: Ping across added host intents
-CASE5: Reading state of ONOS
-CASE6: The Failure case.
-CASE7: Check state after control plane failure
-CASE8: Compare topo
-CASE9: Link s3-s28 down
-CASE10: Link s3-s28 up
-CASE11: Switch down
-CASE12: Switch up
-CASE13: Clean up
-CASE14: start election app on all onos nodes
-CASE15: Check that Leadership Election is still functional
-CASE16: Install Distributed Primitives app
-CASE17: Check for basic functionality with distributed primitives
-"""
-
-
-class HATestClusterRestart:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- """
- CASE1 is to compile ONOS and push it to the test machines
-
- Startup sequence:
- cell <name>
- onos-verify-cell
- NOTE: temporary - onos-remove-raft-logs
- onos-uninstall
- start mininet
- git pull
- mvn clean install
- onos-package
- onos-install -f
- onos-wait-for-start
- start cli sessions
- start tcpdump
- """
- main.log.info( "ONOS HA test: Restart all ONOS nodes - " +
- "initialization" )
- main.case( "Setting up test environment" )
- main.caseExplaination = "Setup the test environment including " +\
- "installing ONOS, starting Mininet and ONOS" +\
- "cli sessions."
- # TODO: save all the timers and output them for plotting
-
- # load some variables from the params file
- PULLCODE = False
- if main.params[ 'Git' ] == 'True':
- PULLCODE = True
- gitBranch = main.params[ 'branch' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
-
- # set global variables
- global ONOS1Port
- global ONOS2Port
- global ONOS3Port
- global ONOS4Port
- global ONOS5Port
- global ONOS6Port
- global ONOS7Port
- global numControllers
- # These are for csv plotting in jenkins
- global labels
- global data
- labels = []
- data = []
- numControllers = int( main.params[ 'num_controllers' ] )
-
- # FIXME: just get controller port from params?
- # TODO: do we really need all these?
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
- ONOS4Port = main.params[ 'CTRL' ][ 'port4' ]
- ONOS5Port = main.params[ 'CTRL' ][ 'port5' ]
- ONOS6Port = main.params[ 'CTRL' ][ 'port6' ]
- ONOS7Port = main.params[ 'CTRL' ][ 'port7' ]
-
- global CLIs
- CLIs = []
- global nodes
- nodes = []
- for i in range( 1, numControllers + 1 ):
- CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
- nodes.append( getattr( main, 'ONOS' + str( i ) ) )
-
- main.step( "Applying cell variable to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- # FIXME:this is short term fix
- main.log.info( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
-
- main.log.info( "Uninstalling ONOS" )
- for node in nodes:
- main.ONOSbench.onosUninstall( node.ip_address )
-
- # Make sure ONOS is DEAD
- main.log.info( "Killing any ONOS processes" )
- killResults = main.TRUE
- for node in nodes:
- killed = main.ONOSbench.onosKill( node.ip_address )
- killResults = killResults and killed
-
- cleanInstallResult = main.TRUE
- gitPullResult = main.TRUE
-
- main.step( "Starting Mininet" )
- mnResult = main.Mininet1.startNet( )
- utilities.assert_equals( expect=main.TRUE, actual=mnResult,
- onpass="Mininet Started",
- onfail="Error starting Mininet" )
-
- main.step( "Git checkout and pull " + gitBranch )
- if PULLCODE:
- main.ONOSbench.gitCheckout( gitBranch )
- gitPullResult = main.ONOSbench.gitPull()
- # values of 1 or 3 are good
- utilities.assert_lesser( expect=0, actual=gitPullResult,
- onpass="Git pull successful",
- onfail="Git pull failed" )
- main.ONOSbench.getVersion( report=True )
-
- main.step( "Using mvn clean install" )
- cleanInstallResult = main.TRUE
- if PULLCODE and gitPullResult == main.TRUE:
- cleanInstallResult = main.ONOSbench.cleanInstall()
- else:
- main.log.warn( "Did not pull new code so skipping mvn " +
- "clean install" )
- utilities.assert_equals( expect=main.TRUE,
- actual=cleanInstallResult,
- onpass="MCI successful",
- onfail="MCI failed" )
- # GRAPHS
- # NOTE: important params here:
- # job = name of Jenkins job
- # Plot Name = Plot-HA, only can be used if multiple plots
- # index = The number of the graph under plot name
- job = "HAClusterRestart"
- plotName = "Plot-HA"
- 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' +\
- '&width=500&height=300"' +\
- 'noborder="0" width="500" height="300" scrolling="yes" ' +\
- 'seamless="seamless"></iframe>\n'
- graphs += ']]></ac:plain-text-body>\n'
- graphs += '</ac:structured-macro>\n'
- main.log.wiki(graphs)
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
- utilities.assert_equals( expect=main.TRUE, actual=packageResult,
- onpass="ONOS package successful",
- onfail="ONOS package failed" )
-
- main.step( "Installing ONOS package" )
- onosInstallResult = main.TRUE
- for node in nodes:
- tmpResult = main.ONOSbench.onosInstall( options="-f",
- node=node.ip_address )
- onosInstallResult = onosInstallResult and tmpResult
- utilities.assert_equals( expect=main.TRUE, actual=onosInstallResult,
- onpass="ONOS install successful",
- onfail="ONOS install failed" )
-
- main.step( "Checking if ONOS is up yet" )
- for i in range( 2 ):
- onosIsupResult = main.TRUE
- for node in nodes:
- started = main.ONOSbench.isup( node.ip_address )
- if not started:
- main.log.error( node.name + " didn't start!" )
- main.ONOSbench.onosStop( node.ip_address )
- main.ONOSbench.onosStart( node.ip_address )
- onosIsupResult = onosIsupResult and started
- if onosIsupResult == main.TRUE:
- break
- utilities.assert_equals( expect=main.TRUE, actual=onosIsupResult,
- onpass="ONOS startup successful",
- onfail="ONOS startup failed" )
-
- main.log.step( "Starting ONOS CLI sessions" )
- cliResults = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].startOnosCli,
- name="startOnosCli-" + str( i ),
- args=[nodes[i].ip_address] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- cliResults = cliResults and t.result
- utilities.assert_equals( expect=main.TRUE, actual=cliResults,
- onpass="ONOS cli startup successful",
- onfail="ONOS cli startup failed" )
-
- if main.params[ 'tcpdump' ].lower() == "true":
- main.step( "Start Packet Capture MN" )
- main.Mininet2.startTcpdump(
- str( main.params[ 'MNtcpdump' ][ 'folder' ] ) + str( main.TEST )
- + "-MN.pcap",
- intf=main.params[ 'MNtcpdump' ][ 'intf' ],
- port=main.params[ 'MNtcpdump' ][ 'port' ] )
-
- main.step( "App Ids check" )
- appCheck = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- appCheck = appCheck and t.result
- if appCheck != main.TRUE:
- main.log.warn( CLIs[0].apps() )
- main.log.warn( CLIs[0].appIDs() )
- utilities.assert_equals( expect=main.TRUE, actual=appCheck,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
-
- if cliResults == main.FALSE:
- main.log.error( "Failed to start ONOS, stopping test" )
- main.cleanup()
- main.exit()
-
- def CASE2( self, main ):
- """
- Assign devices to controllers
- """
- import re
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- assert ONOS1Port, "ONOS1Port not defined"
- assert ONOS2Port, "ONOS2Port not defined"
- assert ONOS3Port, "ONOS3Port not defined"
- assert ONOS4Port, "ONOS4Port not defined"
- assert ONOS5Port, "ONOS5Port not defined"
- assert ONOS6Port, "ONOS6Port not defined"
- assert ONOS7Port, "ONOS7Port not defined"
-
- main.case( "Assigning devices to controllers" )
- main.caseExplaination = "Assign switches to ONOS using 'ovs-vsctl' " +\
- "and check that an ONOS node becomes the " +\
- "master of the device."
- main.step( "Assign switches to controllers" )
-
- ipList = []
- for i in range( numControllers ):
- ipList.append( nodes[ i ].ip_address )
- swList = []
- for i in range( 1, 29 ):
- swList.append( "s" + str( i ) )
- main.Mininet1.assignSwController( sw=swList, ip=ipList )
-
- mastershipCheck = main.TRUE
- for i in range( 1, 29 ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
- try:
- main.log.info( str( response ) )
- except Exception:
- main.log.info( repr( response ) )
- for node in nodes:
- if re.search( "tcp:" + node.ip_address, response ):
- mastershipCheck = mastershipCheck and main.TRUE
- else:
- main.log.error( "Error, node " + node.ip_address + " is " +
- "not in the list of controllers s" +
- str( i ) + " is connecting to." )
- mastershipCheck = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=mastershipCheck,
- onpass="Switch mastership assigned correctly",
- onfail="Switches not assigned correctly to controllers" )
-
- def CASE21( self, main ):
- """
- Assign mastership to controllers
- """
- import re
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- assert ONOS1Port, "ONOS1Port not defined"
- assert ONOS2Port, "ONOS2Port not defined"
- assert ONOS3Port, "ONOS3Port not defined"
- assert ONOS4Port, "ONOS4Port not defined"
- assert ONOS5Port, "ONOS5Port not defined"
- assert ONOS6Port, "ONOS6Port not defined"
- assert ONOS7Port, "ONOS7Port not defined"
-
- main.case( "Assigning Controller roles for switches" )
- main.caseExplaination = "Check that ONOS is connected to each " +\
- "device. Then manually assign" +\
- " mastership to specific ONOS nodes using" +\
- " 'device-role'"
- main.step( "Assign mastership of switches to specific controllers" )
- # Manually assign mastership to the controller we want
- roleCall = main.TRUE
-
- ipList = [ ]
- deviceList = []
- try:
- for i in range( 1, 29 ): # switches 1 through 28
- # set up correct variables:
- if i == 1:
- ip = nodes[ 0 ].ip_address # ONOS1
- deviceId = main.ONOScli1.getDevice( "1000" ).get( 'id' )
- elif i == 2:
- ip = nodes[ 1 ].ip_address # ONOS2
- deviceId = main.ONOScli1.getDevice( "2000" ).get( 'id' )
- elif i == 3:
- ip = nodes[ 1 ].ip_address # ONOS2
- deviceId = main.ONOScli1.getDevice( "3000" ).get( 'id' )
- elif i == 4:
- ip = nodes[ 3 ].ip_address # ONOS4
- deviceId = main.ONOScli1.getDevice( "3004" ).get( 'id' )
- elif i == 5:
- ip = nodes[ 2 ].ip_address # ONOS3
- deviceId = main.ONOScli1.getDevice( "5000" ).get( 'id' )
- elif i == 6:
- ip = nodes[ 2 ].ip_address # ONOS3
- deviceId = main.ONOScli1.getDevice( "6000" ).get( 'id' )
- elif i == 7:
- ip = nodes[ 5 ].ip_address # ONOS6
- deviceId = main.ONOScli1.getDevice( "6007" ).get( 'id' )
- elif i >= 8 and i <= 17:
- ip = nodes[ 4 ].ip_address # ONOS5
- dpid = '3' + str( i ).zfill( 3 )
- deviceId = main.ONOScli1.getDevice( dpid ).get( 'id' )
- elif i >= 18 and i <= 27:
- ip = nodes[ 6 ].ip_address # ONOS7
- dpid = '6' + str( i ).zfill( 3 )
- deviceId = main.ONOScli1.getDevice( dpid ).get( 'id' )
- elif i == 28:
- ip = nodes[ 0 ].ip_address # ONOS1
- deviceId = main.ONOScli1.getDevice( "2800" ).get( 'id' )
- else:
- main.log.error( "You didn't write an else statement for " +
- "switch s" + str( i ) )
- roleCall = main.FALSE
- # Assign switch
- assert deviceId, "No device id for s" + str( i ) + " in ONOS"
- # TODO: make this controller dynamic
- roleCall = roleCall and main.ONOScli1.deviceRole( deviceId,
- ip )
- ipList.append( ip )
- deviceList.append( deviceId )
- except ( AttributeError, AssertionError ):
- main.log.exception( "Something is wrong with ONOS device view" )
- main.log.info( main.ONOScli1.devices() )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=roleCall,
- onpass="Re-assigned switch mastership to designated controller",
- onfail="Something wrong with deviceRole calls" )
-
- main.step( "Check mastership was correctly assigned" )
- roleCheck = main.TRUE
- # NOTE: This is due to the fact that device mastership change is not
- # atomic and is actually a multi step process
- time.sleep( 5 )
- for i in range( len( ipList ) ):
- ip = ipList[i]
- deviceId = deviceList[i]
- # Check assignment
- master = main.ONOScli1.getRole( deviceId ).get( 'master' )
- if ip in master:
- roleCheck = roleCheck and main.TRUE
- else:
- roleCheck = roleCheck and main.FALSE
- main.log.error( "Error, controller " + ip + " is not" +
- " master " + "of device " +
- str( deviceId ) + ". Master is " +
- repr( master ) + "." )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=roleCheck,
- onpass="Switches were successfully reassigned to designated " +
- "controller",
- onfail="Switches were not successfully reassigned" )
-
- def CASE3( self, main ):
- """
- Assign intents
- """
- import time
- import json
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- try:
- labels
- except NameError:
- main.log.error( "labels not defined, setting to []" )
- labels = []
- try:
- data
- except NameError:
- main.log.error( "data not defined, setting to []" )
- data = []
- # NOTE: we must reinstall intents until we have a persistant intent
- # datastore!
- main.case( "Adding host Intents" )
- main.caseExplaination = "Discover hosts by using pingall then " +\
- "assign predetermined host-to-host intents." +\
- " After installation, check that the intent" +\
- " is distributed to all nodes and the state" +\
- " is INSTALLED"
-
- # install onos-app-fwd
- main.step( "Install reactive forwarding app" )
- installResults = CLIs[0].activateApp( "org.onosproject.fwd" )
- utilities.assert_equals( expect=main.TRUE, actual=installResults,
- onpass="Install fwd successful",
- onfail="Install fwd failed" )
-
- main.step( "Check app ids" )
- appCheck = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- appCheck = appCheck and t.result
- if appCheck != main.TRUE:
- main.log.warn( CLIs[0].apps() )
- main.log.warn( CLIs[0].appIDs() )
- utilities.assert_equals( expect=main.TRUE, actual=appCheck,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
-
- main.step( "Discovering Hosts( Via pingall for now )" )
- # FIXME: Once we have a host discovery mechanism, use that instead
- # REACTIVE FWD test
- pingResult = main.FALSE
- for i in range(2): # Retry if pingall fails first time
- time1 = time.time()
- pingResult = main.Mininet1.pingall()
- if i == 0:
- utilities.assert_equals(
- expect=main.TRUE,
- actual=pingResult,
- onpass="Reactive Pingall test passed",
- onfail="Reactive Pingall failed, " +
- "one or more ping pairs failed" )
- time2 = time.time()
- main.log.info( "Time for pingall: %2f seconds" %
- ( time2 - time1 ) )
- # timeout for fwd flows
- time.sleep( 11 )
- # uninstall onos-app-fwd
- main.step( "Uninstall reactive forwarding app" )
- uninstallResult = CLIs[0].deactivateApp( "org.onosproject.fwd" )
- utilities.assert_equals( expect=main.TRUE, actual=uninstallResult,
- onpass="Uninstall fwd successful",
- onfail="Uninstall fwd failed" )
-
- main.step( "Check app ids" )
- threads = []
- appCheck2 = main.TRUE
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- appCheck2 = appCheck2 and t.result
- if appCheck2 != main.TRUE:
- main.log.warn( CLIs[0].apps() )
- main.log.warn( CLIs[0].appIDs() )
- utilities.assert_equals( expect=main.TRUE, actual=appCheck2,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
-
- main.step( "Add host intents via cli" )
- intentIds = []
- # TODO: move the host numbers to params
- # Maybe look at all the paths we ping?
- intentAddResult = True
- hostResult = main.TRUE
- for i in range( 8, 18 ):
- main.log.info( "Adding host intent between h" + str( i ) +
- " and h" + str( i + 10 ) )
- host1 = "00:00:00:00:00:" + \
- str( hex( i )[ 2: ] ).zfill( 2 ).upper()
- host2 = "00:00:00:00:00:" + \
- str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
- # NOTE: getHost can return None
- host1Dict = main.ONOScli1.getHost( host1 )
- host2Dict = main.ONOScli1.getHost( host2 )
- host1Id = None
- host2Id = None
- if host1Dict and host2Dict:
- host1Id = host1Dict.get( 'id', None )
- host2Id = host2Dict.get( 'id', None )
- if host1Id and host2Id:
- nodeNum = ( i % 7 )
- tmpId = CLIs[ nodeNum ].addHostIntent( host1Id, host2Id )
- if tmpId:
- main.log.info( "Added intent with id: " + tmpId )
- intentIds.append( tmpId )
- else:
- main.log.error( "addHostIntent returned: " +
- repr( tmpId ) )
- else:
- main.log.error( "Error, getHost() failed for h" + str( i ) +
- " and/or h" + str( i + 10 ) )
- hosts = CLIs[ 0 ].hosts()
- main.log.warn( "Hosts output: " )
- try:
- main.log.warn( json.dumps( json.loads( hosts ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( hosts ) )
- hostResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE, actual=hostResult,
- onpass="Found a host id for each host",
- onfail="Error looking up host ids" )
-
- intentStart = time.time()
- onosIds = main.ONOScli1.getAllIntentsId()
- main.log.info( "Submitted intents: " + str( intentIds ) )
- main.log.info( "Intents in ONOS: " + str( onosIds ) )
- for intent in intentIds:
- if intent in onosIds:
- pass # intent submitted is in onos
- else:
- intentAddResult = False
- if intentAddResult:
- intentStop = time.time()
- else:
- intentStop = None
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- installedCheck = True
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- try:
- for intent in json.loads( intents ):
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents" )
- # add submitted intents not in the store
- tmplist = [ i for i, s in intentStates ]
- missingIntents = False
- for i in intentIds:
- if i not in tmplist:
- intentStates.append( ( i, " - " ) )
- missingIntents = True
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- leaders = main.ONOScli1.leaders()
- try:
- missing = False
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- missing = True
- else:
- main.log.error( "leaders() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- # Check all nodes
- if missing:
- for node in CLIs:
- response = node.leaders( jsonFormat=False)
- main.log.warn( str( node.name ) + " leaders output: \n" +
- str( response ) )
-
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
-
- intentAddResult = bool( intentAddResult and not missingIntents and
- installedCheck )
- if not intentAddResult:
- main.log.error( "Error in pushing host intents to ONOS" )
-
- main.step( "Intent Anti-Entropy dispersion" )
- for i in range(100):
- correct = True
- main.log.info( "Submitted intents: " + str( sorted( intentIds ) ) )
- for cli in CLIs:
- onosIds = []
- ids = cli.getAllIntentsId()
- onosIds.append( ids )
- main.log.debug( "Intents in " + cli.name + ": " +
- str( sorted( onosIds ) ) )
- if sorted( ids ) != sorted( intentIds ):
- main.log.warn( "Set of intent IDs doesn't match" )
- correct = False
- break
- else:
- intents = json.loads( cli.intents() )
- for intent in intents:
- if intent[ 'state' ] != "INSTALLED":
- main.log.warn( "Intent " + intent[ 'id' ] +
- " is " + intent[ 'state' ] )
- correct = False
- break
- if correct:
- break
- else:
- time.sleep(1)
- if not intentStop:
- intentStop = time.time()
- global gossipTime
- gossipTime = intentStop - intentStart
- main.log.info( "It took about " + str( gossipTime ) +
- " seconds for all intents to appear in each node" )
- append = False
- title = "Gossip Intents"
- count = 1
- while append is False:
- curTitle = title + str( count )
- if curTitle not in labels:
- labels.append( curTitle )
- data.append( str( gossipTime ) )
- append = True
- else:
- count += 1
- # FIXME: make this time configurable/calculate based off of number of
- # nodes and gossip rounds
- utilities.assert_greater_equals(
- expect=40, actual=gossipTime,
- onpass="ECM anti-entropy for intents worked within " +
- "expected time",
- onfail="Intent ECM anti-entropy took too long" )
- if gossipTime <= 40:
- intentAddResult = True
-
- if not intentAddResult or "key" in pendingMap:
- import time
- installedCheck = True
- main.log.info( "Sleeping 60 seconds to see if intents are found" )
- time.sleep( 60 )
- onosIds = main.ONOScli1.getAllIntentsId()
- main.log.info( "Submitted intents: " + str( intentIds ) )
- main.log.info( "Intents in ONOS: " + str( onosIds ) )
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- try:
- for intent in json.loads( intents ):
- # Iter through intents of a node
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents" )
- # add submitted intents not in the store
- tmplist = [ i for i, s in intentStates ]
- for i in intentIds:
- if i not in tmplist:
- intentStates.append( ( i, " - " ) )
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- leaders = main.ONOScli1.leaders()
- try:
- missing = False
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- # check for election
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- # FIXME: this should only be after we start the app
- topics.append( "org.onosproject.election" )
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- missing = True
- else:
- main.log.error( "leaders() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- # Check all nodes
- if missing:
- for node in CLIs:
- response = node.leaders( jsonFormat=False)
- main.log.warn( str( node.name ) + " leaders output: \n" +
- str( response ) )
-
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
-
- def CASE4( self, main ):
- """
- Ping across added host intents
- """
- import json
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- main.case( "Verify connectivity by sendind traffic across Intents" )
- main.caseExplaination = "Ping across added host intents to check " +\
- "functionality and check the state of " +\
- "the intent"
- main.step( "Ping across added host intents" )
- PingResult = main.TRUE
- for i in range( 8, 18 ):
- ping = main.Mininet1.pingHost( src="h" + str( i ),
- target="h" + str( i + 10 ) )
- PingResult = PingResult and ping
- if ping == main.FALSE:
- main.log.warn( "Ping failed between h" + str( i ) +
- " and h" + str( i + 10 ) )
- elif ping == main.TRUE:
- main.log.info( "Ping test passed!" )
- # Don't set PingResult or you'd override failures
- if PingResult == main.FALSE:
- main.log.error(
- "Intents have not been installed correctly, pings failed." )
- # TODO: pretty print
- main.log.warn( "ONOS1 intents: " )
- try:
- tmpIntents = main.ONOScli1.intents()
- main.log.warn( json.dumps( json.loads( tmpIntents ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( tmpIntents ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=PingResult,
- onpass="Intents have been installed correctly and pings work",
- onfail="Intents have not been installed correctly, pings failed." )
-
- main.step( "Check Intent state" )
- installedCheck = False
- loopCount = 0
- while not installedCheck and loopCount < 40:
- installedCheck = True
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- # Iter through intents of a node
- try:
- for intent in json.loads( intents ):
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents." )
- # Print states
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- if not installedCheck:
- time.sleep( 1 )
- loopCount += 1
- utilities.assert_equals( expect=True, actual=installedCheck,
- onpass="Intents are all INSTALLED",
- onfail="Intents are not all in " +
- "INSTALLED state" )
-
- main.step( "Check leadership of topics" )
- leaders = main.ONOScli1.leaders()
- topicCheck = main.TRUE
- try:
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- # check for election
- # TODO: Look at Devices as topics now that it uses this system
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- # FIXME: this should only be after we start the app
- # FIXME: topics.append( "org.onosproject.election" )
- # Print leaders output
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- topicCheck = main.FALSE
- else:
- main.log.error( "leaders() returned None" )
- topicCheck = main.FALSE
- except ( ValueError, TypeError ):
- topicCheck = main.FALSE
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- # TODO: Check for a leader of these topics
- # Check all nodes
- if topicCheck:
- for node in CLIs:
- response = node.leaders( jsonFormat=False)
- main.log.warn( str( node.name ) + " leaders output: \n" +
- str( response ) )
-
- utilities.assert_equals( expect=main.TRUE, actual=topicCheck,
- onpass="intent Partitions is in leaders",
- onfail="Some topics were lost " )
- # Print partitions
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- # Print Pending Map
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
-
- if not installedCheck:
- main.log.info( "Waiting 60 seconds to see if the state of " +
- "intents change" )
- time.sleep( 60 )
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- # Iter through intents of a node
- try:
- for intent in json.loads( intents ):
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents." )
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- leaders = main.ONOScli1.leaders()
- try:
- missing = False
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- # check for election
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- # FIXME: this should only be after we start the app
- topics.append( "org.onosproject.election" )
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- missing = True
- else:
- main.log.error( "leaders() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- if missing:
- for node in CLIs:
- response = node.leaders( jsonFormat=False)
- main.log.warn( str( node.name ) + " leaders output: \n" +
- str( response ) )
-
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
- # Print flowrules
- main.log.debug( CLIs[0].flows( jsonFormat=False ) )
- main.step( "Wait a minute then ping again" )
- # the wait is above
- PingResult = main.TRUE
- for i in range( 8, 18 ):
- ping = main.Mininet1.pingHost( src="h" + str( i ),
- target="h" + str( i + 10 ) )
- PingResult = PingResult and ping
- if ping == main.FALSE:
- main.log.warn( "Ping failed between h" + str( i ) +
- " and h" + str( i + 10 ) )
- elif ping == main.TRUE:
- main.log.info( "Ping test passed!" )
- # Don't set PingResult or you'd override failures
- if PingResult == main.FALSE:
- main.log.error(
- "Intents have not been installed correctly, pings failed." )
- # TODO: pretty print
- main.log.warn( "ONOS1 intents: " )
- try:
- tmpIntents = main.ONOScli1.intents()
- main.log.warn( json.dumps( json.loads( tmpIntents ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( tmpIntents ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=PingResult,
- onpass="Intents have been installed correctly and pings work",
- onfail="Intents have not been installed correctly, pings failed." )
-
- def CASE5( self, main ):
- """
- Reading state of ONOS
- """
- import json
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- main.case( "Setting up and gathering data for current state" )
- # The general idea for this test case is to pull the state of
- # ( intents,flows, topology,... ) from each ONOS node
- # We can then compare them with each other and also with past states
-
- main.step( "Check that each switch has a master" )
- global mastershipState
- mastershipState = '[]'
-
- # Assert that each device has a master
- rolesNotNull = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].rolesNotNull,
- name="rolesNotNull-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- rolesNotNull = rolesNotNull and t.result
- utilities.assert_equals(
- expect=main.TRUE,
- actual=rolesNotNull,
- onpass="Each device has a master",
- onfail="Some devices don't have a master assigned" )
-
- main.step( "Get the Mastership of each switch from each controller" )
- ONOSMastership = []
- mastershipCheck = main.FALSE
- consistentMastership = True
- rolesResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].roles,
- name="roles-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ONOSMastership.append( t.result )
-
- for i in range( numControllers ):
- if not ONOSMastership[i] or "Error" in ONOSMastership[i]:
- main.log.error( "Error in getting ONOS" + str( i + 1 ) +
- " roles" )
- main.log.warn(
- "ONOS" + str( i + 1 ) + " mastership response: " +
- repr( ONOSMastership[i] ) )
- rolesResults = False
- utilities.assert_equals(
- expect=True,
- actual=rolesResults,
- onpass="No error in reading roles output",
- onfail="Error in reading roles from ONOS" )
-
- main.step( "Check for consistency in roles from each controller" )
- if all([ i == ONOSMastership[ 0 ] for i in ONOSMastership ] ):
- main.log.info(
- "Switch roles are consistent across all ONOS nodes" )
- else:
- consistentMastership = False
- utilities.assert_equals(
- expect=True,
- actual=consistentMastership,
- onpass="Switch roles are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of switch roles" )
-
- if rolesResults and not consistentMastership:
- for i in range( numControllers ):
- try:
- main.log.warn(
- "ONOS" + str( i + 1 ) + " roles: ",
- json.dumps(
- json.loads( ONOSMastership[ i ] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( ONOSMastership[ i ] ) )
- elif rolesResults and consistentMastership:
- mastershipCheck = main.TRUE
- mastershipState = ONOSMastership[ 0 ]
-
- main.step( "Get the intents from each controller" )
- global intentState
- intentState = []
- ONOSIntents = []
- intentCheck = main.FALSE
- consistentIntents = True
- intentsResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].intents,
- name="intents-" + str( i ),
- args=[],
- kwargs={ 'jsonFormat': True } )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ONOSIntents.append( t.result )
-
- for i in range( numControllers ):
- if not ONOSIntents[ i ] or "Error" in ONOSIntents[ i ]:
- main.log.error( "Error in getting ONOS" + str( i + 1 ) +
- " intents" )
- main.log.warn( "ONOS" + str( i + 1 ) + " intents response: " +
- repr( ONOSIntents[ i ] ) )
- intentsResults = False
- utilities.assert_equals(
- expect=True,
- actual=intentsResults,
- onpass="No error in reading intents output",
- onfail="Error in reading intents from ONOS" )
-
- main.step( "Check for consistency in Intents from each controller" )
- if all([ sorted( i ) == sorted( ONOSIntents[ 0 ] ) for i in ONOSIntents ] ):
- main.log.info( "Intents are consistent across all ONOS " +
- "nodes" )
- else:
- consistentIntents = False
- main.log.error( "Intents not consistent" )
- utilities.assert_equals(
- expect=True,
- actual=consistentIntents,
- onpass="Intents are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of intents" )
-
- if intentsResults:
- # Try to make it easy to figure out what is happening
- #
- # Intent ONOS1 ONOS2 ...
- # 0x01 INSTALLED INSTALLING
- # ... ... ...
- # ... ... ...
- title = " Id"
- for n in range( numControllers ):
- title += " " * 10 + "ONOS" + str( n + 1 )
- main.log.warn( title )
- # get all intent keys in the cluster
- keys = []
- for nodeStr in ONOSIntents:
- node = json.loads( nodeStr )
- for intent in node:
- keys.append( intent.get( 'id' ) )
- keys = set( keys )
- for key in keys:
- row = "%-13s" % key
- for nodeStr in ONOSIntents:
- node = json.loads( nodeStr )
- for intent in node:
- if intent.get( 'id', "Error" ) == key:
- row += "%-15s" % intent.get( 'state' )
- main.log.warn( row )
- # End table view
-
- if intentsResults and not consistentIntents:
- # print the json objects
- n = len(ONOSIntents)
- main.log.debug( "ONOS" + str( n ) + " intents: " )
- main.log.debug( json.dumps( json.loads( ONOSIntents[ -1 ] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- for i in range( numControllers ):
- if ONOSIntents[ i ] != ONOSIntents[ -1 ]:
- main.log.debug( "ONOS" + str( i + 1 ) + " intents: " )
- main.log.debug( json.dumps( json.loads( ONOSIntents[i] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- else:
- main.log.debug( nodes[ i ].name + " intents match ONOS" +
- str( n ) + " intents" )
- elif intentsResults and consistentIntents:
- intentCheck = main.TRUE
- intentState = ONOSIntents[ 0 ]
-
- main.step( "Get the flows from each controller" )
- global flowState
- flowState = []
- ONOSFlows = []
- ONOSFlowsJson = []
- flowCheck = main.FALSE
- consistentFlows = True
- flowsResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].flows,
- name="flows-" + str( i ),
- args=[],
- kwargs={ 'jsonFormat': True } )
- threads.append( t )
- t.start()
-
- # NOTE: Flows command can take some time to run
- time.sleep(30)
- for t in threads:
- t.join()
- result = t.result
- ONOSFlows.append( result )
-
- for i in range( numControllers ):
- num = str( i + 1 )
- if not ONOSFlows[ i ] or "Error" in ONOSFlows[ i ]:
- main.log.error( "Error in getting ONOS" + num + " flows" )
- main.log.warn( "ONOS" + num + " flows response: " +
- repr( ONOSFlows[ i ] ) )
- flowsResults = False
- ONOSFlowsJson.append( None )
- else:
- try:
- ONOSFlowsJson.append( json.loads( ONOSFlows[ i ] ) )
- except ( ValueError, TypeError ):
- # FIXME: change this to log.error?
- main.log.exception( "Error in parsing ONOS" + num +
- " response as json." )
- main.log.error( repr( ONOSFlows[ i ] ) )
- ONOSFlowsJson.append( None )
- flowsResults = False
- utilities.assert_equals(
- expect=True,
- actual=flowsResults,
- onpass="No error in reading flows output",
- onfail="Error in reading flows from ONOS" )
-
- main.step( "Check for consistency in Flows from each controller" )
- tmp = [ len( i ) == len( ONOSFlowsJson[ 0 ] ) for i in ONOSFlowsJson ]
- if all( tmp ):
- main.log.info( "Flow count is consistent across all ONOS nodes" )
- else:
- consistentFlows = False
- utilities.assert_equals(
- expect=True,
- actual=consistentFlows,
- onpass="The flow count is consistent across all ONOS nodes",
- onfail="ONOS nodes have different flow counts" )
-
- if flowsResults and not consistentFlows:
- for i in range( numControllers ):
- try:
- main.log.warn(
- "ONOS" + str( i + 1 ) + " flows: " +
- json.dumps( json.loads( ONOSFlows[i] ), sort_keys=True,
- indent=4, separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn(
- "ONOS" + str( i + 1 ) + " flows: " +
- repr( ONOSFlows[ i ] ) )
- elif flowsResults and consistentFlows:
- flowCheck = main.TRUE
- flowState = ONOSFlows[ 0 ]
-
- main.step( "Get the OF Table entries" )
- global flows
- flows = []
- for i in range( 1, 29 ):
- flows.append( main.Mininet2.getFlowTable( 1.3, "s" + str( i ) ) )
- if flowCheck == main.FALSE:
- for table in flows:
- main.log.warn( table )
- # TODO: Compare switch flow tables with ONOS flow tables
-
- main.step( "Start continuous pings" )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source1' ],
- target=main.params[ 'PING' ][ 'target1' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source2' ],
- target=main.params[ 'PING' ][ 'target2' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source3' ],
- target=main.params[ 'PING' ][ 'target3' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source4' ],
- target=main.params[ 'PING' ][ 'target4' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source5' ],
- target=main.params[ 'PING' ][ 'target5' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source6' ],
- target=main.params[ 'PING' ][ 'target6' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source7' ],
- target=main.params[ 'PING' ][ 'target7' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source8' ],
- target=main.params[ 'PING' ][ 'target8' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source9' ],
- target=main.params[ 'PING' ][ 'target9' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source10' ],
- target=main.params[ 'PING' ][ 'target10' ],
- pingTime=500 )
-
- main.step( "Collecting topology information from ONOS" )
- devices = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].devices,
- name="devices-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- devices.append( t.result )
- hosts = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].hosts,
- name="hosts-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- try:
- hosts.append( json.loads( t.result ) )
- except ( ValueError, TypeError ):
- # FIXME: better handling of this, print which node
- # Maybe use thread name?
- main.log.exception( "Error parsing json output of hosts" )
- # FIXME: should this be an empty json object instead?
- hosts.append( None )
-
- ports = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].ports,
- name="ports-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ports.append( t.result )
- links = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].links,
- name="links-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- links.append( t.result )
- clusters = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].clusters,
- name="clusters-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- clusters.append( t.result )
- # Compare json objects for hosts and dataplane clusters
-
- # hosts
- main.step( "Host view is consistent across ONOS nodes" )
- consistentHostsResult = main.TRUE
- for controller in range( len( hosts ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in hosts[ controller ]:
- if hosts[ controller ] == hosts[ 0 ]:
- continue
- else: # hosts not consistent
- main.log.error( "hosts from ONOS" +
- controllerStr +
- " is inconsistent with ONOS1" )
- main.log.warn( repr( hosts[ controller ] ) )
- consistentHostsResult = main.FALSE
-
- else:
- main.log.error( "Error in getting ONOS hosts from ONOS" +
- controllerStr )
- consistentHostsResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " hosts response: " +
- repr( hosts[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentHostsResult,
- onpass="Hosts view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of hosts" )
-
- main.step( "Each host has an IP address" )
- ipResult = main.TRUE
- for controller in range( 0, len( hosts ) ):
- controllerStr = str( controller + 1 )
- for host in hosts[ controller ]:
- if not host.get( 'ipAddresses', [ ] ):
- main.log.error( "DEBUG:Error with host ips on controller" +
- controllerStr + ": " + str( host ) )
- ipResult = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=ipResult,
- onpass="The ips of the hosts aren't empty",
- onfail="The ip of at least one host is missing" )
-
- # Strongly connected clusters of devices
- main.step( "Cluster view is consistent across ONOS nodes" )
- consistentClustersResult = main.TRUE
- for controller in range( len( clusters ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in clusters[ controller ]:
- if clusters[ controller ] == clusters[ 0 ]:
- continue
- else: # clusters not consistent
- main.log.error( "clusters from ONOS" + controllerStr +
- " is inconsistent with ONOS1" )
- consistentClustersResult = main.FALSE
-
- else:
- main.log.error( "Error in getting dataplane clusters " +
- "from ONOS" + controllerStr )
- consistentClustersResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " clusters response: " +
- repr( clusters[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentClustersResult,
- onpass="Clusters view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of clusters" )
- # there should always only be one cluster
- main.step( "Cluster view correct across ONOS nodes" )
- try:
- numClusters = len( json.loads( clusters[ 0 ] ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing clusters[0]: " +
- repr( clusters[ 0 ] ) )
- clusterResults = main.FALSE
- if numClusters == 1:
- clusterResults = main.TRUE
- utilities.assert_equals(
- expect=1,
- actual=numClusters,
- onpass="ONOS shows 1 SCC",
- onfail="ONOS shows " + str( numClusters ) + " SCCs" )
-
- main.step( "Comparing ONOS topology to MN" )
- devicesResults = main.TRUE
- linksResults = main.TRUE
- hostsResults = main.TRUE
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
- mnHosts = main.Mininet1.getHosts()
- for controller in range( numControllers ):
- controllerStr = str( controller + 1 )
- if devices[ controller ] and ports[ controller ] and\
- "Error" not in devices[ controller ] and\
- "Error" not in ports[ controller ]:
-
- currentDevicesResult = main.Mininet1.compareSwitches(
- mnSwitches,
- json.loads( devices[ controller ] ),
- json.loads( ports[ controller ] ) )
- else:
- currentDevicesResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentDevicesResult,
- onpass="ONOS" + controllerStr +
- " Switches view is correct",
- onfail="ONOS" + controllerStr +
- " Switches view is incorrect" )
- if links[ controller ] and "Error" not in links[ controller ]:
- currentLinksResult = main.Mininet1.compareLinks(
- mnSwitches, mnLinks,
- json.loads( links[ controller ] ) )
- else:
- currentLinksResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentLinksResult,
- onpass="ONOS" + controllerStr +
- " links view is correct",
- onfail="ONOS" + controllerStr +
- " links view is incorrect" )
-
- if hosts[ controller ] or "Error" not in hosts[ controller ]:
- currentHostsResult = main.Mininet1.compareHosts(
- mnHosts,
- hosts[ controller ] )
- else:
- currentHostsResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentHostsResult,
- onpass="ONOS" + controllerStr +
- " hosts exist in Mininet",
- onfail="ONOS" + controllerStr +
- " hosts don't match Mininet" )
-
- devicesResults = devicesResults and currentDevicesResult
- linksResults = linksResults and currentLinksResult
- hostsResults = hostsResults and currentHostsResult
-
- main.step( "Device information is correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=devicesResults,
- onpass="Device information is correct",
- onfail="Device information is incorrect" )
-
- main.step( "Links are correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linksResults,
- onpass="Link are correct",
- onfail="Links are incorrect" )
-
- main.step( "Hosts are correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=hostsResults,
- onpass="Hosts are correct",
- onfail="Hosts are incorrect" )
-
- def CASE6( self, main ):
- """
- The Failure case.
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- try:
- labels
- except NameError:
- main.log.error( "labels not defined, setting to []" )
- global labels
- labels = []
- try:
- data
- except NameError:
- main.log.error( "data not defined, setting to []" )
- global data
- data = []
- # Reset non-persistent variables
- try:
- iCounterValue = 0
- except NameError:
- main.log.error( "iCounterValue not defined, setting to 0" )
- iCounterValue = 0
-
- main.case( "Restart entire ONOS cluster" )
-
- main.step( "Killing ONOS nodes" )
- killResults = main.TRUE
- killTime = time.time()
- for node in nodes:
- killed = main.ONOSbench.onosKill( node.ip_address )
- killResults = killResults and killed
- utilities.assert_equals( expect=main.TRUE, actual=killResults,
- onpass="ONOS nodes killed",
- onfail="ONOS kill unsuccessful" )
-
- main.step( "Checking if ONOS is up yet" )
- for i in range( 2 ):
- onosIsupResult = main.TRUE
- for node in nodes:
- started = main.ONOSbench.isup( node.ip_address )
- if not started:
- main.log.error( node.name + " didn't start!" )
- onosIsupResult = onosIsupResult and started
- if onosIsupResult == main.TRUE:
- break
- utilities.assert_equals( expect=main.TRUE, actual=onosIsupResult,
- onpass="ONOS restarted",
- onfail="ONOS restart NOT successful" )
-
- main.log.step( "Starting ONOS CLI sessions" )
- cliResults = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].startOnosCli,
- name="startOnosCli-" + str( i ),
- args=[nodes[i].ip_address] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- cliResults = cliResults and t.result
- utilities.assert_equals( expect=main.TRUE, actual=cliResults,
- onpass="ONOS cli started",
- onfail="ONOS clis did not restart" )
-
- # Grab the time of restart so we chan check how long the gossip
- # protocol has had time to work
- main.restartTime = time.time() - killTime
- main.log.debug( "Restart time: " + str( main.restartTime ) )
- labels.append( "Restart" )
- data.append( str( main.restartTime ) )
-
- # FIXME: revisit test plan for election with madan
- # Rerun for election on restarted nodes
- runResults = main.TRUE
- for cli in CLIs:
- run = CLIs[0].electionTestRun()
- if run != main.TRUE:
- main.log.error( "Error running for election on " + cli.name )
- runResults = runResults and run
- utilities.assert_equals( expect=main.TRUE, actual=runResults,
- onpass="Reran for election",
- onfail="Failed to rerun for election" )
-
- # TODO: Make this configurable
- time.sleep( 60 )
- main.log.debug( CLIs[0].nodes( jsonFormat=False ) )
- main.log.debug( CLIs[0].leaders( jsonFormat=False ) )
- main.log.debug( CLIs[0].partitions( jsonFormat=False ) )
-
- def CASE7( self, main ):
- """
- Check state after ONOS failure
- """
- import json
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- main.case( "Running ONOS Constant State Tests" )
-
- main.step( "Check that each switch has a master" )
- # Assert that each device has a master
- rolesNotNull = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].rolesNotNull,
- name="rolesNotNull-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- rolesNotNull = rolesNotNull and t.result
- utilities.assert_equals(
- expect=main.TRUE,
- actual=rolesNotNull,
- onpass="Each device has a master",
- onfail="Some devices don't have a master assigned" )
-
- main.step( "Read device roles from ONOS" )
- ONOSMastership = []
- mastershipCheck = main.FALSE
- consistentMastership = True
- rolesResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].roles,
- name="roles-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ONOSMastership.append( t.result )
-
- for i in range( numControllers ):
- if not ONOSMastership[i] or "Error" in ONOSMastership[i]:
- main.log.error( "Error in getting ONOS" + str( i + 1 ) +
- " roles" )
- main.log.warn(
- "ONOS" + str( i + 1 ) + " mastership response: " +
- repr( ONOSMastership[i] ) )
- rolesResults = False
- utilities.assert_equals(
- expect=True,
- actual=rolesResults,
- onpass="No error in reading roles output",
- onfail="Error in reading roles from ONOS" )
-
- main.step( "Check for consistency in roles from each controller" )
- if all([ i == ONOSMastership[ 0 ] for i in ONOSMastership ] ):
- main.log.info(
- "Switch roles are consistent across all ONOS nodes" )
- else:
- consistentMastership = False
- utilities.assert_equals(
- expect=True,
- actual=consistentMastership,
- onpass="Switch roles are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of switch roles" )
-
- if rolesResults and not consistentMastership:
- for i in range( numControllers ):
- main.log.warn(
- "ONOS" + str( i + 1 ) + " roles: ",
- json.dumps(
- json.loads( ONOSMastership[ i ] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- elif rolesResults and not consistentMastership:
- mastershipCheck = main.TRUE
-
- '''
- description2 = "Compare switch roles from before failure"
- main.step( description2 )
- try:
- currentJson = json.loads( ONOSMastership[0] )
- oldJson = json.loads( mastershipState )
- except ( ValueError, TypeError ):
- main.log.exception( "Something is wrong with parsing " +
- "ONOSMastership[0] or mastershipState" )
- main.log.error( "ONOSMastership[0]: " + repr( ONOSMastership[0] ) )
- main.log.error( "mastershipState" + repr( mastershipState ) )
- main.cleanup()
- main.exit()
- mastershipCheck = main.TRUE
- for i in range( 1, 29 ):
- switchDPID = str(
- main.Mininet1.getSwitchDPID( switch="s" + str( i ) ) )
- current = [ switch[ 'master' ] for switch in currentJson
- if switchDPID in switch[ 'id' ] ]
- old = [ switch[ 'master' ] for switch in oldJson
- if switchDPID in switch[ 'id' ] ]
- if current == old:
- mastershipCheck = mastershipCheck and main.TRUE
- else:
- main.log.warn( "Mastership of switch %s changed" % switchDPID )
- mastershipCheck = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=mastershipCheck,
- onpass="Mastership of Switches was not changed",
- onfail="Mastership of some switches changed" )
- '''
- # NOTE: we expect mastership to change on controller failure
-
- main.step( "Get the intents and compare across all nodes" )
- ONOSIntents = []
- intentCheck = main.FALSE
- consistentIntents = True
- intentsResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].intents,
- name="intents-" + str( i ),
- args=[],
- kwargs={ 'jsonFormat': True } )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ONOSIntents.append( t.result )
-
- for i in range( numControllers ):
- if not ONOSIntents[ i ] or "Error" in ONOSIntents[ i ]:
- main.log.error( "Error in getting ONOS" + str( i + 1 ) +
- " intents" )
- main.log.warn( "ONOS" + str( i + 1 ) + " intents response: " +
- repr( ONOSIntents[ i ] ) )
- intentsResults = False
- utilities.assert_equals(
- expect=True,
- actual=intentsResults,
- onpass="No error in reading intents output",
- onfail="Error in reading intents from ONOS" )
-
- main.step( "Check for consistency in Intents from each controller" )
- if all([ sorted( i ) == sorted( ONOSIntents[ 0 ] ) for i in ONOSIntents ] ):
- main.log.info( "Intents are consistent across all ONOS " +
- "nodes" )
- else:
- consistentIntents = False
-
- # Try to make it easy to figure out what is happening
- #
- # Intent ONOS1 ONOS2 ...
- # 0x01 INSTALLED INSTALLING
- # ... ... ...
- # ... ... ...
- title = " ID"
- for n in range( numControllers ):
- title += " " * 10 + "ONOS" + str( n + 1 )
- main.log.warn( title )
- # get all intent keys in the cluster
- keys = []
- for nodeStr in ONOSIntents:
- node = json.loads( nodeStr )
- for intent in node:
- keys.append( intent.get( 'id' ) )
- keys = set( keys )
- for key in keys:
- row = "%-13s" % key
- for nodeStr in ONOSIntents:
- node = json.loads( nodeStr )
- for intent in node:
- if intent.get( 'id' ) == key:
- row += "%-15s" % intent.get( 'state' )
- main.log.warn( row )
- # End table view
-
- utilities.assert_equals(
- expect=True,
- actual=consistentIntents,
- onpass="Intents are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of intents" )
- intentStates = []
- for node in ONOSIntents: # Iter through ONOS nodes
- nodeStates = []
- # Iter through intents of a node
- try:
- for intent in json.loads( node ):
- nodeStates.append( intent[ 'state' ] )
- except ( ValueError, TypeError ):
- main.log.exception( "Error in parsing intents" )
- main.log.error( repr( node ) )
- intentStates.append( nodeStates )
- out = [ (i, nodeStates.count( i ) ) for i in set( nodeStates ) ]
- main.log.info( dict( out ) )
-
- if intentsResults and not consistentIntents:
- for i in range( numControllers ):
- main.log.warn( "ONOS" + str( i + 1 ) + " intents: " )
- main.log.warn( json.dumps(
- json.loads( ONOSIntents[ i ] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- elif intentsResults and consistentIntents:
- intentCheck = main.TRUE
-
- # NOTE: Store has no durability, so intents are lost across system
- # restarts
- """
- main.step( "Compare current intents with intents before the failure" )
- # NOTE: this requires case 5 to pass for intentState to be set.
- # maybe we should stop the test if that fails?
- sameIntents = main.FALSE
- if intentState and intentState == ONOSIntents[ 0 ]:
- sameIntents = main.TRUE
- main.log.info( "Intents are consistent with before failure" )
- # TODO: possibly the states have changed? we may need to figure out
- # what the acceptable states are
- elif len( intentState ) == len( ONOSIntents[ 0 ] ):
- sameIntents = main.TRUE
- try:
- before = json.loads( intentState )
- after = json.loads( ONOSIntents[ 0 ] )
- for intent in before:
- if intent not in after:
- sameIntents = main.FALSE
- main.log.debug( "Intent is not currently in ONOS " +
- "(at least in the same form):" )
- main.log.debug( json.dumps( intent ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Exception printing intents" )
- main.log.debug( repr( ONOSIntents[0] ) )
- main.log.debug( repr( intentState ) )
- if sameIntents == main.FALSE:
- try:
- main.log.debug( "ONOS intents before: " )
- main.log.debug( json.dumps( json.loads( intentState ),
- sort_keys=True, indent=4,
- separators=( ',', ': ' ) ) )
- main.log.debug( "Current ONOS intents: " )
- main.log.debug( json.dumps( json.loads( ONOSIntents[ 0 ] ),
- sort_keys=True, indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Exception printing intents" )
- main.log.debug( repr( ONOSIntents[0] ) )
- main.log.debug( repr( intentState ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=sameIntents,
- onpass="Intents are consistent with before failure",
- onfail="The Intents changed during failure" )
- intentCheck = intentCheck and sameIntents
- """
- main.step( "Get the OF Table entries and compare to before " +
- "component failure" )
- FlowTables = main.TRUE
- flows2 = []
- for i in range( 28 ):
- main.log.info( "Checking flow table on s" + str( i + 1 ) )
- tmpFlows = main.Mininet2.getFlowTable( 1.3, "s" + str( i + 1 ) )
- flows2.append( tmpFlows )
- tempResult = main.Mininet2.flowComp(
- flow1=flows[ i ],
- flow2=tmpFlows )
- FlowTables = FlowTables and tempResult
- if FlowTables == main.FALSE:
- main.log.info( "Differences in flow table for switch: s" +
- str( i + 1 ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=FlowTables,
- onpass="No changes were found in the flow tables",
- onfail="Changes were found in the flow tables" )
-
- # main.step( "Check the continuous pings to ensure that no packets " +
- # "were dropped during component failure" )
- main.Mininet2.pingKill( main.params[ 'TESTONUSER' ],
- main.params[ 'TESTONIP' ] )
- LossInPings = main.FALSE
- # NOTE: checkForLoss returns main.FALSE with 0% packet loss
- for i in range( 8, 18 ):
- main.log.info(
- "Checking for a loss in pings along flow from s" +
- str( i ) )
- LossInPings = main.Mininet2.checkForLoss(
- "/tmp/ping.h" +
- str( i ) ) or LossInPings
- if LossInPings == main.TRUE:
- main.log.info( "Loss in ping detected" )
- elif LossInPings == main.ERROR:
- main.log.info( "There are multiple mininet process running" )
- elif LossInPings == main.FALSE:
- main.log.info( "No Loss in the pings" )
- main.log.info( "No loss of dataplane connectivity" )
- # utilities.assert_equals(
- # expect=main.FALSE,
- # actual=LossInPings,
- # onpass="No Loss of connectivity",
- # onfail="Loss of dataplane connectivity detected" )
-
- # NOTE: Since intents are not persisted with IntnentStore,
- # we expect loss in dataplane connectivity
- LossInPings = main.FALSE
-
- main.step( "Leadership Election is still functional" )
- # Test of LeadershipElection
- leaderList = []
- leaderResult = main.TRUE
- for cli in CLIs:
- leaderN = cli.electionTestLeader()
- leaderList.append( leaderN )
- if leaderN == main.FALSE:
- # error in response
- main.log.error( "Something is wrong with " +
- "electionTestLeader function, check the" +
- " error logs" )
- leaderResult = main.FALSE
- elif leaderN is None:
- main.log.error( cli.name +
- " shows no leader for the election-app." )
- leaderResult = main.FALSE
- if len( set( leaderList ) ) != 1:
- leaderResult = main.FALSE
- main.log.error(
- "Inconsistent view of leader for the election test app" )
- # TODO: print the list
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Leadership election passed",
- onfail="Something went wrong with Leadership election" )
-
- def CASE8( self, main ):
- """
- Compare topo
- """
- import json
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- main.case( "Compare ONOS Topology view to Mininet topology" )
- main.caseExplaination = "Compare topology objects between Mininet" +\
- " and ONOS"
-
- main.step( "Comparing ONOS topology to MN" )
- devicesResults = main.TRUE
- linksResults = main.TRUE
- hostsResults = main.TRUE
- hostAttachmentResults = True
- topoResult = main.FALSE
- elapsed = 0
- count = 0
- main.step( "Collecting topology information from ONOS" )
- startTime = time.time()
- # Give time for Gossip to work
- while topoResult == main.FALSE and elapsed < 60:
- count += 1
- cliStart = time.time()
- devices = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].devices,
- name="devices-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- devices.append( t.result )
- hosts = []
- ipResult = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].hosts,
- name="hosts-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- try:
- hosts.append( json.loads( t.result ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing hosts results" )
- main.log.error( repr( t.result ) )
- for controller in range( 0, len( hosts ) ):
- controllerStr = str( controller + 1 )
- for host in hosts[ controller ]:
- if host is None or host.get( 'ipAddresses', [] ) == []:
- main.log.error(
- "DEBUG:Error with host ipAddresses on controller" +
- controllerStr + ": " + str( host ) )
- ipResult = main.FALSE
- ports = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].ports,
- name="ports-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ports.append( t.result )
- links = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].links,
- name="links-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- links.append( t.result )
- clusters = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].clusters,
- name="clusters-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- clusters.append( t.result )
-
- elapsed = time.time() - startTime
- cliTime = time.time() - cliStart
- print "Elapsed time: " + str( elapsed )
- print "CLI time: " + str( cliTime )
-
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
- mnHosts = main.Mininet1.getHosts()
- for controller in range( numControllers ):
- controllerStr = str( controller + 1 )
- if devices[ controller ] and ports[ controller ] and\
- "Error" not in devices[ controller ] and\
- "Error" not in ports[ controller ]:
-
- currentDevicesResult = main.Mininet1.compareSwitches(
- mnSwitches,
- json.loads( devices[ controller ] ),
- json.loads( ports[ controller ] ) )
- else:
- currentDevicesResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentDevicesResult,
- onpass="ONOS" + controllerStr +
- " Switches view is correct",
- onfail="ONOS" + controllerStr +
- " Switches view is incorrect" )
-
- if links[ controller ] and "Error" not in links[ controller ]:
- currentLinksResult = main.Mininet1.compareLinks(
- mnSwitches, mnLinks,
- json.loads( links[ controller ] ) )
- else:
- currentLinksResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentLinksResult,
- onpass="ONOS" + controllerStr +
- " links view is correct",
- onfail="ONOS" + controllerStr +
- " links view is incorrect" )
-
- if hosts[ controller ] or "Error" not in hosts[ controller ]:
- currentHostsResult = main.Mininet1.compareHosts(
- mnHosts,
- hosts[ controller ] )
- else:
- currentHostsResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentHostsResult,
- onpass="ONOS" + controllerStr +
- " hosts exist in Mininet",
- onfail="ONOS" + controllerStr +
- " hosts don't match Mininet" )
- # CHECKING HOST ATTACHMENT POINTS
- hostAttachment = True
- noHosts = False
- # FIXME: topo-HA/obelisk specific mappings:
- # key is mac and value is dpid
- mappings = {}
- for i in range( 1, 29 ): # hosts 1 through 28
- # set up correct variables:
- macId = "00:" * 5 + hex( i ).split( "0x" )[1].upper().zfill(2)
- if i == 1:
- deviceId = "1000".zfill(16)
- elif i == 2:
- deviceId = "2000".zfill(16)
- elif i == 3:
- deviceId = "3000".zfill(16)
- elif i == 4:
- deviceId = "3004".zfill(16)
- elif i == 5:
- deviceId = "5000".zfill(16)
- elif i == 6:
- deviceId = "6000".zfill(16)
- elif i == 7:
- deviceId = "6007".zfill(16)
- elif i >= 8 and i <= 17:
- dpid = '3' + str( i ).zfill( 3 )
- deviceId = dpid.zfill(16)
- elif i >= 18 and i <= 27:
- dpid = '6' + str( i ).zfill( 3 )
- deviceId = dpid.zfill(16)
- elif i == 28:
- deviceId = "2800".zfill(16)
- mappings[ macId ] = deviceId
- if hosts[ controller ] or "Error" not in hosts[ controller ]:
- if hosts[ controller ] == []:
- main.log.warn( "There are no hosts discovered" )
- noHosts = True
- else:
- for host in hosts[ controller ]:
- mac = None
- location = None
- device = None
- port = None
- try:
- mac = host.get( 'mac' )
- assert mac, "mac field could not be found for this host object"
-
- location = host.get( 'location' )
- assert location, "location field could not be found for this host object"
-
- # Trim the protocol identifier off deviceId
- device = str( location.get( 'elementId' ) ).split(':')[1]
- assert device, "elementId field could not be found for this host location object"
-
- port = location.get( 'port' )
- assert port, "port field could not be found for this host location object"
-
- # Now check if this matches where they should be
- if mac and device and port:
- if str( port ) != "1":
- main.log.error( "The attachment port is incorrect for " +
- "host " + str( mac ) +
- ". Expected: 1 Actual: " + str( port) )
- hostAttachment = False
- if device != mappings[ str( mac ) ]:
- main.log.error( "The attachment device is incorrect for " +
- "host " + str( mac ) +
- ". Expected: " + mappings[ str( mac ) ] +
- " Actual: " + device )
- hostAttachment = False
- else:
- hostAttachment = False
- except AssertionError:
- main.log.exception( "Json object not as expected" )
- main.log.error( repr( host ) )
- hostAttachment = False
- else:
- main.log.error( "No hosts json output or \"Error\"" +
- " in output. hosts = " +
- repr( hosts[ controller ] ) )
- if noHosts is False:
- # TODO: Find a way to know if there should be hosts in a
- # given point of the test
- hostAttachment = True
-
- # END CHECKING HOST ATTACHMENT POINTS
- devicesResults = devicesResults and currentDevicesResult
- linksResults = linksResults and currentLinksResult
- hostsResults = hostsResults and currentHostsResult
- hostAttachmentResults = hostAttachmentResults and\
- hostAttachment
- topoResult = ( devicesResults and linksResults
- and hostsResults and ipResult and
- hostAttachmentResults )
-
- # Compare json objects for hosts and dataplane clusters
-
- # hosts
- main.step( "Hosts view is consistent across all ONOS nodes" )
- consistentHostsResult = main.TRUE
- for controller in range( len( hosts ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in hosts[ controller ]:
- if hosts[ controller ] == hosts[ 0 ]:
- continue
- else: # hosts not consistent
- main.log.error( "hosts from ONOS" + controllerStr +
- " is inconsistent with ONOS1" )
- main.log.warn( repr( hosts[ controller ] ) )
- consistentHostsResult = main.FALSE
-
- else:
- main.log.error( "Error in getting ONOS hosts from ONOS" +
- controllerStr )
- consistentHostsResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " hosts response: " +
- repr( hosts[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentHostsResult,
- onpass="Hosts view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of hosts" )
-
- main.step( "Hosts information is correct" )
- hostsResults = hostsResults and ipResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=hostsResults,
- onpass="Host information is correct",
- onfail="Host information is incorrect" )
-
- main.step( "Host attachment points to the network" )
- utilities.assert_equals(
- expect=True,
- actual=hostAttachmentResults,
- onpass="Hosts are correctly attached to the network",
- onfail="ONOS did not correctly attach hosts to the network" )
-
- # Strongly connected clusters of devices
- main.step( "Clusters view is consistent across all ONOS nodes" )
- consistentClustersResult = main.TRUE
- for controller in range( len( clusters ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in clusters[ controller ]:
- if clusters[ controller ] == clusters[ 0 ]:
- continue
- else: # clusters not consistent
- main.log.error( "clusters from ONOS" +
- controllerStr +
- " is inconsistent with ONOS1" )
- consistentClustersResult = main.FALSE
-
- else:
- main.log.error( "Error in getting dataplane clusters " +
- "from ONOS" + controllerStr )
- consistentClustersResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " clusters response: " +
- repr( clusters[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentClustersResult,
- onpass="Clusters view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of clusters" )
-
- main.step( "There is only one SCC" )
- # there should always only be one cluster
- try:
- numClusters = len( json.loads( clusters[ 0 ] ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing clusters[0]: " +
- repr( clusters[0] ) )
- clusterResults = main.FALSE
- if numClusters == 1:
- clusterResults = main.TRUE
- utilities.assert_equals(
- expect=1,
- actual=numClusters,
- onpass="ONOS shows 1 SCC",
- onfail="ONOS shows " + str( numClusters ) + " SCCs" )
-
- topoResult = ( devicesResults and linksResults
- and hostsResults and consistentHostsResult
- and consistentClustersResult and clusterResults
- and ipResult and hostAttachmentResults )
-
- topoResult = topoResult and int( count <= 2 )
- note = "note it takes about " + str( int( cliTime ) ) + \
- " seconds for the test to make all the cli calls to fetch " +\
- "the topology from each ONOS instance"
- main.log.info(
- "Very crass estimate for topology discovery/convergence( " +
- str( note ) + " ): " + str( elapsed ) + " seconds, " +
- str( count ) + " tries" )
-
- main.step( "Device information is correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=devicesResults,
- onpass="Device information is correct",
- onfail="Device information is incorrect" )
-
- main.step( "Links are correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linksResults,
- onpass="Link are correct",
- onfail="Links are incorrect" )
-
- # FIXME: move this to an ONOS state case
- main.step( "Checking ONOS nodes" )
- nodesOutput = []
- nodeResults = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].nodes,
- name="nodes-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- nodesOutput.append( t.result )
- ips = [ node.ip_address for node in nodes ]
- for i in nodesOutput:
- try:
- current = json.loads( i )
- for node in current:
- currentResult = main.FALSE
- if node['ip'] in ips: # node in nodes() output is in cell
- if node['state'] == 'ACTIVE':
- currentResult = main.TRUE
- else:
- main.log.error( "Error in ONOS node availability" )
- main.log.error(
- json.dumps( current,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- break
- nodeResults = nodeResults and currentResult
- except ( ValueError, TypeError ):
- main.log.error( "Error parsing nodes output" )
- main.log.warn( repr( i ) )
- utilities.assert_equals( expect=main.TRUE, actual=nodeResults,
- onpass="Nodes check successful",
- onfail="Nodes check NOT successful" )
-
- def CASE9( self, main ):
- """
- Link s3-s28 down
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- # NOTE: You should probably run a topology check after this
-
- linkSleep = float( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- description = "Turn off a link to ensure that Link Discovery " +\
- "is working properly"
- main.case( description )
-
- main.step( "Kill Link between s3 and s28" )
- LinkDown = main.Mininet1.link( END1="s3", END2="s28", OPTION="down" )
- main.log.info( "Waiting " + str( linkSleep ) +
- " seconds for link down to be discovered" )
- time.sleep( linkSleep )
- utilities.assert_equals( expect=main.TRUE, actual=LinkDown,
- onpass="Link down successful",
- onfail="Failed to bring link down" )
- # TODO do some sort of check here
-
- def CASE10( self, main ):
- """
- Link s3-s28 up
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- # NOTE: You should probably run a topology check after this
-
- linkSleep = float( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- description = "Restore a link to ensure that Link Discovery is " + \
- "working properly"
- main.case( description )
-
- main.step( "Bring link between s3 and s28 back up" )
- LinkUp = main.Mininet1.link( END1="s3", END2="s28", OPTION="up" )
- main.log.info( "Waiting " + str( linkSleep ) +
- " seconds for link up to be discovered" )
- time.sleep( linkSleep )
- utilities.assert_equals( expect=main.TRUE, actual=LinkUp,
- onpass="Link up successful",
- onfail="Failed to bring link up" )
- # TODO do some sort of check here
-
- def CASE11( self, main ):
- """
- Switch Down
- """
- # NOTE: You should probably run a topology check after this
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- switchSleep = float( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
-
- description = "Killing a switch to ensure it is discovered correctly"
- main.case( description )
- switch = main.params[ 'kill' ][ 'switch' ]
- switchDPID = main.params[ 'kill' ][ 'dpid' ]
-
- # TODO: Make this switch parameterizable
- main.step( "Kill " + switch )
- main.log.info( "Deleting " + switch )
- main.Mininet1.delSwitch( switch )
- main.log.info( "Waiting " + str( switchSleep ) +
- " seconds for switch down to be discovered" )
- time.sleep( switchSleep )
- device = main.ONOScli1.getDevice( dpid=switchDPID )
- # Peek at the deleted switch
- main.log.warn( str( device ) )
- result = main.FALSE
- if device and device[ 'available' ] is False:
- result = main.TRUE
- utilities.assert_equals( expect=main.TRUE, actual=result,
- onpass="Kill switch successful",
- onfail="Failed to kill switch?" )
-
- def CASE12( self, main ):
- """
- Switch Up
- """
- # NOTE: You should probably run a topology check after this
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- assert ONOS1Port, "ONOS1Port not defined"
- assert ONOS2Port, "ONOS2Port not defined"
- assert ONOS3Port, "ONOS3Port not defined"
- assert ONOS4Port, "ONOS4Port not defined"
- assert ONOS5Port, "ONOS5Port not defined"
- assert ONOS6Port, "ONOS6Port not defined"
- assert ONOS7Port, "ONOS7Port not defined"
-
- switchSleep = float( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
- switch = main.params[ 'kill' ][ 'switch' ]
- switchDPID = main.params[ 'kill' ][ 'dpid' ]
- links = main.params[ 'kill' ][ 'links' ].split()
- description = "Adding a switch to ensure it is discovered correctly"
- main.case( description )
-
- main.step( "Add back " + switch )
- main.Mininet1.addSwitch( switch, dpid=switchDPID )
- for peer in links:
- main.Mininet1.addLink( switch, peer )
- ipList = []
- for i in range( numControllers ):
- ipList.append( nodes[ i ].ip_address )
- main.Mininet1.assignSwController( sw=switch, ip=ipList )
- main.log.info( "Waiting " + str( switchSleep ) +
- " seconds for switch up to be discovered" )
- time.sleep( switchSleep )
- device = main.ONOScli1.getDevice( dpid=switchDPID )
- # Peek at the deleted switch
- main.log.warn( str( device ) )
- result = main.FALSE
- if device and device[ 'available' ]:
- result = main.TRUE
- utilities.assert_equals( expect=main.TRUE, actual=result,
- onpass="add switch successful",
- onfail="Failed to add switch?" )
-
- def CASE13( self, main ):
- """
- Clean up
- """
- import os
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- # printing colors to terminal
- colors = { 'cyan': '\033[96m', 'purple': '\033[95m',
- 'blue': '\033[94m', 'green': '\033[92m',
- 'yellow': '\033[93m', 'red': '\033[91m', 'end': '\033[0m' }
- main.case( "Test Cleanup" )
- main.step( "Killing tcpdumps" )
- main.Mininet2.stopTcpdump()
-
- main.step( "Copying MN pcap and ONOS log files to test station" )
- testname = main.TEST
- teststationUser = main.params[ 'TESTONUSER' ]
- teststationIP = main.params[ 'TESTONIP' ]
- # NOTE: MN Pcap file is being saved to ~/packet_captures
- # scp this file as MN and TestON aren't necessarily the same vm
- # FIXME: scp
- # mn files
- # TODO: Load these from params
- # NOTE: must end in /
- logFolder = "/opt/onos/log/"
- logFiles = [ "karaf.log", "karaf.log.1" ]
- # NOTE: must end in /
- dstDir = "~/packet_captures/"
- for f in logFiles:
- for node in nodes:
- main.ONOSbench.handle.sendline( "scp sdn@" + node.ip_address +
- ":" + logFolder + f + " " +
- teststationUser + "@" +
- teststationIP + ":" +
- dstDir + str( testname ) +
- "-" + node.name + "-" + f )
- main.ONOSbench.handle.expect( "\$" )
-
- # std*.log's
- # NOTE: must end in /
- logFolder = "/opt/onos/var/"
- logFiles = [ "stderr.log", "stdout.log" ]
- # NOTE: must end in /
- dstDir = "~/packet_captures/"
- for f in logFiles:
- for node in nodes:
- main.ONOSbench.handle.sendline( "scp sdn@" + node.ip_address +
- ":" + logFolder + f + " " +
- teststationUser + "@" +
- teststationIP + ":" +
- dstDir + str( testname ) +
- "-" + node.name + "-" + f )
- main.ONOSbench.handle.expect( "\$" )
- # sleep so scp can finish
- time.sleep( 10 )
-
- main.step( "Stopping Mininet" )
- mnResult = main.Mininet1.stopNet()
- utilities.assert_equals( expect=main.TRUE, actual=mnResult,
- onpass="Mininet stopped",
- onfail="MN cleanup NOT successful" )
-
- main.step( "Checking ONOS Logs for errors" )
- for node in nodes:
- print colors[ 'purple' ] + "Checking logs for errors on " + \
- node.name + ":" + colors[ 'end' ]
- print main.ONOSbench.checkLogs( node.ip_address, restart=True )
-
- main.step( "Packing and rotating pcap archives" )
- os.system( "~/TestON/dependencies/rotate.sh " + str( testname ) )
-
- try:
- timerLog = open( main.logdir + "/Timers.csv", 'w')
- main.log.error( ", ".join( labels ) + "\n" + ", ".join( data ) )
- timerLog.write( ", ".join( labels ) + "\n" + ", ".join( data ) )
- timerLog.close()
- except NameError, e:
- main.log.exception(e)
-
- def CASE14( self, main ):
- """
- start election app on all onos nodes
- """
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- main.case("Start Leadership Election app")
- main.step( "Install leadership election app" )
- appResult = main.ONOScli1.activateApp( "org.onosproject.election" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=appResult,
- onpass="Election app installed",
- onfail="Something went wrong with installing Leadership election" )
-
- main.step( "Run for election on each node" )
- leaderResult = main.TRUE
- leaders = []
- for cli in CLIs:
- cli.electionTestRun()
- for cli in CLIs:
- leader = cli.electionTestLeader()
- if leader is None or leader == main.FALSE:
- main.log.error( cli.name + ": Leader for the election app " +
- "should be an ONOS node, instead got '" +
- str( leader ) + "'" )
- leaderResult = main.FALSE
- leaders.append( leader )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Successfully ran for leadership",
- onfail="Failed to run for leadership" )
-
- main.step( "Check that each node shows the same leader" )
- sameLeader = main.TRUE
- if len( set( leaders ) ) != 1:
- sameLeader = main.FALSE
- main.log.error( "Results of electionTestLeader is order of CLIs:" +
- str( leaders ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=sameLeader,
- onpass="Leadership is consistent for the election topic",
- onfail="Nodes have different leaders" )
-
- def CASE15( self, main ):
- """
- Check that Leadership Election is still functional
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- leaderResult = main.TRUE
- description = "Check that Leadership Election is still functional"
- main.case( description )
- # NOTE: Need to re-run since being a canidate is not persistant
- main.step( "Run for election on each node" )
- leaderResult = main.TRUE
- leaders = []
- for cli in CLIs:
- cli.electionTestRun()
- for cli in CLIs:
- leader = cli.electionTestLeader()
- if leader is None or leader == main.FALSE:
- main.log.error( cli.name + ": Leader for the election app " +
- "should be an ONOS node, instead got '" +
- str( leader ) + "'" )
- leaderResult = main.FALSE
- leaders.append( leader )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Successfully ran for leadership",
- onfail="Failed to run for leadership" )
-
- main.step( "Check that each node shows the same leader" )
- sameLeader = main.TRUE
- if len( set( leaders ) ) != 1:
- sameLeader = main.FALSE
- main.log.error( "Results of electionTestLeader is order of CLIs:" +
- str( leaders ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=sameLeader,
- onpass="Leadership is consistent for the election topic",
- onfail="Nodes have different leaders" )
-
- main.step( "Find current leader and withdraw" )
- leader = main.ONOScli1.electionTestLeader()
- # do some sanity checking on leader before using it
- withdrawResult = main.FALSE
- if leader is None or leader == main.FALSE:
- main.log.error(
- "Leader for the election app should be an ONOS node," +
- "instead got '" + str( leader ) + "'" )
- leaderResult = main.FALSE
- oldLeader = None
- for i in range( len( CLIs ) ):
- if leader == nodes[ i ].ip_address:
- oldLeader = CLIs[ i ]
- break
- else: # FOR/ELSE statement
- main.log.error( "Leader election, could not find current leader" )
- if oldLeader:
- withdrawResult = oldLeader.electionTestWithdraw()
- utilities.assert_equals(
- expect=main.TRUE,
- actual=withdrawResult,
- onpass="Node was withdrawn from election",
- onfail="Node was not withdrawn from election" )
-
- main.step( "Make sure new leader is elected" )
- # FIXME: use threads
- leaderList = []
- for cli in CLIs:
- leaderN = cli.electionTestLeader()
- leaderList.append( leaderN )
- if leaderN == leader:
- main.log.error( cli.name + " still sees " + str( leader ) +
- " as leader after they withdrew" )
- leaderResult = main.FALSE
- elif leaderN == main.FALSE:
- # error in response
- # TODO: add check for "Command not found:" in the driver, this
- # means the app isn't loaded
- main.log.error( "Something is wrong with " +
- "electionTestLeader function, " +
- "check the error logs" )
- leaderResult = main.FALSE
- elif leaderN is None:
- # node may not have recieved the event yet
- time.sleep(7)
- leaderN = cli.electionTestLeader()
- leaderList.pop()
- leaderList.append( leaderN )
- consistentLeader = main.FALSE
- if len( set( leaderList ) ) == 1:
- main.log.info( "Each Election-app sees '" +
- str( leaderList[ 0 ] ) +
- "' as the leader" )
- consistentLeader = main.TRUE
- else:
- main.log.error(
- "Inconsistent responses for leader of Election-app:" )
- for n in range( len( leaderList ) ):
- main.log.error( "ONOS" + str( n + 1 ) + " response: " +
- str( leaderList[ n ] ) )
- leaderResult = leaderResult and consistentLeader
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Leadership election passed",
- onfail="Something went wrong with Leadership election" )
-
- main.step( "Run for election on old leader( just so everyone " +
- "is in the hat )" )
- if oldLeader:
- runResult = oldLeader.electionTestRun()
- else:
- runResult = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=runResult,
- onpass="App re-ran for election",
- onfail="App failed to run for election" )
-
- main.step( "Leader did not change when old leader re-ran" )
- afterRun = main.ONOScli1.electionTestLeader()
- # verify leader didn't just change
- if afterRun == leaderList[ 0 ]:
- afterResult = main.TRUE
- else:
- afterResult = main.FALSE
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=afterResult,
- onpass="Old leader successfully re-ran for election",
- onfail="Something went wrong with Leadership election after " +
- "the old leader re-ran for election" )
-
- def CASE16( self, main ):
- """
- Install Distributed Primitives app
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- # Variables for the distributed primitives tests
- global pCounterName
- global iCounterName
- global pCounterValue
- global iCounterValue
- global onosSet
- global onosSetName
- pCounterName = "TestON-Partitions"
- iCounterName = "TestON-inMemory"
- pCounterValue = 0
- iCounterValue = 0
- onosSet = set([])
- onosSetName = "TestON-set"
-
- description = "Install Primitives app"
- main.case( description )
- main.step( "Install Primitives app" )
- appName = "org.onosproject.distributedprimitives"
- appResults = CLIs[0].activateApp( appName )
- utilities.assert_equals( expect=main.TRUE,
- actual=appResults,
- onpass="Primitives app activated",
- onfail="Primitives app not activated" )
- time.sleep( 5 ) # To allow all nodes to activate
-
- def CASE17( self, main ):
- """
- Check for basic functionality with distributed primitives
- """
- import json
- # Make sure variables are defined/set
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- assert pCounterName, "pCounterName not defined"
- assert iCounterName, "iCounterName not defined"
- assert onosSetName, "onosSetName not defined"
- # NOTE: assert fails if value is 0/None/Empty/False
- try:
- pCounterValue
- except NameError:
- main.log.error( "pCounterValue not defined, setting to 0" )
- pCounterValue = 0
- try:
- iCounterValue
- except NameError:
- main.log.error( "iCounterValue not defined, setting to 0" )
- iCounterValue = 0
- try:
- onosSet
- except NameError:
- main.log.error( "onosSet not defined, setting to empty Set" )
- onosSet = set([])
- # Variables for the distributed primitives tests. These are local only
- addValue = "a"
- addAllValue = "a b c d e f"
- retainValue = "c d e f"
-
- description = "Check for basic functionality with distributed " +\
- "primitives"
- main.case( description )
- main.caseExplaination = "Test the methods of the distributed primitives (counters and sets) throught the cli"
- # DISTRIBUTED ATOMIC COUNTERS
- main.step( "Increment and get a default counter on each node" )
- pCounters = []
- threads = []
- addedPValues = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].counterTestIncrement,
- name="counterIncrement-" + str( i ),
- args=[ pCounterName ] )
- pCounterValue += 1
- addedPValues.append( pCounterValue )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- pCounters.append( t.result )
- # Check that counter incremented numController times
- pCounterResults = True
- for i in addedPValues:
- tmpResult = i in pCounters
- pCounterResults = pCounterResults and tmpResult
- if not tmpResult:
- main.log.error( str( i ) + " is not in partitioned "
- "counter incremented results" )
- utilities.assert_equals( expect=True,
- actual=pCounterResults,
- onpass="Default counter incremented",
- onfail="Error incrementing default" +
- " counter" )
-
- main.step( "Increment and get an in memory counter on each node" )
- iCounters = []
- addedIValues = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].counterTestIncrement,
- name="icounterIncrement-" + str( i ),
- args=[ iCounterName ],
- kwargs={ "inMemory": True } )
- iCounterValue += 1
- addedIValues.append( iCounterValue )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- iCounters.append( t.result )
- # Check that counter incremented numController times
- iCounterResults = True
- for i in addedIValues:
- tmpResult = i in iCounters
- iCounterResults = iCounterResults and tmpResult
- if not tmpResult:
- main.log.error( str( i ) + " is not in the in-memory "
- "counter incremented results" )
- utilities.assert_equals( expect=True,
- actual=iCounterResults,
- onpass="In memory counter incremented",
- onfail="Error incrementing in memory" +
- " counter" )
-
- main.step( "Check counters are consistant across nodes" )
- onosCounters = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].counters,
- name="counters-" + str( i ) )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- onosCounters.append( t.result )
- tmp = [ i == onosCounters[ 0 ] for i in onosCounters ]
- if all( tmp ):
- main.log.info( "Counters are consistent across all nodes" )
- consistentCounterResults = main.TRUE
- else:
- main.log.error( "Counters are not consistent across all nodes" )
- consistentCounterResults = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=consistentCounterResults,
- onpass="ONOS counters are consistent " +
- "across nodes",
- onfail="ONOS Counters are inconsistent " +
- "across nodes" )
-
- main.step( "Counters we added have the correct values" )
- correctResults = main.TRUE
- for i in range( numControllers ):
- current = json.loads( onosCounters[i] )
- pValue = None
- iValue = None
- try:
- for database in current:
- partitioned = database.get( 'partitionedDatabaseCounters' )
- if partitioned:
- for value in partitioned:
- if value.get( 'name' ) == pCounterName:
- pValue = value.get( 'value' )
- break
- inMemory = database.get( 'inMemoryDatabaseCounters' )
- if inMemory:
- for value in inMemory:
- if value.get( 'name' ) == iCounterName:
- iValue = value.get( 'value' )
- break
- except AttributeError, e:
- main.log.error( "ONOS" + str( i + 1 ) + " counters result " +
- "is not as expected" )
- correctResults = main.FALSE
- if pValue == pCounterValue:
- main.log.info( "Partitioned counter value is correct" )
- else:
- main.log.error( "Partitioned counter value is incorrect," +
- " expected value: " + str( pCounterValue )
- + " current value: " + str( pValue ) )
- correctResults = main.FALSE
- if iValue == iCounterValue:
- main.log.info( "In memory counter value is correct" )
- else:
- main.log.error( "In memory counter value is incorrect, " +
- "expected value: " + str( iCounterValue ) +
- " current value: " + str( iValue ) )
- correctResults = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=correctResults,
- onpass="Added counters are correct",
- onfail="Added counters are incorrect" )
- # DISTRIBUTED SETS
- main.step( "Distributed Set get" )
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
-
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=getResults,
- onpass="Set elements are correct",
- onfail="Set elements are incorrect" )
-
- main.step( "Distributed Set size" )
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
-
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- utilities.assert_equals( expect=main.TRUE,
- actual=sizeResults,
- onpass="Set sizes are correct",
- onfail="Set sizes are incorrect" )
-
- main.step( "Distributed Set add()" )
- onosSet.add( addValue )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAdd-" + str( i ),
- args=[ onosSetName, addValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addResults = main.FALSE
- else:
- # unexpected result
- addResults = main.FALSE
- if addResults != main.TRUE:
- main.log.error( "Error executing set add" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addResults = addResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addResults,
- onpass="Set add correct",
- onfail="Set add was incorrect" )
-
- main.step( "Distributed Set addAll()" )
- onosSet.update( addAllValue.split() )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAddAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addAllResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addAllResults = main.FALSE
- else:
- # unexpected result
- addAllResults = main.FALSE
- if addAllResults != main.TRUE:
- main.log.error( "Error executing set addAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addAllResults = addAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addAllResults,
- onpass="Set addAll correct",
- onfail="Set addAll was incorrect" )
-
- main.step( "Distributed Set contains()" )
- containsResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setContains-" + str( i ),
- args=[ onosSetName ],
- kwargs={ "values": addValue } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- # NOTE: This is the tuple
- containsResponses.append( t.result )
-
- containsResults = main.TRUE
- for i in range( numControllers ):
- if containsResponses[ i ] == main.ERROR:
- containsResults = main.FALSE
- else:
- containsResults = containsResults and\
- containsResponses[ i ][ 1 ]
- utilities.assert_equals( expect=main.TRUE,
- actual=containsResults,
- onpass="Set contains is functional",
- onfail="Set contains failed" )
-
- main.step( "Distributed Set containsAll()" )
- containsAllResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setContainsAll-" + str( i ),
- args=[ onosSetName ],
- kwargs={ "values": addAllValue } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- # NOTE: This is the tuple
- containsAllResponses.append( t.result )
-
- containsAllResults = main.TRUE
- for i in range( numControllers ):
- if containsResponses[ i ] == main.ERROR:
- containsResults = main.FALSE
- else:
- containsResults = containsResults and\
- containsResponses[ i ][ 1 ]
- utilities.assert_equals( expect=main.TRUE,
- actual=containsAllResults,
- onpass="Set containsAll is functional",
- onfail="Set containsAll failed" )
-
- main.step( "Distributed Set remove()" )
- onosSet.remove( addValue )
- removeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestRemove-" + str( i ),
- args=[ onosSetName, addValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- removeResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- removeResults = main.TRUE
- for i in range( numControllers ):
- if removeResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif removeResponses[ i ] == main.FALSE:
- # not in set, probably fine
- pass
- elif removeResponses[ i ] == main.ERROR:
- # Error in execution
- removeResults = main.FALSE
- else:
- # unexpected result
- removeResults = main.FALSE
- if removeResults != main.TRUE:
- main.log.error( "Error executing set remove" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- removeResults = removeResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=removeResults,
- onpass="Set remove correct",
- onfail="Set remove was incorrect" )
-
- main.step( "Distributed Set removeAll()" )
- onosSet.difference_update( addAllValue.split() )
- removeAllResponses = []
- threads = []
- try:
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestRemoveAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- removeAllResponses.append( t.result )
- except Exception, e:
- main.log.exception(e)
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- removeAllResults = main.TRUE
- for i in range( numControllers ):
- if removeAllResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif removeAllResponses[ i ] == main.FALSE:
- # not in set, probably fine
- pass
- elif removeAllResponses[ i ] == main.ERROR:
- # Error in execution
- removeAllResults = main.FALSE
- else:
- # unexpected result
- removeAllResults = main.FALSE
- if removeAllResults != main.TRUE:
- main.log.error( "Error executing set removeAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- removeAllResults = removeAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=removeAllResults,
- onpass="Set removeAll correct",
- onfail="Set removeAll was incorrect" )
-
- main.step( "Distributed Set addAll()" )
- onosSet.update( addAllValue.split() )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAddAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addAllResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addAllResults = main.FALSE
- else:
- # unexpected result
- addAllResults = main.FALSE
- if addAllResults != main.TRUE:
- main.log.error( "Error executing set addAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addAllResults = addAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addAllResults,
- onpass="Set addAll correct",
- onfail="Set addAll was incorrect" )
-
- main.step( "Distributed Set clear()" )
- onosSet.clear()
- clearResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestClear-" + str( i ),
- args=[ onosSetName, " "], # Values doesn't matter
- kwargs={ "clear": True } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- clearResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- clearResults = main.TRUE
- for i in range( numControllers ):
- if clearResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif clearResponses[ i ] == main.FALSE:
- # Nothing set, probably fine
- pass
- elif clearResponses[ i ] == main.ERROR:
- # Error in execution
- clearResults = main.FALSE
- else:
- # unexpected result
- clearResults = main.FALSE
- if clearResults != main.TRUE:
- main.log.error( "Error executing set clear" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- clearResults = clearResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=clearResults,
- onpass="Set clear correct",
- onfail="Set clear was incorrect" )
-
- main.step( "Distributed Set addAll()" )
- onosSet.update( addAllValue.split() )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAddAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addAllResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addAllResults = main.FALSE
- else:
- # unexpected result
- addAllResults = main.FALSE
- if addAllResults != main.TRUE:
- main.log.error( "Error executing set addAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addAllResults = addAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addAllResults,
- onpass="Set addAll correct",
- onfail="Set addAll was incorrect" )
-
- main.step( "Distributed Set retain()" )
- onosSet.intersection_update( retainValue.split() )
- retainResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestRetain-" + str( i ),
- args=[ onosSetName, retainValue ],
- kwargs={ "retain": True } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- retainResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- retainResults = main.TRUE
- for i in range( numControllers ):
- if retainResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif retainResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif retainResponses[ i ] == main.ERROR:
- # Error in execution
- retainResults = main.FALSE
- else:
- # unexpected result
- retainResults = main.FALSE
- if retainResults != main.TRUE:
- main.log.error( "Error executing set retain" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " +
- str( size ) + " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- retainResults = retainResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=retainResults,
- onpass="Set retain correct",
- onfail="Set retain was incorrect" )
-
diff --git a/TestON/tests/HATestClusterRestart/HATestClusterRestart.topo b/TestON/tests/HATestClusterRestart/HATestClusterRestart.topo
deleted file mode 100644
index 9305025..0000000
--- a/TestON/tests/HATestClusterRestart/HATestClusterRestart.topo
+++ /dev/null
@@ -1,169 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOScli1>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli1>
-
- <ONOScli2>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli2>
-
- <ONOScli3>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli3>
-
-
- <ONOScli4>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli4>
-
-
- <ONOScli5>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli5>
-
-
- <ONOScli6>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli6>
-
-
- <ONOScli7>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli7>
-
- <ONOS1>
- <host>10.128.30.11</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.128.30.12</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>10</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.128.30.13</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>11</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
- <ONOS4>
- <host>10.128.30.14</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>12</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4>
-
- <ONOS5>
- <host>10.128.30.15</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>13</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5>
-
- <ONOS6>
- <host>10.128.30.16</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>14</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6>
-
- <ONOS7>
- <host>10.128.30.17</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>15</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7>
-
- <Mininet1>
- <host>10.128.30.9</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>16</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> </arg3>
- <controller> none </controller>
- </COMPONENTS>
- </Mininet1>
-
- <Mininet2>
- <host>10.128.30.9</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>17</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </Mininet2>
-
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/HATestClusterRestart/__init__.py b/TestON/tests/HATestClusterRestart/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/HATestClusterRestart/__init__.py
+++ /dev/null
diff --git a/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.params b/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.params
deleted file mode 100644
index 956d889..0000000
--- a/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.params
+++ /dev/null
@@ -1,71 +0,0 @@
-<PARAMS>
- <testcases>1,2,8,3,4,5,14,16,17,[6],8,7,4,15,17,9,8,4,10,8,4,11,8,4,12,8,4,13</testcases>
- <ENV>
- <cellName>HA</cellName>
- </ENV>
- <Git>False</Git>
- <branch> master </branch>
- <num_controllers> 7 </num_controllers>
- <tcpdump> False </tcpdump>
-
- <CTRL>
- <ip1>10.128.30.11</ip1>
- <port1>6633</port1>
-
- <ip2>10.128.30.12</ip2>
- <port2>6633</port2>
-
- <ip3>10.128.30.13</ip3>
- <port3>6633</port3>
-
- <ip4>10.128.30.14</ip4>
- <port4>6633</port4>
-
- <ip5>10.128.30.15</ip5>
- <port5>6633</port5>
-
- <ip6>10.128.30.16</ip6>
- <port6>6633</port6>
-
- <ip7>10.128.30.17</ip7>
- <port7>6633</port7>
- </CTRL>
- <TESTONUSER>admin</TESTONUSER>
- <TESTONIP>10.128.30.9</TESTONIP>
- <PING>
- <source1>h8</source1>
- <source2>h9</source2>
- <source3>h10</source3>
- <source4>h11</source4>
- <source5>h12</source5>
- <source6>h13</source6>
- <source7>h14</source7>
- <source8>h15</source8>
- <source9>h16</source9>
- <source10>h17</source10>
- <target1>10.0.0.18</target1>
- <target2>10.0.0.19</target2>
- <target3>10.0.0.20</target3>
- <target4>10.0.0.21</target4>
- <target5>10.0.0.22</target5>
- <target6>10.0.0.23</target6>
- <target7>10.0.0.24</target7>
- <target8>10.0.0.25</target8>
- <target9>10.0.0.26</target9>
- <target10>10.0.0.27</target10>
- </PING>
- <timers>
- <LinkDiscovery>.2</LinkDiscovery>
- <SwitchDiscovery>.2</SwitchDiscovery>
- </timers>
- <kill>
- <switch> s5 </switch>
- <dpid> 0000000000005000 </dpid>
- <links> h5 s2 s1 s6 </links>
- </kill>
- <MNtcpdump>
- <intf>eth0</intf>
- <port> </port>
- <folder>~/packet_captures/</folder>
- </MNtcpdump>
-</PARAMS>
diff --git a/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.py b/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.py
deleted file mode 100644
index a81845f..0000000
--- a/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.py
+++ /dev/null
@@ -1,3929 +0,0 @@
-"""
-Description: This test is to determine if ONOS can handle
- a minority of it's nodes restarting
-
-List of test cases:
-CASE1: Compile ONOS and push it to the test machines
-CASE2: Assign devices to controllers
-CASE21: Assign mastership to controllers
-CASE3: Assign intents
-CASE4: Ping across added host intents
-CASE5: Reading state of ONOS
-CASE6: The Failure case.
-CASE7: Check state after control plane failure
-CASE8: Compare topo
-CASE9: Link s3-s28 down
-CASE10: Link s3-s28 up
-CASE11: Switch down
-CASE12: Switch up
-CASE13: Clean up
-CASE14: start election app on all onos nodes
-CASE15: Check that Leadership Election is still functional
-CASE16: Install Distributed Primitives app
-CASE17: Check for basic functionality with distributed primitives
-"""
-
-
-class HATestMinorityRestart:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- """
- CASE1 is to compile ONOS and push it to the test machines
-
- Startup sequence:
- cell <name>
- onos-verify-cell
- NOTE: temporary - onos-remove-raft-logs
- onos-uninstall
- start mininet
- git pull
- mvn clean install
- onos-package
- onos-install -f
- onos-wait-for-start
- start cli sessions
- start tcpdump
- """
- main.log.info( "ONOS HA test: Restart minority of ONOS nodes - " +
- "initialization" )
- main.case( "Setting up test environment" )
- main.caseExplaination = "Setup the test environment including " +\
- "installing ONOS, starting Mininet and ONOS" +\
- "cli sessions."
- # TODO: save all the timers and output them for plotting
-
- # load some variables from the params file
- PULLCODE = False
- if main.params[ 'Git' ] == 'True':
- PULLCODE = True
- gitBranch = main.params[ 'branch' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
-
- # set global variables
- global ONOS1Port
- global ONOS2Port
- global ONOS3Port
- global ONOS4Port
- global ONOS5Port
- global ONOS6Port
- global ONOS7Port
- global numControllers
- numControllers = int( main.params[ 'num_controllers' ] )
-
- # FIXME: just get controller port from params?
- # TODO: do we really need all these?
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
- ONOS4Port = main.params[ 'CTRL' ][ 'port4' ]
- ONOS5Port = main.params[ 'CTRL' ][ 'port5' ]
- ONOS6Port = main.params[ 'CTRL' ][ 'port6' ]
- ONOS7Port = main.params[ 'CTRL' ][ 'port7' ]
-
- global CLIs
- CLIs = []
- global nodes
- nodes = []
- for i in range( 1, numControllers + 1 ):
- CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
- nodes.append( getattr( main, 'ONOS' + str( i ) ) )
-
- main.step( "Applying cell variable to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- # FIXME:this is short term fix
- main.log.info( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
-
- main.log.info( "Uninstalling ONOS" )
- for node in nodes:
- main.ONOSbench.onosUninstall( node.ip_address )
-
- # Make sure ONOS is DEAD
- main.log.info( "Killing any ONOS processes" )
- killResults = main.TRUE
- for node in nodes:
- killed = main.ONOSbench.onosKill( node.ip_address )
- killResults = killResults and killed
-
- cleanInstallResult = main.TRUE
- gitPullResult = main.TRUE
-
- main.step( "Starting Mininet" )
- mnResult = main.Mininet1.startNet( )
- utilities.assert_equals( expect=main.TRUE, actual=mnResult,
- onpass="Mininet Started",
- onfail="Error starting Mininet" )
-
- main.step( "Git checkout and pull " + gitBranch )
- if PULLCODE:
- main.ONOSbench.gitCheckout( gitBranch )
- gitPullResult = main.ONOSbench.gitPull()
- # values of 1 or 3 are good
- utilities.assert_lesser( expect=0, actual=gitPullResult,
- onpass="Git pull successful",
- onfail="Git pull failed" )
- main.ONOSbench.getVersion( report=True )
-
- main.step( "Using mvn clean install" )
- cleanInstallResult = main.TRUE
- if PULLCODE and gitPullResult == main.TRUE:
- cleanInstallResult = main.ONOSbench.cleanInstall()
- else:
- main.log.warn( "Did not pull new code so skipping mvn " +
- "clean install" )
- utilities.assert_equals( expect=main.TRUE,
- actual=cleanInstallResult,
- onpass="MCI successful",
- onfail="MCI failed" )
- # GRAPHS
- # NOTE: important params here:
- # job = name of Jenkins job
- # Plot Name = Plot-HA, only can be used if multiple plots
- # index = The number of the graph under plot name
- job = "HAMinorityRestart"
- plotName = "Plot-HA"
- 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' +\
- '&width=500&height=300"' +\
- 'noborder="0" width="500" height="300" scrolling="yes" ' +\
- 'seamless="seamless"></iframe>\n'
- graphs += ']]></ac:plain-text-body>\n'
- graphs += '</ac:structured-macro>\n'
- main.log.wiki(graphs)
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
- utilities.assert_equals( expect=main.TRUE, actual=packageResult,
- onpass="ONOS package successful",
- onfail="ONOS package failed" )
-
- main.step( "Installing ONOS package" )
- onosInstallResult = main.TRUE
- for node in nodes:
- tmpResult = main.ONOSbench.onosInstall( options="-f",
- node=node.ip_address )
- onosInstallResult = onosInstallResult and tmpResult
- utilities.assert_equals( expect=main.TRUE, actual=onosInstallResult,
- onpass="ONOS install successful",
- onfail="ONOS install failed" )
-
- main.step( "Checking if ONOS is up yet" )
- for i in range( 2 ):
- onosIsupResult = main.TRUE
- for node in nodes:
- started = main.ONOSbench.isup( node.ip_address )
- if not started:
- main.log.error( node.name + " didn't start!" )
- main.ONOSbench.onosStop( node.ip_address )
- main.ONOSbench.onosStart( node.ip_address )
- onosIsupResult = onosIsupResult and started
- if onosIsupResult == main.TRUE:
- break
- utilities.assert_equals( expect=main.TRUE, actual=onosIsupResult,
- onpass="ONOS startup successful",
- onfail="ONOS startup failed" )
-
- main.log.step( "Starting ONOS CLI sessions" )
- cliResults = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].startOnosCli,
- name="startOnosCli-" + str( i ),
- args=[nodes[i].ip_address] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- cliResults = cliResults and t.result
- utilities.assert_equals( expect=main.TRUE, actual=cliResults,
- onpass="ONOS cli startup successful",
- onfail="ONOS cli startup failed" )
-
- if main.params[ 'tcpdump' ].lower() == "true":
- main.step( "Start Packet Capture MN" )
- main.Mininet2.startTcpdump(
- str( main.params[ 'MNtcpdump' ][ 'folder' ] ) + str( main.TEST )
- + "-MN.pcap",
- intf=main.params[ 'MNtcpdump' ][ 'intf' ],
- port=main.params[ 'MNtcpdump' ][ 'port' ] )
-
- main.step( "App Ids check" )
- appCheck = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- appCheck = appCheck and t.result
- if appCheck != main.TRUE:
- main.log.warn( CLIs[0].apps() )
- main.log.warn( CLIs[0].appIDs() )
- utilities.assert_equals( expect=main.TRUE, actual=appCheck,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
-
- if cliResults == main.FALSE:
- main.log.error( "Failed to start ONOS, stopping test" )
- main.cleanup()
- main.exit()
-
- def CASE2( self, main ):
- """
- Assign devices to controllers
- """
- import re
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- assert ONOS1Port, "ONOS1Port not defined"
- assert ONOS2Port, "ONOS2Port not defined"
- assert ONOS3Port, "ONOS3Port not defined"
- assert ONOS4Port, "ONOS4Port not defined"
- assert ONOS5Port, "ONOS5Port not defined"
- assert ONOS6Port, "ONOS6Port not defined"
- assert ONOS7Port, "ONOS7Port not defined"
-
- main.case( "Assigning devices to controllers" )
- main.caseExplaination = "Assign switches to ONOS using 'ovs-vsctl' " +\
- "and check that an ONOS node becomes the " +\
- "master of the device."
- main.step( "Assign switches to controllers" )
-
- ipList = []
- for i in range( numControllers ):
- ipList.append( nodes[ i ].ip_address )
- swList = []
- for i in range( 1, 29 ):
- swList.append( "s" + str( i ) )
- main.Mininet1.assignSwController( sw=swList, ip=ipList )
-
- mastershipCheck = main.TRUE
- for i in range( 1, 29 ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
- try:
- main.log.info( str( response ) )
- except Exception:
- main.log.info( repr( response ) )
- for node in nodes:
- if re.search( "tcp:" + node.ip_address, response ):
- mastershipCheck = mastershipCheck and main.TRUE
- else:
- main.log.error( "Error, node " + node.ip_address + " is " +
- "not in the list of controllers s" +
- str( i ) + " is connecting to." )
- mastershipCheck = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=mastershipCheck,
- onpass="Switch mastership assigned correctly",
- onfail="Switches not assigned correctly to controllers" )
-
- def CASE21( self, main ):
- """
- Assign mastership to controllers
- """
- import re
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- assert ONOS1Port, "ONOS1Port not defined"
- assert ONOS2Port, "ONOS2Port not defined"
- assert ONOS3Port, "ONOS3Port not defined"
- assert ONOS4Port, "ONOS4Port not defined"
- assert ONOS5Port, "ONOS5Port not defined"
- assert ONOS6Port, "ONOS6Port not defined"
- assert ONOS7Port, "ONOS7Port not defined"
-
- main.case( "Assigning Controller roles for switches" )
- main.caseExplaination = "Check that ONOS is connected to each " +\
- "device. Then manually assign" +\
- " mastership to specific ONOS nodes using" +\
- " 'device-role'"
- main.step( "Assign mastership of switches to specific controllers" )
- # Manually assign mastership to the controller we want
- roleCall = main.TRUE
-
- ipList = [ ]
- deviceList = []
- try:
- for i in range( 1, 29 ): # switches 1 through 28
- # set up correct variables:
- if i == 1:
- ip = nodes[ 0 ].ip_address # ONOS1
- deviceId = main.ONOScli1.getDevice( "1000" ).get( 'id' )
- elif i == 2:
- ip = nodes[ 1 ].ip_address # ONOS2
- deviceId = main.ONOScli1.getDevice( "2000" ).get( 'id' )
- elif i == 3:
- ip = nodes[ 1 ].ip_address # ONOS2
- deviceId = main.ONOScli1.getDevice( "3000" ).get( 'id' )
- elif i == 4:
- ip = nodes[ 3 ].ip_address # ONOS4
- deviceId = main.ONOScli1.getDevice( "3004" ).get( 'id' )
- elif i == 5:
- ip = nodes[ 2 ].ip_address # ONOS3
- deviceId = main.ONOScli1.getDevice( "5000" ).get( 'id' )
- elif i == 6:
- ip = nodes[ 2 ].ip_address # ONOS3
- deviceId = main.ONOScli1.getDevice( "6000" ).get( 'id' )
- elif i == 7:
- ip = nodes[ 5 ].ip_address # ONOS6
- deviceId = main.ONOScli1.getDevice( "6007" ).get( 'id' )
- elif i >= 8 and i <= 17:
- ip = nodes[ 4 ].ip_address # ONOS5
- dpid = '3' + str( i ).zfill( 3 )
- deviceId = main.ONOScli1.getDevice( dpid ).get( 'id' )
- elif i >= 18 and i <= 27:
- ip = nodes[ 6 ].ip_address # ONOS7
- dpid = '6' + str( i ).zfill( 3 )
- deviceId = main.ONOScli1.getDevice( dpid ).get( 'id' )
- elif i == 28:
- ip = nodes[ 0 ].ip_address # ONOS1
- deviceId = main.ONOScli1.getDevice( "2800" ).get( 'id' )
- else:
- main.log.error( "You didn't write an else statement for " +
- "switch s" + str( i ) )
- roleCall = main.FALSE
- # Assign switch
- assert deviceId, "No device id for s" + str( i ) + " in ONOS"
- # TODO: make this controller dynamic
- roleCall = roleCall and main.ONOScli1.deviceRole( deviceId,
- ip )
- ipList.append( ip )
- deviceList.append( deviceId )
- except ( AttributeError, AssertionError ):
- main.log.exception( "Something is wrong with ONOS device view" )
- main.log.info( main.ONOScli1.devices() )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=roleCall,
- onpass="Re-assigned switch mastership to designated controller",
- onfail="Something wrong with deviceRole calls" )
-
- main.step( "Check mastership was correctly assigned" )
- roleCheck = main.TRUE
- # NOTE: This is due to the fact that device mastership change is not
- # atomic and is actually a multi step process
- time.sleep( 5 )
- for i in range( len( ipList ) ):
- ip = ipList[i]
- deviceId = deviceList[i]
- # Check assignment
- master = main.ONOScli1.getRole( deviceId ).get( 'master' )
- if ip in master:
- roleCheck = roleCheck and main.TRUE
- else:
- roleCheck = roleCheck and main.FALSE
- main.log.error( "Error, controller " + ip + " is not" +
- " master " + "of device " +
- str( deviceId ) + ". Master is " +
- repr( master ) + "." )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=roleCheck,
- onpass="Switches were successfully reassigned to designated " +
- "controller",
- onfail="Switches were not successfully reassigned" )
-
- def CASE3( self, main ):
- """
- Assign intents
- """
- import time
- import json
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- main.case( "Adding host Intents" )
- main.caseExplaination = "Discover hosts by using pingall then " +\
- "assign predetermined host-to-host intents." +\
- " After installation, check that the intent" +\
- " is distributed to all nodes and the state" +\
- " is INSTALLED"
-
- # install onos-app-fwd
- main.step( "Install reactive forwarding app" )
- installResults = CLIs[0].activateApp( "org.onosproject.fwd" )
- utilities.assert_equals( expect=main.TRUE, actual=installResults,
- onpass="Install fwd successful",
- onfail="Install fwd failed" )
-
- main.step( "Check app ids" )
- appCheck = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- appCheck = appCheck and t.result
- if appCheck != main.TRUE:
- main.log.warn( CLIs[0].apps() )
- main.log.warn( CLIs[0].appIDs() )
- utilities.assert_equals( expect=main.TRUE, actual=appCheck,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
-
- main.step( "Discovering Hosts( Via pingall for now )" )
- # FIXME: Once we have a host discovery mechanism, use that instead
- # REACTIVE FWD test
- pingResult = main.FALSE
- for i in range(2): # Retry if pingall fails first time
- time1 = time.time()
- pingResult = main.Mininet1.pingall()
- if i == 0:
- utilities.assert_equals(
- expect=main.TRUE,
- actual=pingResult,
- onpass="Reactive Pingall test passed",
- onfail="Reactive Pingall failed, " +
- "one or more ping pairs failed" )
- time2 = time.time()
- main.log.info( "Time for pingall: %2f seconds" %
- ( time2 - time1 ) )
- # timeout for fwd flows
- time.sleep( 11 )
- # uninstall onos-app-fwd
- main.step( "Uninstall reactive forwarding app" )
- uninstallResult = CLIs[0].deactivateApp( "org.onosproject.fwd" )
- utilities.assert_equals( expect=main.TRUE, actual=uninstallResult,
- onpass="Uninstall fwd successful",
- onfail="Uninstall fwd failed" )
-
- main.step( "Check app ids" )
- threads = []
- appCheck2 = main.TRUE
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- appCheck2 = appCheck2 and t.result
- if appCheck2 != main.TRUE:
- main.log.warn( CLIs[0].apps() )
- main.log.warn( CLIs[0].appIDs() )
- utilities.assert_equals( expect=main.TRUE, actual=appCheck2,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
-
- main.step( "Add host intents via cli" )
- intentIds = []
- # TODO: move the host numbers to params
- # Maybe look at all the paths we ping?
- intentAddResult = True
- hostResult = main.TRUE
- for i in range( 8, 18 ):
- main.log.info( "Adding host intent between h" + str( i ) +
- " and h" + str( i + 10 ) )
- host1 = "00:00:00:00:00:" + \
- str( hex( i )[ 2: ] ).zfill( 2 ).upper()
- host2 = "00:00:00:00:00:" + \
- str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
- # NOTE: getHost can return None
- host1Dict = main.ONOScli1.getHost( host1 )
- host2Dict = main.ONOScli1.getHost( host2 )
- host1Id = None
- host2Id = None
- if host1Dict and host2Dict:
- host1Id = host1Dict.get( 'id', None )
- host2Id = host2Dict.get( 'id', None )
- if host1Id and host2Id:
- nodeNum = ( i % 7 )
- tmpId = CLIs[ nodeNum ].addHostIntent( host1Id, host2Id )
- if tmpId:
- main.log.info( "Added intent with id: " + tmpId )
- intentIds.append( tmpId )
- else:
- main.log.error( "addHostIntent returned: " +
- repr( tmpId ) )
- else:
- main.log.error( "Error, getHost() failed for h" + str( i ) +
- " and/or h" + str( i + 10 ) )
- hosts = CLIs[ 0 ].hosts()
- main.log.warn( "Hosts output: " )
- try:
- main.log.warn( json.dumps( json.loads( hosts ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( hosts ) )
- hostResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE, actual=hostResult,
- onpass="Found a host id for each host",
- onfail="Error looking up host ids" )
-
- intentStart = time.time()
- onosIds = main.ONOScli1.getAllIntentsId()
- main.log.info( "Submitted intents: " + str( intentIds ) )
- main.log.info( "Intents in ONOS: " + str( onosIds ) )
- for intent in intentIds:
- if intent in onosIds:
- pass # intent submitted is in onos
- else:
- intentAddResult = False
- if intentAddResult:
- intentStop = time.time()
- else:
- intentStop = None
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- installedCheck = True
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- try:
- for intent in json.loads( intents ):
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents" )
- # add submitted intents not in the store
- tmplist = [ i for i, s in intentStates ]
- missingIntents = False
- for i in intentIds:
- if i not in tmplist:
- intentStates.append( ( i, " - " ) )
- missingIntents = True
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- leaders = main.ONOScli1.leaders()
- try:
- missing = False
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- missing = True
- else:
- main.log.error( "leaders() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- # Check all nodes
- if missing:
- for node in CLIs:
- response = node.leaders( jsonFormat=False)
- main.log.warn( str( node.name ) + " leaders output: \n" +
- str( response ) )
-
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
-
- intentAddResult = bool( intentAddResult and not missingIntents and
- installedCheck )
- if not intentAddResult:
- main.log.error( "Error in pushing host intents to ONOS" )
-
- main.step( "Intent Anti-Entropy dispersion" )
- for i in range(100):
- correct = True
- main.log.info( "Submitted intents: " + str( sorted( intentIds ) ) )
- for cli in CLIs:
- onosIds = []
- ids = cli.getAllIntentsId()
- onosIds.append( ids )
- main.log.debug( "Intents in " + cli.name + ": " +
- str( sorted( onosIds ) ) )
- if sorted( ids ) != sorted( intentIds ):
- main.log.warn( "Set of intent IDs doesn't match" )
- correct = False
- break
- else:
- intents = json.loads( cli.intents() )
- for intent in intents:
- if intent[ 'state' ] != "INSTALLED":
- main.log.warn( "Intent " + intent[ 'id' ] +
- " is " + intent[ 'state' ] )
- correct = False
- break
- if correct:
- break
- else:
- time.sleep(1)
- if not intentStop:
- intentStop = time.time()
- global gossipTime
- gossipTime = intentStop - intentStart
- main.log.info( "It took about " + str( gossipTime ) +
- " seconds for all intents to appear in each node" )
- # FIXME: make this time configurable/calculate based off of number of
- # nodes and gossip rounds
- utilities.assert_greater_equals(
- expect=40, actual=gossipTime,
- onpass="ECM anti-entropy for intents worked within " +
- "expected time",
- onfail="Intent ECM anti-entropy took too long" )
- if gossipTime <= 40:
- intentAddResult = True
-
- if not intentAddResult or "key" in pendingMap:
- import time
- installedCheck = True
- main.log.info( "Sleeping 60 seconds to see if intents are found" )
- time.sleep( 60 )
- onosIds = main.ONOScli1.getAllIntentsId()
- main.log.info( "Submitted intents: " + str( intentIds ) )
- main.log.info( "Intents in ONOS: " + str( onosIds ) )
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- try:
- for intent in json.loads( intents ):
- # Iter through intents of a node
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents" )
- # add submitted intents not in the store
- tmplist = [ i for i, s in intentStates ]
- for i in intentIds:
- if i not in tmplist:
- intentStates.append( ( i, " - " ) )
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- leaders = main.ONOScli1.leaders()
- try:
- missing = False
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- # check for election
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- # FIXME: this should only be after we start the app
- topics.append( "org.onosproject.election" )
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- missing = True
- else:
- main.log.error( "leaders() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- # Check all nodes
- if missing:
- for node in CLIs:
- response = node.leaders( jsonFormat=False)
- main.log.warn( str( node.name ) + " leaders output: \n" +
- str( response ) )
-
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
-
- def CASE4( self, main ):
- """
- Ping across added host intents
- """
- import json
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- main.case( "Verify connectivity by sendind traffic across Intents" )
- main.caseExplaination = "Ping across added host intents to check " +\
- "functionality and check the state of " +\
- "the intent"
- main.step( "Ping across added host intents" )
- PingResult = main.TRUE
- for i in range( 8, 18 ):
- ping = main.Mininet1.pingHost( src="h" + str( i ),
- target="h" + str( i + 10 ) )
- PingResult = PingResult and ping
- if ping == main.FALSE:
- main.log.warn( "Ping failed between h" + str( i ) +
- " and h" + str( i + 10 ) )
- elif ping == main.TRUE:
- main.log.info( "Ping test passed!" )
- # Don't set PingResult or you'd override failures
- if PingResult == main.FALSE:
- main.log.error(
- "Intents have not been installed correctly, pings failed." )
- # TODO: pretty print
- main.log.warn( "ONOS1 intents: " )
- try:
- tmpIntents = main.ONOScli1.intents()
- main.log.warn( json.dumps( json.loads( tmpIntents ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( tmpIntents ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=PingResult,
- onpass="Intents have been installed correctly and pings work",
- onfail="Intents have not been installed correctly, pings failed." )
-
- main.step( "Check Intent state" )
- installedCheck = False
- loopCount = 0
- while not installedCheck and loopCount < 40:
- installedCheck = True
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- # Iter through intents of a node
- try:
- for intent in json.loads( intents ):
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents." )
- # Print states
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- if not installedCheck:
- time.sleep( 1 )
- loopCount += 1
- utilities.assert_equals( expect=True, actual=installedCheck,
- onpass="Intents are all INSTALLED",
- onfail="Intents are not all in " +
- "INSTALLED state" )
-
- main.step( "Check leadership of topics" )
- leaders = main.ONOScli1.leaders()
- topicCheck = main.TRUE
- try:
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- # check for election
- # TODO: Look at Devices as topics now that it uses this system
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- # FIXME: this should only be after we start the app
- # FIXME: topics.append( "org.onosproject.election" )
- # Print leaders output
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- topicCheck = main.FALSE
- else:
- main.log.error( "leaders() returned None" )
- topicCheck = main.FALSE
- except ( ValueError, TypeError ):
- topicCheck = main.FALSE
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- # TODO: Check for a leader of these topics
- # Check all nodes
- if topicCheck:
- for node in CLIs:
- response = node.leaders( jsonFormat=False)
- main.log.warn( str( node.name ) + " leaders output: \n" +
- str( response ) )
-
- utilities.assert_equals( expect=main.TRUE, actual=topicCheck,
- onpass="intent Partitions is in leaders",
- onfail="Some topics were lost " )
- # Print partitions
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- # Print Pending Map
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
-
- if not installedCheck:
- main.log.info( "Waiting 60 seconds to see if the state of " +
- "intents change" )
- time.sleep( 60 )
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- # Iter through intents of a node
- try:
- for intent in json.loads( intents ):
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents." )
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- leaders = main.ONOScli1.leaders()
- try:
- missing = False
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- # check for election
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- # FIXME: this should only be after we start the app
- topics.append( "org.onosproject.election" )
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- missing = True
- else:
- main.log.error( "leaders() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- if missing:
- for node in CLIs:
- response = node.leaders( jsonFormat=False)
- main.log.warn( str( node.name ) + " leaders output: \n" +
- str( response ) )
-
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
- # Print flowrules
- main.log.debug( CLIs[0].flows( jsonFormat=False ) )
- main.step( "Wait a minute then ping again" )
- # the wait is above
- PingResult = main.TRUE
- for i in range( 8, 18 ):
- ping = main.Mininet1.pingHost( src="h" + str( i ),
- target="h" + str( i + 10 ) )
- PingResult = PingResult and ping
- if ping == main.FALSE:
- main.log.warn( "Ping failed between h" + str( i ) +
- " and h" + str( i + 10 ) )
- elif ping == main.TRUE:
- main.log.info( "Ping test passed!" )
- # Don't set PingResult or you'd override failures
- if PingResult == main.FALSE:
- main.log.error(
- "Intents have not been installed correctly, pings failed." )
- # TODO: pretty print
- main.log.warn( "ONOS1 intents: " )
- try:
- tmpIntents = main.ONOScli1.intents()
- main.log.warn( json.dumps( json.loads( tmpIntents ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( tmpIntents ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=PingResult,
- onpass="Intents have been installed correctly and pings work",
- onfail="Intents have not been installed correctly, pings failed." )
-
- def CASE5( self, main ):
- """
- Reading state of ONOS
- """
- import json
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- main.case( "Setting up and gathering data for current state" )
- # The general idea for this test case is to pull the state of
- # ( intents,flows, topology,... ) from each ONOS node
- # We can then compare them with each other and also with past states
-
- main.step( "Check that each switch has a master" )
- global mastershipState
- mastershipState = '[]'
-
- # Assert that each device has a master
- rolesNotNull = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].rolesNotNull,
- name="rolesNotNull-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- rolesNotNull = rolesNotNull and t.result
- utilities.assert_equals(
- expect=main.TRUE,
- actual=rolesNotNull,
- onpass="Each device has a master",
- onfail="Some devices don't have a master assigned" )
-
- main.step( "Get the Mastership of each switch from each controller" )
- ONOSMastership = []
- mastershipCheck = main.FALSE
- consistentMastership = True
- rolesResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].roles,
- name="roles-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ONOSMastership.append( t.result )
-
- for i in range( numControllers ):
- if not ONOSMastership[i] or "Error" in ONOSMastership[i]:
- main.log.error( "Error in getting ONOS" + str( i + 1 ) +
- " roles" )
- main.log.warn(
- "ONOS" + str( i + 1 ) + " mastership response: " +
- repr( ONOSMastership[i] ) )
- rolesResults = False
- utilities.assert_equals(
- expect=True,
- actual=rolesResults,
- onpass="No error in reading roles output",
- onfail="Error in reading roles from ONOS" )
-
- main.step( "Check for consistency in roles from each controller" )
- if all([ i == ONOSMastership[ 0 ] for i in ONOSMastership ] ):
- main.log.info(
- "Switch roles are consistent across all ONOS nodes" )
- else:
- consistentMastership = False
- utilities.assert_equals(
- expect=True,
- actual=consistentMastership,
- onpass="Switch roles are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of switch roles" )
-
- if rolesResults and not consistentMastership:
- for i in range( numControllers ):
- try:
- main.log.warn(
- "ONOS" + str( i + 1 ) + " roles: ",
- json.dumps(
- json.loads( ONOSMastership[ i ] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( ONOSMastership[ i ] ) )
- elif rolesResults and consistentMastership:
- mastershipCheck = main.TRUE
- mastershipState = ONOSMastership[ 0 ]
-
- main.step( "Get the intents from each controller" )
- global intentState
- intentState = []
- ONOSIntents = []
- intentCheck = main.FALSE
- consistentIntents = True
- intentsResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].intents,
- name="intents-" + str( i ),
- args=[],
- kwargs={ 'jsonFormat': True } )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ONOSIntents.append( t.result )
-
- for i in range( numControllers ):
- if not ONOSIntents[ i ] or "Error" in ONOSIntents[ i ]:
- main.log.error( "Error in getting ONOS" + str( i + 1 ) +
- " intents" )
- main.log.warn( "ONOS" + str( i + 1 ) + " intents response: " +
- repr( ONOSIntents[ i ] ) )
- intentsResults = False
- utilities.assert_equals(
- expect=True,
- actual=intentsResults,
- onpass="No error in reading intents output",
- onfail="Error in reading intents from ONOS" )
-
- main.step( "Check for consistency in Intents from each controller" )
- if all([ sorted( i ) == sorted( ONOSIntents[ 0 ] ) for i in ONOSIntents ] ):
- main.log.info( "Intents are consistent across all ONOS " +
- "nodes" )
- else:
- consistentIntents = False
- main.log.error( "Intents not consistent" )
- utilities.assert_equals(
- expect=True,
- actual=consistentIntents,
- onpass="Intents are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of intents" )
-
- if intentsResults:
- # Try to make it easy to figure out what is happening
- #
- # Intent ONOS1 ONOS2 ...
- # 0x01 INSTALLED INSTALLING
- # ... ... ...
- # ... ... ...
- title = " Id"
- for n in range( numControllers ):
- title += " " * 10 + "ONOS" + str( n + 1 )
- main.log.warn( title )
- # get all intent keys in the cluster
- keys = []
- for nodeStr in ONOSIntents:
- node = json.loads( nodeStr )
- for intent in node:
- keys.append( intent.get( 'id' ) )
- keys = set( keys )
- for key in keys:
- row = "%-13s" % key
- for nodeStr in ONOSIntents:
- node = json.loads( nodeStr )
- for intent in node:
- if intent.get( 'id', "Error" ) == key:
- row += "%-15s" % intent.get( 'state' )
- main.log.warn( row )
- # End table view
-
- if intentsResults and not consistentIntents:
- # print the json objects
- n = len(ONOSIntents)
- main.log.debug( "ONOS" + str( n ) + " intents: " )
- main.log.debug( json.dumps( json.loads( ONOSIntents[ -1 ] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- for i in range( numControllers ):
- if ONOSIntents[ i ] != ONOSIntents[ -1 ]:
- main.log.debug( "ONOS" + str( i + 1 ) + " intents: " )
- main.log.debug( json.dumps( json.loads( ONOSIntents[i] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- else:
- main.log.debug( nodes[ i ].name + " intents match ONOS" +
- str( n ) + " intents" )
- elif intentsResults and consistentIntents:
- intentCheck = main.TRUE
- intentState = ONOSIntents[ 0 ]
-
- main.step( "Get the flows from each controller" )
- global flowState
- flowState = []
- ONOSFlows = []
- ONOSFlowsJson = []
- flowCheck = main.FALSE
- consistentFlows = True
- flowsResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].flows,
- name="flows-" + str( i ),
- args=[],
- kwargs={ 'jsonFormat': True } )
- threads.append( t )
- t.start()
-
- # NOTE: Flows command can take some time to run
- time.sleep(30)
- for t in threads:
- t.join()
- result = t.result
- ONOSFlows.append( result )
-
- for i in range( numControllers ):
- num = str( i + 1 )
- if not ONOSFlows[ i ] or "Error" in ONOSFlows[ i ]:
- main.log.error( "Error in getting ONOS" + num + " flows" )
- main.log.warn( "ONOS" + num + " flows response: " +
- repr( ONOSFlows[ i ] ) )
- flowsResults = False
- ONOSFlowsJson.append( None )
- else:
- try:
- ONOSFlowsJson.append( json.loads( ONOSFlows[ i ] ) )
- except ( ValueError, TypeError ):
- # FIXME: change this to log.error?
- main.log.exception( "Error in parsing ONOS" + num +
- " response as json." )
- main.log.error( repr( ONOSFlows[ i ] ) )
- ONOSFlowsJson.append( None )
- flowsResults = False
- utilities.assert_equals(
- expect=True,
- actual=flowsResults,
- onpass="No error in reading flows output",
- onfail="Error in reading flows from ONOS" )
-
- main.step( "Check for consistency in Flows from each controller" )
- tmp = [ len( i ) == len( ONOSFlowsJson[ 0 ] ) for i in ONOSFlowsJson ]
- if all( tmp ):
- main.log.info( "Flow count is consistent across all ONOS nodes" )
- else:
- consistentFlows = False
- utilities.assert_equals(
- expect=True,
- actual=consistentFlows,
- onpass="The flow count is consistent across all ONOS nodes",
- onfail="ONOS nodes have different flow counts" )
-
- if flowsResults and not consistentFlows:
- for i in range( numControllers ):
- try:
- main.log.warn(
- "ONOS" + str( i + 1 ) + " flows: " +
- json.dumps( json.loads( ONOSFlows[i] ), sort_keys=True,
- indent=4, separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn(
- "ONOS" + str( i + 1 ) + " flows: " +
- repr( ONOSFlows[ i ] ) )
- elif flowsResults and consistentFlows:
- flowCheck = main.TRUE
- flowState = ONOSFlows[ 0 ]
-
- main.step( "Get the OF Table entries" )
- global flows
- flows = []
- for i in range( 1, 29 ):
- flows.append( main.Mininet2.getFlowTable( 1.3, "s" + str( i ) ) )
- if flowCheck == main.FALSE:
- for table in flows:
- main.log.warn( table )
- # TODO: Compare switch flow tables with ONOS flow tables
-
- main.step( "Start continuous pings" )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source1' ],
- target=main.params[ 'PING' ][ 'target1' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source2' ],
- target=main.params[ 'PING' ][ 'target2' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source3' ],
- target=main.params[ 'PING' ][ 'target3' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source4' ],
- target=main.params[ 'PING' ][ 'target4' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source5' ],
- target=main.params[ 'PING' ][ 'target5' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source6' ],
- target=main.params[ 'PING' ][ 'target6' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source7' ],
- target=main.params[ 'PING' ][ 'target7' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source8' ],
- target=main.params[ 'PING' ][ 'target8' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source9' ],
- target=main.params[ 'PING' ][ 'target9' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source10' ],
- target=main.params[ 'PING' ][ 'target10' ],
- pingTime=500 )
-
- main.step( "Collecting topology information from ONOS" )
- devices = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].devices,
- name="devices-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- devices.append( t.result )
- hosts = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].hosts,
- name="hosts-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- try:
- hosts.append( json.loads( t.result ) )
- except ( ValueError, TypeError ):
- # FIXME: better handling of this, print which node
- # Maybe use thread name?
- main.log.exception( "Error parsing json output of hosts" )
- # FIXME: should this be an empty json object instead?
- hosts.append( None )
-
- ports = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].ports,
- name="ports-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ports.append( t.result )
- links = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].links,
- name="links-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- links.append( t.result )
- clusters = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].clusters,
- name="clusters-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- clusters.append( t.result )
- # Compare json objects for hosts and dataplane clusters
-
- # hosts
- main.step( "Host view is consistent across ONOS nodes" )
- consistentHostsResult = main.TRUE
- for controller in range( len( hosts ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in hosts[ controller ]:
- if hosts[ controller ] == hosts[ 0 ]:
- continue
- else: # hosts not consistent
- main.log.error( "hosts from ONOS" +
- controllerStr +
- " is inconsistent with ONOS1" )
- main.log.warn( repr( hosts[ controller ] ) )
- consistentHostsResult = main.FALSE
-
- else:
- main.log.error( "Error in getting ONOS hosts from ONOS" +
- controllerStr )
- consistentHostsResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " hosts response: " +
- repr( hosts[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentHostsResult,
- onpass="Hosts view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of hosts" )
-
- main.step( "Each host has an IP address" )
- ipResult = main.TRUE
- for controller in range( 0, len( hosts ) ):
- controllerStr = str( controller + 1 )
- for host in hosts[ controller ]:
- if not host.get( 'ipAddresses', [ ] ):
- main.log.error( "DEBUG:Error with host ips on controller" +
- controllerStr + ": " + str( host ) )
- ipResult = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=ipResult,
- onpass="The ips of the hosts aren't empty",
- onfail="The ip of at least one host is missing" )
-
- # Strongly connected clusters of devices
- main.step( "Cluster view is consistent across ONOS nodes" )
- consistentClustersResult = main.TRUE
- for controller in range( len( clusters ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in clusters[ controller ]:
- if clusters[ controller ] == clusters[ 0 ]:
- continue
- else: # clusters not consistent
- main.log.error( "clusters from ONOS" + controllerStr +
- " is inconsistent with ONOS1" )
- consistentClustersResult = main.FALSE
-
- else:
- main.log.error( "Error in getting dataplane clusters " +
- "from ONOS" + controllerStr )
- consistentClustersResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " clusters response: " +
- repr( clusters[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentClustersResult,
- onpass="Clusters view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of clusters" )
- # there should always only be one cluster
- main.step( "Cluster view correct across ONOS nodes" )
- try:
- numClusters = len( json.loads( clusters[ 0 ] ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing clusters[0]: " +
- repr( clusters[ 0 ] ) )
- clusterResults = main.FALSE
- if numClusters == 1:
- clusterResults = main.TRUE
- utilities.assert_equals(
- expect=1,
- actual=numClusters,
- onpass="ONOS shows 1 SCC",
- onfail="ONOS shows " + str( numClusters ) + " SCCs" )
-
- main.step( "Comparing ONOS topology to MN" )
- devicesResults = main.TRUE
- linksResults = main.TRUE
- hostsResults = main.TRUE
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
- mnHosts = main.Mininet1.getHosts()
- for controller in range( numControllers ):
- controllerStr = str( controller + 1 )
- if devices[ controller ] and ports[ controller ] and\
- "Error" not in devices[ controller ] and\
- "Error" not in ports[ controller ]:
-
- currentDevicesResult = main.Mininet1.compareSwitches(
- mnSwitches,
- json.loads( devices[ controller ] ),
- json.loads( ports[ controller ] ) )
- else:
- currentDevicesResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentDevicesResult,
- onpass="ONOS" + controllerStr +
- " Switches view is correct",
- onfail="ONOS" + controllerStr +
- " Switches view is incorrect" )
- if links[ controller ] and "Error" not in links[ controller ]:
- currentLinksResult = main.Mininet1.compareLinks(
- mnSwitches, mnLinks,
- json.loads( links[ controller ] ) )
- else:
- currentLinksResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentLinksResult,
- onpass="ONOS" + controllerStr +
- " links view is correct",
- onfail="ONOS" + controllerStr +
- " links view is incorrect" )
-
- if hosts[ controller ] or "Error" not in hosts[ controller ]:
- currentHostsResult = main.Mininet1.compareHosts(
- mnHosts,
- hosts[ controller ] )
- else:
- currentHostsResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentHostsResult,
- onpass="ONOS" + controllerStr +
- " hosts exist in Mininet",
- onfail="ONOS" + controllerStr +
- " hosts don't match Mininet" )
-
- devicesResults = devicesResults and currentDevicesResult
- linksResults = linksResults and currentLinksResult
- hostsResults = hostsResults and currentHostsResult
-
- main.step( "Device information is correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=devicesResults,
- onpass="Device information is correct",
- onfail="Device information is incorrect" )
-
- main.step( "Links are correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linksResults,
- onpass="Link are correct",
- onfail="Links are incorrect" )
-
- main.step( "Hosts are correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=hostsResults,
- onpass="Hosts are correct",
- onfail="Hosts are incorrect" )
-
- def CASE6( self, main ):
- """
- The Failure case.
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- main.case( "Restart minority of ONOS nodes" )
- main.step( "Killing 3 ONOS nodes" )
- killTime = time.time()
- # TODO: Randomize these nodes or base this on partitions
- # TODO: use threads in this case
- killResults = main.ONOSbench.onosKill( nodes[0].ip_address )
- time.sleep( 10 )
- killResults = killResults and\
- main.ONOSbench.onosKill( nodes[1].ip_address )
- time.sleep( 10 )
- killResults = killResults and\
- main.ONOSbench.onosKill( nodes[2].ip_address )
- utilities.assert_equals( expect=main.TRUE, actual=killResults,
- onpass="ONOS Killed successfully",
- onfail="ONOS kill NOT successful" )
-
- main.step( "Checking if ONOS is up yet" )
- count = 0
- onosIsupResult = main.FALSE
- while onosIsupResult == main.FALSE and count < 10:
- onos1Isup = main.ONOSbench.isup( nodes[0].ip_address )
- onos2Isup = main.ONOSbench.isup( nodes[1].ip_address )
- onos3Isup = main.ONOSbench.isup( nodes[2].ip_address )
- onosIsupResult = onos1Isup and onos2Isup and onos3Isup
- count = count + 1
- # TODO: if it becomes an issue, we can retry this step a few times
- utilities.assert_equals( expect=main.TRUE, actual=onosIsupResult,
- onpass="ONOS restarted successfully",
- onfail="ONOS restart NOT successful" )
-
- main.step( "Restarting ONOS CLIs" )
- cliResult1 = main.ONOScli1.startOnosCli( nodes[0].ip_address )
- cliResult2 = main.ONOScli2.startOnosCli( nodes[1].ip_address )
- cliResult3 = main.ONOScli3.startOnosCli( nodes[2].ip_address )
- cliResults = cliResult1 and cliResult2 and cliResult3
- utilities.assert_equals( expect=main.TRUE, actual=cliResults,
- onpass="ONOS cli restarted",
- onfail="ONOS cli did not restart" )
-
- # Grab the time of restart so we chan check how long the gossip
- # protocol has had time to work
- main.restartTime = time.time() - killTime
- main.log.debug( "Restart time: " + str( main.restartTime ) )
- '''
- # FIXME: revisit test plan for election with madan
- # Rerun for election on restarted nodes
- run1 = CLIs[0].electionTestRun()
- run2 = CLIs[1].electionTestRun()
- run3 = CLIs[2].electionTestRun()
- runResults = run1 and run2 and run3
- utilities.assert_equals( expect=main.TRUE, actual=runResults,
- onpass="Reran for election",
- onfail="Failed to rerun for election" )
- '''
- # TODO: MAke this configurable. Also, we are breaking the above timer
- time.sleep( 60 )
- main.log.debug( CLIs[0].nodes( jsonFormat=False ) )
- main.log.debug( CLIs[0].leaders( jsonFormat=False ) )
- main.log.debug( CLIs[0].partitions( jsonFormat=False ) )
-
- def CASE7( self, main ):
- """
- Check state after ONOS failure
- """
- import json
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- main.case( "Running ONOS Constant State Tests" )
-
- main.step( "Check that each switch has a master" )
- # Assert that each device has a master
- rolesNotNull = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].rolesNotNull,
- name="rolesNotNull-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- rolesNotNull = rolesNotNull and t.result
- utilities.assert_equals(
- expect=main.TRUE,
- actual=rolesNotNull,
- onpass="Each device has a master",
- onfail="Some devices don't have a master assigned" )
-
- main.step( "Read device roles from ONOS" )
- ONOSMastership = []
- consistentMastership = True
- rolesResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].roles,
- name="roles-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ONOSMastership.append( t.result )
-
- for i in range( numControllers ):
- if not ONOSMastership[i] or "Error" in ONOSMastership[i]:
- main.log.error( "Error in getting ONOS" + str( i + 1 ) +
- " roles" )
- main.log.warn(
- "ONOS" + str( i + 1 ) + " mastership response: " +
- repr( ONOSMastership[i] ) )
- rolesResults = False
- utilities.assert_equals(
- expect=True,
- actual=rolesResults,
- onpass="No error in reading roles output",
- onfail="Error in reading roles from ONOS" )
-
- main.step( "Check for consistency in roles from each controller" )
- if all([ i == ONOSMastership[ 0 ] for i in ONOSMastership ] ):
- main.log.info(
- "Switch roles are consistent across all ONOS nodes" )
- else:
- consistentMastership = False
- utilities.assert_equals(
- expect=True,
- actual=consistentMastership,
- onpass="Switch roles are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of switch roles" )
-
- if rolesResults and not consistentMastership:
- for i in range( numControllers ):
- main.log.warn(
- "ONOS" + str( i + 1 ) + " roles: ",
- json.dumps(
- json.loads( ONOSMastership[ i ] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
-
- # NOTE: we expect mastership to change on controller failure
- '''
- description2 = "Compare switch roles from before failure"
- main.step( description2 )
- try:
- currentJson = json.loads( ONOSMastership[0] )
- oldJson = json.loads( mastershipState )
- except ( ValueError, TypeError ):
- main.log.exception( "Something is wrong with parsing " +
- "ONOSMastership[0] or mastershipState" )
- main.log.error( "ONOSMastership[0]: " + repr( ONOSMastership[0] ) )
- main.log.error( "mastershipState" + repr( mastershipState ) )
- main.cleanup()
- main.exit()
- mastershipCheck = main.TRUE
- for i in range( 1, 29 ):
- switchDPID = str(
- main.Mininet1.getSwitchDPID( switch="s" + str( i ) ) )
- current = [ switch[ 'master' ] for switch in currentJson
- if switchDPID in switch[ 'id' ] ]
- old = [ switch[ 'master' ] for switch in oldJson
- if switchDPID in switch[ 'id' ] ]
- if current == old:
- mastershipCheck = mastershipCheck and main.TRUE
- else:
- main.log.warn( "Mastership of switch %s changed" % switchDPID )
- mastershipCheck = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=mastershipCheck,
- onpass="Mastership of Switches was not changed",
- onfail="Mastership of some switches changed" )
- '''
-
- main.step( "Get the intents and compare across all nodes" )
- ONOSIntents = []
- intentCheck = main.FALSE
- consistentIntents = True
- intentsResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].intents,
- name="intents-" + str( i ),
- args=[],
- kwargs={ 'jsonFormat': True } )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ONOSIntents.append( t.result )
-
- for i in range( numControllers ):
- if not ONOSIntents[ i ] or "Error" in ONOSIntents[ i ]:
- main.log.error( "Error in getting ONOS" + str( i + 1 ) +
- " intents" )
- main.log.warn( "ONOS" + str( i + 1 ) + " intents response: " +
- repr( ONOSIntents[ i ] ) )
- intentsResults = False
- utilities.assert_equals(
- expect=True,
- actual=intentsResults,
- onpass="No error in reading intents output",
- onfail="Error in reading intents from ONOS" )
-
- main.step( "Check for consistency in Intents from each controller" )
- if all([ sorted( i ) == sorted( ONOSIntents[ 0 ] ) for i in ONOSIntents ] ):
- main.log.info( "Intents are consistent across all ONOS " +
- "nodes" )
- else:
- consistentIntents = False
-
- # Try to make it easy to figure out what is happening
- #
- # Intent ONOS1 ONOS2 ...
- # 0x01 INSTALLED INSTALLING
- # ... ... ...
- # ... ... ...
- title = " ID"
- for n in range( numControllers ):
- title += " " * 10 + "ONOS" + str( n + 1 )
- main.log.warn( title )
- # get all intent keys in the cluster
- keys = []
- for nodeStr in ONOSIntents:
- node = json.loads( nodeStr )
- for intent in node:
- keys.append( intent.get( 'id' ) )
- keys = set( keys )
- for key in keys:
- row = "%-13s" % key
- for nodeStr in ONOSIntents:
- node = json.loads( nodeStr )
- for intent in node:
- if intent.get( 'id' ) == key:
- row += "%-15s" % intent.get( 'state' )
- main.log.warn( row )
- # End table view
-
- utilities.assert_equals(
- expect=True,
- actual=consistentIntents,
- onpass="Intents are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of intents" )
- intentStates = []
- for node in ONOSIntents: # Iter through ONOS nodes
- nodeStates = []
- # Iter through intents of a node
- try:
- for intent in json.loads( node ):
- nodeStates.append( intent[ 'state' ] )
- except ( ValueError, TypeError ):
- main.log.exception( "Error in parsing intents" )
- main.log.error( repr( node ) )
- intentStates.append( nodeStates )
- out = [ (i, nodeStates.count( i ) ) for i in set( nodeStates ) ]
- main.log.info( dict( out ) )
-
- if intentsResults and not consistentIntents:
- for i in range( numControllers ):
- main.log.warn( "ONOS" + str( i + 1 ) + " intents: " )
- main.log.warn( json.dumps(
- json.loads( ONOSIntents[ i ] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- elif intentsResults and consistentIntents:
- intentCheck = main.TRUE
-
- # NOTE: Store has no durability, so intents are lost across system
- # restarts
- main.step( "Compare current intents with intents before the failure" )
- # NOTE: this requires case 5 to pass for intentState to be set.
- # maybe we should stop the test if that fails?
- sameIntents = main.FALSE
- if intentState and intentState == ONOSIntents[ 0 ]:
- sameIntents = main.TRUE
- main.log.info( "Intents are consistent with before failure" )
- # TODO: possibly the states have changed? we may need to figure out
- # what the acceptable states are
- elif len( intentState ) == len( ONOSIntents[ 0 ] ):
- sameIntents = main.TRUE
- try:
- before = json.loads( intentState )
- after = json.loads( ONOSIntents[ 0 ] )
- for intent in before:
- if intent not in after:
- sameIntents = main.FALSE
- main.log.debug( "Intent is not currently in ONOS " +
- "(at least in the same form):" )
- main.log.debug( json.dumps( intent ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Exception printing intents" )
- main.log.debug( repr( ONOSIntents[0] ) )
- main.log.debug( repr( intentState ) )
- if sameIntents == main.FALSE:
- try:
- main.log.debug( "ONOS intents before: " )
- main.log.debug( json.dumps( json.loads( intentState ),
- sort_keys=True, indent=4,
- separators=( ',', ': ' ) ) )
- main.log.debug( "Current ONOS intents: " )
- main.log.debug( json.dumps( json.loads( ONOSIntents[ 0 ] ),
- sort_keys=True, indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Exception printing intents" )
- main.log.debug( repr( ONOSIntents[0] ) )
- main.log.debug( repr( intentState ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=sameIntents,
- onpass="Intents are consistent with before failure",
- onfail="The Intents changed during failure" )
- intentCheck = intentCheck and sameIntents
-
- main.step( "Get the OF Table entries and compare to before " +
- "component failure" )
- FlowTables = main.TRUE
- flows2 = []
- for i in range( 28 ):
- main.log.info( "Checking flow table on s" + str( i + 1 ) )
- tmpFlows = main.Mininet2.getFlowTable( 1.3, "s" + str( i + 1 ) )
- flows2.append( tmpFlows )
- tempResult = main.Mininet2.flowComp(
- flow1=flows[ i ],
- flow2=tmpFlows )
- FlowTables = FlowTables and tempResult
- if FlowTables == main.FALSE:
- main.log.info( "Differences in flow table for switch: s" +
- str( i + 1 ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=FlowTables,
- onpass="No changes were found in the flow tables",
- onfail="Changes were found in the flow tables" )
-
- main.step( "Check the continuous pings to ensure that no packets " +
- "were dropped during component failure" )
- main.Mininet2.pingKill( main.params[ 'TESTONUSER' ],
- main.params[ 'TESTONIP' ] )
- LossInPings = main.FALSE
- # NOTE: checkForLoss returns main.FALSE with 0% packet loss
- for i in range( 8, 18 ):
- main.log.info(
- "Checking for a loss in pings along flow from s" +
- str( i ) )
- LossInPings = main.Mininet2.checkForLoss(
- "/tmp/ping.h" +
- str( i ) ) or LossInPings
- if LossInPings == main.TRUE:
- main.log.info( "Loss in ping detected" )
- elif LossInPings == main.ERROR:
- main.log.info( "There are multiple mininet process running" )
- elif LossInPings == main.FALSE:
- main.log.info( "No Loss in the pings" )
- main.log.info( "No loss of dataplane connectivity" )
- utilities.assert_equals(
- expect=main.FALSE,
- actual=LossInPings,
- onpass="No Loss of connectivity",
- onfail="Loss of dataplane connectivity detected" )
-
- main.step( "Leadership Election is still functional" )
- # Test of LeadershipElection
- leaderList = []
- # FIXME: make sure this matches nodes that were restarted
- restarted = [ nodes[0].ip_address, nodes[1].ip_address,
- nodes[2].ip_address ]
-
- leaderResult = main.TRUE
- for cli in CLIs:
- leaderN = cli.electionTestLeader()
- leaderList.append( leaderN )
- if leaderN == main.FALSE:
- # error in response
- main.log.error( "Something is wrong with " +
- "electionTestLeader function, check the" +
- " error logs" )
- leaderResult = main.FALSE
- elif leaderN is None:
- main.log.error( cli.name +
- " shows no leader for the election-app was" +
- " elected after the old one died" )
- leaderResult = main.FALSE
- elif leaderN in restarted:
- main.log.error( cli.name + " shows " + str( leaderN ) +
- " as leader for the election-app, but it " +
- "was restarted" )
- leaderResult = main.FALSE
- if len( set( leaderList ) ) != 1:
- leaderResult = main.FALSE
- main.log.error(
- "Inconsistent view of leader for the election test app" )
- # TODO: print the list
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Leadership election passed",
- onfail="Something went wrong with Leadership election" )
-
- def CASE8( self, main ):
- """
- Compare topo
- """
- import json
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- main.case( "Compare ONOS Topology view to Mininet topology" )
- main.caseExplaination = "Compare topology objects between Mininet" +\
- " and ONOS"
-
- main.step( "Comparing ONOS topology to MN" )
- devicesResults = main.TRUE
- linksResults = main.TRUE
- hostsResults = main.TRUE
- hostAttachmentResults = True
- topoResult = main.FALSE
- elapsed = 0
- count = 0
- main.step( "Collecting topology information from ONOS" )
- startTime = time.time()
- # Give time for Gossip to work
- while topoResult == main.FALSE and elapsed < 60:
- count += 1
- cliStart = time.time()
- devices = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].devices,
- name="devices-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- devices.append( t.result )
- hosts = []
- ipResult = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].hosts,
- name="hosts-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- try:
- hosts.append( json.loads( t.result ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing hosts results" )
- main.log.error( repr( t.result ) )
- for controller in range( 0, len( hosts ) ):
- controllerStr = str( controller + 1 )
- for host in hosts[ controller ]:
- if host is None or host.get( 'ipAddresses', [] ) == []:
- main.log.error(
- "DEBUG:Error with host ipAddresses on controller" +
- controllerStr + ": " + str( host ) )
- ipResult = main.FALSE
- ports = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].ports,
- name="ports-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ports.append( t.result )
- links = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].links,
- name="links-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- links.append( t.result )
- clusters = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].clusters,
- name="clusters-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- clusters.append( t.result )
-
- elapsed = time.time() - startTime
- cliTime = time.time() - cliStart
- print "Elapsed time: " + str( elapsed )
- print "CLI time: " + str( cliTime )
-
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
- mnHosts = main.Mininet1.getHosts()
- for controller in range( numControllers ):
- controllerStr = str( controller + 1 )
- if devices[ controller ] and ports[ controller ] and\
- "Error" not in devices[ controller ] and\
- "Error" not in ports[ controller ]:
-
- currentDevicesResult = main.Mininet1.compareSwitches(
- mnSwitches,
- json.loads( devices[ controller ] ),
- json.loads( ports[ controller ] ) )
- else:
- currentDevicesResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentDevicesResult,
- onpass="ONOS" + controllerStr +
- " Switches view is correct",
- onfail="ONOS" + controllerStr +
- " Switches view is incorrect" )
-
- if links[ controller ] and "Error" not in links[ controller ]:
- currentLinksResult = main.Mininet1.compareLinks(
- mnSwitches, mnLinks,
- json.loads( links[ controller ] ) )
- else:
- currentLinksResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentLinksResult,
- onpass="ONOS" + controllerStr +
- " links view is correct",
- onfail="ONOS" + controllerStr +
- " links view is incorrect" )
-
- if hosts[ controller ] or "Error" not in hosts[ controller ]:
- currentHostsResult = main.Mininet1.compareHosts(
- mnHosts,
- hosts[ controller ] )
- else:
- currentHostsResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentHostsResult,
- onpass="ONOS" + controllerStr +
- " hosts exist in Mininet",
- onfail="ONOS" + controllerStr +
- " hosts don't match Mininet" )
- # CHECKING HOST ATTACHMENT POINTS
- hostAttachment = True
- zeroHosts = False
- # FIXME: topo-HA/obelisk specific mappings:
- # key is mac and value is dpid
- mappings = {}
- for i in range( 1, 29 ): # hosts 1 through 28
- # set up correct variables:
- macId = "00:" * 5 + hex( i ).split( "0x" )[1].upper().zfill(2)
- if i == 1:
- deviceId = "1000".zfill(16)
- elif i == 2:
- deviceId = "2000".zfill(16)
- elif i == 3:
- deviceId = "3000".zfill(16)
- elif i == 4:
- deviceId = "3004".zfill(16)
- elif i == 5:
- deviceId = "5000".zfill(16)
- elif i == 6:
- deviceId = "6000".zfill(16)
- elif i == 7:
- deviceId = "6007".zfill(16)
- elif i >= 8 and i <= 17:
- dpid = '3' + str( i ).zfill( 3 )
- deviceId = dpid.zfill(16)
- elif i >= 18 and i <= 27:
- dpid = '6' + str( i ).zfill( 3 )
- deviceId = dpid.zfill(16)
- elif i == 28:
- deviceId = "2800".zfill(16)
- mappings[ macId ] = deviceId
- if hosts[ controller ] or "Error" not in hosts[ controller ]:
- if hosts[ controller ] == []:
- main.log.warn( "There are no hosts discovered" )
- zeroHosts = True
- else:
- for host in hosts[ controller ]:
- mac = None
- location = None
- device = None
- port = None
- try:
- mac = host.get( 'mac' )
- assert mac, "mac field could not be found for this host object"
-
- location = host.get( 'location' )
- assert location, "location field could not be found for this host object"
-
- # Trim the protocol identifier off deviceId
- device = str( location.get( 'elementId' ) ).split(':')[1]
- assert device, "elementId field could not be found for this host location object"
-
- port = location.get( 'port' )
- assert port, "port field could not be found for this host location object"
-
- # Now check if this matches where they should be
- if mac and device and port:
- if str( port ) != "1":
- main.log.error( "The attachment port is incorrect for " +
- "host " + str( mac ) +
- ". Expected: 1 Actual: " + str( port) )
- hostAttachment = False
- if device != mappings[ str( mac ) ]:
- main.log.error( "The attachment device is incorrect for " +
- "host " + str( mac ) +
- ". Expected: " + mappings[ str( mac ) ] +
- " Actual: " + device )
- hostAttachment = False
- else:
- hostAttachment = False
- except AssertionError:
- main.log.exception( "Json object not as expected" )
- main.log.error( repr( host ) )
- hostAttachment = False
- else:
- main.log.error( "No hosts json output or \"Error\"" +
- " in output. hosts = " +
- repr( hosts[ controller ] ) )
- if zeroHosts is False:
- hostAttachment = True
-
- # END CHECKING HOST ATTACHMENT POINTS
- devicesResults = devicesResults and currentDevicesResult
- linksResults = linksResults and currentLinksResult
- hostsResults = hostsResults and currentHostsResult
- hostAttachmentResults = hostAttachmentResults and\
- hostAttachment
-
- # Compare json objects for hosts and dataplane clusters
-
- # hosts
- main.step( "Hosts view is consistent across all ONOS nodes" )
- consistentHostsResult = main.TRUE
- for controller in range( len( hosts ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in hosts[ controller ]:
- if hosts[ controller ] == hosts[ 0 ]:
- continue
- else: # hosts not consistent
- main.log.error( "hosts from ONOS" + controllerStr +
- " is inconsistent with ONOS1" )
- main.log.warn( repr( hosts[ controller ] ) )
- consistentHostsResult = main.FALSE
-
- else:
- main.log.error( "Error in getting ONOS hosts from ONOS" +
- controllerStr )
- consistentHostsResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " hosts response: " +
- repr( hosts[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentHostsResult,
- onpass="Hosts view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of hosts" )
-
- main.step( "Hosts information is correct" )
- hostsResults = hostsResults and ipResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=hostsResults,
- onpass="Host information is correct",
- onfail="Host information is incorrect" )
-
- main.step( "Host attachment points to the network" )
- utilities.assert_equals(
- expect=True,
- actual=hostAttachmentResults,
- onpass="Hosts are correctly attached to the network",
- onfail="ONOS did not correctly attach hosts to the network" )
-
- # Strongly connected clusters of devices
- main.step( "Clusters view is consistent across all ONOS nodes" )
- consistentClustersResult = main.TRUE
- for controller in range( len( clusters ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in clusters[ controller ]:
- if clusters[ controller ] == clusters[ 0 ]:
- continue
- else: # clusters not consistent
- main.log.error( "clusters from ONOS" +
- controllerStr +
- " is inconsistent with ONOS1" )
- consistentClustersResult = main.FALSE
-
- else:
- main.log.error( "Error in getting dataplane clusters " +
- "from ONOS" + controllerStr )
- consistentClustersResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " clusters response: " +
- repr( clusters[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentClustersResult,
- onpass="Clusters view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of clusters" )
-
- main.step( "There is only one SCC" )
- # there should always only be one cluster
- try:
- numClusters = len( json.loads( clusters[ 0 ] ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing clusters[0]: " +
- repr( clusters[0] ) )
- clusterResults = main.FALSE
- if numClusters == 1:
- clusterResults = main.TRUE
- utilities.assert_equals(
- expect=1,
- actual=numClusters,
- onpass="ONOS shows 1 SCC",
- onfail="ONOS shows " + str( numClusters ) + " SCCs" )
-
- topoResult = ( devicesResults and linksResults
- and hostsResults and consistentHostsResult
- and consistentClustersResult and clusterResults
- and ipResult and hostAttachmentResults )
-
- topoResult = topoResult and int( count <= 2 )
- note = "note it takes about " + str( int( cliTime ) ) + \
- " seconds for the test to make all the cli calls to fetch " +\
- "the topology from each ONOS instance"
- main.log.info(
- "Very crass estimate for topology discovery/convergence( " +
- str( note ) + " ): " + str( elapsed ) + " seconds, " +
- str( count ) + " tries" )
-
- main.step( "Device information is correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=devicesResults,
- onpass="Device information is correct",
- onfail="Device information is incorrect" )
-
- main.step( "Links are correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linksResults,
- onpass="Link are correct",
- onfail="Links are incorrect" )
-
- # FIXME: move this to an ONOS state case
- main.step( "Checking ONOS nodes" )
- nodesOutput = []
- nodeResults = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].nodes,
- name="nodes-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- nodesOutput.append( t.result )
- ips = [ node.ip_address for node in nodes ]
- for i in nodesOutput:
- try:
- current = json.loads( i )
- for node in current:
- currentResult = main.FALSE
- if node['ip'] in ips: # node in nodes() output is in cell
- if node['state'] == 'ACTIVE':
- currentResult = main.TRUE
- else:
- main.log.error( "Error in ONOS node availability" )
- main.log.error(
- json.dumps( current,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- break
- nodeResults = nodeResults and currentResult
- except ( ValueError, TypeError ):
- main.log.error( "Error parsing nodes output" )
- main.log.warn( repr( i ) )
- utilities.assert_equals( expect=main.TRUE, actual=nodeResults,
- onpass="Nodes check successful",
- onfail="Nodes check NOT successful" )
-
- def CASE9( self, main ):
- """
- Link s3-s28 down
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- # NOTE: You should probably run a topology check after this
-
- linkSleep = float( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- description = "Turn off a link to ensure that Link Discovery " +\
- "is working properly"
- main.case( description )
-
- main.step( "Kill Link between s3 and s28" )
- LinkDown = main.Mininet1.link( END1="s3", END2="s28", OPTION="down" )
- main.log.info( "Waiting " + str( linkSleep ) +
- " seconds for link down to be discovered" )
- time.sleep( linkSleep )
- utilities.assert_equals( expect=main.TRUE, actual=LinkDown,
- onpass="Link down successful",
- onfail="Failed to bring link down" )
- # TODO do some sort of check here
-
- def CASE10( self, main ):
- """
- Link s3-s28 up
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- # NOTE: You should probably run a topology check after this
-
- linkSleep = float( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- description = "Restore a link to ensure that Link Discovery is " + \
- "working properly"
- main.case( description )
-
- main.step( "Bring link between s3 and s28 back up" )
- LinkUp = main.Mininet1.link( END1="s3", END2="s28", OPTION="up" )
- main.log.info( "Waiting " + str( linkSleep ) +
- " seconds for link up to be discovered" )
- time.sleep( linkSleep )
- utilities.assert_equals( expect=main.TRUE, actual=LinkUp,
- onpass="Link up successful",
- onfail="Failed to bring link up" )
- # TODO do some sort of check here
-
- def CASE11( self, main ):
- """
- Switch Down
- """
- # NOTE: You should probably run a topology check after this
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- switchSleep = float( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
-
- description = "Killing a switch to ensure it is discovered correctly"
- main.case( description )
- switch = main.params[ 'kill' ][ 'switch' ]
- switchDPID = main.params[ 'kill' ][ 'dpid' ]
-
- # TODO: Make this switch parameterizable
- main.step( "Kill " + switch )
- main.log.info( "Deleting " + switch )
- main.Mininet1.delSwitch( switch )
- main.log.info( "Waiting " + str( switchSleep ) +
- " seconds for switch down to be discovered" )
- time.sleep( switchSleep )
- device = main.ONOScli1.getDevice( dpid=switchDPID )
- # Peek at the deleted switch
- main.log.warn( str( device ) )
- result = main.FALSE
- if device and device[ 'available' ] is False:
- result = main.TRUE
- utilities.assert_equals( expect=main.TRUE, actual=result,
- onpass="Kill switch successful",
- onfail="Failed to kill switch?" )
-
- def CASE12( self, main ):
- """
- Switch Up
- """
- # NOTE: You should probably run a topology check after this
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- assert ONOS1Port, "ONOS1Port not defined"
- assert ONOS2Port, "ONOS2Port not defined"
- assert ONOS3Port, "ONOS3Port not defined"
- assert ONOS4Port, "ONOS4Port not defined"
- assert ONOS5Port, "ONOS5Port not defined"
- assert ONOS6Port, "ONOS6Port not defined"
- assert ONOS7Port, "ONOS7Port not defined"
-
- switchSleep = float( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
- switch = main.params[ 'kill' ][ 'switch' ]
- switchDPID = main.params[ 'kill' ][ 'dpid' ]
- links = main.params[ 'kill' ][ 'links' ].split()
- description = "Adding a switch to ensure it is discovered correctly"
- main.case( description )
-
- main.step( "Add back " + switch )
- main.Mininet1.addSwitch( switch, dpid=switchDPID )
- for peer in links:
- main.Mininet1.addLink( switch, peer )
- ipList = []
- for i in range( numControllers ):
- ipList.append( nodes[ i ].ip_address )
- main.Mininet1.assignSwController( sw=switch, ip=ipList )
- main.log.info( "Waiting " + str( switchSleep ) +
- " seconds for switch up to be discovered" )
- time.sleep( switchSleep )
- device = main.ONOScli1.getDevice( dpid=switchDPID )
- # Peek at the deleted switch
- main.log.warn( str( device ) )
- result = main.FALSE
- if device and device[ 'available' ]:
- result = main.TRUE
- utilities.assert_equals( expect=main.TRUE, actual=result,
- onpass="add switch successful",
- onfail="Failed to add switch?" )
-
- def CASE13( self, main ):
- """
- Clean up
- """
- import os
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- # printing colors to terminal
- colors = { 'cyan': '\033[96m', 'purple': '\033[95m',
- 'blue': '\033[94m', 'green': '\033[92m',
- 'yellow': '\033[93m', 'red': '\033[91m', 'end': '\033[0m' }
- main.case( "Test Cleanup" )
- main.step( "Killing tcpdumps" )
- main.Mininet2.stopTcpdump()
-
- main.step( "Copying MN pcap and ONOS log files to test station" )
- testname = main.TEST
- teststationUser = main.params[ 'TESTONUSER' ]
- teststationIP = main.params[ 'TESTONIP' ]
- # NOTE: MN Pcap file is being saved to ~/packet_captures
- # scp this file as MN and TestON aren't necessarily the same vm
- # FIXME: scp
- # mn files
- # TODO: Load these from params
- # NOTE: must end in /
- logFolder = "/opt/onos/log/"
- logFiles = [ "karaf.log", "karaf.log.1" ]
- # NOTE: must end in /
- dstDir = "~/packet_captures/"
- for f in logFiles:
- for node in nodes:
- main.ONOSbench.handle.sendline( "scp sdn@" + node.ip_address +
- ":" + logFolder + f + " " +
- teststationUser + "@" +
- teststationIP + ":" +
- dstDir + str( testname ) +
- "-" + node.name + "-" + f )
- main.ONOSbench.handle.expect( "\$" )
-
- # std*.log's
- # NOTE: must end in /
- logFolder = "/opt/onos/var/"
- logFiles = [ "stderr.log", "stdout.log" ]
- # NOTE: must end in /
- dstDir = "~/packet_captures/"
- for f in logFiles:
- for node in nodes:
- main.ONOSbench.handle.sendline( "scp sdn@" + node.ip_address +
- ":" + logFolder + f + " " +
- teststationUser + "@" +
- teststationIP + ":" +
- dstDir + str( testname ) +
- "-" + node.name + "-" + f )
- main.ONOSbench.handle.expect( "\$" )
- # sleep so scp can finish
- time.sleep( 10 )
-
- main.step( "Stopping Mininet" )
- mnResult = main.Mininet1.stopNet()
- utilities.assert_equals( expect=main.TRUE, actual=mnResult,
- onpass="Mininet stopped",
- onfail="MN cleanup NOT successful" )
-
- main.step( "Checking ONOS Logs for errors" )
- for node in nodes:
- print colors[ 'purple' ] + "Checking logs for errors on " + \
- node.name + ":" + colors[ 'end' ]
- print main.ONOSbench.checkLogs( node.ip_address, restart=True )
-
- main.step( "Packing and rotating pcap archives" )
- os.system( "~/TestON/dependencies/rotate.sh " + str( testname ) )
-
- try:
- timerLog = open( main.logdir + "/Timers.csv", 'w')
- # Overwrite with empty line and close
- labels = "Gossip Intents, Restart"
- data = str( gossipTime ) + ", " + str( main.restartTime )
- timerLog.write( labels + "\n" + data )
- timerLog.close()
- except NameError, e:
- main.log.exception(e)
-
- def CASE14( self, main ):
- """
- start election app on all onos nodes
- """
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- main.case("Start Leadership Election app")
- main.step( "Install leadership election app" )
- appResult = main.ONOScli1.activateApp( "org.onosproject.election" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=appResult,
- onpass="Election app installed",
- onfail="Something went wrong with installing Leadership election" )
-
- main.step( "Run for election on each node" )
- leaderResult = main.TRUE
- leaders = []
- for cli in CLIs:
- cli.electionTestRun()
- for cli in CLIs:
- leader = cli.electionTestLeader()
- if leader is None or leader == main.FALSE:
- main.log.error( cli.name + ": Leader for the election app " +
- "should be an ONOS node, instead got '" +
- str( leader ) + "'" )
- leaderResult = main.FALSE
- leaders.append( leader )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Successfully ran for leadership",
- onfail="Failed to run for leadership" )
-
- main.step( "Check that each node shows the same leader" )
- sameLeader = main.TRUE
- if len( set( leaders ) ) != 1:
- sameLeader = main.FALSE
- main.log.error( "Results of electionTestLeader is order of CLIs:" +
- str( leaders ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=sameLeader,
- onpass="Leadership is consistent for the election topic",
- onfail="Nodes have different leaders" )
-
- def CASE15( self, main ):
- """
- Check that Leadership Election is still functional
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- leaderResult = main.TRUE
- description = "Check that Leadership Election is still functional"
- main.case( description )
-
- main.step( "Check that each node shows the same leader" )
- sameLeader = main.TRUE
- leaders = []
- for cli in CLIs:
- leader = cli.electionTestLeader()
- leaders.append( leader )
- if len( set( leaders ) ) != 1:
- sameLeader = main.FALSE
- main.log.error( "Results of electionTestLeader is order of CLIs:" +
- str( leaders ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=sameLeader,
- onpass="Leadership is consistent for the election topic",
- onfail="Nodes have different leaders" )
-
- main.step( "Find current leader and withdraw" )
- leader = main.ONOScli1.electionTestLeader()
- # do some sanity checking on leader before using it
- withdrawResult = main.FALSE
- if leader is None or leader == main.FALSE:
- main.log.error(
- "Leader for the election app should be an ONOS node," +
- "instead got '" + str( leader ) + "'" )
- leaderResult = main.FALSE
- oldLeader = None
- for i in range( len( CLIs ) ):
- if leader == nodes[ i ].ip_address:
- oldLeader = CLIs[ i ]
- break
- else: # FOR/ELSE statement
- main.log.error( "Leader election, could not find current leader" )
- if oldLeader:
- withdrawResult = oldLeader.electionTestWithdraw()
- utilities.assert_equals(
- expect=main.TRUE,
- actual=withdrawResult,
- onpass="Node was withdrawn from election",
- onfail="Node was not withdrawn from election" )
-
- main.step( "Make sure new leader is elected" )
- # FIXME: use threads
- leaderList = []
- for cli in CLIs:
- leaderN = cli.electionTestLeader()
- leaderList.append( leaderN )
- if leaderN == leader:
- main.log.error( cli.name + " still sees " + str( leader ) +
- " as leader after they withdrew" )
- leaderResult = main.FALSE
- elif leaderN == main.FALSE:
- # error in response
- # TODO: add check for "Command not found:" in the driver, this
- # means the app isn't loaded
- main.log.error( "Something is wrong with " +
- "electionTestLeader function, " +
- "check the error logs" )
- leaderResult = main.FALSE
- elif leaderN is None:
- # node may not have recieved the event yet
- time.sleep(7)
- leaderN = cli.electionTestLeader()
- leaderList.pop()
- leaderList.append( leaderN )
- consistentLeader = main.FALSE
- if len( set( leaderList ) ) == 1:
- main.log.info( "Each Election-app sees '" +
- str( leaderList[ 0 ] ) +
- "' as the leader" )
- consistentLeader = main.TRUE
- else:
- main.log.error(
- "Inconsistent responses for leader of Election-app:" )
- for n in range( len( leaderList ) ):
- main.log.error( "ONOS" + str( n + 1 ) + " response: " +
- str( leaderList[ n ] ) )
- leaderResult = leaderResult and consistentLeader
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Leadership election passed",
- onfail="Something went wrong with Leadership election" )
-
- main.step( "Run for election on old leader( just so everyone " +
- "is in the hat )" )
- if oldLeader:
- runResult = oldLeader.electionTestRun()
- else:
- runResult = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=runResult,
- onpass="App re-ran for election",
- onfail="App failed to run for election" )
-
- main.step( "Leader did not change when old leader re-ran" )
- afterRun = main.ONOScli1.electionTestLeader()
- # verify leader didn't just change
- if afterRun == leaderList[ 0 ]:
- afterResult = main.TRUE
- else:
- afterResult = main.FALSE
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=afterResult,
- onpass="Old leader successfully re-ran for election",
- onfail="Something went wrong with Leadership election after " +
- "the old leader re-ran for election" )
-
- def CASE16( self, main ):
- """
- Install Distributed Primitives app
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- # Variables for the distributed primitives tests
- global pCounterName
- global iCounterName
- global pCounterValue
- global iCounterValue
- global onosSet
- global onosSetName
- pCounterName = "TestON-Partitions"
- iCounterName = "TestON-inMemory"
- pCounterValue = 0
- iCounterValue = 0
- onosSet = set([])
- onosSetName = "TestON-set"
-
- description = "Install Primitives app"
- main.case( description )
- main.step( "Install Primitives app" )
- appName = "org.onosproject.distributedprimitives"
- appResults = CLIs[0].activateApp( appName )
- utilities.assert_equals( expect=main.TRUE,
- actual=appResults,
- onpass="Primitives app activated",
- onfail="Primitives app not activated" )
- time.sleep( 5 ) # To allow all nodes to activate
-
- def CASE17( self, main ):
- """
- Check for basic functionality with distributed primitives
- """
- import json
- # Make sure variables are defined/set
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- assert pCounterName, "pCounterName not defined"
- assert iCounterName, "iCounterName not defined"
- assert onosSetName, "onosSetName not defined"
- # NOTE: assert fails if value is 0/None/Empty/False
- try:
- pCounterValue
- except NameError:
- main.log.error( "pCounterValue not defined, setting to 0" )
- pCounterValue = 0
- try:
- iCounterValue
- except NameError:
- main.log.error( "iCounterValue not defined, setting to 0" )
- iCounterValue = 0
- try:
- onosSet
- except NameError:
- main.log.error( "onosSet not defined, setting to empty Set" )
- onosSet = set([])
- # Variables for the distributed primitives tests. These are local only
- addValue = "a"
- addAllValue = "a b c d e f"
- retainValue = "c d e f"
-
- description = "Check for basic functionality with distributed " +\
- "primitives"
- main.case( description )
- main.caseExplaination = "Test the methods of the distributed primitives (counters and sets) throught the cli"
- # DISTRIBUTED ATOMIC COUNTERS
- main.step( "Increment and get a default counter on each node" )
- pCounters = []
- threads = []
- addedPValues = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].counterTestIncrement,
- name="counterIncrement-" + str( i ),
- args=[ pCounterName ] )
- pCounterValue += 1
- addedPValues.append( pCounterValue )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- pCounters.append( t.result )
- # Check that counter incremented numController times
- pCounterResults = True
- for i in addedPValues:
- tmpResult = i in pCounters
- pCounterResults = pCounterResults and tmpResult
- if not tmpResult:
- main.log.error( str( i ) + " is not in partitioned "
- "counter incremented results" )
- utilities.assert_equals( expect=True,
- actual=pCounterResults,
- onpass="Default counter incremented",
- onfail="Error incrementing default" +
- " counter" )
-
- main.step( "Increment and get an in memory counter on each node" )
- iCounters = []
- addedIValues = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].counterTestIncrement,
- name="icounterIncrement-" + str( i ),
- args=[ iCounterName ],
- kwargs={ "inMemory": True } )
- iCounterValue += 1
- addedIValues.append( iCounterValue )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- iCounters.append( t.result )
- # Check that counter incremented numController times
- iCounterResults = True
- for i in addedIValues:
- tmpResult = i in iCounters
- iCounterResults = iCounterResults and tmpResult
- if not tmpResult:
- main.log.error( str( i ) + " is not in the in-memory "
- "counter incremented results" )
- utilities.assert_equals( expect=True,
- actual=iCounterResults,
- onpass="In memory counter incremented",
- onfail="Error incrementing in memory" +
- " counter" )
-
- main.step( "Check counters are consistant across nodes" )
- onosCounters = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].counters,
- name="counters-" + str( i ) )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- onosCounters.append( t.result )
- tmp = [ i == onosCounters[ 0 ] for i in onosCounters ]
- if all( tmp ):
- main.log.info( "Counters are consistent across all nodes" )
- consistentCounterResults = main.TRUE
- else:
- main.log.error( "Counters are not consistent across all nodes" )
- consistentCounterResults = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=consistentCounterResults,
- onpass="ONOS counters are consistent " +
- "across nodes",
- onfail="ONOS Counters are inconsistent " +
- "across nodes" )
-
- main.step( "Counters we added have the correct values" )
- correctResults = main.TRUE
- for i in range( numControllers ):
- current = json.loads( onosCounters[i] )
- pValue = None
- iValue = None
- try:
- for database in current:
- partitioned = database.get( 'partitionedDatabaseCounters' )
- if partitioned:
- for value in partitioned:
- if value.get( 'name' ) == pCounterName:
- pValue = value.get( 'value' )
- break
- inMemory = database.get( 'inMemoryDatabaseCounters' )
- if inMemory:
- for value in inMemory:
- if value.get( 'name' ) == iCounterName:
- iValue = value.get( 'value' )
- break
- except AttributeError, e:
- main.log.error( "ONOS" + str( i + 1 ) + " counters result " +
- "is not as expected" )
- correctResults = main.FALSE
- if pValue == pCounterValue:
- main.log.info( "Partitioned counter value is correct" )
- else:
- main.log.error( "Partitioned counter value is incorrect," +
- " expected value: " + str( pCounterValue )
- + " current value: " + str( pValue ) )
- correctResults = main.FALSE
- if iValue == iCounterValue:
- main.log.info( "In memory counter value is correct" )
- else:
- main.log.error( "In memory counter value is incorrect, " +
- "expected value: " + str( iCounterValue ) +
- " current value: " + str( iValue ) )
- correctResults = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=correctResults,
- onpass="Added counters are correct",
- onfail="Added counters are incorrect" )
- # DISTRIBUTED SETS
- main.step( "Distributed Set get" )
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
-
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=getResults,
- onpass="Set elements are correct",
- onfail="Set elements are incorrect" )
-
- main.step( "Distributed Set size" )
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
-
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- utilities.assert_equals( expect=main.TRUE,
- actual=sizeResults,
- onpass="Set sizes are correct",
- onfail="Set sizes are incorrect" )
-
- main.step( "Distributed Set add()" )
- onosSet.add( addValue )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAdd-" + str( i ),
- args=[ onosSetName, addValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addResults = main.FALSE
- else:
- # unexpected result
- addResults = main.FALSE
- if addResults != main.TRUE:
- main.log.error( "Error executing set add" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addResults = addResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addResults,
- onpass="Set add correct",
- onfail="Set add was incorrect" )
-
- main.step( "Distributed Set addAll()" )
- onosSet.update( addAllValue.split() )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAddAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addAllResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addAllResults = main.FALSE
- else:
- # unexpected result
- addAllResults = main.FALSE
- if addAllResults != main.TRUE:
- main.log.error( "Error executing set addAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addAllResults = addAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addAllResults,
- onpass="Set addAll correct",
- onfail="Set addAll was incorrect" )
-
- main.step( "Distributed Set contains()" )
- containsResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setContains-" + str( i ),
- args=[ onosSetName ],
- kwargs={ "values": addValue } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- # NOTE: This is the tuple
- containsResponses.append( t.result )
-
- containsResults = main.TRUE
- for i in range( numControllers ):
- if containsResponses[ i ] == main.ERROR:
- containsResults = main.FALSE
- else:
- containsResults = containsResults and\
- containsResponses[ i ][ 1 ]
- utilities.assert_equals( expect=main.TRUE,
- actual=containsResults,
- onpass="Set contains is functional",
- onfail="Set contains failed" )
-
- main.step( "Distributed Set containsAll()" )
- containsAllResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setContainsAll-" + str( i ),
- args=[ onosSetName ],
- kwargs={ "values": addAllValue } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- # NOTE: This is the tuple
- containsAllResponses.append( t.result )
-
- containsAllResults = main.TRUE
- for i in range( numControllers ):
- if containsResponses[ i ] == main.ERROR:
- containsResults = main.FALSE
- else:
- containsResults = containsResults and\
- containsResponses[ i ][ 1 ]
- utilities.assert_equals( expect=main.TRUE,
- actual=containsAllResults,
- onpass="Set containsAll is functional",
- onfail="Set containsAll failed" )
-
- main.step( "Distributed Set remove()" )
- onosSet.remove( addValue )
- removeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestRemove-" + str( i ),
- args=[ onosSetName, addValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- removeResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- removeResults = main.TRUE
- for i in range( numControllers ):
- if removeResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif removeResponses[ i ] == main.FALSE:
- # not in set, probably fine
- pass
- elif removeResponses[ i ] == main.ERROR:
- # Error in execution
- removeResults = main.FALSE
- else:
- # unexpected result
- removeResults = main.FALSE
- if removeResults != main.TRUE:
- main.log.error( "Error executing set remove" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- removeResults = removeResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=removeResults,
- onpass="Set remove correct",
- onfail="Set remove was incorrect" )
-
- main.step( "Distributed Set removeAll()" )
- onosSet.difference_update( addAllValue.split() )
- removeAllResponses = []
- threads = []
- try:
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestRemoveAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- removeAllResponses.append( t.result )
- except Exception, e:
- main.log.exception(e)
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- removeAllResults = main.TRUE
- for i in range( numControllers ):
- if removeAllResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif removeAllResponses[ i ] == main.FALSE:
- # not in set, probably fine
- pass
- elif removeAllResponses[ i ] == main.ERROR:
- # Error in execution
- removeAllResults = main.FALSE
- else:
- # unexpected result
- removeAllResults = main.FALSE
- if removeAllResults != main.TRUE:
- main.log.error( "Error executing set removeAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- removeAllResults = removeAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=removeAllResults,
- onpass="Set removeAll correct",
- onfail="Set removeAll was incorrect" )
-
- main.step( "Distributed Set addAll()" )
- onosSet.update( addAllValue.split() )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAddAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addAllResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addAllResults = main.FALSE
- else:
- # unexpected result
- addAllResults = main.FALSE
- if addAllResults != main.TRUE:
- main.log.error( "Error executing set addAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addAllResults = addAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addAllResults,
- onpass="Set addAll correct",
- onfail="Set addAll was incorrect" )
-
- main.step( "Distributed Set clear()" )
- onosSet.clear()
- clearResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestClear-" + str( i ),
- args=[ onosSetName, " "], # Values doesn't matter
- kwargs={ "clear": True } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- clearResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- clearResults = main.TRUE
- for i in range( numControllers ):
- if clearResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif clearResponses[ i ] == main.FALSE:
- # Nothing set, probably fine
- pass
- elif clearResponses[ i ] == main.ERROR:
- # Error in execution
- clearResults = main.FALSE
- else:
- # unexpected result
- clearResults = main.FALSE
- if clearResults != main.TRUE:
- main.log.error( "Error executing set clear" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- clearResults = clearResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=clearResults,
- onpass="Set clear correct",
- onfail="Set clear was incorrect" )
-
- main.step( "Distributed Set addAll()" )
- onosSet.update( addAllValue.split() )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAddAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addAllResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addAllResults = main.FALSE
- else:
- # unexpected result
- addAllResults = main.FALSE
- if addAllResults != main.TRUE:
- main.log.error( "Error executing set addAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addAllResults = addAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addAllResults,
- onpass="Set addAll correct",
- onfail="Set addAll was incorrect" )
-
- main.step( "Distributed Set retain()" )
- onosSet.intersection_update( retainValue.split() )
- retainResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestRetain-" + str( i ),
- args=[ onosSetName, retainValue ],
- kwargs={ "retain": True } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- retainResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- retainResults = main.TRUE
- for i in range( numControllers ):
- if retainResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif retainResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif retainResponses[ i ] == main.ERROR:
- # Error in execution
- retainResults = main.FALSE
- else:
- # unexpected result
- retainResults = main.FALSE
- if retainResults != main.TRUE:
- main.log.error( "Error executing set retain" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " +
- str( size ) + " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- retainResults = retainResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=retainResults,
- onpass="Set retain correct",
- onfail="Set retain was incorrect" )
-
diff --git a/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.topo b/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.topo
deleted file mode 100644
index 9305025..0000000
--- a/TestON/tests/HATestMinorityRestart/HATestMinorityRestart.topo
+++ /dev/null
@@ -1,169 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOScli1>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli1>
-
- <ONOScli2>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli2>
-
- <ONOScli3>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli3>
-
-
- <ONOScli4>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli4>
-
-
- <ONOScli5>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli5>
-
-
- <ONOScli6>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli6>
-
-
- <ONOScli7>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli7>
-
- <ONOS1>
- <host>10.128.30.11</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.128.30.12</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>10</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.128.30.13</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>11</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
- <ONOS4>
- <host>10.128.30.14</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>12</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4>
-
- <ONOS5>
- <host>10.128.30.15</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>13</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5>
-
- <ONOS6>
- <host>10.128.30.16</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>14</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6>
-
- <ONOS7>
- <host>10.128.30.17</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>15</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7>
-
- <Mininet1>
- <host>10.128.30.9</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>16</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> </arg3>
- <controller> none </controller>
- </COMPONENTS>
- </Mininet1>
-
- <Mininet2>
- <host>10.128.30.9</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>17</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </Mininet2>
-
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/HATestMinorityRestart/__init__.py b/TestON/tests/HATestMinorityRestart/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/HATestMinorityRestart/__init__.py
+++ /dev/null
diff --git a/TestON/tests/HATestNetworkPartition/HATestNetworkPartition.params b/TestON/tests/HATestNetworkPartition/HATestNetworkPartition.params
deleted file mode 100644
index f82aba3..0000000
--- a/TestON/tests/HATestNetworkPartition/HATestNetworkPartition.params
+++ /dev/null
@@ -1,90 +0,0 @@
-<PARAMS>
-
-#List of test cases:
-#CASE1: Compile ONOS and push it to the test machines
-#CASE2: Assign mastership to controllers
-#CASE3: Assign intents
-#CASE4: Ping across added host intents
-#CASE5: Reading state of ONOS
-#CASE6: The Failure case. We will create IPTables rules here.
-#CASE7: Check state after control plane partition.
-#CASE8: Compare topo
-#CASE9: Link s3-s28 down
-#CASE10: Link s3-s28 up
-#CASE11: Switch down
-#CASE12: Switch up
-#CASE13: Clean up
-#CASE14: start election app on all onos nodes
-#CASE15: Check that Leadership Election is still functional
-#CASE16: Repair network partition
- #1,2,8,3,4,5,14,[6],8,7,4,15,9,8,4,10,8,4,11,8,4,12,8,4,13
- <testcases>1,2,5,14,[6],8,7,4,15,9,8,4,10,8,4,11,8,4,12,8,4,16,13</testcases>
- <ENV>
- <cellName>HA</cellName>
- </ENV>
- <Git> False </Git>
- <branch> master </branch>
- <num_controllers> 7 </num_controllers>
- <tcpdump> False </tcpdump>
-
- <CTRL>
- <ip1>10.128.30.11</ip1>
- <port1>6633</port1>
-
- <ip2>10.128.30.12</ip2>
- <port2>6633</port2>
-
- <ip3>10.128.30.13</ip3>
- <port3>6633</port3>
-
- <ip4>10.128.30.14</ip4>
- <port4>6633</port4>
-
- <ip5>10.128.30.15</ip5>
- <port5>6633</port5>
-
- <ip6>10.128.30.16</ip6>
- <port6>6633</port6>
-
- <ip7>10.128.30.17</ip7>
- <port7>6633</port7>
- </CTRL>
- <TESTONUSER>admin</TESTONUSER>
- <TESTONIP>10.128.30.9</TESTONIP>
- <PING>
- <source1>h8</source1>
- <source2>h9</source2>
- <source3>h10</source3>
- <source4>h11</source4>
- <source5>h12</source5>
- <source6>h13</source6>
- <source7>h14</source7>
- <source8>h15</source8>
- <source9>h16</source9>
- <source10>h17</source10>
- <target1>10.0.0.18</target1>
- <target2>10.0.0.19</target2>
- <target3>10.0.0.20</target3>
- <target4>10.0.0.21</target4>
- <target5>10.0.0.22</target5>
- <target6>10.0.0.23</target6>
- <target7>10.0.0.24</target7>
- <target8>10.0.0.25</target8>
- <target9>10.0.0.26</target9>
- <target10>10.0.0.27</target10>
- </PING>
- <timers>
- <LinkDiscovery>.2</LinkDiscovery>
- <SwitchDiscovery>.2</SwitchDiscovery>
- </timers>
- <kill>
- <switch> s5 </switch>
- <dpid> 0000000000005000 </dpid>
- <links> h5 s2 s1 s6 </links>
- </kill>
- <MNtcpdump>
- <intf>eth0</intf>
- <port> </port>
- <folder>~/packet_captures/</folder>
- </MNtcpdump>
-</PARAMS>
diff --git a/TestON/tests/HATestNetworkPartition/HATestNetworkPartition.py b/TestON/tests/HATestNetworkPartition/HATestNetworkPartition.py
deleted file mode 100644
index d2a2ec1..0000000
--- a/TestON/tests/HATestNetworkPartition/HATestNetworkPartition.py
+++ /dev/null
@@ -1,2012 +0,0 @@
-"""
-Description: This test is to determine how ONOS behaves in a control network
- partion. ONOS 1,2,3 will be split into a sub cluster and ONOS
- 4,5,6,7 will be in another sub-cluster.
-
-List of test cases:
-CASE1: Compile ONOS and push it to the test machines
-CASE2: Assign mastership to controllers
-CASE3: Assign intents
-CASE4: Ping across added host intents
-CASE5: Reading state of ONOS
-CASE6: The Failure case. We will create IPTables rules here.
-CASE7: Check state after control plane partition.
-CASE8: Compare topo
-CASE9: Link s3-s28 down
-CASE10: Link s3-s28 up
-CASE11: Switch down
-CASE12: Switch up
-CASE13: Clean up
-CASE14: start election app on all onos nodes
-CASE15: Check that Leadership Election is still functional
-CASE16: Repair network partition
-"""
-# FIXME: Add new comparison case for during the failure?
-class HATestNetworkPartition:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- """
- CASE1 is to compile ONOS and push it to the test machines
-
- Startup sequence:
- cell <name>
- onos-verify-cell
- NOTE: temporary - onos-remove-raft-logs
- onos-uninstall
- start mininet
- git pull
- mvn clean install
- onos-package
- onos-install -f
- onos-wait-for-start
- start cli sessions
- start tcpdump
- """
- main.log.report( "ONOS HA test: Network partition - initialization" )
- main.log.report( "This test will partition a 7 node cluster into " +
- "3 node and 4 node sub clusters by blocking " +
- "communication between nodes." )
- main.case( "Setting up test environment" )
- # TODO: save all the timers and output them for plotting
-
- # load some vairables from the params file
- PULLCODE = False
- if main.params[ 'Git' ] == 'True':
- PULLCODE = True
- gitBranch = main.params[ 'branch' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
-
- # set global variables
- global ONOS1Ip
- global ONOS1Port
- global ONOS2Ip
- global ONOS2Port
- global ONOS3Ip
- global ONOS3Port
- global ONOS4Ip
- global ONOS4Port
- global ONOS5Ip
- global ONOS5Port
- global ONOS6Ip
- global ONOS6Port
- global ONOS7Ip
- global ONOS7Port
- global numControllers
-
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
- ONOS4Ip = main.params[ 'CTRL' ][ 'ip4' ]
- ONOS4Port = main.params[ 'CTRL' ][ 'port4' ]
- ONOS5Ip = main.params[ 'CTRL' ][ 'ip5' ]
- ONOS5Port = main.params[ 'CTRL' ][ 'port5' ]
- ONOS6Ip = main.params[ 'CTRL' ][ 'ip6' ]
- ONOS6Port = main.params[ 'CTRL' ][ 'port6' ]
- ONOS7Ip = main.params[ 'CTRL' ][ 'ip7' ]
- ONOS7Port = main.params[ 'CTRL' ][ 'port7' ]
- numControllers = int( main.params[ 'num_controllers' ] )
-
- main.step( "Applying cell variable to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- # FIXME:this is short term fix
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
- main.ONOSbench.onosUninstall( ONOS2Ip )
- main.ONOSbench.onosUninstall( ONOS3Ip )
- main.ONOSbench.onosUninstall( ONOS4Ip )
- main.ONOSbench.onosUninstall( ONOS5Ip )
- main.ONOSbench.onosUninstall( ONOS6Ip )
- main.ONOSbench.onosUninstall( ONOS7Ip )
-
- cleanInstallResult = main.TRUE
- gitPullResult = main.TRUE
-
- main.step( "Starting Mininet" )
- main.Mininet1.startNet( )
-
- main.step( "Compiling the latest version of ONOS" )
- if PULLCODE:
- main.step( "Git checkout and pull " + gitBranch )
- main.ONOSbench.gitCheckout( gitBranch )
- gitPullResult = main.ONOSbench.gitPull()
-
- main.step( "Using mvn clean and install" )
- cleanInstallResult = main.ONOSbench.cleanInstall()
- else:
- main.log.warn( "Did not pull new code so skipping mvn " +
- "clean install" )
- main.ONOSbench.getVersion( report=True )
- # GRAPHS
- # NOTE: important params here:
- # job = name of Jenkins job
- # Plot Name = Plot-HA, only can be used if multiple plots
- # index = The number of the graph under plot name
- job = "HANetworkPartition"
- 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/getPlot?index=0&width=500&height=300"' +\
- 'noborder="0" width="500" height="300" scrolling="yes" '+\
- 'seamless="seamless"></iframe>\n'
- graphs += ']]></ac:plain-text-body>\n'
- graphs += '</ac:structured-macro>\n'
- main.log.wiki(graphs)
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
- node=ONOS1Ip )
- onos2InstallResult = main.ONOSbench.onosInstall( options="-f",
- node=ONOS2Ip )
- onos3InstallResult = main.ONOSbench.onosInstall( options="-f",
- node=ONOS3Ip )
- onos4InstallResult = main.ONOSbench.onosInstall( options="-f",
- node=ONOS4Ip )
- onos5InstallResult = main.ONOSbench.onosInstall( options="-f",
- node=ONOS5Ip )
- onos6InstallResult = main.ONOSbench.onosInstall( options="-f",
- node=ONOS6Ip )
- onos7InstallResult = main.ONOSbench.onosInstall( options="-f",
- node=ONOS7Ip )
- onosInstallResult = onos1InstallResult and onos2InstallResult\
- and onos3InstallResult and onos4InstallResult\
- and onos5InstallResult and onos6InstallResult\
- and onos7InstallResult
-
- main.step( "Checking if ONOS is up yet" )
- for i in range( 2 ):
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
- main.ONOSbench.onosStop( ONOS1Ip )
- main.ONOSbench.onosStart( ONOS1Ip )
- onos2Isup = main.ONOSbench.isup( ONOS2Ip )
- if not onos2Isup:
- main.log.report( "ONOS2 didn't start!" )
- main.ONOSbench.onosStop( ONOS2Ip )
- main.ONOSbench.onosStart( ONOS2Ip )
- onos3Isup = main.ONOSbench.isup( ONOS3Ip )
- if not onos3Isup:
- main.log.report( "ONOS3 didn't start!" )
- main.ONOSbench.onosStop( ONOS3Ip )
- main.ONOSbench.onosStart( ONOS3Ip )
- onos4Isup = main.ONOSbench.isup( ONOS4Ip )
- if not onos4Isup:
- main.log.report( "ONOS4 didn't start!" )
- main.ONOSbench.onosStop( ONOS4Ip )
- main.ONOSbench.onosStart( ONOS4Ip )
- onos5Isup = main.ONOSbench.isup( ONOS5Ip )
- if not onos5Isup:
- main.log.report( "ONOS5 didn't start!" )
- main.ONOSbench.onosStop( ONOS5Ip )
- main.ONOSbench.onosStart( ONOS5Ip )
- onos6Isup = main.ONOSbench.isup( ONOS6Ip )
- if not onos6Isup:
- main.log.report( "ONOS6 didn't start!" )
- main.ONOSbench.onosStop( ONOS6Ip )
- main.ONOSbench.onosStart( ONOS6Ip )
- onos7Isup = main.ONOSbench.isup( ONOS7Ip )
- if not onos7Isup:
- main.log.report( "ONOS7 didn't start!" )
- main.ONOSbench.onosStop( ONOS7Ip )
- main.ONOSbench.onosStart( ONOS7Ip )
- onosIsupResult = onos1Isup and onos2Isup and onos3Isup\
- and onos4Isup and onos5Isup and onos6Isup and onos7Isup
- if onosIsupResult == main.TRUE:
- break
-
- cliResult1 = main.ONOScli1.startOnosCli( ONOS1Ip )
- cliResult2 = main.ONOScli2.startOnosCli( ONOS2Ip )
- cliResult3 = main.ONOScli3.startOnosCli( ONOS3Ip )
- cliResult4 = main.ONOScli4.startOnosCli( ONOS4Ip )
- cliResult5 = main.ONOScli5.startOnosCli( ONOS5Ip )
- cliResult6 = main.ONOScli6.startOnosCli( ONOS6Ip )
- cliResult7 = main.ONOScli7.startOnosCli( ONOS7Ip )
- cliResults = cliResult1 and cliResult2 and cliResult3 and\
- cliResult4 and cliResult5 and cliResult6 and cliResult7
-
- if main.params[ 'tcpdump' ].lower() == "true":
- main.step( "Start Packet Capture MN" )
- main.Mininet2.startTcpdump(
- str( main.params[ 'MNtcpdump' ][ 'folder' ] ) + str( main.TEST )
- + "-MN.pcap",
- intf=main.params[ 'MNtcpdump' ][ 'intf' ],
- port=main.params[ 'MNtcpdump' ][ 'port' ] )
-
- case1Result = ( cleanInstallResult and packageResult and
- cellResult and verifyResult and onosInstallResult
- and onosIsupResult and cliResults )
-
- utilities.assert_equals( expect=main.TRUE, actual=case1Result,
- onpass="Test startup successful",
- onfail="Test startup NOT successful" )
-
- if case1Result == main.FALSE:
- main.log.error( "Failed to start ONOS, stopping test" )
- main.cleanup()
- main.exit()
-
- def CASE2( self, main ):
- """
- Assign mastership to controllers
- """
- import re
-
- main.log.report( "Assigning switches to controllers" )
- main.case( "Assigning Controllers" )
- main.step( "Assign switches to controllers" )
-
- for i in range( 1, 29 ):
- main.Mininet1.assignSwController(
- sw=str( i ),
- count=numControllers,
- ip1=ONOS1Ip, port1=ONOS1Port,
- ip2=ONOS2Ip, port2=ONOS2Port,
- ip3=ONOS3Ip, port3=ONOS3Port,
- ip4=ONOS4Ip, port4=ONOS4Port,
- ip5=ONOS5Ip, port5=ONOS5Port,
- ip6=ONOS6Ip, port6=ONOS6Port,
- ip7=ONOS7Ip, port7=ONOS7Port )
-
- mastershipCheck = main.TRUE
- for i in range( 1, 29 ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
- try:
- main.log.info( str( response ) )
- except:
- main.log.info( repr( response ) )
- if re.search( "tcp:" + ONOS1Ip, response )\
- and re.search( "tcp:" + ONOS2Ip, response )\
- and re.search( "tcp:" + ONOS3Ip, response )\
- and re.search( "tcp:" + ONOS4Ip, response )\
- and re.search( "tcp:" + ONOS5Ip, response )\
- and re.search( "tcp:" + ONOS6Ip, response )\
- and re.search( "tcp:" + ONOS7Ip, response ):
- mastershipCheck = mastershipCheck and main.TRUE
- else:
- mastershipCheck = main.FALSE
- if mastershipCheck == main.TRUE:
- main.log.report( "Switch mastership assigned correctly" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=mastershipCheck,
- onpass="Switch mastership assigned correctly",
- onfail="Switches not assigned correctly to controllers" )
-
- # Manually assign mastership to the controller we want
- roleCall = main.TRUE
- roleCheck = main.TRUE
-
- # Assign switch
- deviceId = main.ONOScli1.getDevice( "1000" ).get( 'id' )
- roleCall = roleCall and main.ONOScli1.deviceRole(
- deviceId,
- ONOS1Ip )
- # Check assignment
- if ONOS1Ip in main.ONOScli1.getRole( deviceId ).get( 'master' ):
- roleCheck = roleCheck and main.TRUE
- else:
- roleCheck = roleCheck and main.FALSE
-
- # Assign switch
- deviceId = main.ONOScli1.getDevice( "2800" ).get( 'id' )
- roleCall = roleCall and main.ONOScli1.deviceRole(
- deviceId,
- ONOS1Ip )
- # Check assignment
- if ONOS1Ip in main.ONOScli1.getRole( deviceId ).get( 'master' ):
- roleCheck = roleCheck and main.TRUE
- else:
- roleCheck = roleCheck and main.FALSE
-
- # Assign switch
- deviceId = main.ONOScli1.getDevice( "2000" ).get( 'id' )
- roleCall = roleCall and main.ONOScli1.deviceRole(
- deviceId,
- ONOS2Ip )
- # Check assignment
- if ONOS2Ip in main.ONOScli1.getRole( deviceId ).get( 'master' ):
- roleCheck = roleCheck and main.TRUE
- else:
- roleCheck = roleCheck and main.FALSE
-
- # Assign switch
- deviceId = main.ONOScli1.getDevice( "3000" ).get( 'id' )
- roleCall = roleCall and main.ONOScli1.deviceRole(
- deviceId,
- ONOS2Ip )
- # Check assignment
- if ONOS2Ip in main.ONOScli1.getRole( deviceId ).get( 'master' ):
- roleCheck = roleCheck and main.TRUE
- else:
- roleCheck = roleCheck and main.FALSE
-
- # Assign switch
- deviceId = main.ONOScli1.getDevice( "5000" ).get( 'id' )
- roleCall = roleCall and main.ONOScli1.deviceRole(
- deviceId,
- ONOS3Ip )
- # Check assignment
- if ONOS3Ip in main.ONOScli1.getRole( deviceId ).get( 'master' ):
- roleCheck = roleCheck and main.TRUE
- else:
- roleCheck = roleCheck and main.FALSE
-
- # Assign switch
- deviceId = main.ONOScli1.getDevice( "6000" ).get( 'id' )
- roleCall = roleCall and main.ONOScli1.deviceRole(
- deviceId,
- ONOS3Ip )
- # Check assignment
- if ONOS3Ip in main.ONOScli1.getRole( deviceId ).get( 'master' ):
- roleCheck = roleCheck and main.TRUE
- else:
- roleCheck = roleCheck and main.FALSE
-
- # Assign switch
- deviceId = main.ONOScli1.getDevice( "3004" ).get( 'id' )
- roleCall = roleCall and main.ONOScli1.deviceRole(
- deviceId,
- ONOS4Ip )
- # Check assignment
- if ONOS4Ip in main.ONOScli1.getRole( deviceId ).get( 'master' ):
- roleCheck = roleCheck and main.TRUE
- else:
- roleCheck = roleCheck and main.FALSE
-
- for i in range( 8, 18 ):
- dpid = '3' + str( i ).zfill( 3 )
- deviceId = main.ONOScli1.getDevice( dpid ).get( 'id' )
- roleCall = roleCall and main.ONOScli1.deviceRole(
- deviceId,
- ONOS5Ip )
- # Check assignment
- if ONOS5Ip in main.ONOScli1.getRole( deviceId ).get( 'master' ):
- roleCheck = roleCheck and main.TRUE
- else:
- roleCheck = roleCheck and main.FALSE
-
- deviceId = main.ONOScli1.getDevice( "6007" ).get( 'id' )
- roleCall = roleCall and main.ONOScli1.deviceRole(
- deviceId,
- ONOS6Ip )
- # Check assignment
- if ONOS6Ip in main.ONOScli1.getRole( deviceId ).get( 'master' ):
- roleCheck = roleCheck and main.TRUE
- else:
- roleCheck = roleCheck and main.FALSE
-
- for i in range( 18, 28 ):
- dpid = '6' + str( i ).zfill( 3 )
- deviceId = main.ONOScli1.getDevice( dpid ).get( 'id' )
- roleCall = roleCall and main.ONOScli1.deviceRole(
- deviceId,
- ONOS7Ip )
- # Check assignment
- if ONOS7Ip in main.ONOScli1.getRole( deviceId ).get( 'master' ):
- roleCheck = roleCheck and main.TRUE
- else:
- roleCheck = roleCheck and main.FALSE
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=roleCall,
- onpass="Re-assigned switch mastership to designated controller",
- onfail="Something wrong with deviceRole calls" )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=roleCheck,
- onpass="Switches were successfully reassigned to designated " +
- "controller",
- onfail="Switches were not successfully reassigned" )
- mastershipCheck = mastershipCheck and roleCall and roleCheck
- utilities.assert_equals( expect=main.TRUE, actual=mastershipCheck,
- onpass="Switch mastership correctly assigned",
- onfail="Error in (re)assigning switch" +
- " mastership" )
-
- def CASE3( self, main ):
- """
- Assign intents
- """
- import time
- import json
- main.log.report( "Adding host intents" )
- main.case( "Adding host Intents" )
-
- main.step( "Discovering Hosts( Via pingall for now )" )
- # FIXME: Once we have a host discovery mechanism, use that instead
-
- # install onos-app-fwd
- main.log.info( "Install reactive forwarding app" )
- appResults = CLIs[0].activateApp( "org.onosproject.fwd" )
- '''
- main.ONOScli1.featureInstall( "onos-app-fwd" )
- main.ONOScli2.featureInstall( "onos-app-fwd" )
- main.ONOScli3.featureInstall( "onos-app-fwd" )
- main.ONOScli4.featureInstall( "onos-app-fwd" )
- main.ONOScli5.featureInstall( "onos-app-fwd" )
- main.ONOScli6.featureInstall( "onos-app-fwd" )
- main.ONOScli7.featureInstall( "onos-app-fwd" )
- '''
-
- # REACTIVE FWD test
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall()
- utilities.assert_equals(
- expect=main.TRUE,
- actual=pingResult,
- onpass="Reactive Pingall test passed",
- onfail="Reactive Pingall failed, one or more ping pairs failed" )
- time2 = time.time()
- main.log.info( "Time for pingall: %2f seconds" % ( time2 - time1 ) )
-
- # uninstall onos-app-fwd
- main.log.info( "Uninstall reactive forwarding app" )
- appResults = appResults and CLIs[0].deactivateApp( "org.onosproject.fwd" )
- '''
- main.ONOScli1.featureUninstall( "onos-app-fwd" )
- main.ONOScli2.featureUninstall( "onos-app-fwd" )
- main.ONOScli3.featureUninstall( "onos-app-fwd" )
- main.ONOScli4.featureUninstall( "onos-app-fwd" )
- main.ONOScli5.featureUninstall( "onos-app-fwd" )
- main.ONOScli6.featureUninstall( "onos-app-fwd" )
- main.ONOScli7.featureUninstall( "onos-app-fwd" )
- '''
- # timeout for fwd flows
- time.sleep( 10 )
-
- main.step( "Add host intents" )
- # TODO: move the host numbers to params
- # Maybe look at all the paths we ping?
- intentAddResult = True
- for i in range( 8, 18 ):
- main.log.info( "Adding host intent between h" + str( i ) +
- " and h" + str( i + 10 ) )
- host1 = "00:00:00:00:00:" + \
- str( hex( i )[ 2: ] ).zfill( 2 ).upper()
- host2 = "00:00:00:00:00:" + \
- str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
- # NOTE: getHost can return None
- host1Dict = main.ONOScli1.getHost( host1 )
- host2Dict = main.ONOScli1.getHost( host2 )
- host1Id = None
- host2Id = None
- if host1Dict and host2Dict:
- host1Id = host1Dict.get( 'id', None )
- host2Id = host2Dict.get( 'id', None )
- if host1Id and host2Id:
- # distribute the intents across ONOS nodes
- nodeNum = ( i % 7 ) + 1
- node = getattr( main, ( 'ONOScli' + str( nodeNum ) ) )
- tmpResult = node.addHostIntent(
- host1Id,
- host2Id )
- else:
- main.log.error( "Error, getHost() failed" )
- main.log.warn( json.dumps( json.loads( main.ONOScli1.hosts() ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- tmpResult = main.FALSE
- intentAddResult = bool( pingResult and intentAddResult
- and tmpResult )
- # FIXME Check that intents were added?
- # TODO Use the new return from add host command and look at each
- # intent individually
- #
- #
- #
- #
- #
- #
- # End of for loop to add intents
- # Print the intent states
- intents = main.ONOScli1.intents( )
- intentStates = []
- for intent in json.loads( intents ): # Iter through intents of a node
- intentStates.append( intent.get( 'state', None ) )
- out = [ (i, intentStates.count( i ) ) for i in set( intentStates ) ]
- main.log.info( dict( out ) )
-
- utilities.assert_equals(
- expect=True,
- actual=intentAddResult,
- onpass="Pushed host intents to ONOS",
- onfail="Error in pushing host intents to ONOS" )
- # TODO Check if intents all exist in datastore
-
- def CASE4( self, main ):
- """
- Ping across added host intents
- """
- import json
- description = " Ping across added host intents"
- main.log.report( description )
- main.case( description )
- PingResult = main.TRUE
- for i in range( 8, 18 ):
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- PingResult = PingResult and ping
- if ping == main.FALSE:
- main.log.warn( "Ping failed between h" + str( i ) +
- " and h" + str( i + 10 ) )
- elif ping == main.TRUE:
- main.log.info( "Ping test passed!" )
- # Don't set PingResult or you'd override failures
- if PingResult == main.FALSE:
- main.log.report(
- "Intents have not been installed correctly, pings failed." )
- main.log.warn( "ONOS1 intents: " )
- main.log.warn( json.dumps( json.loads( main.ONOScli1.intents() ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- if PingResult == main.TRUE:
- main.log.report(
- "Intents have been installed correctly and verified by pings" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=PingResult,
- onpass="Intents have been installed correctly and pings work",
- onfail="Intents have not been installed correctly, pings failed." )
-
- def CASE5( self, main ):
- """
- Reading state of ONOS
- """
- import json
- # assumes that sts is already in you PYTHONPATH
- from sts.topology.teston_topology import TestONTopology
-
- main.log.report( "Setting up and gathering data for current state" )
- main.case( "Setting up and gathering data for current state" )
- # The general idea for this test case is to pull the state of
- # ( intents,flows, topology,... ) from each ONOS node
- # We can then compare them with eachother and also with past states
-
- main.step( "Get the Mastership of each switch from each controller" )
- global mastershipState
- mastershipState = []
-
- # Assert that each device has a master
- ONOS1MasterNotNull = main.ONOScli1.rolesNotNull()
- ONOS2MasterNotNull = main.ONOScli2.rolesNotNull()
- ONOS3MasterNotNull = main.ONOScli3.rolesNotNull()
- ONOS4MasterNotNull = main.ONOScli4.rolesNotNull()
- ONOS5MasterNotNull = main.ONOScli5.rolesNotNull()
- ONOS6MasterNotNull = main.ONOScli6.rolesNotNull()
- ONOS7MasterNotNull = main.ONOScli7.rolesNotNull()
- rolesNotNull = ONOS1MasterNotNull and ONOS2MasterNotNull and\
- ONOS3MasterNotNull and ONOS4MasterNotNull and\
- ONOS5MasterNotNull and ONOS6MasterNotNull and\
- ONOS7MasterNotNull
- utilities.assert_equals(
- expect=main.TRUE,
- actual=rolesNotNull,
- onpass="Each device has a master",
- onfail="Some devices don't have a master assigned" )
-
- ONOS1Mastership = main.ONOScli1.roles()
- ONOS2Mastership = main.ONOScli2.roles()
- ONOS3Mastership = main.ONOScli3.roles()
- ONOS4Mastership = main.ONOScli4.roles()
- ONOS5Mastership = main.ONOScli5.roles()
- ONOS6Mastership = main.ONOScli6.roles()
- ONOS7Mastership = main.ONOScli7.roles()
- if "Error" in ONOS1Mastership or not ONOS1Mastership\
- or "Error" in ONOS2Mastership or not ONOS2Mastership\
- or "Error" in ONOS3Mastership or not ONOS3Mastership\
- or "Error" in ONOS4Mastership or not ONOS4Mastership\
- or "Error" in ONOS5Mastership or not ONOS5Mastership\
- or "Error" in ONOS6Mastership or not ONOS6Mastership\
- or "Error" in ONOS7Mastership or not ONOS7Mastership:
- main.log.report( "Error in getting ONOS roles" )
- for i in range( 1, numControllers + 1 ):
- mastership = eval( "ONOS" + str( i ) + "Mastership" )
- main.log.warn(
- "ONOS" + str( i ) + " mastership response: " +
- repr( mastership ) )
- consistentMastership = main.FALSE
- elif ONOS1Mastership == ONOS2Mastership\
- and ONOS1Mastership == ONOS3Mastership\
- and ONOS1Mastership == ONOS4Mastership\
- and ONOS1Mastership == ONOS5Mastership\
- and ONOS1Mastership == ONOS6Mastership\
- and ONOS1Mastership == ONOS7Mastership:
- mastershipState = ONOS1Mastership
- consistentMastership = main.TRUE
- main.log.report(
- "Switch roles are consistent across all ONOS nodes" )
- else:
- for i in range( 1, numControllers + 1 ):
- mastership = eval( "ONOS" + str( i ) + "Mastership" )
- main.log.warn( "ONOS" + str( i ) + " roles: " +
- json.dumps( json.loads( mastership ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- consistentMastership = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentMastership,
- onpass="Switch roles are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of switch roles" )
-
- main.step( "Get the intents from each controller" )
- global intentState
- intentState = []
- ONOS1Intents = main.ONOScli1.intents( jsonFormat=True )
- ONOS2Intents = main.ONOScli2.intents( jsonFormat=True )
- ONOS3Intents = main.ONOScli3.intents( jsonFormat=True )
- ONOS4Intents = main.ONOScli4.intents( jsonFormat=True )
- ONOS5Intents = main.ONOScli5.intents( jsonFormat=True )
- ONOS6Intents = main.ONOScli6.intents( jsonFormat=True )
- ONOS7Intents = main.ONOScli7.intents( jsonFormat=True )
- intentCheck = main.FALSE
- if "Error" in ONOS1Intents or not ONOS1Intents\
- or "Error" in ONOS2Intents or not ONOS2Intents\
- or "Error" in ONOS3Intents or not ONOS3Intents\
- or "Error" in ONOS4Intents or not ONOS4Intents\
- or "Error" in ONOS5Intents or not ONOS5Intents\
- or "Error" in ONOS6Intents or not ONOS6Intents\
- or "Error" in ONOS7Intents or not ONOS7Intents:
- main.log.report( "Error in getting ONOS intents" )
- for i in range( 1, numControllers + 1 ):
- intents = eval( "ONOS" + str( i ) + "Intents" )
- main.log.warn(
- "ONOS" + str( i ) + " intents response: " +
- repr( intents ) )
- elif ONOS1Intents == ONOS2Intents\
- and ONOS1Intents == ONOS3Intents\
- and ONOS1Intents == ONOS4Intents\
- and ONOS1Intents == ONOS5Intents\
- and ONOS1Intents == ONOS6Intents\
- and ONOS1Intents == ONOS7Intents:
- intentState = ONOS1Intents
- intentCheck = main.TRUE
- main.log.report( "Intents are consistent across all ONOS nodes" )
- else:
- for i in range( 1, numControllers + 1 ):
- intents = eval( "ONOS" + str( i ) + "Intents" )
- main.log.warn( "ONOS" + str( i ) + " intents: " +
- json.dumps( json.loads( intents ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=intentCheck,
- onpass="Intents are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of intents" )
-
- main.step( "Get the flows from each controller" )
- global flowState
- flowState = []
- ONOS1Flows = main.ONOScli1.flows( jsonFormat=True )
- ONOS2Flows = main.ONOScli2.flows( jsonFormat=True )
- ONOS3Flows = main.ONOScli3.flows( jsonFormat=True )
- ONOS4Flows = main.ONOScli4.flows( jsonFormat=True )
- ONOS5Flows = main.ONOScli5.flows( jsonFormat=True )
- ONOS6Flows = main.ONOScli6.flows( jsonFormat=True )
- ONOS7Flows = main.ONOScli7.flows( jsonFormat=True )
- ONOS1FlowsJson = json.loads( ONOS1Flows )
- ONOS2FlowsJson = json.loads( ONOS2Flows )
- ONOS3FlowsJson = json.loads( ONOS3Flows )
- ONOS4FlowsJson = json.loads( ONOS4Flows )
- ONOS5FlowsJson = json.loads( ONOS5Flows )
- ONOS6FlowsJson = json.loads( ONOS6Flows )
- ONOS7FlowsJson = json.loads( ONOS7Flows )
- flowCheck = main.FALSE
- if "Error" in ONOS1Flows or not ONOS1Flows\
- or "Error" in ONOS2Flows or not ONOS2Flows\
- or "Error" in ONOS3Flows or not ONOS3Flows\
- or "Error" in ONOS4Flows or not ONOS4Flows\
- or "Error" in ONOS5Flows or not ONOS5Flows\
- or "Error" in ONOS6Flows or not ONOS6Flows\
- or "Error" in ONOS7Flows or not ONOS7Flows:
- main.log.report( "Error in getting ONOS intents" )
- for i in range( 1, numControllers + 1 ):
- flowsIter = eval( "ONOS" + str( i ) + "Flows" )
- main.log.warn( "ONOS" + str( i ) + " flows repsponse: " +
- flowsIter )
- elif len( ONOS1FlowsJson ) == len( ONOS2FlowsJson )\
- and len( ONOS1FlowsJson ) == len( ONOS3FlowsJson )\
- and len( ONOS1FlowsJson ) == len( ONOS4FlowsJson )\
- and len( ONOS1FlowsJson ) == len( ONOS5FlowsJson )\
- and len( ONOS1FlowsJson ) == len( ONOS6FlowsJson )\
- and len( ONOS1FlowsJson ) == len( ONOS7FlowsJson ):
- # TODO: Do a better check, maybe compare flows on switches?
- flowState = ONOS1Flows
- flowCheck = main.TRUE
- main.log.report( "Flow count is consistent across all ONOS nodes" )
- else:
- for i in range( 1, numControllers + 1 ):
- flowsJson = eval( "ONOS" + str( i ) + "FlowsJson" )
- main.log.warn( "ONOS" + str( i ) + " flows repsponse: " +
- json.dumps( flowsJson,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=flowCheck,
- onpass="The flow count is consistent across all ONOS nodes",
- onfail="ONOS nodes have different flow counts" )
-
- main.step( "Get the OF Table entries" )
- global flows
- flows = []
- for i in range( 1, 29 ):
- flows.append( main.Mininet2.getFlowTable( 1.3, "s" + str( i ) ) )
-
- # TODO: Compare switch flow tables with ONOS flow tables
-
- main.step( "Start continuous pings" )
- for i in range( 1, 11 ):
- source = main.params[ 'PING' ][ 'source' + str( i ) ]
- target = main.params[ 'PING' ][ 'target' + str( i ) ]
- main.Mininet2.pingLong(
- src=source,
- target=target,
- pingTime=500 )
- main.step( "Create TestONTopology object" )
- ctrls = []
- count = 1
- while True:
- temp = ()
- if ( 'ip' + str( count ) ) in main.params[ 'CTRL' ]:
- temp = temp + ( getattr( main, ( 'ONOS' + str( count ) ) ), )
- temp = temp + ( "ONOS" + str( count ), )
- temp = temp + ( main.params[ 'CTRL' ][ 'ip' + str( count ) ], )
- temp = temp + \
- ( eval( main.params[ 'CTRL' ][ 'port' + str( count ) ] ), )
- ctrls.append( temp )
- count = count + 1
- else:
- break
- MNTopo = TestONTopology(
- main.Mininet1,
- ctrls ) # can also add Intent API info for intent operations
-
- main.step( "Collecting topology information from ONOS" )
- # TODO Refactor to a loop? We want all similar calls together?
- # So get all "devices" as close together as possible
- devices = []
- print "ONOS1"
- devices.append( main.ONOScli1.devices() )
- print "ONOS2"
- devices.append( main.ONOScli2.devices() )
- print "ONOS3"
- devices.append( main.ONOScli3.devices() )
- print "ONOS4"
- devices.append( main.ONOScli4.devices() )
- print "ONOS5"
- devices.append( main.ONOScli5.devices() )
- print "ONOS6"
- devices.append( main.ONOScli6.devices() )
- print "ONOS7"
- devices.append( main.ONOScli7.devices() )
- hosts = []
- hosts.append( main.ONOScli1.hosts() )
- hosts.append( main.ONOScli2.hosts() )
- hosts.append( main.ONOScli3.hosts() )
- hosts.append( main.ONOScli4.hosts() )
- hosts.append( main.ONOScli5.hosts() )
- hosts.append( main.ONOScli6.hosts() )
- hosts.append( main.ONOScli7.hosts() )
- ports = []
- ports.append( main.ONOScli1.ports() )
- ports.append( main.ONOScli2.ports() )
- ports.append( main.ONOScli3.ports() )
- ports.append( main.ONOScli4.ports() )
- ports.append( main.ONOScli5.ports() )
- ports.append( main.ONOScli6.ports() )
- ports.append( main.ONOScli7.ports() )
- links = []
- links.append( main.ONOScli1.links() )
- links.append( main.ONOScli2.links() )
- links.append( main.ONOScli3.links() )
- links.append( main.ONOScli4.links() )
- links.append( main.ONOScli5.links() )
- links.append( main.ONOScli6.links() )
- links.append( main.ONOScli7.links() )
- clusters = []
- clusters.append( main.ONOScli1.clusters() )
- clusters.append( main.ONOScli2.clusters() )
- clusters.append( main.ONOScli3.clusters() )
- clusters.append( main.ONOScli4.clusters() )
- clusters.append( main.ONOScli5.clusters() )
- clusters.append( main.ONOScli6.clusters() )
- clusters.append( main.ONOScli7.clusters() )
- # Compare json objects for hosts and dataplane clusters
-
- # hosts
- consistentHostsResult = main.TRUE
- for controller in range( len( hosts ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in hosts[ controller ]:
- if hosts[ controller ] == hosts[ 0 ]:
- continue
- else: # hosts not consistent
- main.log.report( "hosts from ONOS" +
- controllerStr +
- " is inconsistent with ONOS1" )
- main.log.warn( repr( hosts[ controller ] ) )
- consistentHostsResult = main.FALSE
-
- else:
- main.log.report( "Error in getting ONOS hosts from ONOS" +
- controllerStr )
- consistentHostsResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " hosts response: " +
- repr( hosts[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentHostsResult,
- onpass="Hosts view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of hosts" )
-
- # Strongly connected clusters of devices
- consistentClustersResult = main.TRUE
- for controller in range( len( clusters ) ):
- if "Error" not in clusters[ controller ]:
- if clusters[ controller ] == clusters[ 0 ]:
- continue
- else: # clusters not consistent
- main.log.report( "clusters from ONOS" +
- controllerStr +
- " is inconsistent with ONOS1" )
- consistentClustersResult = main.FALSE
-
- else:
- main.log.report( "Error in getting dataplane clusters " +
- "from ONOS" + controllerStr )
- consistentClustersResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " clusters response: " +
- repr( clusters[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentClustersResult,
- onpass="Clusters view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of clusters" )
- # there should always only be one cluster
- numClusters = len( json.loads( clusters[ 0 ] ) )
- utilities.assert_equals(
- expect=1,
- actual=numClusters,
- onpass="ONOS shows 1 SCC",
- onfail="ONOS shows " +
- str( numClusters ) +
- " SCCs" )
-
- main.step( "Comparing ONOS topology to MN" )
- devicesResults = main.TRUE
- portsResults = main.TRUE
- linksResults = main.TRUE
- for controller in range( numControllers ):
- controllerStr = str( controller + 1 )
- if devices[ controller ] or "Error" not in devices[ controller ]:
- currentDevicesResult = main.Mininet1.compareSwitches(
- MNTopo,
- json.loads(
- devices[ controller ] ) )
- else:
- currentDevicesResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentDevicesResult,
- onpass="ONOS" + controllerStr +
- " Switches view is correct",
- onfail="ONOS" + controllerStr +
- " Switches view is incorrect" )
-
- if ports[ controller ] or "Error" not in ports[ controller ]:
- currentPortsResult = main.Mininet1.comparePorts(
- MNTopo,
- json.loads(
- ports[ controller ] ) )
- else:
- currentPortsResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentPortsResult,
- onpass="ONOS" + controllerStr +
- " ports view is correct",
- onfail="ONOS" + controllerStr +
- " ports view is incorrect" )
-
- if links[ controller ] or "Error" not in links[ controller ]:
- currentLinksResult = main.Mininet1.compareLinks(
- MNTopo,
- json.loads(
- links[ controller ] ) )
- else:
- currentLinksResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentLinksResult,
- onpass="ONOS" + controllerStr +
- " links view is correct",
- onfail="ONOS" + controllerStr +
- " links view is incorrect" )
-
- devicesResults = devicesResults and currentDevicesResult
- portsResults = portsResults and currentPortsResult
- linksResults = linksResults and currentLinksResult
-
- topoResult = devicesResults and portsResults and linksResults\
- and consistentHostsResult and consistentClustersResult
- utilities.assert_equals( expect=main.TRUE, actual=topoResult,
- onpass="Topology Check Test successful",
- onfail="Topology Check Test NOT successful" )
-
- finalAssert = main.TRUE
- finalAssert = finalAssert and topoResult and flowCheck \
- and intentCheck and consistentMastership and rolesNotNull
- utilities.assert_equals( expect=main.TRUE, actual=finalAssert,
- onpass="State check successful",
- onfail="State check NOT successful" )
-
- def CASE6( self, main ):
- """
- The Failure case. We will create IPTables rules here.
- """
- import time
- main.log.report( "Wait 30 seconds instead of inducing a failure" )
- time.sleep( 30 )
-
- # 1 blocks 4,5,6,7, mn
- # 2 blocks 4,5,6,7, mn
- # 3 blocks 4,5,6,7, mn
- # 4 block 1,2,3
- # 5 blocks 1,2,3
- # 6 blocks 1,2,3
- # 7 blocks 1,2,3
-
- # TODO: use new log command
- logcmd = "log:log \" About to partition the ONOS nodes\""
- main.ONOScli1.handle.sendline( logcmd )
- main.ONOScli1.handle.expect( "onos>" )
- print main.ONOScli1.handle.before
- main.ONOScli2.handle.sendline( logcmd )
- main.ONOScli2.handle.expect( "onos>" )
- print main.ONOScli2.handle.before
- main.ONOScli3.handle.sendline( logcmd )
- main.ONOScli3.handle.expect( "onos>" )
- print main.ONOScli3.handle.before
- main.ONOScli4.handle.sendline( logcmd )
- main.ONOScli4.handle.expect( "onos>" )
- print main.ONOScli4.handle.before
- main.ONOScli5.handle.sendline( logcmd )
- main.ONOScli5.handle.expect( "onos>" )
- print main.ONOScli5.handle.before
- main.ONOScli6.handle.sendline( logcmd )
- main.ONOScli6.handle.expect( "onos>" )
- print main.ONOScli6.handle.before
- main.ONOScli7.handle.sendline( logcmd )
- main.ONOScli7.handle.expect( "onos>" )
- print main.ONOScli7.handle.before
-
- nodes = []
- #create list of ONOS components
- for controller in range( 1, numControllers + 1 ):
- # loop through ONOS handlers
- node = getattr( main, ( 'ONOS' + str( controller ) ) )
- nodes.append( node )
- for node in nodes:
- # if node is in first half (rounded down )
- # ( 0 through 2 ) < ( 3.5 - 1)
- if nodes.index( node ) < ( numControllers / 2.0 - 1 ):
- # blocked nodes are the last half ( rounded up )
- # // is forced integer division
- for blockNode in nodes[ (numControllers // 2 + 1) * -1: ]:
- # block all traffic between these ONOS nodes
- # NOTE: ONOS 1 and 2 don't support state tracking
- node.setIpTables( blockNode.ip_address, states=False )
- node.setIpTables( blockNode.ip_address,
- direction="OUTPUT" , states=False )
- # block traffic between smaller subcluster and Mininet
- # TODO make OF controller port confgigurable
- # FIXME Remove this once ONOS can deal with the conflicting
- # device mastership
- node.setIpTables( main.Mininet1.ip_address, 6633,
- packet_type="tcp", states=False )
- else: # the larger subcluster
- # blocked nodes are the first half
- for blockNode in nodes[ :(numControllers // 2 ) ]:
- # block all traffic between these ONOS nodes
- node.setIpTables( blockNode.ip_address )
- node.setIpTables( blockNode.ip_address,
- direction="OUTPUT" )
- #FIXME update this
- utilities.assert_equals(
- expect=main.TRUE,
- actual=main.TRUE,
- onpass="Sleeping 30 seconds",
- onfail="Something is terribly wrong with my math" )
- main.ONOScli1.handle.sendline( "devices -j" )
- main.ONOScli1.handle.expect( ["onos>", "\$"] )
- print main.ONOScli1.handle.before
- main.ONOScli2.handle.sendline( "devices -j" )
- main.ONOScli2.handle.expect( ["onos>", "\$"] )
- print main.ONOScli2.handle.before
- main.ONOScli3.handle.sendline( "devices -j" )
- main.ONOScli3.handle.expect( ["onos>", "\$"] )
- print main.ONOScli3.handle.before
- main.ONOScli4.handle.sendline( "devices -j" )
- main.ONOScli4.handle.expect( ["onos>", "\$"] )
- print main.ONOScli4.handle.before
- main.ONOScli5.handle.sendline( "devices -j" )
- main.ONOScli5.handle.expect( ["onos>", "\$"] )
- print main.ONOScli5.handle.before
- main.ONOScli6.handle.sendline( "devices -j" )
- main.ONOScli6.handle.expect( ["onos>", "\$"] )
- print main.ONOScli6.handle.before
- main.ONOScli7.handle.sendline( "devices -j" )
- main.ONOScli7.handle.expect( ["onos>", "\$"] )
- print main.ONOScli7.handle.before
- time.sleep(100000)
-
-
- def CASE7( self, main ):
- """
- Check state after ONOS failure
- """
- import json
- main.case( "Running ONOS Constant State Tests" )
-
- # Assert that each device has a master
- ONOS1MasterNotNull = main.ONOScli1.rolesNotNull()
- ONOS2MasterNotNull = main.ONOScli2.rolesNotNull()
- ONOS3MasterNotNull = main.ONOScli3.rolesNotNull()
- ONOS4MasterNotNull = main.ONOScli4.rolesNotNull()
- ONOS5MasterNotNull = main.ONOScli5.rolesNotNull()
- ONOS6MasterNotNull = main.ONOScli6.rolesNotNull()
- ONOS7MasterNotNull = main.ONOScli7.rolesNotNull()
- rolesNotNull = ONOS1MasterNotNull and ONOS2MasterNotNull and\
- ONOS3MasterNotNull and ONOS4MasterNotNull and\
- ONOS5MasterNotNull and ONOS6MasterNotNull and\
- ONOS7MasterNotNull
- utilities.assert_equals(
- expect=main.TRUE,
- actual=rolesNotNull,
- onpass="Each device has a master",
- onfail="Some devices don't have a master assigned" )
-
- main.step( "Check if switch roles are consistent across all nodes" )
- ONOS1Mastership = main.ONOScli1.roles()
- ONOS2Mastership = main.ONOScli2.roles()
- ONOS3Mastership = main.ONOScli3.roles()
- ONOS4Mastership = main.ONOScli4.roles()
- ONOS5Mastership = main.ONOScli5.roles()
- ONOS6Mastership = main.ONOScli6.roles()
- ONOS7Mastership = main.ONOScli7.roles()
- if "Error" in ONOS1Mastership or not ONOS1Mastership\
- or "Error" in ONOS2Mastership or not ONOS2Mastership\
- or "Error" in ONOS3Mastership or not ONOS3Mastership\
- or "Error" in ONOS4Mastership or not ONOS4Mastership\
- or "Error" in ONOS5Mastership or not ONOS5Mastership\
- or "Error" in ONOS6Mastership or not ONOS6Mastership\
- or "Error" in ONOS7Mastership or not ONOS7Mastership:
- main.log.error( "Error in getting ONOS mastership" )
- main.log.warn( "ONOS1 mastership response: " +
- repr( ONOS1Mastership ) )
- main.log.warn( "ONOS2 mastership response: " +
- repr( ONOS2Mastership ) )
- main.log.warn( "ONOS3 mastership response: " +
- repr( ONOS3Mastership ) )
- main.log.warn( "ONOS4 mastership response: " +
- repr( ONOS4Mastership ) )
- main.log.warn( "ONOS5 mastership response: " +
- repr( ONOS5Mastership ) )
- main.log.warn( "ONOS6 mastership response: " +
- repr( ONOS6Mastership ) )
- main.log.warn( "ONOS7 mastership response: " +
- repr( ONOS7Mastership ) )
- consistentMastership = main.FALSE
- elif ONOS1Mastership == ONOS2Mastership\
- and ONOS1Mastership == ONOS3Mastership\
- and ONOS1Mastership == ONOS4Mastership\
- and ONOS1Mastership == ONOS5Mastership\
- and ONOS1Mastership == ONOS6Mastership\
- and ONOS1Mastership == ONOS7Mastership:
- consistentMastership = main.TRUE
- main.log.report(
- "Switch roles are consistent across all ONOS nodes" )
- else:
- for i in range( 1, numControllers + 1 ):
- mastership = eval( "ONOS" + str( i ) + "Mastership" )
- main.log.warn( "ONOS" + str( i ) + " roles: " +
- json.dumps( json.loads( mastership ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- consistentMastership = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentMastership,
- onpass="Switch roles are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of switch roles" )
-
- description2 = "Compare switch roles from before failure"
- main.step( description2 )
-
- currentJson = json.loads( ONOS1Mastership )
- oldJson = json.loads( mastershipState )
- mastershipCheck = main.TRUE
- for i in range( 1, 29 ):
- switchDPID = str(
- main.Mininet1.getSwitchDPID( switch="s" + str( i ) ) )
-
- current = [ switch[ 'master' ] for switch in currentJson
- if switchDPID in switch[ 'id' ] ]
- old = [ switch[ 'master' ] for switch in oldJson
- if switchDPID in switch[ 'id' ] ]
- if current == old:
- mastershipCheck = mastershipCheck and main.TRUE
- else:
- main.log.warn( "Mastership of switch %s changed" % switchDPID )
- mastershipCheck = main.FALSE
- if mastershipCheck == main.TRUE:
- main.log.report( "Mastership of Switches was not changed" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=mastershipCheck,
- onpass="Mastership of Switches was not changed",
- onfail="Mastership of some switches changed" )
- mastershipCheck = mastershipCheck and consistentMastership
-
- main.step( "Get the intents and compare across all nodes" )
- ONOS1Intents = main.ONOScli1.intents( jsonFormat=True )
- ONOS2Intents = main.ONOScli2.intents( jsonFormat=True )
- ONOS3Intents = main.ONOScli3.intents( jsonFormat=True )
- ONOS4Intents = main.ONOScli4.intents( jsonFormat=True )
- ONOS5Intents = main.ONOScli5.intents( jsonFormat=True )
- ONOS6Intents = main.ONOScli6.intents( jsonFormat=True )
- ONOS7Intents = main.ONOScli7.intents( jsonFormat=True )
- intentCheck = main.FALSE
- if "Error" in ONOS1Intents or not ONOS1Intents\
- or "Error" in ONOS2Intents or not ONOS2Intents\
- or "Error" in ONOS3Intents or not ONOS3Intents\
- or "Error" in ONOS4Intents or not ONOS4Intents\
- or "Error" in ONOS5Intents or not ONOS5Intents\
- or "Error" in ONOS6Intents or not ONOS6Intents\
- or "Error" in ONOS7Intents or not ONOS7Intents:
- main.log.report( "Error in getting ONOS intents" )
- main.log.warn( "ONOS1 intents response: " + repr( ONOS1Intents ) )
- main.log.warn( "ONOS2 intents response: " + repr( ONOS2Intents ) )
- main.log.warn( "ONOS3 intents response: " + repr( ONOS3Intents ) )
- main.log.warn( "ONOS4 intents response: " + repr( ONOS4Intents ) )
- main.log.warn( "ONOS5 intents response: " + repr( ONOS5Intents ) )
- main.log.warn( "ONOS6 intents response: " + repr( ONOS6Intents ) )
- main.log.warn( "ONOS7 intents response: " + repr( ONOS7Intents ) )
- elif ONOS1Intents == ONOS2Intents\
- and ONOS1Intents == ONOS3Intents\
- and ONOS1Intents == ONOS4Intents\
- and ONOS1Intents == ONOS5Intents\
- and ONOS1Intents == ONOS6Intents\
- and ONOS1Intents == ONOS7Intents:
- intentCheck = main.TRUE
- main.log.report( "Intents are consistent across all ONOS nodes" )
- else:
- for i in range( 1, numControllers + 1 ):
- intents = eval( "ONOS" + str( i ) + "Intents" )
- main.log.warn( "ONOS" + str( i ) + " intents: " +
- json.dumps( json.loads( ONOS1Intents ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=intentCheck,
- onpass="Intents are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of intents" )
- # Print the intent states
- intents = []
- intents.append( ONOS1Intents )
- intents.append( ONOS2Intents )
- intents.append( ONOS3Intents )
- intents.append( ONOS4Intents )
- intents.append( ONOS5Intents )
- intents.append( ONOS6Intents )
- intents.append( ONOS7Intents )
- intentStates = []
- for node in intents: # Iter through ONOS nodes
- nodeStates = []
- for intent in json.loads( node ): # Iter through intents of a node
- nodeStates.append( intent[ 'state' ] )
- intentStates.append( nodeStates )
- out = [ (i, nodeStates.count( i ) ) for i in set( nodeStates ) ]
- main.log.info( dict( out ) )
- # NOTE: Hazelcast has no durability, so intents are lost across system
- # restarts
- main.step( "Compare current intents with intents before the failure" )
- # NOTE: this requires case 5 to pass for intentState to be set.
- # maybe we should stop the test if that fails?
- sameIntents = main.TRUE
- if intentState and intentState == ONOS1Intents:
- sameIntents = main.TRUE
- main.log.report( "Intents are consistent with before failure" )
- # TODO: possibly the states have changed? we may need to figure out
- # what the aceptable states are
- else:
- try:
- main.log.warn( "ONOS1 intents: " )
- print json.dumps( json.loads( ONOS1Intents ),
- sort_keys=True, indent=4,
- separators=( ',', ': ' ) )
- except:
- pass
- sameIntents = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=sameIntents,
- onpass="Intents are consistent with before failure",
- onfail="The Intents changed during failure" )
- intentCheck = intentCheck and sameIntents
-
- main.step( "Get the OF Table entries and compare to before " +
- "component failure" )
- FlowTables = main.TRUE
- flows2 = []
- for i in range( 28 ):
- main.log.info( "Checking flow table on s" + str( i + 1 ) )
- tmpFlows = main.Mininet2.getFlowTable( 1.3, "s" + str( i + 1 ) )
- flows2.append( tmpFlows )
- tempResult = main.Mininet2.flowComp(
- flow1=flows[ i ],
- flow2=tmpFlows )
- FlowTables = FlowTables and tempResult
- if FlowTables == main.FALSE:
- main.log.info( "Differences in flow table for switch: s" +
- str( i + 1 ) )
- if FlowTables == main.TRUE:
- main.log.report( "No changes were found in the flow tables" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=FlowTables,
- onpass="No changes were found in the flow tables",
- onfail="Changes were found in the flow tables" )
-
- main.step( "Check the continuous pings to ensure that no packets " +
- "were dropped during component failure" )
- # FIXME: This check is always failing. Investigate cause
- # NOTE: this may be something to do with file permsissions
- # or slight change in format
- main.Mininet2.pingKill(
- main.params[ 'TESTONUSER' ],
- main.params[ 'TESTONIP' ] )
- LossInPings = main.FALSE
- # NOTE: checkForLoss returns main.FALSE with 0% packet loss
- for i in range( 8, 18 ):
- main.log.info(
- "Checking for a loss in pings along flow from s" +
- str( i ) )
- LossInPings = main.Mininet2.checkForLoss(
- "/tmp/ping.h" +
- str( i ) ) or LossInPings
- if LossInPings == main.TRUE:
- main.log.info( "Loss in ping detected" )
- elif LossInPings == main.ERROR:
- main.log.info( "There are multiple mininet process running" )
- elif LossInPings == main.FALSE:
- main.log.info( "No Loss in the pings" )
- main.log.report( "No loss of dataplane connectivity" )
- utilities.assert_equals(
- expect=main.FALSE,
- actual=LossInPings,
- onpass="No Loss of connectivity",
- onfail="Loss of dataplane connectivity detected" )
-
- # Test of LeadershipElection
- # FIXME Update this for network partition case
- # NOTE: this only works for the sanity test. In case of failures,
- # leader will likely change
- leader = ONOS1Ip
- leaderResult = main.TRUE
- for controller in range( 1, numControllers + 1 ):
- # loop through ONOScli handlers
- node = getattr( main, ( 'ONOScli' + str( controller ) ) )
- leaderN = node.electionTestLeader()
- # verify leader is ONOS1
- if leaderN == leader:
- # all is well
- # NOTE: In failure scenario, this could be a new node, maybe
- # check != ONOS1
- pass
- elif leaderN == main.FALSE:
- # error in response
- main.log.report( "Something is wrong with " +
- "electionTestLeader function," +
- " check the error logs" )
- leaderResult = main.FALSE
- elif leader != leaderN:
- leaderResult = main.FALSE
- main.log.report( "ONOS" + str( controller ) + " sees " +
- str( leaderN ) +
- " as the leader of the election app. " +
- "Leader should be " + str( leader ) )
- if leaderResult:
- main.log.report( "Leadership election tests passed( consistent " +
- "view of leader across listeners and a new " +
- "leader was re-elected if applicable )" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Leadership election passed",
- onfail="Something went wrong with Leadership election" )
-
- result = mastershipCheck and intentCheck and FlowTables and\
- ( not LossInPings ) and rolesNotNull and leaderResult
- result = int( result )
- if result == main.TRUE:
- main.log.report( "Constant State Tests Passed" )
- utilities.assert_equals( expect=main.TRUE, actual=result,
- onpass="Constant State Tests Passed",
- onfail="Constant state tests failed" )
-
- def CASE8( self, main ):
- """
- Compare topo
- """
- import sys
- # FIXME add this path to params
- sys.path.append( "/home/admin/sts" )
- # assumes that sts is already in you PYTHONPATH
- from sts.topology.teston_topology import TestONTopology
- import json
- import time
-
- description = "Compare ONOS Topology view to Mininet topology"
- main.case( description )
- main.log.report( description )
- main.step( "Create TestONTopology object" )
- ctrls = []
- count = 1
- while True:
- temp = ()
- if ( 'ip' + str( count ) ) in main.params[ 'CTRL' ]:
- temp = temp + ( getattr( main, ( 'ONOS' + str( count ) ) ), )
- temp = temp + ( "ONOS" + str( count ), )
- temp = temp + ( main.params[ 'CTRL' ][ 'ip' + str( count ) ], )
- temp = temp + \
- ( eval( main.params[ 'CTRL' ][ 'port' + str( count ) ] ), )
- ctrls.append( temp )
- count = count + 1
- else:
- break
- MNTopo = TestONTopology(
- main.Mininet1,
- ctrls ) # can also add Intent API info for intent operations
-
- main.step( "Comparing ONOS topology to MN" )
- devicesResults = main.TRUE
- portsResults = main.TRUE
- linksResults = main.TRUE
- topoResult = main.FALSE
- elapsed = 0
- count = 0
- main.step( "Collecting topology information from ONOS" )
- startTime = time.time()
- # Give time for Gossip to work
- while topoResult == main.FALSE and elapsed < 60:
- count = count + 1
- if count > 1:
- # TODO: Depricate STS usage
- MNTopo = TestONTopology(
- main.Mininet1,
- ctrls )
- cliStart = time.time()
- devices = []
- devices.append( main.ONOScli1.devices() )
- devices.append( main.ONOScli2.devices() )
- devices.append( main.ONOScli3.devices() )
- devices.append( main.ONOScli4.devices() )
- devices.append( main.ONOScli5.devices() )
- devices.append( main.ONOScli6.devices() )
- devices.append( main.ONOScli7.devices() )
- hosts = []
- hosts.append( json.loads( main.ONOScli1.hosts() ) )
- hosts.append( json.loads( main.ONOScli2.hosts() ) )
- hosts.append( json.loads( main.ONOScli3.hosts() ) )
- hosts.append( json.loads( main.ONOScli4.hosts() ) )
- hosts.append( json.loads( main.ONOScli5.hosts() ) )
- hosts.append( json.loads( main.ONOScli6.hosts() ) )
- hosts.append( json.loads( main.ONOScli7.hosts() ) )
- for controller in range( 0, len( hosts ) ):
- controllerStr = str( controller + 1 )
- for host in hosts[ controller ]:
- if host[ 'ipAddresses' ] == []:
- main.log.error(
- "DEBUG:Error with host ips on controller" +
- controllerStr + ": " + str( host ) )
- ports = []
- ports.append( main.ONOScli1.ports() )
- ports.append( main.ONOScli2.ports() )
- ports.append( main.ONOScli3.ports() )
- ports.append( main.ONOScli4.ports() )
- ports.append( main.ONOScli5.ports() )
- ports.append( main.ONOScli6.ports() )
- ports.append( main.ONOScli7.ports() )
- links = []
- links.append( main.ONOScli1.links() )
- links.append( main.ONOScli2.links() )
- links.append( main.ONOScli3.links() )
- links.append( main.ONOScli4.links() )
- links.append( main.ONOScli5.links() )
- links.append( main.ONOScli6.links() )
- links.append( main.ONOScli7.links() )
- clusters = []
- clusters.append( main.ONOScli1.clusters() )
- clusters.append( main.ONOScli2.clusters() )
- clusters.append( main.ONOScli3.clusters() )
- clusters.append( main.ONOScli4.clusters() )
- clusters.append( main.ONOScli5.clusters() )
- clusters.append( main.ONOScli6.clusters() )
- clusters.append( main.ONOScli7.clusters() )
-
- elapsed = time.time() - startTime
- cliTime = time.time() - cliStart
- print "CLI time: " + str( cliTime )
-
- for controller in range( numControllers ):
- controllerStr = str( controller + 1 )
- if devices[ controller ] or "Error" not in devices[
- controller ]:
- currentDevicesResult = main.Mininet1.compareSwitches(
- MNTopo,
- json.loads(
- devices[ controller ] ) )
- else:
- currentDevicesResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentDevicesResult,
- onpass="ONOS" + controllerStr +
- " Switches view is correct",
- onfail="ONOS" + controllerStr +
- " Switches view is incorrect" )
-
- if ports[ controller ] or "Error" not in ports[ controller ]:
- currentPortsResult = main.Mininet1.comparePorts(
- MNTopo,
- json.loads(
- ports[ controller ] ) )
- else:
- currentPortsResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentPortsResult,
- onpass="ONOS" + controllerStr +
- " ports view is correct",
- onfail="ONOS" + controllerStr +
- " ports view is incorrect" )
-
- if links[ controller ] or "Error" not in links[ controller ]:
- currentLinksResult = main.Mininet1.compareLinks(
- MNTopo,
- json.loads(
- links[ controller ] ) )
- else:
- currentLinksResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentLinksResult,
- onpass="ONOS" + controllerStr +
- " links view is correct",
- onfail="ONOS" + controllerStr +
- " links view is incorrect" )
- devicesResults = devicesResults and currentDevicesResult
- portsResults = portsResults and currentPortsResult
- linksResults = linksResults and currentLinksResult
-
- # Compare json objects for hosts and dataplane clusters
-
- # hosts
- consistentHostsResult = main.TRUE
- for controller in range( len( hosts ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in hosts[ controller ]:
- if hosts[ controller ] == hosts[ 0 ]:
- continue
- else: # hosts not consistent
- main.log.report( "hosts from ONOS" + controllerStr +
- " is inconsistent with ONOS1" )
- main.log.warn( repr( hosts[ controller ] ) )
- consistentHostsResult = main.FALSE
-
- else:
- main.log.report( "Error in getting ONOS hosts from ONOS" +
- controllerStr )
- consistentHostsResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " hosts response: " +
- repr( hosts[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentHostsResult,
- onpass="Hosts view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of hosts" )
-
- # Strongly connected clusters of devices
- consistentClustersResult = main.TRUE
- for controller in range( len( clusters ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in clusters[ controller ]:
- if clusters[ controller ] == clusters[ 0 ]:
- continue
- else: # clusters not consistent
- main.log.report( "clusters from ONOS" +
- controllerStr +
- " is inconsistent with ONOS1" )
- consistentClustersResult = main.FALSE
-
- else:
- main.log.report( "Error in getting dataplane clusters " +
- "from ONOS" + controllerStr )
- consistentClustersResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " clusters response: " +
- repr( clusters[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentClustersResult,
- onpass="Clusters view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of clusters" )
- # there should always only be one cluster
- numClusters = len( json.loads( clusters[ 0 ] ) )
- utilities.assert_equals(
- expect=1,
- actual=numClusters,
- onpass="ONOS shows 1 SCC",
- onfail="ONOS shows " +
- str( numClusters ) +
- " SCCs" )
-
- topoResult = ( devicesResults and portsResults and linksResults
- and consistentHostsResult
- and consistentClustersResult )
-
- topoResult = topoResult and int( count <= 2 )
- note = "note it takes about " + str( int( cliTime ) ) + \
- " seconds for the test to make all the cli calls to fetch " +\
- "the topology from each ONOS instance"
- main.log.info(
- "Very crass estimate for topology discovery/convergence( " +
- str( note ) + " ): " + str( elapsed ) + " seconds, " +
- str( count ) + " tries" )
- utilities.assert_equals( expect=main.TRUE, actual=topoResult,
- onpass="Topology Check Test successful",
- onfail="Topology Check Test NOT successful" )
- if topoResult == main.TRUE:
- main.log.report( "ONOS topology view matches Mininet topology" )
-
- def CASE9( self, main ):
- """
- Link s3-s28 down
- """
- import time
- # NOTE: You should probably run a topology check after this
-
- linkSleep = float( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- description = "Turn off a link to ensure that Link Discovery " +\
- "is working properly"
- main.log.report( description )
- main.case( description )
-
- main.step( "Kill Link between s3 and s28" )
- LinkDown = main.Mininet1.link( END1="s3", END2="s28", OPTION="down" )
- main.log.info(
- "Waiting " +
- str( linkSleep ) +
- " seconds for link down to be discovered" )
- time.sleep( linkSleep )
- utilities.assert_equals( expect=main.TRUE, actual=LinkDown,
- onpass="Link down succesful",
- onfail="Failed to bring link down" )
- # TODO do some sort of check here
-
- def CASE10( self, main ):
- """
- Link s3-s28 up
- """
- import time
- # NOTE: You should probably run a topology check after this
-
- linkSleep = float( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- description = "Restore a link to ensure that Link Discovery is " + \
- "working properly"
- main.log.report( description )
- main.case( description )
-
- main.step( "Bring link between s3 and s28 back up" )
- LinkUp = main.Mininet1.link( END1="s3", END2="s28", OPTION="up" )
- main.log.info(
- "Waiting " +
- str( linkSleep ) +
- " seconds for link up to be discovered" )
- time.sleep( linkSleep )
- utilities.assert_equals( expect=main.TRUE, actual=LinkUp,
- onpass="Link up succesful",
- onfail="Failed to bring link up" )
- # TODO do some sort of check here
-
- def CASE11( self, main ):
- """
- Switch Down
- """
- # NOTE: You should probably run a topology check after this
- import time
-
- switchSleep = float( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
-
- description = "Killing a switch to ensure it is discovered correctly"
- main.log.report( description )
- main.case( description )
- switch = main.params[ 'kill' ][ 'switch' ]
- switchDPID = main.params[ 'kill' ][ 'dpid' ]
-
- # TODO: Make this switch parameterizable
- main.step( "Kill " + switch )
- main.log.report( "Deleting " + switch )
- main.Mininet1.delSwitch( switch )
- main.log.info( "Waiting " + str( switchSleep ) +
- " seconds for switch down to be discovered" )
- time.sleep( switchSleep )
- device = main.ONOScli1.getDevice( dpid=switchDPID )
- # Peek at the deleted switch
- main.log.warn( str( device ) )
- result = main.FALSE
- if device and device[ 'available' ] is False:
- result = main.TRUE
- utilities.assert_equals( expect=main.TRUE, actual=result,
- onpass="Kill switch succesful",
- onfail="Failed to kill switch?" )
-
- def CASE12( self, main ):
- """
- Switch Up
- """
- # NOTE: You should probably run a topology check after this
- import time
-
- switchSleep = float( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
- switch = main.params[ 'kill' ][ 'switch' ]
- switchDPID = main.params[ 'kill' ][ 'dpid' ]
- links = main.params[ 'kill' ][ 'links' ].split()
- description = "Adding a switch to ensure it is discovered correctly"
- main.log.report( description )
- main.case( description )
-
- main.step( "Add back " + switch )
- main.log.report( "Adding back " + switch )
- main.Mininet1.addSwitch( switch, dpid=switchDPID )
- for peer in links:
- main.Mininet1.addLink( switch, peer )
- main.Mininet1.assignSwController(
- sw=switch.split( 's' )[ 1 ],
- count=numControllers,
- ip1=ONOS1Ip,
- port1=ONOS1Port,
- ip2=ONOS2Ip,
- port2=ONOS2Port,
- ip3=ONOS3Ip,
- port3=ONOS3Port,
- ip4=ONOS4Ip,
- port4=ONOS4Port,
- ip5=ONOS5Ip,
- port5=ONOS5Port,
- ip6=ONOS6Ip,
- port6=ONOS6Port,
- ip7=ONOS7Ip,
- port7=ONOS7Port )
- main.log.info(
- "Waiting " +
- str( switchSleep ) +
- " seconds for switch up to be discovered" )
- time.sleep( switchSleep )
- device = main.ONOScli1.getDevice( dpid=switchDPID )
- # Peek at the deleted switch
- main.log.warn( str( device ) )
- result = main.FALSE
- if device and device[ 'available' ]:
- result = main.TRUE
- utilities.assert_equals( expect=main.TRUE, actual=result,
- onpass="add switch succesful",
- onfail="Failed to add switch?" )
-
- def CASE13( self, main ):
- """
- Clean up
- """
- import os
- import time
- # TODO: make use of this elsewhere
- ips = []
- ips.append( ONOS1Ip )
- ips.append( ONOS2Ip )
- ips.append( ONOS3Ip )
- ips.append( ONOS4Ip )
- ips.append( ONOS5Ip )
- ips.append( ONOS6Ip )
- ips.append( ONOS7Ip )
-
- # printing colors to terminal
- colors = {}
- colors[ 'cyan' ] = '\033[96m'
- colors[ 'purple' ] = '\033[95m'
- colors[ 'blue' ] = '\033[94m'
- colors[ 'green' ] = '\033[92m'
- colors[ 'yellow' ] = '\033[93m'
- colors[ 'red' ] = '\033[91m'
- colors[ 'end' ] = '\033[0m'
- description = "Test Cleanup"
- main.log.report( description )
- main.case( description )
- main.step( "Killing tcpdumps" )
- main.Mininet2.stopTcpdump()
-
- main.step( "Checking ONOS Logs for errors" )
- for i in range( 7 ):
- print colors[ 'purple' ] + "Checking logs for errors on " + \
- "ONOS" + str( i + 1 ) + ":" + colors[ 'end' ]
- print main.ONOSbench.checkLogs( ips[ i ] )
-
- main.step( "Copying MN pcap and ONOS log files to test station" )
- testname = main.TEST
- teststationUser = main.params[ 'TESTONUSER' ]
- teststationIP = main.params[ 'TESTONIP' ]
- # NOTE: MN Pcap file is being saved to ~/packet_captures
- # scp this file as MN and TestON aren't necessarily the same vm
- # FIXME: scp
- # mn files
- # TODO: Load these from params
- # NOTE: must end in /
- logFolder = "/opt/onos/log/"
- logFiles = [ "karaf.log", "karaf.log.1" ]
- # NOTE: must end in /
- dstDir = "~/packet_captures/"
- for f in logFiles:
- for i in range( 7 ):
- main.ONOSbench.handle.sendline( "scp sdn@" + ips[ i ] + ":" +
- logFolder + f + " " +
- teststationUser + "@" +
- teststationIP + ":" +
- dstDir + str( testname ) +
- "-ONOS" + str( i + 1 ) + "-" +
- f )
- # std*.log's
- # NOTE: must end in /
- logFolder = "/opt/onos/var/"
- logFiles = [ "stderr.log", "stdout.log" ]
- # NOTE: must end in /
- dstDir = "~/packet_captures/"
- for f in logFiles:
- for i in range( 7 ):
- main.ONOSbench.handle.sendline( "scp sdn@" + ips[ i ] + ":" +
- logFolder + f + " " +
- teststationUser + "@" +
- teststationIP + ":" +
- dstDir + str( testname ) +
- "-ONOS" + str( i + 1 ) + "-" +
- f )
- # sleep so scp can finish
- time.sleep( 10 )
- main.step( "Packing and rotating pcap archives" )
- os.system( "~/TestON/dependencies/rotate.sh " + str( testname ) )
-
- # TODO: actually check something here
- utilities.assert_equals( expect=main.TRUE, actual=main.TRUE,
- onpass="Test cleanup successful",
- onfail="Test cleanup NOT successful" )
-
- def CASE14( self, main ):
- """
- start election app on all onos nodes
- """
- leaderResult = main.TRUE
- # install app on onos 1
- main.log.info( "Install leadership election app" )
- main.ONOScli1.featureInstall( "onos-app-election" )
- # wait for election
- # check for leader
- leader = main.ONOScli1.electionTestLeader()
- # verify leader is ONOS1
- if leader == ONOS1Ip:
- # all is well
- pass
- elif leader is None:
- # No leader elected
- main.log.report( "No leader was elected" )
- leaderResult = main.FALSE
- elif leader == main.FALSE:
- # error in response
- # TODO: add check for "Command not found:" in the driver, this
- # means the app isn't loaded
- main.log.report( "Something is wrong with electionTestLeader" +
- " function, check the error logs" )
- leaderResult = main.FALSE
- else:
- # error in response
- main.log.report(
- "Unexpected response from electionTestLeader function:'" +
- str( leader ) +
- "'" )
- leaderResult = main.FALSE
-
- # install on other nodes and check for leader.
- # Should be onos1 and each app should show the same leader
- for controller in range( 2, numControllers + 1 ):
- # loop through ONOScli handlers
- node = getattr( main, ( 'ONOScli' + str( controller ) ) )
- node.featureInstall( "onos-app-election" )
- leaderN = node.electionTestLeader()
- # verify leader is ONOS1
- if leaderN == ONOS1Ip:
- # all is well
- pass
- elif leaderN == main.FALSE:
- # error in response
- # TODO: add check for "Command not found:" in the driver, this
- # means the app isn't loaded
- main.log.report( "Something is wrong with " +
- "electionTestLeader function, check the" +
- " error logs" )
- leaderResult = main.FALSE
- elif leader != leaderN:
- leaderResult = main.FALSE
- main.log.report( "ONOS" + str( controller ) + " sees " +
- str( leaderN ) +
- " as the leader of the election app. Leader" +
- " should be " +
- str( leader ) )
- if leaderResult:
- main.log.report( "Leadership election tests passed( consistent " +
- "view of leader across listeners and a leader " +
- "was elected )" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Leadership election passed",
- onfail="Something went wrong with Leadership election" )
-
- def CASE15( self, main ):
- """
- Check that Leadership Election is still functional
- """
- leaderResult = main.TRUE
- description = "Check that Leadership Election is still functional"
- main.log.report( description )
- main.case( description )
- main.step( "Find current leader and withdraw" )
- leader = main.ONOScli1.electionTestLeader()
- withdrawResult = main.FALSE
- if leader == ONOS1Ip:
- oldLeader = getattr( main, "ONOScli1" )
- elif leader == ONOS2Ip:
- oldLeader = getattr( main, "ONOScli2" )
- elif leader == ONOS3Ip:
- oldLeader = getattr( main, "ONOScli3" )
- elif leader == ONOS4Ip:
- oldLeader = getattr( main, "ONOScli4" )
- elif leader == ONOS5Ip:
- oldLeader = getattr( main, "ONOScli5" )
- elif leader == ONOS6Ip:
- oldLeader = getattr( main, "ONOScli6" )
- elif leader == ONOS7Ip:
- oldLeader = getattr( main, "ONOScli7" )
- elif leader is None or leader == main.FALSE:
- main.log.report(
- "Leader for the election app should be an ONOS node," +
- "instead got '" +
- str( leader ) +
- "'" )
- leaderResult = main.FALSE
- withdrawResult = oldLeader.electionTestWithdraw()
- utilities.assert_equals(
- expect=main.TRUE,
- actual=withdrawResult,
- onpass="App was withdrawn from election",
- onfail="App was not withdrawn from election" )
-
- main.step( "Make sure new leader is elected" )
- leaderList = []
- for controller in range( 1, numControllers + 1 ):
- # loop through ONOScli handlers
- node = getattr( main, ( 'ONOScli' + str( controller ) ) )
- leaderList.append( node.electionTestLeader() )
- for leaderN in leaderList:
- if leaderN == leader:
- main.log.report(
- "ONOS" +
- str( controller ) +
- " still sees " +
- str( leader ) +
- " as leader after they withdrew" )
- leaderResult = main.FALSE
- elif leaderN == main.FALSE:
- # error in response
- # TODO: add check for "Command not found:" in the driver, this
- # means the app isn't loaded
- main.log.report( "Something is wrong with " +
- "electionTestLeader function, " +
- "check the error logs" )
- leaderResult = main.FALSE
- consistentLeader = main.FALSE
- if len( set( leaderList ) ) == 1:
- main.log.info( "Each Election-app sees '" +
- str( leaderList[ 0 ] ) +
- "' as the leader" )
- consistentLeader = main.TRUE
- else:
- main.log.report(
- "Inconsistent responses for leader of Election-app:" )
- for n in range( len( leaderList ) ):
- main.log.report( "ONOS" + str( n + 1 ) + " response: " +
- str( leaderList[ n ] ) )
- if leaderResult:
- main.log.report( "Leadership election tests passed( consistent " +
- "view of leader across listeners and a new " +
- "leader was elected when the old leader " +
- "resigned )" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Leadership election passed",
- onfail="Something went wrong with Leadership election" )
-
- main.step( "Run for election on old leader( just so everyone "
- "is in the hat )" )
- runResult = oldLeader.electionTestRun()
- utilities.assert_equals(
- expect=main.TRUE,
- actual=runResult,
- onpass="App re-ran for election",
- onfail="App failed to run for election" )
- if consistentLeader == main.TRUE:
- afterRun = main.ONOScli1.electionTestLeader()
- # verify leader didn't just change
- if afterRun == leaderList[ 0 ]:
- leaderResult = main.TRUE
- else:
- leaderResult = main.FALSE
- # TODO: assert on run and withdraw results?
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Leadership election passed",
- onfail="Something went wrong with Leadership election after " +
- "the old leader re-ran for election" )
- def CASE16( self ):
- """
- """
- main.ONOScli1.handle.sendline( "sudo iptables -F" )
- main.ONOScli1.handle.expect( "\$" )
- main.ONOScli2.handle.sendline( "sudo iptables -F" )
- main.ONOScli2.handle.expect( "\$" )
- main.ONOScli3.handle.sendline( "sudo iptables -F" )
- main.ONOScli3.handle.expect( "\$" )
- main.ONOScli4.handle.sendline( "sudo iptables -F" )
- main.ONOScli4.handle.expect( "\$" )
- main.ONOScli5.handle.sendline( "sudo iptables -F" )
- main.ONOScli5.handle.expect( "\$" )
- main.ONOScli6.handle.sendline( "sudo iptables -F" )
- main.ONOScli6.handle.expect( "\$" )
- main.ONOScli7.handle.sendline( "sudo iptables -F" )
- main.ONOScli7.handle.expect( "\$" )
-
diff --git a/TestON/tests/HATestNetworkPartition/HATestNetworkPartition.topo b/TestON/tests/HATestNetworkPartition/HATestNetworkPartition.topo
deleted file mode 100644
index 7b32cc2..0000000
--- a/TestON/tests/HATestNetworkPartition/HATestNetworkPartition.topo
+++ /dev/null
@@ -1,170 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOScli1>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli1>
-
- <ONOScli2>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli2>
-
- <ONOScli3>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli3>
-
-
- <ONOScli4>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli4>
-
-
- <ONOScli5>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli5>
-
-
- <ONOScli6>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli6>
-
-
- <ONOScli7>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli7>
-
- <ONOS1>
- <host>10.128.30.11</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.128.30.12</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>10</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.128.30.13</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>11</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
- <ONOS4>
- <host>10.128.30.14</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>12</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4>
-
- <ONOS5>
- <host>10.128.30.15</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>13</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </ONOS5>
-
- <ONOS6>
- <host>10.128.30.16</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>14</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6>
-
- <ONOS7>
- <host>10.128.30.17</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>15</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7>
-
- <Mininet1>
- <host>10.128.30.9</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>16</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> </arg3>
- <controller> none </controller>
- </COMPONENTS>
- </Mininet1>
-
- <Mininet2>
- <host>10.128.30.9</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>17</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </Mininet2>
-
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/HATestNetworkPartition/__init__.py b/TestON/tests/HATestNetworkPartition/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/HATestNetworkPartition/__init__.py
+++ /dev/null
diff --git a/TestON/tests/HATestSanity/HATestSanity.params b/TestON/tests/HATestSanity/HATestSanity.params
deleted file mode 100644
index 1e9d141..0000000
--- a/TestON/tests/HATestSanity/HATestSanity.params
+++ /dev/null
@@ -1,90 +0,0 @@
-<PARAMS>
- #List of test cases:
- #CASE1: Compile ONOS and push it to the test machines
- #CASE2: Assign mastership to controllers
- #CASE3: Assign intents
- #CASE4: Ping across added host intents
- #CASE5: Reading state of ONOS
- #CASE6: The Failure case. Since this is the Sanity test, we do nothing.
- #CASE7: Check state after control plane failure
- #CASE8: Compare topo
- #CASE9: Link s3-s28 down
- #CASE10: Link s3-s28 up
- #CASE11: Switch down
- #CASE12: Switch up
- #CASE13: Clean up
- #CASE14: start election app on all onos nodes
- #CASE15: Check that Leadership Election is still functional
- #CASE16: Install Distributed Primitives app
- #CASE17: Check for basic functionality with distributed primitives
- #1,2,8,3,4,5,14,16,17,[6],8,7,4,15,17,9,8,4,10,8,4,11,8,4,12,8,4,13
- <testcases>1,2,8,21,8,3,4,5,14,16,17,[6],8,7,4,15,17,9,8,4,10,8,4,11,8,4,12,8,4,13</testcases>
- <ENV>
- <cellName>HA</cellName>
- </ENV>
- <Git> True </Git>
- <branch> master </branch>
- <num_controllers> 7 </num_controllers>
- <tcpdump> False </tcpdump>
-
- <CTRL>
- <ip1>10.128.30.11</ip1>
- <port1>6633</port1>
-
- <ip2>10.128.30.12</ip2>
- <port2>6633</port2>
-
- <ip3>10.128.30.13</ip3>
- <port3>6633</port3>
-
- <ip4>10.128.30.14</ip4>
- <port4>6633</port4>
-
- <ip5>10.128.30.15</ip5>
- <port5>6633</port5>
-
- <ip6>10.128.30.16</ip6>
- <port6>6633</port6>
-
- <ip7>10.128.30.17</ip7>
- <port7>6633</port7>
- </CTRL>
- <TESTONUSER>admin</TESTONUSER>
- <TESTONIP>10.128.30.9</TESTONIP>
- <PING>
- <source1>h8</source1>
- <source2>h9</source2>
- <source3>h10</source3>
- <source4>h11</source4>
- <source5>h12</source5>
- <source6>h13</source6>
- <source7>h14</source7>
- <source8>h15</source8>
- <source9>h16</source9>
- <source10>h17</source10>
- <target1>10.0.0.18</target1>
- <target2>10.0.0.19</target2>
- <target3>10.0.0.20</target3>
- <target4>10.0.0.21</target4>
- <target5>10.0.0.22</target5>
- <target6>10.0.0.23</target6>
- <target7>10.0.0.24</target7>
- <target8>10.0.0.25</target8>
- <target9>10.0.0.26</target9>
- <target10>10.0.0.27</target10>
- </PING>
- <timers>
- <LinkDiscovery>.2</LinkDiscovery>
- <SwitchDiscovery>.2</SwitchDiscovery>
- </timers>
- <kill>
- <switch> s5 </switch>
- <dpid> 0000000000005000 </dpid>
- <links> h5 s2 s1 s6 </links>
- </kill>
- <MNtcpdump>
- <intf>eth0</intf>
- <port> </port>
- <folder>~/packet_captures/</folder>
- </MNtcpdump>
-</PARAMS>
diff --git a/TestON/tests/HATestSanity/HATestSanity.py b/TestON/tests/HATestSanity/HATestSanity.py
deleted file mode 100644
index 8d952c7..0000000
--- a/TestON/tests/HATestSanity/HATestSanity.py
+++ /dev/null
@@ -1,3891 +0,0 @@
-"""
-Description: This test is to determine if the HA test setup is
- working correctly. There are no failures so this test should
- have a 100% pass rate
-
-List of test cases:
-CASE1: Compile ONOS and push it to the test machines
-CASE2: Assign devices to controllers
-CASE21: Assign mastership to controllers
-CASE3: Assign intents
-CASE4: Ping across added host intents
-CASE5: Reading state of ONOS
-CASE6: The Failure case. Since this is the Sanity test, we do nothing.
-CASE7: Check state after control plane failure
-CASE8: Compare topo
-CASE9: Link s3-s28 down
-CASE10: Link s3-s28 up
-CASE11: Switch down
-CASE12: Switch up
-CASE13: Clean up
-CASE14: start election app on all onos nodes
-CASE15: Check that Leadership Election is still functional
-CASE16: Install Distributed Primitives app
-CASE17: Check for basic functionality with distributed primitives
-"""
-
-
-class HATestSanity:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- """
- CASE1 is to compile ONOS and push it to the test machines
-
- Startup sequence:
- cell <name>
- onos-verify-cell
- NOTE: temporary - onos-remove-raft-logs
- onos-uninstall
- start mininet
- git pull
- mvn clean install
- onos-package
- onos-install -f
- onos-wait-for-start
- start cli sessions
- start tcpdump
- """
- main.log.info( "ONOS HA Sanity test - initialization" )
- main.case( "Setting up test environment" )
- main.caseExplaination = "Setup the test environment including " +\
- "installing ONOS, starting Mininet and ONOS" +\
- "cli sessions."
- # TODO: save all the timers and output them for plotting
-
- # load some variables from the params file
- PULLCODE = False
- if main.params[ 'Git' ] == 'True':
- PULLCODE = True
- gitBranch = main.params[ 'branch' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
-
- # set global variables
- global ONOS1Port
- global ONOS2Port
- global ONOS3Port
- global ONOS4Port
- global ONOS5Port
- global ONOS6Port
- global ONOS7Port
- global numControllers
- numControllers = int( main.params[ 'num_controllers' ] )
-
- # FIXME: just get controller port from params?
- # TODO: do we really need all these?
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
- ONOS4Port = main.params[ 'CTRL' ][ 'port4' ]
- ONOS5Port = main.params[ 'CTRL' ][ 'port5' ]
- ONOS6Port = main.params[ 'CTRL' ][ 'port6' ]
- ONOS7Port = main.params[ 'CTRL' ][ 'port7' ]
-
- global CLIs
- CLIs = []
- global nodes
- nodes = []
- for i in range( 1, numControllers + 1 ):
- CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
- nodes.append( getattr( main, 'ONOS' + str( i ) ) )
-
- main.step( "Applying cell variable to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- # FIXME:this is short term fix
- main.log.info( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
-
- main.log.info( "Uninstalling ONOS" )
- for node in nodes:
- main.ONOSbench.onosUninstall( node.ip_address )
-
- # Make sure ONOS is DEAD
- main.log.info( "Killing any ONOS processes" )
- killResults = main.TRUE
- for node in nodes:
- killed = main.ONOSbench.onosKill( node.ip_address )
- killResults = killResults and killed
-
- cleanInstallResult = main.TRUE
- gitPullResult = main.TRUE
-
- main.step( "Starting Mininet" )
- mnResult = main.Mininet1.startNet( )
- utilities.assert_equals( expect=main.TRUE, actual=mnResult,
- onpass="Mininet Started",
- onfail="Error starting Mininet" )
-
- main.step( "Git checkout and pull " + gitBranch )
- if PULLCODE:
- main.ONOSbench.gitCheckout( gitBranch )
- gitPullResult = main.ONOSbench.gitPull()
- # values of 1 or 3 are good
- utilities.assert_lesser( expect=0, actual=gitPullResult,
- onpass="Git pull successful",
- onfail="Git pull failed" )
- main.ONOSbench.getVersion( report=True )
-
- main.step( "Using mvn clean install" )
- cleanInstallResult = main.TRUE
- if PULLCODE and gitPullResult == main.TRUE:
- cleanInstallResult = main.ONOSbench.cleanInstall()
- else:
- main.log.warn( "Did not pull new code so skipping mvn " +
- "clean install" )
- utilities.assert_equals( expect=main.TRUE,
- actual=cleanInstallResult,
- onpass="MCI successful",
- onfail="MCI failed" )
- # GRAPHS
- # NOTE: important params here:
- # job = name of Jenkins job
- # Plot Name = Plot-HA, only can be used if multiple plots
- # index = The number of the graph under plot name
- job = "HASanity"
- plotName = "Plot-HA"
- 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' +\
- '&width=500&height=300"' +\
- 'noborder="0" width="500" height="300" scrolling="yes" ' +\
- 'seamless="seamless"></iframe>\n'
- graphs += ']]></ac:plain-text-body>\n'
- graphs += '</ac:structured-macro>\n'
- main.log.wiki(graphs)
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
- utilities.assert_equals( expect=main.TRUE, actual=packageResult,
- onpass="ONOS package successful",
- onfail="ONOS package failed" )
-
- main.step( "Installing ONOS package" )
- onosInstallResult = main.TRUE
- for node in nodes:
- tmpResult = main.ONOSbench.onosInstall( options="-f",
- node=node.ip_address )
- onosInstallResult = onosInstallResult and tmpResult
- utilities.assert_equals( expect=main.TRUE, actual=onosInstallResult,
- onpass="ONOS install successful",
- onfail="ONOS install failed" )
-
- main.step( "Checking if ONOS is up yet" )
- for i in range( 2 ):
- onosIsupResult = main.TRUE
- for node in nodes:
- started = main.ONOSbench.isup( node.ip_address )
- if not started:
- main.log.error( node.name + " didn't start!" )
- main.ONOSbench.onosStop( node.ip_address )
- main.ONOSbench.onosStart( node.ip_address )
- onosIsupResult = onosIsupResult and started
- if onosIsupResult == main.TRUE:
- break
- utilities.assert_equals( expect=main.TRUE, actual=onosIsupResult,
- onpass="ONOS startup successful",
- onfail="ONOS startup failed" )
-
- main.log.step( "Starting ONOS CLI sessions" )
- cliResults = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].startOnosCli,
- name="startOnosCli-" + str( i ),
- args=[nodes[i].ip_address] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- cliResults = cliResults and t.result
- utilities.assert_equals( expect=main.TRUE, actual=cliResults,
- onpass="ONOS cli startup successful",
- onfail="ONOS cli startup failed" )
-
- if main.params[ 'tcpdump' ].lower() == "true":
- main.step( "Start Packet Capture MN" )
- main.Mininet2.startTcpdump(
- str( main.params[ 'MNtcpdump' ][ 'folder' ] ) + str( main.TEST )
- + "-MN.pcap",
- intf=main.params[ 'MNtcpdump' ][ 'intf' ],
- port=main.params[ 'MNtcpdump' ][ 'port' ] )
-
- main.step( "App Ids check" )
- appCheck = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- appCheck = appCheck and t.result
- if appCheck != main.TRUE:
- main.log.warn( CLIs[0].apps() )
- main.log.warn( CLIs[0].appIDs() )
- utilities.assert_equals( expect=main.TRUE, actual=appCheck,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
-
- if cliResults == main.FALSE:
- main.log.error( "Failed to start ONOS, stopping test" )
- main.cleanup()
- main.exit()
-
- def CASE2( self, main ):
- """
- Assign devices to controllers
- """
- import re
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- assert ONOS1Port, "ONOS1Port not defined"
- assert ONOS2Port, "ONOS2Port not defined"
- assert ONOS3Port, "ONOS3Port not defined"
- assert ONOS4Port, "ONOS4Port not defined"
- assert ONOS5Port, "ONOS5Port not defined"
- assert ONOS6Port, "ONOS6Port not defined"
- assert ONOS7Port, "ONOS7Port not defined"
-
- main.case( "Assigning devices to controllers" )
- main.caseExplaination = "Assign switches to ONOS using 'ovs-vsctl' " +\
- "and check that an ONOS node becomes the " +\
- "master of the device."
- main.step( "Assign switches to controllers" )
-
- ipList = []
- for i in range( numControllers ):
- ipList.append( nodes[ i ].ip_address )
- swList = []
- for i in range( 1, 29 ):
- swList.append( "s" + str( i ) )
- main.Mininet1.assignSwController( sw=swList, ip=ipList )
-
- mastershipCheck = main.TRUE
- for i in range( 1, 29 ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
- try:
- main.log.info( str( response ) )
- except Exception:
- main.log.info( repr( response ) )
- for node in nodes:
- if re.search( "tcp:" + node.ip_address, response ):
- mastershipCheck = mastershipCheck and main.TRUE
- else:
- main.log.error( "Error, node " + node.ip_address + " is " +
- "not in the list of controllers s" +
- str( i ) + " is connecting to." )
- mastershipCheck = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=mastershipCheck,
- onpass="Switch mastership assigned correctly",
- onfail="Switches not assigned correctly to controllers" )
-
- def CASE21( self, main ):
- """
- Assign mastership to controllers
- """
- import re
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- assert ONOS1Port, "ONOS1Port not defined"
- assert ONOS2Port, "ONOS2Port not defined"
- assert ONOS3Port, "ONOS3Port not defined"
- assert ONOS4Port, "ONOS4Port not defined"
- assert ONOS5Port, "ONOS5Port not defined"
- assert ONOS6Port, "ONOS6Port not defined"
- assert ONOS7Port, "ONOS7Port not defined"
-
- main.case( "Assigning Controller roles for switches" )
- main.caseExplaination = "Check that ONOS is connected to each " +\
- "device. Then manually assign" +\
- " mastership to specific ONOS nodes using" +\
- " 'device-role'"
- main.step( "Assign mastership of switches to specific controllers" )
- # Manually assign mastership to the controller we want
- roleCall = main.TRUE
-
- ipList = [ ]
- deviceList = []
- try:
- for i in range( 1, 29 ): # switches 1 through 28
- # set up correct variables:
- if i == 1:
- ip = nodes[ 0 ].ip_address # ONOS1
- deviceId = main.ONOScli1.getDevice( "1000" ).get( 'id' )
- elif i == 2:
- ip = nodes[ 1 ].ip_address # ONOS2
- deviceId = main.ONOScli1.getDevice( "2000" ).get( 'id' )
- elif i == 3:
- ip = nodes[ 1 ].ip_address # ONOS2
- deviceId = main.ONOScli1.getDevice( "3000" ).get( 'id' )
- elif i == 4:
- ip = nodes[ 3 ].ip_address # ONOS4
- deviceId = main.ONOScli1.getDevice( "3004" ).get( 'id' )
- elif i == 5:
- ip = nodes[ 2 ].ip_address # ONOS3
- deviceId = main.ONOScli1.getDevice( "5000" ).get( 'id' )
- elif i == 6:
- ip = nodes[ 2 ].ip_address # ONOS3
- deviceId = main.ONOScli1.getDevice( "6000" ).get( 'id' )
- elif i == 7:
- ip = nodes[ 5 ].ip_address # ONOS6
- deviceId = main.ONOScli1.getDevice( "6007" ).get( 'id' )
- elif i >= 8 and i <= 17:
- ip = nodes[ 4 ].ip_address # ONOS5
- dpid = '3' + str( i ).zfill( 3 )
- deviceId = main.ONOScli1.getDevice( dpid ).get( 'id' )
- elif i >= 18 and i <= 27:
- ip = nodes[ 6 ].ip_address # ONOS7
- dpid = '6' + str( i ).zfill( 3 )
- deviceId = main.ONOScli1.getDevice( dpid ).get( 'id' )
- elif i == 28:
- ip = nodes[ 0 ].ip_address # ONOS1
- deviceId = main.ONOScli1.getDevice( "2800" ).get( 'id' )
- else:
- main.log.error( "You didn't write an else statement for " +
- "switch s" + str( i ) )
- roleCall = main.FALSE
- # Assign switch
- assert deviceId, "No device id for s" + str( i ) + " in ONOS"
- # TODO: make this controller dynamic
- roleCall = roleCall and main.ONOScli1.deviceRole( deviceId,
- ip )
- ipList.append( ip )
- deviceList.append( deviceId )
- except ( AttributeError, AssertionError ):
- main.log.exception( "Something is wrong with ONOS device view" )
- main.log.info( main.ONOScli1.devices() )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=roleCall,
- onpass="Re-assigned switch mastership to designated controller",
- onfail="Something wrong with deviceRole calls" )
-
- main.step( "Check mastership was correctly assigned" )
- roleCheck = main.TRUE
- # NOTE: This is due to the fact that device mastership change is not
- # atomic and is actually a multi step process
- time.sleep( 5 )
- for i in range( len( ipList ) ):
- ip = ipList[i]
- deviceId = deviceList[i]
- # Check assignment
- master = main.ONOScli1.getRole( deviceId ).get( 'master' )
- if ip in master:
- roleCheck = roleCheck and main.TRUE
- else:
- roleCheck = roleCheck and main.FALSE
- main.log.error( "Error, controller " + ip + " is not" +
- " master " + "of device " +
- str( deviceId ) + ". Master is " +
- repr( master ) + "." )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=roleCheck,
- onpass="Switches were successfully reassigned to designated " +
- "controller",
- onfail="Switches were not successfully reassigned" )
-
- def CASE3( self, main ):
- """
- Assign intents
- """
- import time
- import json
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- main.case( "Adding host Intents" )
- main.caseExplaination = "Discover hosts by using pingall then " +\
- "assign predetermined host-to-host intents." +\
- " After installation, check that the intent" +\
- " is distributed to all nodes and the state" +\
- " is INSTALLED"
-
- # install onos-app-fwd
- main.step( "Install reactive forwarding app" )
- installResults = CLIs[0].activateApp( "org.onosproject.fwd" )
- utilities.assert_equals( expect=main.TRUE, actual=installResults,
- onpass="Install fwd successful",
- onfail="Install fwd failed" )
-
- main.step( "Check app ids" )
- appCheck = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- appCheck = appCheck and t.result
- if appCheck != main.TRUE:
- main.log.warn( CLIs[0].apps() )
- main.log.warn( CLIs[0].appIDs() )
- utilities.assert_equals( expect=main.TRUE, actual=appCheck,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
-
- main.step( "Discovering Hosts( Via pingall for now )" )
- # FIXME: Once we have a host discovery mechanism, use that instead
- # REACTIVE FWD test
- pingResult = main.FALSE
- for i in range(2): # Retry if pingall fails first time
- time1 = time.time()
- pingResult = main.Mininet1.pingall()
- if i == 0:
- utilities.assert_equals(
- expect=main.TRUE,
- actual=pingResult,
- onpass="Reactive Pingall test passed",
- onfail="Reactive Pingall failed, " +
- "one or more ping pairs failed" )
- time2 = time.time()
- main.log.info( "Time for pingall: %2f seconds" %
- ( time2 - time1 ) )
- # timeout for fwd flows
- time.sleep( 11 )
- # uninstall onos-app-fwd
- main.step( "Uninstall reactive forwarding app" )
- uninstallResult = CLIs[0].deactivateApp( "org.onosproject.fwd" )
- utilities.assert_equals( expect=main.TRUE, actual=uninstallResult,
- onpass="Uninstall fwd successful",
- onfail="Uninstall fwd failed" )
- '''
- main.Mininet1.handle.sendline( "py [ h.cmd( \"arping -c 1 10.1.1.1 \" ) for h in net.hosts ] ")
- import time
- time.sleep(60)
- '''
-
- main.step( "Check app ids" )
- threads = []
- appCheck2 = main.TRUE
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- appCheck2 = appCheck2 and t.result
- if appCheck2 != main.TRUE:
- main.log.warn( CLIs[0].apps() )
- main.log.warn( CLIs[0].appIDs() )
- utilities.assert_equals( expect=main.TRUE, actual=appCheck2,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
-
- main.step( "Add host intents via cli" )
- intentIds = []
- # TODO: move the host numbers to params
- # Maybe look at all the paths we ping?
- intentAddResult = True
- hostResult = main.TRUE
- for i in range( 8, 18 ):
- main.log.info( "Adding host intent between h" + str( i ) +
- " and h" + str( i + 10 ) )
- host1 = "00:00:00:00:00:" + \
- str( hex( i )[ 2: ] ).zfill( 2 ).upper()
- host2 = "00:00:00:00:00:" + \
- str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
- # NOTE: getHost can return None
- host1Dict = main.ONOScli1.getHost( host1 )
- host2Dict = main.ONOScli1.getHost( host2 )
- host1Id = None
- host2Id = None
- if host1Dict and host2Dict:
- host1Id = host1Dict.get( 'id', None )
- host2Id = host2Dict.get( 'id', None )
- if host1Id and host2Id:
- nodeNum = ( i % 7 )
- tmpId = CLIs[ nodeNum ].addHostIntent( host1Id, host2Id )
- if tmpId:
- main.log.info( "Added intent with id: " + tmpId )
- intentIds.append( tmpId )
- else:
- main.log.error( "addHostIntent returned: " +
- repr( tmpId ) )
- else:
- main.log.error( "Error, getHost() failed for h" + str( i ) +
- " and/or h" + str( i + 10 ) )
- hosts = CLIs[ 0 ].hosts()
- main.log.warn( "Hosts output: " )
- try:
- main.log.warn( json.dumps( json.loads( hosts ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( hosts ) )
- hostResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE, actual=hostResult,
- onpass="Found a host id for each host",
- onfail="Error looking up host ids" )
-
- intentStart = time.time()
- onosIds = main.ONOScli1.getAllIntentsId()
- main.log.info( "Submitted intents: " + str( intentIds ) )
- main.log.info( "Intents in ONOS: " + str( onosIds ) )
- for intent in intentIds:
- if intent in onosIds:
- pass # intent submitted is in onos
- else:
- intentAddResult = False
- if intentAddResult:
- intentStop = time.time()
- else:
- intentStop = None
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- installedCheck = True
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- try:
- for intent in json.loads( intents ):
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents" )
- # add submitted intents not in the store
- tmplist = [ i for i, s in intentStates ]
- missingIntents = False
- for i in intentIds:
- if i not in tmplist:
- intentStates.append( ( i, " - " ) )
- missingIntents = True
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- leaders = main.ONOScli1.leaders()
- try:
- missing = False
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- missing = True
- else:
- main.log.error( "leaders() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- # Check all nodes
- if missing:
- for node in CLIs:
- response = node.leaders( jsonFormat=False)
- main.log.warn( str( node.name ) + " leaders output: \n" +
- str( response ) )
-
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
-
- intentAddResult = bool( intentAddResult and not missingIntents and
- installedCheck )
- if not intentAddResult:
- main.log.error( "Error in pushing host intents to ONOS" )
-
- main.step( "Intent Anti-Entropy dispersion" )
- for i in range(100):
- correct = True
- main.log.info( "Submitted intents: " + str( sorted( intentIds ) ) )
- for cli in CLIs:
- onosIds = []
- ids = cli.getAllIntentsId()
- onosIds.append( ids )
- main.log.debug( "Intents in " + cli.name + ": " +
- str( sorted( onosIds ) ) )
- if sorted( ids ) != sorted( intentIds ):
- main.log.warn( "Set of intent IDs doesn't match" )
- correct = False
- break
- else:
- intents = json.loads( cli.intents() )
- for intent in intents:
- if intent[ 'state' ] != "INSTALLED":
- main.log.warn( "Intent " + intent[ 'id' ] +
- " is " + intent[ 'state' ] )
- correct = False
- break
- if correct:
- break
- else:
- time.sleep(1)
- if not intentStop:
- intentStop = time.time()
- global gossipTime
- gossipTime = intentStop - intentStart
- main.log.info( "It took about " + str( gossipTime ) +
- " seconds for all intents to appear in each node" )
- # FIXME: make this time configurable/calculate based off of number of
- # nodes and gossip rounds
- utilities.assert_greater_equals(
- expect=40, actual=gossipTime,
- onpass="ECM anti-entropy for intents worked within " +
- "expected time",
- onfail="Intent ECM anti-entropy took too long" )
- if gossipTime <= 40:
- intentAddResult = True
-
- if not intentAddResult or "key" in pendingMap:
- import time
- installedCheck = True
- main.log.info( "Sleeping 60 seconds to see if intents are found" )
- time.sleep( 60 )
- onosIds = main.ONOScli1.getAllIntentsId()
- main.log.info( "Submitted intents: " + str( intentIds ) )
- main.log.info( "Intents in ONOS: " + str( onosIds ) )
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- try:
- for intent in json.loads( intents ):
- # Iter through intents of a node
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents" )
- # add submitted intents not in the store
- tmplist = [ i for i, s in intentStates ]
- for i in intentIds:
- if i not in tmplist:
- intentStates.append( ( i, " - " ) )
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- leaders = main.ONOScli1.leaders()
- try:
- missing = False
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- # check for election
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- # FIXME: this should only be after we start the app
- topics.append( "org.onosproject.election" )
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- missing = True
- else:
- main.log.error( "leaders() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- # Check all nodes
- if missing:
- for node in CLIs:
- response = node.leaders( jsonFormat=False)
- main.log.warn( str( node.name ) + " leaders output: \n" +
- str( response ) )
-
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
-
- def CASE4( self, main ):
- """
- Ping across added host intents
- """
- import json
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- main.case( "Verify connectivity by sendind traffic across Intents" )
- main.caseExplaination = "Ping across added host intents to check " +\
- "functionality and check the state of " +\
- "the intent"
- main.step( "Ping across added host intents" )
- PingResult = main.TRUE
- for i in range( 8, 18 ):
- ping = main.Mininet1.pingHost( src="h" + str( i ),
- target="h" + str( i + 10 ) )
- PingResult = PingResult and ping
- if ping == main.FALSE:
- main.log.warn( "Ping failed between h" + str( i ) +
- " and h" + str( i + 10 ) )
- elif ping == main.TRUE:
- main.log.info( "Ping test passed!" )
- # Don't set PingResult or you'd override failures
- if PingResult == main.FALSE:
- main.log.error(
- "Intents have not been installed correctly, pings failed." )
- # TODO: pretty print
- main.log.warn( "ONOS1 intents: " )
- try:
- tmpIntents = main.ONOScli1.intents()
- main.log.warn( json.dumps( json.loads( tmpIntents ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( tmpIntents ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=PingResult,
- onpass="Intents have been installed correctly and pings work",
- onfail="Intents have not been installed correctly, pings failed." )
-
- main.step( "Check Intent state" )
- installedCheck = False
- loopCount = 0
- while not installedCheck and loopCount < 40:
- installedCheck = True
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- # Iter through intents of a node
- try:
- for intent in json.loads( intents ):
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents." )
- # Print states
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- if not installedCheck:
- time.sleep( 1 )
- loopCount += 1
- utilities.assert_equals( expect=True, actual=installedCheck,
- onpass="Intents are all INSTALLED",
- onfail="Intents are not all in " +
- "INSTALLED state" )
-
- main.step( "Check leadership of topics" )
- leaders = main.ONOScli1.leaders()
- topicCheck = main.TRUE
- try:
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- # check for election
- # TODO: Look at Devices as topics now that it uses this system
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- # FIXME: this should only be after we start the app
- # FIXME: topics.append( "org.onosproject.election" )
- # Print leaders output
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- topicCheck = main.FALSE
- else:
- main.log.error( "leaders() returned None" )
- topicCheck = main.FALSE
- except ( ValueError, TypeError ):
- topicCheck = main.FALSE
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- # TODO: Check for a leader of these topics
- # Check all nodes
- if topicCheck:
- for node in CLIs:
- response = node.leaders( jsonFormat=False)
- main.log.warn( str( node.name ) + " leaders output: \n" +
- str( response ) )
-
- utilities.assert_equals( expect=main.TRUE, actual=topicCheck,
- onpass="intent Partitions is in leaders",
- onfail="Some topics were lost " )
- # Print partitions
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- # Print Pending Map
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
-
- if not installedCheck:
- main.log.info( "Waiting 60 seconds to see if the state of " +
- "intents change" )
- time.sleep( 60 )
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- # Iter through intents of a node
- try:
- for intent in json.loads( intents ):
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents." )
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- leaders = main.ONOScli1.leaders()
- try:
- missing = False
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- # check for election
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- # FIXME: this should only be after we start the app
- topics.append( "org.onosproject.election" )
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- missing = True
- else:
- main.log.error( "leaders() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- if missing:
- for node in CLIs:
- response = node.leaders( jsonFormat=False)
- main.log.warn( str( node.name ) + " leaders output: \n" +
- str( response ) )
-
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
- # Print flowrules
- main.log.debug( CLIs[0].flows( jsonFormat=False ) )
- main.step( "Wait a minute then ping again" )
- # the wait is above
- PingResult = main.TRUE
- for i in range( 8, 18 ):
- ping = main.Mininet1.pingHost( src="h" + str( i ),
- target="h" + str( i + 10 ) )
- PingResult = PingResult and ping
- if ping == main.FALSE:
- main.log.warn( "Ping failed between h" + str( i ) +
- " and h" + str( i + 10 ) )
- elif ping == main.TRUE:
- main.log.info( "Ping test passed!" )
- # Don't set PingResult or you'd override failures
- if PingResult == main.FALSE:
- main.log.error(
- "Intents have not been installed correctly, pings failed." )
- # TODO: pretty print
- main.log.warn( "ONOS1 intents: " )
- try:
- tmpIntents = main.ONOScli1.intents()
- main.log.warn( json.dumps( json.loads( tmpIntents ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( tmpIntents ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=PingResult,
- onpass="Intents have been installed correctly and pings work",
- onfail="Intents have not been installed correctly, pings failed." )
-
- def CASE5( self, main ):
- """
- Reading state of ONOS
- """
- import json
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- main.case( "Setting up and gathering data for current state" )
- # The general idea for this test case is to pull the state of
- # ( intents,flows, topology,... ) from each ONOS node
- # We can then compare them with each other and also with past states
-
- main.step( "Check that each switch has a master" )
- global mastershipState
- mastershipState = '[]'
-
- # Assert that each device has a master
- rolesNotNull = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].rolesNotNull,
- name="rolesNotNull-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- rolesNotNull = rolesNotNull and t.result
- utilities.assert_equals(
- expect=main.TRUE,
- actual=rolesNotNull,
- onpass="Each device has a master",
- onfail="Some devices don't have a master assigned" )
-
- main.step( "Get the Mastership of each switch from each controller" )
- ONOSMastership = []
- mastershipCheck = main.FALSE
- consistentMastership = True
- rolesResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].roles,
- name="roles-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ONOSMastership.append( t.result )
-
- for i in range( numControllers ):
- if not ONOSMastership[i] or "Error" in ONOSMastership[i]:
- main.log.error( "Error in getting ONOS" + str( i + 1 ) +
- " roles" )
- main.log.warn(
- "ONOS" + str( i + 1 ) + " mastership response: " +
- repr( ONOSMastership[i] ) )
- rolesResults = False
- utilities.assert_equals(
- expect=True,
- actual=rolesResults,
- onpass="No error in reading roles output",
- onfail="Error in reading roles from ONOS" )
-
- main.step( "Check for consistency in roles from each controller" )
- if all([ i == ONOSMastership[ 0 ] for i in ONOSMastership ] ):
- main.log.info(
- "Switch roles are consistent across all ONOS nodes" )
- else:
- consistentMastership = False
- utilities.assert_equals(
- expect=True,
- actual=consistentMastership,
- onpass="Switch roles are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of switch roles" )
-
- if rolesResults and not consistentMastership:
- for i in range( numControllers ):
- try:
- main.log.warn(
- "ONOS" + str( i + 1 ) + " roles: ",
- json.dumps(
- json.loads( ONOSMastership[ i ] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( ONOSMastership[ i ] ) )
- elif rolesResults and consistentMastership:
- mastershipCheck = main.TRUE
- mastershipState = ONOSMastership[ 0 ]
-
- main.step( "Get the intents from each controller" )
- global intentState
- intentState = []
- ONOSIntents = []
- intentCheck = main.FALSE
- consistentIntents = True
- intentsResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].intents,
- name="intents-" + str( i ),
- args=[],
- kwargs={ 'jsonFormat': True } )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ONOSIntents.append( t.result )
-
- for i in range( numControllers ):
- if not ONOSIntents[ i ] or "Error" in ONOSIntents[ i ]:
- main.log.error( "Error in getting ONOS" + str( i + 1 ) +
- " intents" )
- main.log.warn( "ONOS" + str( i + 1 ) + " intents response: " +
- repr( ONOSIntents[ i ] ) )
- intentsResults = False
- utilities.assert_equals(
- expect=True,
- actual=intentsResults,
- onpass="No error in reading intents output",
- onfail="Error in reading intents from ONOS" )
-
- main.step( "Check for consistency in Intents from each controller" )
- if all([ sorted( i ) == sorted( ONOSIntents[ 0 ] ) for i in ONOSIntents ] ):
- main.log.info( "Intents are consistent across all ONOS " +
- "nodes" )
- else:
- consistentIntents = False
- main.log.error( "Intents not consistent" )
- utilities.assert_equals(
- expect=True,
- actual=consistentIntents,
- onpass="Intents are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of intents" )
-
- if intentsResults:
- # Try to make it easy to figure out what is happening
- #
- # Intent ONOS1 ONOS2 ...
- # 0x01 INSTALLED INSTALLING
- # ... ... ...
- # ... ... ...
- title = " Id"
- for n in range( numControllers ):
- title += " " * 10 + "ONOS" + str( n + 1 )
- main.log.warn( title )
- keys = []
- try:
- # Get the set of all intent keys
- for nodeStr in ONOSIntents:
- node = json.loads( nodeStr )
- for intent in node:
- keys.append( intent.get( 'id' ) )
- keys = set( keys )
- # For each intent key, print the state on each node
- for key in keys:
- row = "%-13s" % key
- for nodeStr in ONOSIntents:
- node = json.loads( nodeStr )
- for intent in node:
- if intent.get( 'id', "Error" ) == key:
- row += "%-15s" % intent.get( 'state' )
- main.log.warn( row )
- # End of intent state table
- except ValueError as e:
- main.log.exception( e )
- main.log.debug( "nodeStr was: " + repr( nodeStr ) )
-
- if intentsResults and not consistentIntents:
- # print the json objects
- n = len(ONOSIntents)
- main.log.debug( "ONOS" + str( n ) + " intents: " )
- main.log.debug( json.dumps( json.loads( ONOSIntents[ -1 ] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- for i in range( numControllers ):
- if ONOSIntents[ i ] != ONOSIntents[ -1 ]:
- main.log.debug( "ONOS" + str( i + 1 ) + " intents: " )
- main.log.debug( json.dumps( json.loads( ONOSIntents[i] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- else:
- main.log.debug( nodes[ i ].name + " intents match ONOS" +
- str( n ) + " intents" )
- elif intentsResults and consistentIntents:
- intentCheck = main.TRUE
- intentState = ONOSIntents[ 0 ]
-
- main.step( "Get the flows from each controller" )
- global flowState
- flowState = []
- ONOSFlows = []
- ONOSFlowsJson = []
- flowCheck = main.FALSE
- consistentFlows = True
- flowsResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].flows,
- name="flows-" + str( i ),
- args=[],
- kwargs={ 'jsonFormat': True } )
- threads.append( t )
- t.start()
-
- # NOTE: Flows command can take some time to run
- time.sleep(30)
- for t in threads:
- t.join()
- result = t.result
- ONOSFlows.append( result )
-
- for i in range( numControllers ):
- num = str( i + 1 )
- if not ONOSFlows[ i ] or "Error" in ONOSFlows[ i ]:
- main.log.error( "Error in getting ONOS" + num + " flows" )
- main.log.warn( "ONOS" + num + " flows response: " +
- repr( ONOSFlows[ i ] ) )
- flowsResults = False
- ONOSFlowsJson.append( None )
- else:
- try:
- ONOSFlowsJson.append( json.loads( ONOSFlows[ i ] ) )
- except ( ValueError, TypeError ):
- # FIXME: change this to log.error?
- main.log.exception( "Error in parsing ONOS" + num +
- " response as json." )
- main.log.error( repr( ONOSFlows[ i ] ) )
- ONOSFlowsJson.append( None )
- flowsResults = False
- utilities.assert_equals(
- expect=True,
- actual=flowsResults,
- onpass="No error in reading flows output",
- onfail="Error in reading flows from ONOS" )
-
- main.step( "Check for consistency in Flows from each controller" )
- tmp = [ len( i ) == len( ONOSFlowsJson[ 0 ] ) for i in ONOSFlowsJson ]
- if all( tmp ):
- main.log.info( "Flow count is consistent across all ONOS nodes" )
- else:
- consistentFlows = False
- utilities.assert_equals(
- expect=True,
- actual=consistentFlows,
- onpass="The flow count is consistent across all ONOS nodes",
- onfail="ONOS nodes have different flow counts" )
-
- if flowsResults and not consistentFlows:
- for i in range( numControllers ):
- try:
- main.log.warn(
- "ONOS" + str( i + 1 ) + " flows: " +
- json.dumps( json.loads( ONOSFlows[i] ), sort_keys=True,
- indent=4, separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn(
- "ONOS" + str( i + 1 ) + " flows: " +
- repr( ONOSFlows[ i ] ) )
- elif flowsResults and consistentFlows:
- flowCheck = main.TRUE
- flowState = ONOSFlows[ 0 ]
-
- main.step( "Get the OF Table entries" )
- global flows
- flows = []
- for i in range( 1, 29 ):
- flows.append( main.Mininet2.getFlowTable( 1.3, "s" + str( i ) ) )
- if flowCheck == main.FALSE:
- for table in flows:
- main.log.warn( table )
- # TODO: Compare switch flow tables with ONOS flow tables
-
- main.step( "Start continuous pings" )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source1' ],
- target=main.params[ 'PING' ][ 'target1' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source2' ],
- target=main.params[ 'PING' ][ 'target2' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source3' ],
- target=main.params[ 'PING' ][ 'target3' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source4' ],
- target=main.params[ 'PING' ][ 'target4' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source5' ],
- target=main.params[ 'PING' ][ 'target5' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source6' ],
- target=main.params[ 'PING' ][ 'target6' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source7' ],
- target=main.params[ 'PING' ][ 'target7' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source8' ],
- target=main.params[ 'PING' ][ 'target8' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source9' ],
- target=main.params[ 'PING' ][ 'target9' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source10' ],
- target=main.params[ 'PING' ][ 'target10' ],
- pingTime=500 )
-
- main.step( "Collecting topology information from ONOS" )
- devices = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].devices,
- name="devices-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- devices.append( t.result )
- hosts = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].hosts,
- name="hosts-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- try:
- hosts.append( json.loads( t.result ) )
- except ( ValueError, TypeError ):
- # FIXME: better handling of this, print which node
- # Maybe use thread name?
- main.log.exception( "Error parsing json output of hosts" )
- # FIXME: should this be an empty json object instead?
- hosts.append( None )
-
- ports = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].ports,
- name="ports-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ports.append( t.result )
- links = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].links,
- name="links-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- links.append( t.result )
- clusters = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].clusters,
- name="clusters-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- clusters.append( t.result )
- # Compare json objects for hosts and dataplane clusters
-
- # hosts
- main.step( "Host view is consistent across ONOS nodes" )
- consistentHostsResult = main.TRUE
- for controller in range( len( hosts ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in hosts[ controller ]:
- if hosts[ controller ] == hosts[ 0 ]:
- continue
- else: # hosts not consistent
- main.log.error( "hosts from ONOS" +
- controllerStr +
- " is inconsistent with ONOS1" )
- main.log.warn( repr( hosts[ controller ] ) )
- consistentHostsResult = main.FALSE
-
- else:
- main.log.error( "Error in getting ONOS hosts from ONOS" +
- controllerStr )
- consistentHostsResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " hosts response: " +
- repr( hosts[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentHostsResult,
- onpass="Hosts view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of hosts" )
-
- main.step( "Each host has an IP address" )
- ipResult = main.TRUE
- for controller in range( 0, len( hosts ) ):
- controllerStr = str( controller + 1 )
- for host in hosts[ controller ]:
- if not host.get( 'ipAddresses', [ ] ):
- main.log.error( "DEBUG:Error with host ips on controller" +
- controllerStr + ": " + str( host ) )
- ipResult = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=ipResult,
- onpass="The ips of the hosts aren't empty",
- onfail="The ip of at least one host is missing" )
-
- # Strongly connected clusters of devices
- main.step( "Cluster view is consistent across ONOS nodes" )
- consistentClustersResult = main.TRUE
- for controller in range( len( clusters ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in clusters[ controller ]:
- if clusters[ controller ] == clusters[ 0 ]:
- continue
- else: # clusters not consistent
- main.log.error( "clusters from ONOS" + controllerStr +
- " is inconsistent with ONOS1" )
- consistentClustersResult = main.FALSE
-
- else:
- main.log.error( "Error in getting dataplane clusters " +
- "from ONOS" + controllerStr )
- consistentClustersResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " clusters response: " +
- repr( clusters[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentClustersResult,
- onpass="Clusters view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of clusters" )
- # there should always only be one cluster
- main.step( "Cluster view correct across ONOS nodes" )
- try:
- numClusters = len( json.loads( clusters[ 0 ] ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing clusters[0]: " +
- repr( clusters[ 0 ] ) )
- clusterResults = main.FALSE
- if numClusters == 1:
- clusterResults = main.TRUE
- utilities.assert_equals(
- expect=1,
- actual=numClusters,
- onpass="ONOS shows 1 SCC",
- onfail="ONOS shows " + str( numClusters ) + " SCCs" )
-
- main.step( "Comparing ONOS topology to MN" )
- devicesResults = main.TRUE
- linksResults = main.TRUE
- hostsResults = main.TRUE
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
- mnHosts = main.Mininet1.getHosts()
- for controller in range( numControllers ):
- controllerStr = str( controller + 1 )
- if devices[ controller ] and ports[ controller ] and\
- "Error" not in devices[ controller ] and\
- "Error" not in ports[ controller ]:
-
- currentDevicesResult = main.Mininet1.compareSwitches(
- mnSwitches,
- json.loads( devices[ controller ] ),
- json.loads( ports[ controller ] ) )
- else:
- currentDevicesResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentDevicesResult,
- onpass="ONOS" + controllerStr +
- " Switches view is correct",
- onfail="ONOS" + controllerStr +
- " Switches view is incorrect" )
- if links[ controller ] and "Error" not in links[ controller ]:
- currentLinksResult = main.Mininet1.compareLinks(
- mnSwitches, mnLinks,
- json.loads( links[ controller ] ) )
- else:
- currentLinksResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentLinksResult,
- onpass="ONOS" + controllerStr +
- " links view is correct",
- onfail="ONOS" + controllerStr +
- " links view is incorrect" )
-
- if hosts[ controller ] or "Error" not in hosts[ controller ]:
- currentHostsResult = main.Mininet1.compareHosts(
- mnHosts,
- hosts[ controller ] )
- else:
- currentHostsResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentHostsResult,
- onpass="ONOS" + controllerStr +
- " hosts exist in Mininet",
- onfail="ONOS" + controllerStr +
- " hosts don't match Mininet" )
-
- devicesResults = devicesResults and currentDevicesResult
- linksResults = linksResults and currentLinksResult
- hostsResults = hostsResults and currentHostsResult
-
- main.step( "Device information is correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=devicesResults,
- onpass="Device information is correct",
- onfail="Device information is incorrect" )
-
- main.step( "Links are correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linksResults,
- onpass="Link are correct",
- onfail="Links are incorrect" )
-
- main.step( "Hosts are correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=hostsResults,
- onpass="Hosts are correct",
- onfail="Hosts are incorrect" )
-
- def CASE6( self, main ):
- """
- The Failure case. Since this is the Sanity test, we do nothing.
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- main.case( "Wait 60 seconds instead of inducing a failure" )
- time.sleep( 60 )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=main.TRUE,
- onpass="Sleeping 60 seconds",
- onfail="Something is terribly wrong with my math" )
-
- def CASE7( self, main ):
- """
- Check state after ONOS failure
- """
- import json
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- main.case( "Running ONOS Constant State Tests" )
-
- main.step( "Check that each switch has a master" )
- # Assert that each device has a master
- rolesNotNull = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].rolesNotNull,
- name="rolesNotNull-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- rolesNotNull = rolesNotNull and t.result
- utilities.assert_equals(
- expect=main.TRUE,
- actual=rolesNotNull,
- onpass="Each device has a master",
- onfail="Some devices don't have a master assigned" )
-
- main.step( "Read device roles from ONOS" )
- ONOSMastership = []
- mastershipCheck = main.FALSE
- consistentMastership = True
- rolesResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].roles,
- name="roles-" + str( i ),
- args=[] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ONOSMastership.append( t.result )
-
- for i in range( numControllers ):
- if not ONOSMastership[i] or "Error" in ONOSMastership[i]:
- main.log.error( "Error in getting ONOS" + str( i + 1 ) +
- " roles" )
- main.log.warn(
- "ONOS" + str( i + 1 ) + " mastership response: " +
- repr( ONOSMastership[i] ) )
- rolesResults = False
- utilities.assert_equals(
- expect=True,
- actual=rolesResults,
- onpass="No error in reading roles output",
- onfail="Error in reading roles from ONOS" )
-
- main.step( "Check for consistency in roles from each controller" )
- if all([ i == ONOSMastership[ 0 ] for i in ONOSMastership ] ):
- main.log.info(
- "Switch roles are consistent across all ONOS nodes" )
- else:
- consistentMastership = False
- utilities.assert_equals(
- expect=True,
- actual=consistentMastership,
- onpass="Switch roles are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of switch roles" )
-
- if rolesResults and not consistentMastership:
- for i in range( numControllers ):
- main.log.warn(
- "ONOS" + str( i + 1 ) + " roles: ",
- json.dumps(
- json.loads( ONOSMastership[ i ] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- elif rolesResults and not consistentMastership:
- mastershipCheck = main.TRUE
-
- description2 = "Compare switch roles from before failure"
- main.step( description2 )
- try:
- currentJson = json.loads( ONOSMastership[0] )
- oldJson = json.loads( mastershipState )
- except ( ValueError, TypeError ):
- main.log.exception( "Something is wrong with parsing " +
- "ONOSMastership[0] or mastershipState" )
- main.log.error( "ONOSMastership[0]: " + repr( ONOSMastership[0] ) )
- main.log.error( "mastershipState" + repr( mastershipState ) )
- main.cleanup()
- main.exit()
- mastershipCheck = main.TRUE
- for i in range( 1, 29 ):
- switchDPID = str(
- main.Mininet1.getSwitchDPID( switch="s" + str( i ) ) )
- current = [ switch[ 'master' ] for switch in currentJson
- if switchDPID in switch[ 'id' ] ]
- old = [ switch[ 'master' ] for switch in oldJson
- if switchDPID in switch[ 'id' ] ]
- if current == old:
- mastershipCheck = mastershipCheck and main.TRUE
- else:
- main.log.warn( "Mastership of switch %s changed" % switchDPID )
- mastershipCheck = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=mastershipCheck,
- onpass="Mastership of Switches was not changed",
- onfail="Mastership of some switches changed" )
- mastershipCheck = mastershipCheck and consistentMastership
-
- main.step( "Get the intents and compare across all nodes" )
- ONOSIntents = []
- intentCheck = main.FALSE
- consistentIntents = True
- intentsResults = True
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].intents,
- name="intents-" + str( i ),
- args=[],
- kwargs={ 'jsonFormat': True } )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ONOSIntents.append( t.result )
-
- for i in range( numControllers ):
- if not ONOSIntents[ i ] or "Error" in ONOSIntents[ i ]:
- main.log.error( "Error in getting ONOS" + str( i + 1 ) +
- " intents" )
- main.log.warn( "ONOS" + str( i + 1 ) + " intents response: " +
- repr( ONOSIntents[ i ] ) )
- intentsResults = False
- utilities.assert_equals(
- expect=True,
- actual=intentsResults,
- onpass="No error in reading intents output",
- onfail="Error in reading intents from ONOS" )
-
- main.step( "Check for consistency in Intents from each controller" )
- if all([ sorted( i ) == sorted( ONOSIntents[ 0 ] ) for i in ONOSIntents ] ):
- main.log.info( "Intents are consistent across all ONOS " +
- "nodes" )
- else:
- consistentIntents = False
-
- # Try to make it easy to figure out what is happening
- #
- # Intent ONOS1 ONOS2 ...
- # 0x01 INSTALLED INSTALLING
- # ... ... ...
- # ... ... ...
- title = " ID"
- for n in range( numControllers ):
- title += " " * 10 + "ONOS" + str( n + 1 )
- main.log.warn( title )
- # get all intent keys in the cluster
- keys = []
- for nodeStr in ONOSIntents:
- node = json.loads( nodeStr )
- for intent in node:
- keys.append( intent.get( 'id' ) )
- keys = set( keys )
- for key in keys:
- row = "%-13s" % key
- for nodeStr in ONOSIntents:
- node = json.loads( nodeStr )
- for intent in node:
- if intent.get( 'id' ) == key:
- row += "%-15s" % intent.get( 'state' )
- main.log.warn( row )
- # End table view
-
- utilities.assert_equals(
- expect=True,
- actual=consistentIntents,
- onpass="Intents are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of intents" )
- intentStates = []
- for node in ONOSIntents: # Iter through ONOS nodes
- nodeStates = []
- # Iter through intents of a node
- try:
- for intent in json.loads( node ):
- nodeStates.append( intent[ 'state' ] )
- except ( ValueError, TypeError ):
- main.log.exception( "Error in parsing intents" )
- main.log.error( repr( node ) )
- intentStates.append( nodeStates )
- out = [ (i, nodeStates.count( i ) ) for i in set( nodeStates ) ]
- main.log.info( dict( out ) )
-
- if intentsResults and not consistentIntents:
- for i in range( numControllers ):
- main.log.warn( "ONOS" + str( i + 1 ) + " intents: " )
- main.log.warn( json.dumps(
- json.loads( ONOSIntents[ i ] ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- elif intentsResults and consistentIntents:
- intentCheck = main.TRUE
-
- # NOTE: Store has no durability, so intents are lost across system
- # restarts
- main.step( "Compare current intents with intents before the failure" )
- # NOTE: this requires case 5 to pass for intentState to be set.
- # maybe we should stop the test if that fails?
- sameIntents = main.FALSE
- if intentState and intentState == ONOSIntents[ 0 ]:
- sameIntents = main.TRUE
- main.log.info( "Intents are consistent with before failure" )
- # TODO: possibly the states have changed? we may need to figure out
- # what the acceptable states are
- elif len( intentState ) == len( ONOSIntents[ 0 ] ):
- sameIntents = main.TRUE
- try:
- before = json.loads( intentState )
- after = json.loads( ONOSIntents[ 0 ] )
- for intent in before:
- if intent not in after:
- sameIntents = main.FALSE
- main.log.debug( "Intent is not currently in ONOS " +
- "(at least in the same form):" )
- main.log.debug( json.dumps( intent ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Exception printing intents" )
- main.log.debug( repr( ONOSIntents[0] ) )
- main.log.debug( repr( intentState ) )
- if sameIntents == main.FALSE:
- try:
- main.log.debug( "ONOS intents before: " )
- main.log.debug( json.dumps( json.loads( intentState ),
- sort_keys=True, indent=4,
- separators=( ',', ': ' ) ) )
- main.log.debug( "Current ONOS intents: " )
- main.log.debug( json.dumps( json.loads( ONOSIntents[ 0 ] ),
- sort_keys=True, indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Exception printing intents" )
- main.log.debug( repr( ONOSIntents[0] ) )
- main.log.debug( repr( intentState ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=sameIntents,
- onpass="Intents are consistent with before failure",
- onfail="The Intents changed during failure" )
- intentCheck = intentCheck and sameIntents
-
- main.step( "Get the OF Table entries and compare to before " +
- "component failure" )
- FlowTables = main.TRUE
- flows2 = []
- for i in range( 28 ):
- main.log.info( "Checking flow table on s" + str( i + 1 ) )
- tmpFlows = main.Mininet2.getFlowTable( 1.3, "s" + str( i + 1 ) )
- flows2.append( tmpFlows )
- tempResult = main.Mininet2.flowComp(
- flow1=flows[ i ],
- flow2=tmpFlows )
- FlowTables = FlowTables and tempResult
- if FlowTables == main.FALSE:
- main.log.info( "Differences in flow table for switch: s" +
- str( i + 1 ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=FlowTables,
- onpass="No changes were found in the flow tables",
- onfail="Changes were found in the flow tables" )
-
- main.step( "Check the continuous pings to ensure that no packets " +
- "were dropped during component failure" )
- main.Mininet2.pingKill( main.params[ 'TESTONUSER' ],
- main.params[ 'TESTONIP' ] )
- LossInPings = main.FALSE
- # NOTE: checkForLoss returns main.FALSE with 0% packet loss
- for i in range( 8, 18 ):
- main.log.info(
- "Checking for a loss in pings along flow from s" +
- str( i ) )
- LossInPings = main.Mininet2.checkForLoss(
- "/tmp/ping.h" +
- str( i ) ) or LossInPings
- if LossInPings == main.TRUE:
- main.log.info( "Loss in ping detected" )
- elif LossInPings == main.ERROR:
- main.log.info( "There are multiple mininet process running" )
- elif LossInPings == main.FALSE:
- main.log.info( "No Loss in the pings" )
- main.log.info( "No loss of dataplane connectivity" )
- utilities.assert_equals(
- expect=main.FALSE,
- actual=LossInPings,
- onpass="No Loss of connectivity",
- onfail="Loss of dataplane connectivity detected" )
-
- main.step( "Leadership Election is still functional" )
- # Test of LeadershipElection
- # NOTE: this only works for the sanity test. In case of failures,
- # leader will likely change
- leader = nodes[ 0 ].ip_address
- leaderResult = main.TRUE
- for cli in CLIs:
- leaderN = cli.electionTestLeader()
- # verify leader is ONOS1
- if leaderN == leader:
- # all is well
- # NOTE: In failure scenario, this could be a new node, maybe
- # check != ONOS1
- pass
- elif leaderN == main.FALSE:
- # error in response
- main.log.error( "Something is wrong with " +
- "electionTestLeader function, check the" +
- " error logs" )
- leaderResult = main.FALSE
- elif leader != leaderN:
- leaderResult = main.FALSE
- main.log.error( cli.name + " sees " + str( leaderN ) +
- " as the leader of the election app. " +
- "Leader should be " + str( leader ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Leadership election passed",
- onfail="Something went wrong with Leadership election" )
-
- def CASE8( self, main ):
- """
- Compare topo
- """
- import json
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- main.case( "Compare ONOS Topology view to Mininet topology" )
- main.caseExplaination = "Compare topology objects between Mininet" +\
- " and ONOS"
-
- main.step( "Comparing ONOS topology to MN" )
- devicesResults = main.TRUE
- linksResults = main.TRUE
- hostsResults = main.TRUE
- hostAttachmentResults = True
- topoResult = main.FALSE
- elapsed = 0
- count = 0
- main.step( "Collecting topology information from ONOS" )
- startTime = time.time()
- # Give time for Gossip to work
- while topoResult == main.FALSE and elapsed < 60:
- count += 1
- cliStart = time.time()
- devices = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].devices,
- name="devices-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- devices.append( t.result )
- hosts = []
- ipResult = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].hosts,
- name="hosts-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- try:
- hosts.append( json.loads( t.result ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing hosts results" )
- main.log.error( repr( t.result ) )
- for controller in range( 0, len( hosts ) ):
- controllerStr = str( controller + 1 )
- for host in hosts[ controller ]:
- if host is None or host.get( 'ipAddresses', [] ) == []:
- main.log.error(
- "DEBUG:Error with host ipAddresses on controller" +
- controllerStr + ": " + str( host ) )
- ipResult = main.FALSE
- ports = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].ports,
- name="ports-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- ports.append( t.result )
- links = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].links,
- name="links-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- links.append( t.result )
- clusters = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].clusters,
- name="clusters-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- clusters.append( t.result )
-
- elapsed = time.time() - startTime
- cliTime = time.time() - cliStart
- print "Elapsed time: " + str( elapsed )
- print "CLI time: " + str( cliTime )
-
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
- mnHosts = main.Mininet1.getHosts()
- for controller in range( numControllers ):
- controllerStr = str( controller + 1 )
- if devices[ controller ] and ports[ controller ] and\
- "Error" not in devices[ controller ] and\
- "Error" not in ports[ controller ]:
-
- currentDevicesResult = main.Mininet1.compareSwitches(
- mnSwitches,
- json.loads( devices[ controller ] ),
- json.loads( ports[ controller ] ) )
- else:
- currentDevicesResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentDevicesResult,
- onpass="ONOS" + controllerStr +
- " Switches view is correct",
- onfail="ONOS" + controllerStr +
- " Switches view is incorrect" )
-
- if links[ controller ] and "Error" not in links[ controller ]:
- currentLinksResult = main.Mininet1.compareLinks(
- mnSwitches, mnLinks,
- json.loads( links[ controller ] ) )
- else:
- currentLinksResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentLinksResult,
- onpass="ONOS" + controllerStr +
- " links view is correct",
- onfail="ONOS" + controllerStr +
- " links view is incorrect" )
-
- if hosts[ controller ] or "Error" not in hosts[ controller ]:
- currentHostsResult = main.Mininet1.compareHosts(
- mnHosts,
- hosts[ controller ] )
- else:
- currentHostsResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentHostsResult,
- onpass="ONOS" + controllerStr +
- " hosts exist in Mininet",
- onfail="ONOS" + controllerStr +
- " hosts don't match Mininet" )
- # CHECKING HOST ATTACHMENT POINTS
- hostAttachment = True
- zeroHosts = False
- # FIXME: topo-HA/obelisk specific mappings:
- # key is mac and value is dpid
- mappings = {}
- for i in range( 1, 29 ): # hosts 1 through 28
- # set up correct variables:
- macId = "00:" * 5 + hex( i ).split( "0x" )[1].upper().zfill(2)
- if i == 1:
- deviceId = "1000".zfill(16)
- elif i == 2:
- deviceId = "2000".zfill(16)
- elif i == 3:
- deviceId = "3000".zfill(16)
- elif i == 4:
- deviceId = "3004".zfill(16)
- elif i == 5:
- deviceId = "5000".zfill(16)
- elif i == 6:
- deviceId = "6000".zfill(16)
- elif i == 7:
- deviceId = "6007".zfill(16)
- elif i >= 8 and i <= 17:
- dpid = '3' + str( i ).zfill( 3 )
- deviceId = dpid.zfill(16)
- elif i >= 18 and i <= 27:
- dpid = '6' + str( i ).zfill( 3 )
- deviceId = dpid.zfill(16)
- elif i == 28:
- deviceId = "2800".zfill(16)
- mappings[ macId ] = deviceId
- if hosts[ controller ] or "Error" not in hosts[ controller ]:
- if hosts[ controller ] == []:
- main.log.warn( "There are no hosts discovered" )
- zeroHosts = True
- else:
- for host in hosts[ controller ]:
- mac = None
- location = None
- device = None
- port = None
- try:
- mac = host.get( 'mac' )
- assert mac, "mac field could not be found for this host object"
-
- location = host.get( 'location' )
- assert location, "location field could not be found for this host object"
-
- # Trim the protocol identifier off deviceId
- device = str( location.get( 'elementId' ) ).split(':')[1]
- assert device, "elementId field could not be found for this host location object"
-
- port = location.get( 'port' )
- assert port, "port field could not be found for this host location object"
-
- # Now check if this matches where they should be
- if mac and device and port:
- if str( port ) != "1":
- main.log.error( "The attachment port is incorrect for " +
- "host " + str( mac ) +
- ". Expected: 1 Actual: " + str( port) )
- hostAttachment = False
- if device != mappings[ str( mac ) ]:
- main.log.error( "The attachment device is incorrect for " +
- "host " + str( mac ) +
- ". Expected: " + mappings[ str( mac ) ] +
- " Actual: " + device )
- hostAttachment = False
- else:
- hostAttachment = False
- except AssertionError:
- main.log.exception( "Json object not as expected" )
- main.log.error( repr( host ) )
- hostAttachment = False
- else:
- main.log.error( "No hosts json output or \"Error\"" +
- " in output. hosts = " +
- repr( hosts[ controller ] ) )
- if zeroHosts is False:
- hostAttachment = True
-
- # END CHECKING HOST ATTACHMENT POINTS
- devicesResults = devicesResults and currentDevicesResult
- linksResults = linksResults and currentLinksResult
- hostsResults = hostsResults and currentHostsResult
- hostAttachmentResults = hostAttachmentResults and\
- hostAttachment
- topoResult = ( devicesResults and linksResults
- and hostsResults and ipResult and
- hostAttachmentResults )
-
- # Compare json objects for hosts and dataplane clusters
-
- # hosts
- main.step( "Hosts view is consistent across all ONOS nodes" )
- consistentHostsResult = main.TRUE
- for controller in range( len( hosts ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in hosts[ controller ]:
- if hosts[ controller ] == hosts[ 0 ]:
- continue
- else: # hosts not consistent
- main.log.error( "hosts from ONOS" + controllerStr +
- " is inconsistent with ONOS1" )
- main.log.warn( repr( hosts[ controller ] ) )
- consistentHostsResult = main.FALSE
-
- else:
- main.log.error( "Error in getting ONOS hosts from ONOS" +
- controllerStr )
- consistentHostsResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " hosts response: " +
- repr( hosts[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentHostsResult,
- onpass="Hosts view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of hosts" )
-
- main.step( "Hosts information is correct" )
- hostsResults = hostsResults and ipResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=hostsResults,
- onpass="Host information is correct",
- onfail="Host information is incorrect" )
-
- main.step( "Host attachment points to the network" )
- utilities.assert_equals(
- expect=True,
- actual=hostAttachmentResults,
- onpass="Hosts are correctly attached to the network",
- onfail="ONOS did not correctly attach hosts to the network" )
-
- # Strongly connected clusters of devices
- main.step( "Clusters view is consistent across all ONOS nodes" )
- consistentClustersResult = main.TRUE
- for controller in range( len( clusters ) ):
- controllerStr = str( controller + 1 )
- if "Error" not in clusters[ controller ]:
- if clusters[ controller ] == clusters[ 0 ]:
- continue
- else: # clusters not consistent
- main.log.error( "clusters from ONOS" +
- controllerStr +
- " is inconsistent with ONOS1" )
- consistentClustersResult = main.FALSE
-
- else:
- main.log.error( "Error in getting dataplane clusters " +
- "from ONOS" + controllerStr )
- consistentClustersResult = main.FALSE
- main.log.warn( "ONOS" + controllerStr +
- " clusters response: " +
- repr( clusters[ controller ] ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentClustersResult,
- onpass="Clusters view is consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of clusters" )
-
- main.step( "There is only one SCC" )
- # there should always only be one cluster
- try:
- numClusters = len( json.loads( clusters[ 0 ] ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing clusters[0]: " +
- repr( clusters[0] ) )
- clusterResults = main.FALSE
- if numClusters == 1:
- clusterResults = main.TRUE
- utilities.assert_equals(
- expect=1,
- actual=numClusters,
- onpass="ONOS shows 1 SCC",
- onfail="ONOS shows " + str( numClusters ) + " SCCs" )
-
- topoResult = ( devicesResults and linksResults
- and hostsResults and consistentHostsResult
- and consistentClustersResult and clusterResults
- and ipResult and hostAttachmentResults )
-
- topoResult = topoResult and int( count <= 2 )
- note = "note it takes about " + str( int( cliTime ) ) + \
- " seconds for the test to make all the cli calls to fetch " +\
- "the topology from each ONOS instance"
- main.log.info(
- "Very crass estimate for topology discovery/convergence( " +
- str( note ) + " ): " + str( elapsed ) + " seconds, " +
- str( count ) + " tries" )
-
- main.step( "Device information is correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=devicesResults,
- onpass="Device information is correct",
- onfail="Device information is incorrect" )
-
- main.step( "Links are correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linksResults,
- onpass="Link are correct",
- onfail="Links are incorrect" )
-
- main.step( "Hosts are correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=hostsResults,
- onpass="Hosts are correct",
- onfail="Hosts are incorrect" )
-
- # FIXME: move this to an ONOS state case
- main.step( "Checking ONOS nodes" )
- nodesOutput = []
- nodeResults = main.TRUE
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].nodes,
- name="nodes-" + str( i ),
- args=[ ] )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- nodesOutput.append( t.result )
- ips = [ node.ip_address for node in nodes ]
- for i in nodesOutput:
- try:
- current = json.loads( i )
- for node in current:
- currentResult = main.FALSE
- if node['ip'] in ips: # node in nodes() output is in cell
- if node['state'] == 'ACTIVE':
- currentResult = main.TRUE
- else:
- main.log.error( "Error in ONOS node availability" )
- main.log.error(
- json.dumps( current,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- break
- nodeResults = nodeResults and currentResult
- except ( ValueError, TypeError ):
- main.log.error( "Error parsing nodes output" )
- main.log.warn( repr( i ) )
- utilities.assert_equals( expect=main.TRUE, actual=nodeResults,
- onpass="Nodes check successful",
- onfail="Nodes check NOT successful" )
-
- def CASE9( self, main ):
- """
- Link s3-s28 down
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- # NOTE: You should probably run a topology check after this
-
- linkSleep = float( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- description = "Turn off a link to ensure that Link Discovery " +\
- "is working properly"
- main.case( description )
-
- main.step( "Kill Link between s3 and s28" )
- LinkDown = main.Mininet1.link( END1="s3", END2="s28", OPTION="down" )
- main.log.info( "Waiting " + str( linkSleep ) +
- " seconds for link down to be discovered" )
- time.sleep( linkSleep )
- utilities.assert_equals( expect=main.TRUE, actual=LinkDown,
- onpass="Link down successful",
- onfail="Failed to bring link down" )
- # TODO do some sort of check here
-
- def CASE10( self, main ):
- """
- Link s3-s28 up
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- # NOTE: You should probably run a topology check after this
-
- linkSleep = float( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- description = "Restore a link to ensure that Link Discovery is " + \
- "working properly"
- main.case( description )
-
- main.step( "Bring link between s3 and s28 back up" )
- LinkUp = main.Mininet1.link( END1="s3", END2="s28", OPTION="up" )
- main.log.info( "Waiting " + str( linkSleep ) +
- " seconds for link up to be discovered" )
- time.sleep( linkSleep )
- utilities.assert_equals( expect=main.TRUE, actual=LinkUp,
- onpass="Link up successful",
- onfail="Failed to bring link up" )
- # TODO do some sort of check here
-
- def CASE11( self, main ):
- """
- Switch Down
- """
- # NOTE: You should probably run a topology check after this
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- switchSleep = float( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
-
- description = "Killing a switch to ensure it is discovered correctly"
- main.case( description )
- switch = main.params[ 'kill' ][ 'switch' ]
- switchDPID = main.params[ 'kill' ][ 'dpid' ]
-
- # TODO: Make this switch parameterizable
- main.step( "Kill " + switch )
- main.log.info( "Deleting " + switch )
- main.Mininet1.delSwitch( switch )
- main.log.info( "Waiting " + str( switchSleep ) +
- " seconds for switch down to be discovered" )
- time.sleep( switchSleep )
- device = main.ONOScli1.getDevice( dpid=switchDPID )
- # Peek at the deleted switch
- main.log.warn( str( device ) )
- result = main.FALSE
- if device and device[ 'available' ] is False:
- result = main.TRUE
- utilities.assert_equals( expect=main.TRUE, actual=result,
- onpass="Kill switch successful",
- onfail="Failed to kill switch?" )
-
- def CASE12( self, main ):
- """
- Switch Up
- """
- # NOTE: You should probably run a topology check after this
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- assert ONOS1Port, "ONOS1Port not defined"
- assert ONOS2Port, "ONOS2Port not defined"
- assert ONOS3Port, "ONOS3Port not defined"
- assert ONOS4Port, "ONOS4Port not defined"
- assert ONOS5Port, "ONOS5Port not defined"
- assert ONOS6Port, "ONOS6Port not defined"
- assert ONOS7Port, "ONOS7Port not defined"
-
- switchSleep = float( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
- switch = main.params[ 'kill' ][ 'switch' ]
- switchDPID = main.params[ 'kill' ][ 'dpid' ]
- links = main.params[ 'kill' ][ 'links' ].split()
- description = "Adding a switch to ensure it is discovered correctly"
- main.case( description )
-
- main.step( "Add back " + switch )
- main.Mininet1.addSwitch( switch, dpid=switchDPID )
- for peer in links:
- main.Mininet1.addLink( switch, peer )
- ipList = []
- for i in range( numControllers ):
- ipList.append( nodes[ i ].ip_address )
- main.Mininet1.assignSwController( sw=switch, ip=ipList )
- main.log.info( "Waiting " + str( switchSleep ) +
- " seconds for switch up to be discovered" )
- time.sleep( switchSleep )
- device = main.ONOScli1.getDevice( dpid=switchDPID )
- # Peek at the deleted switch
- main.log.warn( str( device ) )
- result = main.FALSE
- if device and device[ 'available' ]:
- result = main.TRUE
- utilities.assert_equals( expect=main.TRUE, actual=result,
- onpass="add switch successful",
- onfail="Failed to add switch?" )
-
- def CASE13( self, main ):
- """
- Clean up
- """
- import os
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- # printing colors to terminal
- colors = { 'cyan': '\033[96m', 'purple': '\033[95m',
- 'blue': '\033[94m', 'green': '\033[92m',
- 'yellow': '\033[93m', 'red': '\033[91m', 'end': '\033[0m' }
- main.case( "Test Cleanup" )
- main.step( "Killing tcpdumps" )
- main.Mininet2.stopTcpdump()
-
- main.step( "Copying MN pcap and ONOS log files to test station" )
- testname = main.TEST
- teststationUser = main.params[ 'TESTONUSER' ]
- teststationIP = main.params[ 'TESTONIP' ]
- # NOTE: MN Pcap file is being saved to ~/packet_captures
- # scp this file as MN and TestON aren't necessarily the same vm
- # FIXME: scp
- # mn files
- # TODO: Load these from params
- # NOTE: must end in /
- logFolder = "/opt/onos/log/"
- logFiles = [ "karaf.log", "karaf.log.1" ]
- # NOTE: must end in /
- dstDir = "~/packet_captures/"
- for f in logFiles:
- for node in nodes:
- main.ONOSbench.handle.sendline( "scp sdn@" + node.ip_address +
- ":" + logFolder + f + " " +
- teststationUser + "@" +
- teststationIP + ":" +
- dstDir + str( testname ) +
- "-" + node.name + "-" + f )
- main.ONOSbench.handle.expect( "\$" )
-
- # std*.log's
- # NOTE: must end in /
- logFolder = "/opt/onos/var/"
- logFiles = [ "stderr.log", "stdout.log" ]
- # NOTE: must end in /
- dstDir = "~/packet_captures/"
- for f in logFiles:
- for node in nodes:
- main.ONOSbench.handle.sendline( "scp sdn@" + node.ip_address +
- ":" + logFolder + f + " " +
- teststationUser + "@" +
- teststationIP + ":" +
- dstDir + str( testname ) +
- "-" + node.name + "-" + f )
- main.ONOSbench.handle.expect( "\$" )
- # sleep so scp can finish
- time.sleep( 10 )
-
- main.step( "Stopping Mininet" )
- mnResult = main.Mininet1.stopNet()
- utilities.assert_equals( expect=main.TRUE, actual=mnResult,
- onpass="Mininet stopped",
- onfail="MN cleanup NOT successful" )
-
- main.step( "Checking ONOS Logs for errors" )
- for node in nodes:
- print colors[ 'purple' ] + "Checking logs for errors on " + \
- node.name + ":" + colors[ 'end' ]
- print main.ONOSbench.checkLogs( node.ip_address )
-
- main.step( "Packing and rotating pcap archives" )
- os.system( "~/TestON/dependencies/rotate.sh " + str( testname ) )
-
- try:
- timerLog = open( main.logdir + "/Timers.csv", 'w')
- # Overwrite with empty line and close
- labels = "Gossip Intents"
- data = str( gossipTime )
- timerLog.write( labels + "\n" + data )
- timerLog.close()
- except NameError, e:
- main.log.exception(e)
-
- def CASE14( self, main ):
- """
- start election app on all onos nodes
- """
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- main.case("Start Leadership Election app")
- main.step( "Install leadership election app" )
- appResult = main.ONOScli1.activateApp( "org.onosproject.election" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=appResult,
- onpass="Election app installed",
- onfail="Something went wrong with installing Leadership election" )
-
- main.step( "Run for election on each node" )
- leaderResult = main.TRUE
- leaders = []
- for cli in CLIs:
- cli.electionTestRun()
- for cli in CLIs:
- leader = cli.electionTestLeader()
- if leader is None or leader == main.FALSE:
- main.log.error( cli.name + ": Leader for the election app " +
- "should be an ONOS node, instead got '" +
- str( leader ) + "'" )
- leaderResult = main.FALSE
- leaders.append( leader )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Successfully ran for leadership",
- onfail="Failed to run for leadership" )
-
- main.step( "Check that each node shows the same leader" )
- sameLeader = main.TRUE
- if len( set( leaders ) ) != 1:
- sameLeader = main.FALSE
- main.log.error( "Results of electionTestLeader is order of CLIs:" +
- str( leaders ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=sameLeader,
- onpass="Leadership is consistent for the election topic",
- onfail="Nodes have different leaders" )
-
- def CASE15( self, main ):
- """
- Check that Leadership Election is still functional
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- leaderResult = main.TRUE
- description = "Check that Leadership Election is still functional"
- main.case( description )
-
- main.step( "Check that each node shows the same leader" )
- sameLeader = main.TRUE
- leaders = []
- for cli in CLIs:
- leader = cli.electionTestLeader()
- leaders.append( leader )
- if len( set( leaders ) ) != 1:
- sameLeader = main.FALSE
- main.log.error( "Results of electionTestLeader is order of CLIs:" +
- str( leaders ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=sameLeader,
- onpass="Leadership is consistent for the election topic",
- onfail="Nodes have different leaders" )
-
- main.step( "Find current leader and withdraw" )
- leader = main.ONOScli1.electionTestLeader()
- # do some sanity checking on leader before using it
- withdrawResult = main.FALSE
- if leader is None or leader == main.FALSE:
- main.log.error(
- "Leader for the election app should be an ONOS node," +
- "instead got '" + str( leader ) + "'" )
- leaderResult = main.FALSE
- oldLeader = None
- for i in range( len( CLIs ) ):
- if leader == nodes[ i ].ip_address:
- oldLeader = CLIs[ i ]
- break
- else: # FOR/ELSE statement
- main.log.error( "Leader election, could not find current leader" )
- if oldLeader:
- withdrawResult = oldLeader.electionTestWithdraw()
- utilities.assert_equals(
- expect=main.TRUE,
- actual=withdrawResult,
- onpass="Node was withdrawn from election",
- onfail="Node was not withdrawn from election" )
-
- main.step( "Make sure new leader is elected" )
- # FIXME: use threads
- leaderList = []
- for cli in CLIs:
- leaderN = cli.electionTestLeader()
- leaderList.append( leaderN )
- if leaderN == leader:
- main.log.error( cli.name + " still sees " + str( leader ) +
- " as leader after they withdrew" )
- leaderResult = main.FALSE
- elif leaderN == main.FALSE:
- # error in response
- # TODO: add check for "Command not found:" in the driver, this
- # means the app isn't loaded
- main.log.error( "Something is wrong with " +
- "electionTestLeader function, " +
- "check the error logs" )
- leaderResult = main.FALSE
- elif leaderN is None:
- # node may not have recieved the event yet
- time.sleep(7)
- leaderN = cli.electionTestLeader()
- leaderList.pop()
- leaderList.append( leaderN )
- consistentLeader = main.FALSE
- if len( set( leaderList ) ) == 1:
- main.log.info( "Each Election-app sees '" +
- str( leaderList[ 0 ] ) +
- "' as the leader" )
- consistentLeader = main.TRUE
- else:
- main.log.error(
- "Inconsistent responses for leader of Election-app:" )
- for n in range( len( leaderList ) ):
- main.log.error( "ONOS" + str( n + 1 ) + " response: " +
- str( leaderList[ n ] ) )
- leaderResult = leaderResult and consistentLeader
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Leadership election passed",
- onfail="Something went wrong with Leadership election" )
-
- main.step( "Run for election on old leader( just so everyone " +
- "is in the hat )" )
- if oldLeader:
- runResult = oldLeader.electionTestRun()
- else:
- runResult = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=runResult,
- onpass="App re-ran for election",
- onfail="App failed to run for election" )
-
- main.step( "Leader did not change when old leader re-ran" )
- afterRun = main.ONOScli1.electionTestLeader()
- # verify leader didn't just change
- if afterRun == leaderList[ 0 ]:
- afterResult = main.TRUE
- else:
- afterResult = main.FALSE
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=afterResult,
- onpass="Old leader successfully re-ran for election",
- onfail="Something went wrong with Leadership election after " +
- "the old leader re-ran for election" )
-
- def CASE16( self, main ):
- """
- Install Distributed Primitives app
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- # Variables for the distributed primitives tests
- global pCounterName
- global iCounterName
- global pCounterValue
- global iCounterValue
- global onosSet
- global onosSetName
- pCounterName = "TestON-Partitions"
- iCounterName = "TestON-inMemory"
- pCounterValue = 0
- iCounterValue = 0
- onosSet = set([])
- onosSetName = "TestON-set"
-
- description = "Install Primitives app"
- main.case( description )
- main.step( "Install Primitives app" )
- appName = "org.onosproject.distributedprimitives"
- appResults = CLIs[0].activateApp( appName )
- utilities.assert_equals( expect=main.TRUE,
- actual=appResults,
- onpass="Primitives app activated",
- onfail="Primitives app not activated" )
- time.sleep( 5 ) # To allow all nodes to activate
-
- def CASE17( self, main ):
- """
- Check for basic functionality with distributed primitives
- """
- import json
- # Make sure variables are defined/set
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- assert pCounterName, "pCounterName not defined"
- assert iCounterName, "iCounterName not defined"
- assert onosSetName, "onosSetName not defined"
- # NOTE: assert fails if value is 0/None/Empty/False
- try:
- pCounterValue
- except NameError:
- main.log.error( "pCounterValue not defined, setting to 0" )
- pCounterValue = 0
- try:
- iCounterValue
- except NameError:
- main.log.error( "iCounterValue not defined, setting to 0" )
- iCounterValue = 0
- try:
- onosSet
- except NameError:
- main.log.error( "onosSet not defined, setting to empty Set" )
- onosSet = set([])
- # Variables for the distributed primitives tests. These are local only
- addValue = "a"
- addAllValue = "a b c d e f"
- retainValue = "c d e f"
-
- description = "Check for basic functionality with distributed " +\
- "primitives"
- main.case( description )
- main.caseExplaination = "Test the methods of the distributed primitives (counters and sets) throught the cli"
- # DISTRIBUTED ATOMIC COUNTERS
- main.step( "Increment and get a default counter on each node" )
- pCounters = []
- threads = []
- addedPValues = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].counterTestIncrement,
- name="counterIncrement-" + str( i ),
- args=[ pCounterName ] )
- pCounterValue += 1
- addedPValues.append( pCounterValue )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- pCounters.append( t.result )
- # Check that counter incremented numController times
- pCounterResults = True
- for i in addedPValues:
- tmpResult = i in pCounters
- pCounterResults = pCounterResults and tmpResult
- if not tmpResult:
- main.log.error( str( i ) + " is not in partitioned "
- "counter incremented results" )
- utilities.assert_equals( expect=True,
- actual=pCounterResults,
- onpass="Default counter incremented",
- onfail="Error incrementing default" +
- " counter" )
-
- main.step( "Increment and get an in memory counter on each node" )
- iCounters = []
- addedIValues = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].counterTestIncrement,
- name="icounterIncrement-" + str( i ),
- args=[ iCounterName ],
- kwargs={ "inMemory": True } )
- iCounterValue += 1
- addedIValues.append( iCounterValue )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- iCounters.append( t.result )
- # Check that counter incremented numController times
- iCounterResults = True
- for i in addedIValues:
- tmpResult = i in iCounters
- iCounterResults = iCounterResults and tmpResult
- if not tmpResult:
- main.log.error( str( i ) + " is not in the in-memory "
- "counter incremented results" )
- utilities.assert_equals( expect=True,
- actual=iCounterResults,
- onpass="In memory counter incremented",
- onfail="Error incrementing in memory" +
- " counter" )
-
- main.step( "Check counters are consistant across nodes" )
- onosCounters = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].counters,
- name="counters-" + str( i ) )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- onosCounters.append( t.result )
- tmp = [ i == onosCounters[ 0 ] for i in onosCounters ]
- if all( tmp ):
- main.log.info( "Counters are consistent across all nodes" )
- consistentCounterResults = main.TRUE
- else:
- main.log.error( "Counters are not consistent across all nodes" )
- consistentCounterResults = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=consistentCounterResults,
- onpass="ONOS counters are consistent " +
- "across nodes",
- onfail="ONOS Counters are inconsistent " +
- "across nodes" )
-
- main.step( "Counters we added have the correct values" )
- correctResults = main.TRUE
- for i in range( numControllers ):
- current = json.loads( onosCounters[i] )
- pValue = None
- iValue = None
- try:
- for database in current:
- partitioned = database.get( 'partitionedDatabaseCounters' )
- if partitioned:
- for value in partitioned:
- if value.get( 'name' ) == pCounterName:
- pValue = value.get( 'value' )
- break
- inMemory = database.get( 'inMemoryDatabaseCounters' )
- if inMemory:
- for value in inMemory:
- if value.get( 'name' ) == iCounterName:
- iValue = value.get( 'value' )
- break
- except AttributeError, e:
- main.log.error( "ONOS" + str( i + 1 ) + " counters result " +
- "is not as expected" )
- correctResults = main.FALSE
- if pValue == pCounterValue:
- main.log.info( "Partitioned counter value is correct" )
- else:
- main.log.error( "Partitioned counter value is incorrect," +
- " expected value: " + str( pCounterValue )
- + " current value: " + str( pValue ) )
- correctResults = main.FALSE
- if iValue == iCounterValue:
- main.log.info( "In memory counter value is correct" )
- else:
- main.log.error( "In memory counter value is incorrect, " +
- "expected value: " + str( iCounterValue ) +
- " current value: " + str( iValue ) )
- correctResults = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=correctResults,
- onpass="Added counters are correct",
- onfail="Added counters are incorrect" )
- # DISTRIBUTED SETS
- main.step( "Distributed Set get" )
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
-
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=getResults,
- onpass="Set elements are correct",
- onfail="Set elements are incorrect" )
-
- main.step( "Distributed Set size" )
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
-
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- utilities.assert_equals( expect=main.TRUE,
- actual=sizeResults,
- onpass="Set sizes are correct",
- onfail="Set sizes are incorrect" )
-
- main.step( "Distributed Set add()" )
- onosSet.add( addValue )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAdd-" + str( i ),
- args=[ onosSetName, addValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addResults = main.FALSE
- else:
- # unexpected result
- addResults = main.FALSE
- if addResults != main.TRUE:
- main.log.error( "Error executing set add" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addResults = addResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addResults,
- onpass="Set add correct",
- onfail="Set add was incorrect" )
-
- main.step( "Distributed Set addAll()" )
- onosSet.update( addAllValue.split() )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAddAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addAllResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addAllResults = main.FALSE
- else:
- # unexpected result
- addAllResults = main.FALSE
- if addAllResults != main.TRUE:
- main.log.error( "Error executing set addAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addAllResults = addAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addAllResults,
- onpass="Set addAll correct",
- onfail="Set addAll was incorrect" )
-
- main.step( "Distributed Set contains()" )
- containsResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setContains-" + str( i ),
- args=[ onosSetName ],
- kwargs={ "values": addValue } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- # NOTE: This is the tuple
- containsResponses.append( t.result )
-
- containsResults = main.TRUE
- for i in range( numControllers ):
- if containsResponses[ i ] == main.ERROR:
- containsResults = main.FALSE
- else:
- containsResults = containsResults and\
- containsResponses[ i ][ 1 ]
- utilities.assert_equals( expect=main.TRUE,
- actual=containsResults,
- onpass="Set contains is functional",
- onfail="Set contains failed" )
-
- main.step( "Distributed Set containsAll()" )
- containsAllResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setContainsAll-" + str( i ),
- args=[ onosSetName ],
- kwargs={ "values": addAllValue } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- # NOTE: This is the tuple
- containsAllResponses.append( t.result )
-
- containsAllResults = main.TRUE
- for i in range( numControllers ):
- if containsResponses[ i ] == main.ERROR:
- containsResults = main.FALSE
- else:
- containsResults = containsResults and\
- containsResponses[ i ][ 1 ]
- utilities.assert_equals( expect=main.TRUE,
- actual=containsAllResults,
- onpass="Set containsAll is functional",
- onfail="Set containsAll failed" )
-
- main.step( "Distributed Set remove()" )
- onosSet.remove( addValue )
- removeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestRemove-" + str( i ),
- args=[ onosSetName, addValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- removeResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- removeResults = main.TRUE
- for i in range( numControllers ):
- if removeResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif removeResponses[ i ] == main.FALSE:
- # not in set, probably fine
- pass
- elif removeResponses[ i ] == main.ERROR:
- # Error in execution
- removeResults = main.FALSE
- else:
- # unexpected result
- removeResults = main.FALSE
- if removeResults != main.TRUE:
- main.log.error( "Error executing set remove" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- removeResults = removeResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=removeResults,
- onpass="Set remove correct",
- onfail="Set remove was incorrect" )
-
- main.step( "Distributed Set removeAll()" )
- onosSet.difference_update( addAllValue.split() )
- removeAllResponses = []
- threads = []
- try:
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestRemoveAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- removeAllResponses.append( t.result )
- except Exception, e:
- main.log.exception(e)
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- removeAllResults = main.TRUE
- for i in range( numControllers ):
- if removeAllResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif removeAllResponses[ i ] == main.FALSE:
- # not in set, probably fine
- pass
- elif removeAllResponses[ i ] == main.ERROR:
- # Error in execution
- removeAllResults = main.FALSE
- else:
- # unexpected result
- removeAllResults = main.FALSE
- if removeAllResults != main.TRUE:
- main.log.error( "Error executing set removeAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- removeAllResults = removeAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=removeAllResults,
- onpass="Set removeAll correct",
- onfail="Set removeAll was incorrect" )
-
- main.step( "Distributed Set addAll()" )
- onosSet.update( addAllValue.split() )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAddAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addAllResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addAllResults = main.FALSE
- else:
- # unexpected result
- addAllResults = main.FALSE
- if addAllResults != main.TRUE:
- main.log.error( "Error executing set addAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addAllResults = addAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addAllResults,
- onpass="Set addAll correct",
- onfail="Set addAll was incorrect" )
-
- main.step( "Distributed Set clear()" )
- onosSet.clear()
- clearResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestClear-" + str( i ),
- args=[ onosSetName, " "], # Values doesn't matter
- kwargs={ "clear": True } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- clearResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- clearResults = main.TRUE
- for i in range( numControllers ):
- if clearResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif clearResponses[ i ] == main.FALSE:
- # Nothing set, probably fine
- pass
- elif clearResponses[ i ] == main.ERROR:
- # Error in execution
- clearResults = main.FALSE
- else:
- # unexpected result
- clearResults = main.FALSE
- if clearResults != main.TRUE:
- main.log.error( "Error executing set clear" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- clearResults = clearResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=clearResults,
- onpass="Set clear correct",
- onfail="Set clear was incorrect" )
-
- main.step( "Distributed Set addAll()" )
- onosSet.update( addAllValue.split() )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAddAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addAllResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addAllResults = main.FALSE
- else:
- # unexpected result
- addAllResults = main.FALSE
- if addAllResults != main.TRUE:
- main.log.error( "Error executing set addAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addAllResults = addAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addAllResults,
- onpass="Set addAll correct",
- onfail="Set addAll was incorrect" )
-
- main.step( "Distributed Set retain()" )
- onosSet.intersection_update( retainValue.split() )
- retainResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestRetain-" + str( i ),
- args=[ onosSetName, retainValue ],
- kwargs={ "retain": True } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- retainResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- retainResults = main.TRUE
- for i in range( numControllers ):
- if retainResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif retainResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif retainResponses[ i ] == main.ERROR:
- # Error in execution
- retainResults = main.FALSE
- else:
- # unexpected result
- retainResults = main.FALSE
- if retainResults != main.TRUE:
- main.log.error( "Error executing set retain" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " +
- str( size ) + " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- retainResults = retainResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=retainResults,
- onpass="Set retain correct",
- onfail="Set retain was incorrect" )
-
diff --git a/TestON/tests/HATestSanity/HATestSanity.topo b/TestON/tests/HATestSanity/HATestSanity.topo
deleted file mode 100644
index 0855d4e..0000000
--- a/TestON/tests/HATestSanity/HATestSanity.topo
+++ /dev/null
@@ -1,170 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </ONOSbench>
-
- <ONOScli1>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli1>
-
- <ONOScli2>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli2>
-
- <ONOScli3>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli3>
-
-
- <ONOScli4>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli4>
-
-
- <ONOScli5>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli5>
-
-
- <ONOScli6>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli6>
-
-
- <ONOScli7>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli7>
-
- <ONOS1>
- <host>10.128.30.11</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.128.30.12</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>10</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.128.30.13</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>11</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
- <ONOS4>
- <host>10.128.30.14</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>12</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4>
-
- <ONOS5>
- <host>10.128.30.15</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>13</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5>
-
- <ONOS6>
- <host>10.128.30.16</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>14</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6>
-
- <ONOS7>
- <host>10.128.30.17</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>15</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7>
-
- <Mininet1>
- <host>10.128.30.9</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>16</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> </arg3>
- <controller> none </controller>
- </COMPONENTS>
- </Mininet1>
-
- <Mininet2>
- <host>10.128.30.9</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>17</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </Mininet2>
-
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/HATestSanity/__init__.py b/TestON/tests/HATestSanity/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/HATestSanity/__init__.py
+++ /dev/null
diff --git a/TestON/tests/HATestSingleInstanceRestart/HATestSingleInstanceRestart.params b/TestON/tests/HATestSingleInstanceRestart/HATestSingleInstanceRestart.params
deleted file mode 100644
index 108ab88..0000000
--- a/TestON/tests/HATestSingleInstanceRestart/HATestSingleInstanceRestart.params
+++ /dev/null
@@ -1,88 +0,0 @@
-<PARAMS>
- #CASE1: Compile ONOS and push it to the test machines
- #CASE2: Assign mastership to controllers
- #CASE3: Assign intents
- #CASE4: Ping across added host intents
- #CASE5: Reading state of ONOS
- #CASE6: The Failure case. Since this is the Sanity test, we do nothing.
- #CASE7: Check state after control plane failure
- #CASE8: Compare topo
- #CASE9: Link s3-s28 down
- #CASE10: Link s3-s28 up
- #CASE11: Switch down
- #CASE12: Switch up
- #CASE13: Clean up
- #CASE14: start election app on all onos nodes
- #CASE15: Check that Leadership Election is still functional
- #1,2,8,3,4,5,14,[6],8,3,7,4,15,9,8,4,10,8,4,11,8,4,12,8,4,13
- #extra hosts test 1,2,8,11,8,12,8
- <testcases>1,2,8,3,4,5,14,15,16,17,[6],8,3,7,4,15,17,9,8,4,10,8,4,11,8,4,12,8,4,13</testcases>
- <ENV>
- <cellName>HA</cellName>
- </ENV>
- <Git>False</Git>
- <branch> master </branch>
- <num_controllers> 1 </num_controllers>
- <tcpdump> False </tcpdump>
-
- <CTRL>
- <ip1>10.128.30.11</ip1>
- <port1>6633</port1>
-
- <ip2>10.128.30.12</ip2>
- <port2>6633</port2>
-
- <ip3>10.128.30.13</ip3>
- <port3>6633</port3>
-
- <ip4>10.128.30.14</ip4>
- <port4>6633</port4>
-
- <ip5>10.128.30.15</ip5>
- <port5>6633</port5>
-
- <ip6>10.128.30.16</ip6>
- <port6>6633</port6>
-
- <ip7>10.128.30.17</ip7>
- <port7>6633</port7>
- </CTRL>
- <TESTONUSER>admin</TESTONUSER>
- <TESTONIP>10.128.30.9</TESTONIP>
- <PING>
- <source1>h8</source1>
- <source2>h9</source2>
- <source3>h10</source3>
- <source4>h11</source4>
- <source5>h12</source5>
- <source6>h13</source6>
- <source7>h14</source7>
- <source8>h15</source8>
- <source9>h16</source9>
- <source10>h17</source10>
- <target1>10.0.0.18</target1>
- <target2>10.0.0.19</target2>
- <target3>10.0.0.20</target3>
- <target4>10.0.0.21</target4>
- <target5>10.0.0.22</target5>
- <target6>10.0.0.23</target6>
- <target7>10.0.0.24</target7>
- <target8>10.0.0.25</target8>
- <target9>10.0.0.26</target9>
- <target10>10.0.0.27</target10>
- </PING>
- <timers>
- <LinkDiscovery>.2</LinkDiscovery>
- <SwitchDiscovery>.2</SwitchDiscovery>
- </timers>
- <kill>
- <switch> s5 </switch>
- <dpid> 0000000000005000 </dpid>
- <links> h5 s2 s1 s6 </links>
- </kill>
- <MNtcpdump>
- <intf>eth0</intf>
- <port> </port>
- <folder>~/packet_captures/</folder>
- </MNtcpdump>
-</PARAMS>
diff --git a/TestON/tests/HATestSingleInstanceRestart/HATestSingleInstanceRestart.py b/TestON/tests/HATestSingleInstanceRestart/HATestSingleInstanceRestart.py
deleted file mode 100644
index 4dcf0dd..0000000
--- a/TestON/tests/HATestSingleInstanceRestart/HATestSingleInstanceRestart.py
+++ /dev/null
@@ -1,3054 +0,0 @@
-"""
-Description: This test is to determine if a single
- instance ONOS 'cluster' can handle a restart
-
-List of test cases:
-CASE1: Compile ONOS and push it to the test machines
-CASE2: Assign devices to controllers
-CASE21: Assign mastership to controllers
-CASE3: Assign intents
-CASE4: Ping across added host intents
-CASE5: Reading state of ONOS
-CASE6: The Failure case.
-CASE7: Check state after control plane failure
-CASE8: Compare topo
-CASE9: Link s3-s28 down
-CASE10: Link s3-s28 up
-CASE11: Switch down
-CASE12: Switch up
-CASE13: Clean up
-CASE14: start election app on all onos nodes
-CASE15: Check that Leadership Election is still functional
-CASE16: Install Distributed Primitives app
-CASE17: Check for basic functionality with distributed primitives
-"""
-
-
-class HATestSingleInstanceRestart:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- """
- CASE1 is to compile ONOS and push it to the test machines
-
- Startup sequence:
- cell <name>
- onos-verify-cell
- NOTE: temporary - onos-remove-raft-logs
- onos-uninstall
- start mininet
- git pull
- mvn clean install
- onos-package
- onos-install -f
- onos-wait-for-start
- start cli sessions
- start tcpdump
- """
- main.log.info( "ONOS Single node cluster restart " +
- "HA test - initialization" )
- main.case( "Setting up test environment" )
- main.caseExplaination = "Setup the test environment including " +\
- "installing ONOS, starting Mininet and ONOS" +\
- "cli sessions."
- # TODO: save all the timers and output them for plotting
-
- # load some variables from the params file
- PULLCODE = False
- if main.params[ 'Git' ] == 'True':
- PULLCODE = True
- gitBranch = main.params[ 'branch' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
-
- # set global variables
- global ONOS1Ip
- global ONOS1Port
- global ONOS2Port
- global ONOS3Port
- global ONOS4Port
- global ONOS5Port
- global ONOS6Port
- global ONOS7Port
- global numControllers
- numControllers = int( main.params[ 'num_controllers' ] )
-
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
- ONOS4Port = main.params[ 'CTRL' ][ 'port4' ]
- ONOS5Port = main.params[ 'CTRL' ][ 'port5' ]
- ONOS6Port = main.params[ 'CTRL' ][ 'port6' ]
- ONOS7Port = main.params[ 'CTRL' ][ 'port7' ]
-
- global CLIs
- CLIs = []
- global nodes
- nodes = []
- for i in range( 1, numControllers + 1 ):
- CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
- nodes.append( getattr( main, 'ONOS' + str( i ) ) )
-
- main.step( "Applying cell variable to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- # FIXME:this is short term fix
- main.log.info( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
-
- main.log.info( "Uninstalling ONOS" )
- for node in nodes:
- main.ONOSbench.onosUninstall( node.ip_address )
-
- # Make sure ONOS is DEAD
- main.log.info( "Killing any ONOS processes" )
- killResults = main.TRUE
- for node in nodes:
- killed = main.ONOSbench.onosKill( node.ip_address )
- killResults = killResults and killed
-
- cleanInstallResult = main.TRUE
- gitPullResult = main.TRUE
-
- main.step( "Starting Mininet" )
- mnResult = main.Mininet1.startNet( )
- utilities.assert_equals( expect=main.TRUE, actual=mnResult,
- onpass="Mininet Started",
- onfail="Error starting Mininet" )
-
- main.step( "Git checkout and pull " + gitBranch )
- if PULLCODE:
- main.ONOSbench.gitCheckout( gitBranch )
- gitPullResult = main.ONOSbench.gitPull()
- # values of 1 or 3 are good
- utilities.assert_lesser( expect=0, actual=gitPullResult,
- onpass="Git pull successful",
- onfail="Git pull failed" )
- main.ONOSbench.getVersion( report=True )
-
- main.step( "Using mvn clean install" )
- cleanInstallResult = main.TRUE
- if PULLCODE and gitPullResult == main.TRUE:
- cleanInstallResult = main.ONOSbench.cleanInstall()
- else:
- main.log.warn( "Did not pull new code so skipping mvn " +
- "clean install" )
- utilities.assert_equals( expect=main.TRUE,
- actual=cleanInstallResult,
- onpass="MCI successful",
- onfail="MCI failed" )
- # GRAPHS
- # NOTE: important params here:
- # job = name of Jenkins job
- # Plot Name = Plot-HA, only can be used if multiple plots
- # index = The number of the graph under plot name
- job = "HASingleInstanceRestart"
- plotName = "Plot-HA"
- 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' +\
- '&width=500&height=300"' +\
- 'noborder="0" width="500" height="300" scrolling="yes" ' +\
- 'seamless="seamless"></iframe>\n'
- graphs += ']]></ac:plain-text-body>\n'
- graphs += '</ac:structured-macro>\n'
- main.log.wiki(graphs)
-
- cellResult = main.ONOSbench.setCell( "SingleHA" )
- verifyResult = main.ONOSbench.verifyCell()
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
- utilities.assert_equals( expect=main.TRUE, actual=packageResult,
- onpass="ONOS package successful",
- onfail="ONOS package failed" )
-
- main.step( "Installing ONOS package" )
- onosInstallResult = main.ONOSbench.onosInstall( options="-f",
- node=ONOS1Ip )
- utilities.assert_equals( expect=main.TRUE, actual=onosInstallResult,
- onpass="ONOS install successful",
- onfail="ONOS install failed" )
-
- main.step( "Checking if ONOS is up yet" )
- for i in range( 2 ):
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if onos1Isup:
- break
- utilities.assert_equals( expect=main.TRUE, actual=onos1Isup,
- onpass="ONOS startup successful",
- onfail="ONOS startup failed" )
-
- main.log.step( "Starting ONOS CLI sessions" )
- cliResults = main.ONOScli1.startOnosCli( ONOS1Ip )
- utilities.assert_equals( expect=main.TRUE, actual=cliResults,
- onpass="ONOS cli startup successful",
- onfail="ONOS cli startup failed" )
-
- if main.params[ 'tcpdump' ].lower() == "true":
- main.step( "Start Packet Capture MN" )
- main.Mininet2.startTcpdump(
- str( main.params[ 'MNtcpdump' ][ 'folder' ] ) + str( main.TEST )
- + "-MN.pcap",
- intf=main.params[ 'MNtcpdump' ][ 'intf' ],
- port=main.params[ 'MNtcpdump' ][ 'port' ] )
-
- main.step( "App Ids check" )
- appCheck = main.ONOScli1.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( CLIs[0].apps() )
- main.log.warn( CLIs[0].appIDs() )
- utilities.assert_equals( expect=main.TRUE, actual=appCheck,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
-
- if cliResults == main.FALSE:
- main.log.error( "Failed to start ONOS, stopping test" )
- main.cleanup()
- main.exit()
-
- def CASE2( self, main ):
- """
- Assign devices to controllers
- """
- import re
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert ONOS1Port, "ONOS1Port not defined"
- assert ONOS2Port, "ONOS2Port not defined"
- assert ONOS3Port, "ONOS3Port not defined"
- assert ONOS4Port, "ONOS4Port not defined"
- assert ONOS5Port, "ONOS5Port not defined"
- assert ONOS6Port, "ONOS6Port not defined"
- assert ONOS7Port, "ONOS7Port not defined"
-
- main.case( "Assigning devices to controllers" )
- main.caseExplaination = "Assign switches to ONOS using 'ovs-vsctl' " +\
- "and check that an ONOS node becomes the " +\
- "master of the device."
- main.step( "Assign switches to controllers" )
-
- ipList = []
- for i in range( numControllers ):
- ipList.append( nodes[ i ].ip_address )
- swList = []
- for i in range( 1, 29 ):
- swList.append( "s" + str( i ) )
- main.Mininet1.assignSwController( sw=swList, ip=ipList )
-
- mastershipCheck = main.TRUE
- for i in range( 1, 29 ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
- try:
- main.log.info( str( response ) )
- except Exception:
- main.log.info( repr( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- mastershipCheck = mastershipCheck and main.TRUE
- else:
- mastershipCheck = main.FALSE
- if mastershipCheck == main.TRUE:
- main.log.info( "Switch mastership assigned correctly" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=mastershipCheck,
- onpass="Switch mastership assigned correctly",
- onfail="Switches not assigned correctly to controllers" )
-
- def CASE21( self, main ):
- """
- Assign mastership to controllers
- """
- import re
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- assert ONOS1Port, "ONOS1Port not defined"
- assert ONOS2Port, "ONOS2Port not defined"
- assert ONOS3Port, "ONOS3Port not defined"
- assert ONOS4Port, "ONOS4Port not defined"
- assert ONOS5Port, "ONOS5Port not defined"
- assert ONOS6Port, "ONOS6Port not defined"
- assert ONOS7Port, "ONOS7Port not defined"
-
- main.case( "Assigning Controller roles for switches" )
- main.caseExplaination = "Check that ONOS is connected to each " +\
- "device. Then manually assign" +\
- " mastership to specific ONOS nodes using" +\
- " 'device-role'"
- main.step( "Assign mastership of switches to specific controllers" )
- roleCall = main.TRUE
- roleCheck = main.TRUE
- try:
- for i in range( 1, 29 ): # switches 1 through 28
- ip = nodes[ 0 ].ip_address # ONOS1
- # set up correct variables:
- if i == 1:
- deviceId = main.ONOScli1.getDevice( "1000" ).get( 'id' )
- elif i == 2:
- deviceId = main.ONOScli1.getDevice( "2000" ).get( 'id' )
- elif i == 3:
- deviceId = main.ONOScli1.getDevice( "3000" ).get( 'id' )
- elif i == 4:
- deviceId = main.ONOScli1.getDevice( "3004" ).get( 'id' )
- elif i == 5:
- deviceId = main.ONOScli1.getDevice( "5000" ).get( 'id' )
- elif i == 6:
- deviceId = main.ONOScli1.getDevice( "6000" ).get( 'id' )
- elif i == 7:
- deviceId = main.ONOScli1.getDevice( "6007" ).get( 'id' )
- elif i >= 8 and i <= 17:
- dpid = '3' + str( i ).zfill( 3 )
- deviceId = main.ONOScli1.getDevice( dpid ).get( 'id' )
- elif i >= 18 and i <= 27:
- dpid = '6' + str( i ).zfill( 3 )
- deviceId = main.ONOScli1.getDevice( dpid ).get( 'id' )
- elif i == 28:
- deviceId = main.ONOScli1.getDevice( "2800" ).get( 'id' )
- else:
- main.log.error( "You didn't write an else statement for " +
- "switch s" + str( i ) )
- # Assign switch
- assert deviceId, "No device id for s" + str( i ) + " in ONOS"
- # TODO: make this controller dynamic
- roleCall = roleCall and main.ONOScli1.deviceRole( deviceId,
- ip )
- # Check assignment
- master = main.ONOScli1.getRole( deviceId ).get( 'master' )
- if ip in master:
- roleCheck = roleCheck and main.TRUE
- else:
- roleCheck = roleCheck and main.FALSE
- main.log.error( "Error, controller " + ip + " is not" +
- " master " + "of device " +
- str( deviceId ) + ". Master is " +
- repr( master ) + "." )
- except ( AttributeError, AssertionError ):
- main.log.exception( "Something is wrong with ONOS device view" )
- main.log.info( main.ONOScli1.devices() )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=roleCall,
- onpass="Re-assigned switch mastership to designated controller",
- onfail="Something wrong with deviceRole calls" )
-
- main.step( "Check mastership was correctly assigned" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=roleCheck,
- onpass="Switches were successfully reassigned to designated " +
- "controller",
- onfail="Switches were not successfully reassigned" )
-
- def CASE3( self, main ):
- """
- Assign intents
- """
- import time
- import json
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- # NOTE: we must reinstall intents until we have a persistant intent
- # datastore!
- main.case( "Adding host Intents" )
- main.caseExplaination = "Discover hosts by using pingall then " +\
- "assign predetermined host-to-host intents." +\
- " After installation, check that the intent" +\
- " is distributed to all nodes and the state" +\
- " is INSTALLED"
-
- # install onos-app-fwd
- main.step( "Install reactive forwarding app" )
- installResults = CLIs[0].activateApp( "org.onosproject.fwd" )
- utilities.assert_equals( expect=main.TRUE, actual=installResults,
- onpass="Install fwd successful",
- onfail="Install fwd failed" )
-
- main.step( "Check app ids" )
- appCheck = main.ONOScli1.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( CLIs[0].apps() )
- main.log.warn( CLIs[0].appIDs() )
- utilities.assert_equals( expect=main.TRUE, actual=appCheck,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
-
- main.step( "Discovering Hosts( Via pingall for now )" )
- # FIXME: Once we have a host discovery mechanism, use that instead
- # REACTIVE FWD test
- pingResult = main.FALSE
- for i in range(2): # Retry if pingall fails first time
- time1 = time.time()
- pingResult = main.Mininet1.pingall()
- if i == 0:
- utilities.assert_equals(
- expect=main.TRUE,
- actual=pingResult,
- onpass="Reactive Pingall test passed",
- onfail="Reactive Pingall failed, " +
- "one or more ping pairs failed" )
- time2 = time.time()
- main.log.info( "Time for pingall: %2f seconds" %
- ( time2 - time1 ) )
- # timeout for fwd flows
- time.sleep( 11 )
- # uninstall onos-app-fwd
- main.step( "Uninstall reactive forwarding app" )
- uninstallResult = CLIs[0].deactivateApp( "org.onosproject.fwd" )
- utilities.assert_equals( expect=main.TRUE, actual=uninstallResult,
- onpass="Uninstall fwd successful",
- onfail="Uninstall fwd failed" )
-
- main.step( "Check app ids" )
- appCheck2 = main.ONOScli1.appToIDCheck()
- if appCheck2 != main.TRUE:
- main.log.warn( CLIs[0].apps() )
- main.log.warn( CLIs[0].appIDs() )
- utilities.assert_equals( expect=main.TRUE, actual=appCheck2,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
-
- main.step( "Add host intents via cli" )
- intentIds = []
- # TODO: move the host numbers to params
- # Maybe look at all the paths we ping?
- intentAddResult = True
- hostResult = main.TRUE
- for i in range( 8, 18 ):
- main.log.info( "Adding host intent between h" + str( i ) +
- " and h" + str( i + 10 ) )
- host1 = "00:00:00:00:00:" + \
- str( hex( i )[ 2: ] ).zfill( 2 ).upper()
- host2 = "00:00:00:00:00:" + \
- str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
- # NOTE: getHost can return None
- host1Dict = main.ONOScli1.getHost( host1 )
- host2Dict = main.ONOScli1.getHost( host2 )
- host1Id = None
- host2Id = None
- if host1Dict and host2Dict:
- host1Id = host1Dict.get( 'id', None )
- host2Id = host2Dict.get( 'id', None )
- if host1Id and host2Id:
- tmpId = main.ONOScli1.addHostIntent( host1Id, host2Id )
- if tmpId:
- main.log.info( "Added intent with id: " + tmpId )
- intentIds.append( tmpId )
- else:
- main.log.error( "addHostIntent returned: " +
- repr( tmpId ) )
- else:
- main.log.error( "Error, getHost() failed for h" + str( i ) +
- " and/or h" + str( i + 10 ) )
- hosts = main.ONOScli1.hosts()
- main.log.warn( "Hosts output: " )
- try:
- main.log.warn( json.dumps( json.loads( hosts ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( hosts ) )
- hostResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE, actual=hostResult,
- onpass="Found a host id for each host",
- onfail="Error looking up host ids" )
-
- intentStart = time.time()
- onosIds = main.ONOScli1.getAllIntentsId()
- main.log.info( "Submitted intents: " + str( intentIds ) )
- main.log.info( "Intents in ONOS: " + str( onosIds ) )
- for intent in intentIds:
- if intent in onosIds:
- pass # intent submitted is in onos
- else:
- intentAddResult = False
- if intentAddResult:
- intentStop = time.time()
- else:
- intentStop = None
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- installedCheck = True
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- try:
- for intent in json.loads( intents ):
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents" )
- # add submitted intents not in the store
- tmplist = [ i for i, s in intentStates ]
- missingIntents = False
- for i in intentIds:
- if i not in tmplist:
- intentStates.append( ( i, " - " ) )
- missingIntents = True
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- leaders = main.ONOScli1.leaders()
- try:
- missing = False
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- missing = True
- else:
- main.log.error( "leaders() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- # Check all nodes
- if missing:
- response = main.ONOScli1.leaders( jsonFormat=False)
- main.log.warn( "ONOS1 leaders output: \n" +
- str( response ) )
-
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
-
- intentAddResult = bool( intentAddResult and not missingIntents and
- installedCheck )
- if not intentAddResult:
- main.log.error( "Error in pushing host intents to ONOS" )
-
- main.step( "Intent Anti-Entropy dispersion" )
- for i in range(100):
- correct = True
- main.log.info( "Submitted intents: " + str( sorted( intentIds ) ) )
- for cli in CLIs:
- onosIds = []
- ids = cli.getAllIntentsId()
- onosIds.append( ids )
- main.log.debug( "Intents in " + cli.name + ": " +
- str( sorted( onosIds ) ) )
- if sorted( ids ) != sorted( intentIds ):
- main.log.warn( "Set of intent IDs doesn't match" )
- correct = False
- break
- else:
- intents = json.loads( cli.intents() )
- for intent in intents:
- if intent[ 'state' ] != "INSTALLED":
- main.log.warn( "Intent " + intent[ 'id' ] +
- " is " + intent[ 'state' ] )
- correct = False
- break
- if correct:
- break
- else:
- time.sleep(1)
- if not intentStop:
- intentStop = time.time()
- global gossipTime
- gossipTime = intentStop - intentStart
- main.log.info( "It took about " + str( gossipTime ) +
- " seconds for all intents to appear in each node" )
- # FIXME: make this time configurable/calculate based off of number of
- # nodes and gossip rounds
- utilities.assert_greater_equals(
- expect=40, actual=gossipTime,
- onpass="ECM anti-entropy for intents worked within " +
- "expected time",
- onfail="Intent ECM anti-entropy took too long" )
- if gossipTime <= 40:
- intentAddResult = True
-
- if not intentAddResult or "key" in pendingMap:
- import time
- installedCheck = True
- main.log.info( "Sleeping 60 seconds to see if intents are found" )
- time.sleep( 60 )
- onosIds = main.ONOScli1.getAllIntentsId()
- main.log.info( "Submitted intents: " + str( intentIds ) )
- main.log.info( "Intents in ONOS: " + str( onosIds ) )
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- try:
- for intent in json.loads( intents ):
- # Iter through intents of a node
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents" )
- # add submitted intents not in the store
- tmplist = [ i for i, s in intentStates ]
- for i in intentIds:
- if i not in tmplist:
- intentStates.append( ( i, " - " ) )
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- leaders = main.ONOScli1.leaders()
- try:
- missing = False
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- # check for election
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- # FIXME: this should only be after we start the app
- topics.append( "org.onosproject.election" )
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- missing = True
- else:
- main.log.error( "leaders() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- # Check all nodes
- if missing:
- response = main.ONOScli1.leaders( jsonFormat=False)
- main.log.warn( "ONOS1 leaders output: \n" +
- str( response ) )
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
-
- def CASE4( self, main ):
- """
- Ping across added host intents
- """
- import json
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- main.case( "Verify connectivity by sendind traffic across Intents" )
- main.caseExplaination = "Ping across added host intents to check " +\
- "functionality and check the state of " +\
- "the intent"
- main.step( "Ping across added host intents" )
- PingResult = main.TRUE
- for i in range( 8, 18 ):
- ping = main.Mininet1.pingHost( src="h" + str( i ),
- target="h" + str( i + 10 ) )
- PingResult = PingResult and ping
- if ping == main.FALSE:
- main.log.warn( "Ping failed between h" + str( i ) +
- " and h" + str( i + 10 ) )
- elif ping == main.TRUE:
- main.log.info( "Ping test passed!" )
- # Don't set PingResult or you'd override failures
- if PingResult == main.FALSE:
- main.log.error(
- "Intents have not been installed correctly, pings failed." )
- # TODO: pretty print
- main.log.warn( "ONOS1 intents: " )
- try:
- tmpIntents = main.ONOScli1.intents()
- main.log.warn( json.dumps( json.loads( tmpIntents ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( tmpIntents ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=PingResult,
- onpass="Intents have been installed correctly and pings work",
- onfail="Intents have not been installed correctly, pings failed." )
-
- main.step( "Check Intent state" )
- installedCheck = True
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- # Iter through intents of a node
- try:
- for intent in json.loads( intents ):
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents." )
- # Print states
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- utilities.assert_equals( expect=True, actual=installedCheck,
- onpass="Intents are all INSTALLED",
- onfail="Intents are not all in " +
- "INSTALLED state" )
-
- main.step( "Check leadership of topics" )
- leaders = main.ONOScli1.leaders()
- topicCheck = main.TRUE
- try:
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- # check for election
- # TODO: Look at Devices as topics now that it uses this system
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- # FIXME: this should only be after we start the app
- # FIXME: topics.append( "org.onosproject.election" )
- # Print leaders output
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- topicCheck = main.FALSE
- else:
- main.log.error( "leaders() returned None" )
- topicCheck = main.FALSE
- except ( ValueError, TypeError ):
- topicCheck = main.FALSE
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- # TODO: Check for a leader of these topics
- utilities.assert_equals( expect=main.TRUE, actual=topicCheck,
- onpass="intent Partitions is in leaders",
- onfail="Some topics were lost " )
- # Print partitions
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- # Print Pending Map
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
-
- if not installedCheck:
- main.log.info( "Waiting 60 seconds to see if the state of " +
- "intents change" )
- time.sleep( 60 )
- # Print the intent states
- intents = main.ONOScli1.intents()
- intentStates = []
- main.log.info( "%-6s%-15s%-15s" % ( 'Count', 'ID', 'State' ) )
- count = 0
- # Iter through intents of a node
- try:
- for intent in json.loads( intents ):
- state = intent.get( 'state', None )
- if "INSTALLED" not in state:
- installedCheck = False
- intentId = intent.get( 'id', None )
- intentStates.append( ( intentId, state ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing intents." )
- intentStates.sort()
- for i, s in intentStates:
- count += 1
- main.log.info( "%-6s%-15s%-15s" %
- ( str( count ), str( i ), str( s ) ) )
- leaders = main.ONOScli1.leaders()
- try:
- missing = False
- if leaders:
- parsedLeaders = json.loads( leaders )
- main.log.warn( json.dumps( parsedLeaders,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # check for all intent partitions
- # check for election
- topics = []
- for i in range( 14 ):
- topics.append( "intent-partition-" + str( i ) )
- # FIXME: this should only be after we start the app
- topics.append( "org.onosproject.election" )
- main.log.debug( topics )
- ONOStopics = [ j['topic'] for j in parsedLeaders ]
- for topic in topics:
- if topic not in ONOStopics:
- main.log.error( "Error: " + topic +
- " not in leaders" )
- missing = True
- else:
- main.log.error( "leaders() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing leaders" )
- main.log.error( repr( leaders ) )
- if missing:
- response = main.ONOScli1.leaders( jsonFormat=False)
- main.log.warn( "ONOS1 leaders output: \n" +
- str( response ) )
- partitions = main.ONOScli1.partitions()
- try:
- if partitions :
- parsedPartitions = json.loads( partitions )
- main.log.warn( json.dumps( parsedPartitions,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check for a leader in all paritions
- # TODO check for consistency among nodes
- else:
- main.log.error( "partitions() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing partitions" )
- main.log.error( repr( partitions ) )
- pendingMap = main.ONOScli1.pendingMap()
- try:
- if pendingMap :
- parsedPending = json.loads( pendingMap )
- main.log.warn( json.dumps( parsedPending,
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- # TODO check something here?
- else:
- main.log.error( "pendingMap() returned None" )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing pending map" )
- main.log.error( repr( pendingMap ) )
- # Print flowrules
- main.log.debug( CLIs[0].flows( jsonFormat=False ) )
- main.step( "Wait a minute then ping again" )
- # the wait is above
- PingResult = main.TRUE
- for i in range( 8, 18 ):
- ping = main.Mininet1.pingHost( src="h" + str( i ),
- target="h" + str( i + 10 ) )
- PingResult = PingResult and ping
- if ping == main.FALSE:
- main.log.warn( "Ping failed between h" + str( i ) +
- " and h" + str( i + 10 ) )
- elif ping == main.TRUE:
- main.log.info( "Ping test passed!" )
- # Don't set PingResult or you'd override failures
- if PingResult == main.FALSE:
- main.log.error(
- "Intents have not been installed correctly, pings failed." )
- # TODO: pretty print
- main.log.warn( "ONOS1 intents: " )
- try:
- tmpIntents = main.ONOScli1.intents()
- main.log.warn( json.dumps( json.loads( tmpIntents ),
- sort_keys=True,
- indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.warn( repr( tmpIntents ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=PingResult,
- onpass="Intents have been installed correctly and pings work",
- onfail="Intents have not been installed correctly, pings failed." )
-
- def CASE5( self, main ):
- """
- Reading state of ONOS
- """
- import json
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
-
- main.case( "Setting up and gathering data for current state" )
- # The general idea for this test case is to pull the state of
- # ( intents,flows, topology,... ) from each ONOS node
- # We can then compare them with each other and also with past states
-
- main.step( "Check that each switch has a master" )
- global mastershipState
- mastershipState = '[]'
-
- # Assert that each device has a master
- rolesNotNull = main.ONOScli1.rolesNotNull()
- utilities.assert_equals(
- expect=main.TRUE,
- actual=rolesNotNull,
- onpass="Each device has a master",
- onfail="Some devices don't have a master assigned" )
-
- main.step( "Get the Mastership of each switch" )
- ONOS1Mastership = main.ONOScli1.roles()
- # TODO: Make this a meaningful check
- if "Error" in ONOS1Mastership or not ONOS1Mastership:
- main.log.error( "Error in getting ONOS roles" )
- main.log.warn(
- "ONOS1 mastership response: " +
- repr( ONOS1Mastership ) )
- consistentMastership = main.FALSE
- else:
- mastershipState = ONOS1Mastership
- consistentMastership = main.TRUE
-
- main.step( "Get the intents from each controller" )
- global intentState
- intentState = []
- ONOS1Intents = main.ONOScli1.intents( jsonFormat=True )
- intentCheck = main.FALSE
- if "Error" in ONOS1Intents or not ONOS1Intents:
- main.log.error( "Error in getting ONOS intents" )
- main.log.warn( "ONOS1 intents response: " + repr( ONOS1Intents ) )
- else:
- intentCheck = main.TRUE
-
- main.step( "Get the flows from each controller" )
- global flowState
- flowState = []
- flowCheck = main.FALSE
- ONOS1Flows = main.ONOScli1.flows( jsonFormat=True )
- if "Error" in ONOS1Flows or not ONOS1Flows:
- main.log.error( "Error in getting ONOS flows" )
- main.log.warn( "ONOS1 flows repsponse: " + ONOS1Flows )
- else:
- # TODO: Do a better check, maybe compare flows on switches?
- flowState = ONOS1Flows
- flowCheck = main.TRUE
-
- main.step( "Get the OF Table entries" )
- global flows
- flows = []
- for i in range( 1, 29 ):
- flows.append( main.Mininet2.getFlowTable( 1.3, "s" + str( i ) ) )
- if flowCheck == main.FALSE:
- for table in flows:
- main.log.warn( table )
- # TODO: Compare switch flow tables with ONOS flow tables
-
- main.step( "Collecting topology information from ONOS" )
- devices = []
- devices.append( main.ONOScli1.devices() )
- hosts = []
- hosts.append( json.loads( main.ONOScli1.hosts() ) )
- ports = []
- ports.append( main.ONOScli1.ports() )
- links = []
- links.append( main.ONOScli1.links() )
- clusters = []
- clusters.append( main.ONOScli1.clusters() )
-
- main.step( "Each host has an IP address" )
- ipResult = main.TRUE
- for controller in range( 0, len( hosts ) ):
- controllerStr = str( controller + 1 )
- for host in hosts[ controller ]:
- if host is None or host.get( 'ipAddresses', [] ) == []:
- main.log.error(
- "DEBUG:Error with host ips on controller" +
- controllerStr + ": " + str( host ) )
- ipResult = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=ipResult,
- onpass="The ips of the hosts aren't empty",
- onfail="The ip of at least one host is missing" )
-
- # there should always only be one cluster
- main.step( "There is only one dataplane cluster" )
- try:
- numClusters = len( json.loads( clusters[ 0 ] ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Error parsing clusters[0]: " +
- repr( clusters[ 0 ] ) )
- clusterResults = main.FALSE
- if numClusters == 1:
- clusterResults = main.TRUE
- utilities.assert_equals(
- expect=1,
- actual=numClusters,
- onpass="ONOS shows 1 SCC",
- onfail="ONOS shows " + str( numClusters ) + " SCCs" )
-
- main.step( "Comparing ONOS topology to MN" )
- devicesResults = main.TRUE
- linksResults = main.TRUE
- hostsResults = main.TRUE
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
- mnHosts = main.Mininet1.getHosts()
- for controller in range( numControllers ):
- controllerStr = str( controller + 1 )
- if devices[ controller ] and ports[ controller ] and\
- "Error" not in devices[ controller ] and\
- "Error" not in ports[ controller ]:
-
- currentDevicesResult = main.Mininet1.compareSwitches(
- mnSwitches,
- json.loads( devices[ controller ] ),
- json.loads( ports[ controller ] ) )
- else:
- currentDevicesResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentDevicesResult,
- onpass="ONOS" + controllerStr +
- " Switches view is correct",
- onfail="ONOS" + controllerStr +
- " Switches view is incorrect" )
- if links[ controller ] and "Error" not in links[ controller ]:
- currentLinksResult = main.Mininet1.compareLinks(
- mnSwitches, mnLinks,
- json.loads( links[ controller ] ) )
- else:
- currentLinksResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentLinksResult,
- onpass="ONOS" + controllerStr +
- " links view is correct",
- onfail="ONOS" + controllerStr +
- " links view is incorrect" )
-
- if hosts[ controller ] or "Error" not in hosts[ controller ]:
- currentHostsResult = main.Mininet1.compareHosts(
- mnHosts,
- hosts[ controller ] )
- else:
- currentHostsResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentHostsResult,
- onpass="ONOS" + controllerStr +
- " hosts exist in Mininet",
- onfail="ONOS" + controllerStr +
- " hosts don't match Mininet" )
-
- devicesResults = devicesResults and currentDevicesResult
- linksResults = linksResults and currentLinksResult
- hostsResults = hostsResults and currentHostsResult
-
- main.step( "Device information is correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=devicesResults,
- onpass="Device information is correct",
- onfail="Device information is incorrect" )
-
- main.step( "Links are correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linksResults,
- onpass="Link are correct",
- onfail="Links are incorrect" )
-
- main.step( "Hosts are correct" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=hostsResults,
- onpass="Hosts are correct",
- onfail="Hosts are incorrect" )
-
- def CASE6( self, main ):
- """
- The Failure case.
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
-
- # Reset non-persistent variables
- try:
- iCounterValue = 0
- except NameError:
- main.log.error( "iCounterValue not defined, setting to 0" )
- iCounterValue = 0
-
- main.case( "Restart ONOS node" )
- main.caseExplaination = "Killing ONOS process and restart cli " +\
- "sessions once onos is up."
- main.step( "Killing ONOS processes" )
- killResult = main.ONOSbench.onosKill( ONOS1Ip )
- start = time.time()
- utilities.assert_equals( expect=main.TRUE, actual=killResult,
- onpass="ONOS Killed",
- onfail="Error killing ONOS" )
-
- main.step( "Checking if ONOS is up yet" )
- count = 0
- while count < 10:
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if onos1Isup == main.TRUE:
- elapsed = time.time() - start
- break
- else:
- count = count + 1
- utilities.assert_equals( expect=main.TRUE, actual=onos1Isup,
- onpass="ONOS is back up",
- onfail="ONOS failed to start" )
-
- main.log.step( "Starting ONOS CLI sessions" )
- cliResults = main.ONOScli1.startOnosCli( ONOS1Ip )
- utilities.assert_equals( expect=main.TRUE, actual=cliResults,
- onpass="ONOS cli startup successful",
- onfail="ONOS cli startup failed" )
-
- if elapsed:
- main.log.info( "ESTIMATE: ONOS took %s seconds to restart" %
- str( elapsed ) )
- main.restartTime = elapsed
- else:
- main.restartTime = -1
- time.sleep( 5 )
- # rerun on election apps
- main.ONOScli1.electionTestRun()
-
- def CASE7( self, main ):
- """
- Check state after ONOS failure
- """
- import json
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- main.case( "Running ONOS Constant State Tests" )
- main.step( "Check that each switch has a master" )
- # Assert that each device has a master
- rolesNotNull = main.ONOScli1.rolesNotNull()
- utilities.assert_equals(
- expect=main.TRUE,
- actual=rolesNotNull,
- onpass="Each device has a master",
- onfail="Some devices don't have a master assigned" )
-
- main.step( "Check if switch roles are consistent across all nodes" )
- ONOS1Mastership = main.ONOScli1.roles()
- # FIXME: Refactor this whole case for single instance
- if "Error" in ONOS1Mastership or not ONOS1Mastership:
- main.log.error( "Error in getting ONOS mastership" )
- main.log.warn( "ONOS1 mastership response: " +
- repr( ONOS1Mastership ) )
- consistentMastership = main.FALSE
- else:
- consistentMastership = main.TRUE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=consistentMastership,
- onpass="Switch roles are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of switch roles" )
-
- description2 = "Compare switch roles from before failure"
- main.step( description2 )
-
- currentJson = json.loads( ONOS1Mastership )
- oldJson = json.loads( mastershipState )
- mastershipCheck = main.TRUE
- for i in range( 1, 29 ):
- switchDPID = str(
- main.Mininet1.getSwitchDPID( switch="s" + str( i ) ) )
-
- current = [ switch[ 'master' ] for switch in currentJson
- if switchDPID in switch[ 'id' ] ]
- old = [ switch[ 'master' ] for switch in oldJson
- if switchDPID in switch[ 'id' ] ]
- if current == old:
- mastershipCheck = mastershipCheck and main.TRUE
- else:
- main.log.warn( "Mastership of switch %s changed" % switchDPID )
- mastershipCheck = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=mastershipCheck,
- onpass="Mastership of Switches was not changed",
- onfail="Mastership of some switches changed" )
- mastershipCheck = mastershipCheck and consistentMastership
-
- main.step( "Get the intents and compare across all nodes" )
- ONOS1Intents = main.ONOScli1.intents( jsonFormat=True )
- intentCheck = main.FALSE
- if "Error" in ONOS1Intents or not ONOS1Intents:
- main.log.error( "Error in getting ONOS intents" )
- main.log.warn( "ONOS1 intents response: " + repr( ONOS1Intents ) )
- else:
- intentCheck = main.TRUE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=intentCheck,
- onpass="Intents are consistent across all ONOS nodes",
- onfail="ONOS nodes have different views of intents" )
- # Print the intent states
- intents = []
- intents.append( ONOS1Intents )
- intentStates = []
- for node in intents: # Iter through ONOS nodes
- nodeStates = []
- # Iter through intents of a node
- for intent in json.loads( node ):
- nodeStates.append( intent[ 'state' ] )
- intentStates.append( nodeStates )
- out = [ (i, nodeStates.count( i ) ) for i in set( nodeStates ) ]
- main.log.info( dict( out ) )
-
- # NOTE: Store has no durability, so intents are lost across system
- # restarts
- """
- main.step( "Compare current intents with intents before the failure" )
- # NOTE: this requires case 5 to pass for intentState to be set.
- # maybe we should stop the test if that fails?
- sameIntents = main.FALSE
- if intentState and intentState == ONOSIntents[ 0 ]:
- sameIntents = main.TRUE
- main.log.info( "Intents are consistent with before failure" )
- # TODO: possibly the states have changed? we may need to figure out
- # what the acceptable states are
- elif len( intentState ) == len( ONOSIntents[ 0 ] ):
- sameIntents = main.TRUE
- try:
- before = json.loads( intentState )
- after = json.loads( ONOSIntents[ 0 ] )
- for intent in before:
- if intent not in after:
- sameIntents = main.FALSE
- main.log.debug( "Intent is not currently in ONOS " +
- "(at least in the same form):" )
- main.log.debug( json.dumps( intent ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Exception printing intents" )
- main.log.debug( repr( ONOSIntents[0] ) )
- main.log.debug( repr( intentState ) )
- if sameIntents == main.FALSE:
- try:
- main.log.debug( "ONOS intents before: " )
- main.log.debug( json.dumps( json.loads( intentState ),
- sort_keys=True, indent=4,
- separators=( ',', ': ' ) ) )
- main.log.debug( "Current ONOS intents: " )
- main.log.debug( json.dumps( json.loads( ONOSIntents[ 0 ] ),
- sort_keys=True, indent=4,
- separators=( ',', ': ' ) ) )
- except ( ValueError, TypeError ):
- main.log.exception( "Exception printing intents" )
- main.log.debug( repr( ONOSIntents[0] ) )
- main.log.debug( repr( intentState ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=sameIntents,
- onpass="Intents are consistent with before failure",
- onfail="The Intents changed during failure" )
- intentCheck = intentCheck and sameIntents
- """
- main.step( "Get the OF Table entries and compare to before " +
- "component failure" )
- FlowTables = main.TRUE
- flows2 = []
- for i in range( 28 ):
- main.log.info( "Checking flow table on s" + str( i + 1 ) )
- tmpFlows = main.Mininet2.getFlowTable( 1.3, "s" + str( i + 1 ) )
- flows2.append( tmpFlows )
- tempResult = main.Mininet2.flowComp(
- flow1=flows[ i ],
- flow2=tmpFlows )
- FlowTables = FlowTables and tempResult
- if FlowTables == main.FALSE:
- main.log.info( "Differences in flow table for switch: s" +
- str( i + 1 ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=FlowTables,
- onpass="No changes were found in the flow tables",
- onfail="Changes were found in the flow tables" )
-
- main.step( "Leadership Election is still functional" )
- # Test of LeadershipElection
-
- leader = ONOS1Ip
- leaderResult = main.TRUE
- for controller in range( 1, numControllers + 1 ):
- # loop through ONOScli handlers
- node = getattr( main, ( 'ONOScli' + str( controller ) ) )
- leaderN = node.electionTestLeader()
- # verify leader is ONOS1
- # NOTE even though we restarted ONOS, it is the only one so onos 1
- # must be leader
- if leaderN == leader:
- # all is well
- pass
- elif leaderN == main.FALSE:
- # error in response
- main.log.error( "Something is wrong with " +
- "electionTestLeader function, check the" +
- " error logs" )
- leaderResult = main.FALSE
- elif leader != leaderN:
- leaderResult = main.FALSE
- main.log.error( "ONOS" + str( controller ) + " sees " +
- str( leaderN ) +
- " as the leader of the election app. " +
- "Leader should be " + str( leader ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Leadership election passed",
- onfail="Something went wrong with Leadership election" )
-
- def CASE8( self, main ):
- """
- Compare topo
- """
- import json
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
-
- main.case( "Compare ONOS Topology view to Mininet topology" )
- main.caseExplaination = "Compare topology objects between Mininet" +\
- " and ONOS"
-
- main.step( "Comparing ONOS topology to MN" )
- devicesResults = main.TRUE
- linksResults = main.TRUE
- hostsResults = main.TRUE
- hostAttachmentResults = True
- topoResult = main.FALSE
- elapsed = 0
- count = 0
- main.step( "Collecting topology information from ONOS" )
- startTime = time.time()
- # Give time for Gossip to work
- while topoResult == main.FALSE and elapsed < 60:
- count += 1
- cliStart = time.time()
- devices = []
- devices.append( main.ONOScli1.devices() )
- hosts = []
- hosts.append( json.loads( main.ONOScli1.hosts() ) )
- ipResult = main.TRUE
- for controller in range( 0, len( hosts ) ):
- controllerStr = str( controller + 1 )
- for host in hosts[ controller ]:
- if host is None or host.get( 'ipAddresses', [] ) == []:
- main.log.error(
- "DEBUG:Error with host ips on controller" +
- controllerStr + ": " + str( host ) )
- ipResult = main.FALSE
- ports = []
- ports.append( main.ONOScli1.ports() )
- links = []
- links.append( main.ONOScli1.links() )
- clusters = []
- clusters.append( main.ONOScli1.clusters() )
-
- elapsed = time.time() - startTime
- cliTime = time.time() - cliStart
- print "CLI time: " + str( cliTime )
-
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
- mnHosts = main.Mininet1.getHosts()
- for controller in range( numControllers ):
- controllerStr = str( controller + 1 )
- if devices[ controller ] and ports[ controller ] and\
- "Error" not in devices[ controller ] and\
- "Error" not in ports[ controller ]:
-
- currentDevicesResult = main.Mininet1.compareSwitches(
- mnSwitches,
- json.loads( devices[ controller ] ),
- json.loads( ports[ controller ] ) )
- else:
- currentDevicesResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentDevicesResult,
- onpass="ONOS" + controllerStr +
- " Switches view is correct",
- onfail="ONOS" + controllerStr +
- " Switches view is incorrect" )
-
- if links[ controller ] and "Error" not in links[ controller ]:
- currentLinksResult = main.Mininet1.compareLinks(
- mnSwitches, mnLinks,
- json.loads( links[ controller ] ) )
- else:
- currentLinksResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentLinksResult,
- onpass="ONOS" + controllerStr +
- " links view is correct",
- onfail="ONOS" + controllerStr +
- " links view is incorrect" )
-
- if hosts[ controller ] or "Error" not in hosts[ controller ]:
- currentHostsResult = main.Mininet1.compareHosts(
- mnHosts,
- hosts[ controller ] )
- else:
- currentHostsResult = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=currentHostsResult,
- onpass="ONOS" + controllerStr +
- " hosts exist in Mininet",
- onfail="ONOS" + controllerStr +
- " hosts don't match Mininet" )
- # CHECKING HOST ATTACHMENT POINTS
- hostAttachment = True
- zeroHosts = False
- # FIXME: topo-HA/obelisk specific mappings:
- # key is mac and value is dpid
- mappings = {}
- for i in range( 1, 29 ): # hosts 1 through 28
- # set up correct variables:
- macId = "00:" * 5 + hex( i ).split( "0x" )[1].upper().zfill(2)
- if i == 1:
- deviceId = "1000".zfill(16)
- elif i == 2:
- deviceId = "2000".zfill(16)
- elif i == 3:
- deviceId = "3000".zfill(16)
- elif i == 4:
- deviceId = "3004".zfill(16)
- elif i == 5:
- deviceId = "5000".zfill(16)
- elif i == 6:
- deviceId = "6000".zfill(16)
- elif i == 7:
- deviceId = "6007".zfill(16)
- elif i >= 8 and i <= 17:
- dpid = '3' + str( i ).zfill( 3 )
- deviceId = dpid.zfill(16)
- elif i >= 18 and i <= 27:
- dpid = '6' + str( i ).zfill( 3 )
- deviceId = dpid.zfill(16)
- elif i == 28:
- deviceId = "2800".zfill(16)
- mappings[ macId ] = deviceId
- if hosts[ controller ] or "Error" not in hosts[ controller ]:
- if hosts[ controller ] == []:
- main.log.warn( "There are no hosts discovered" )
- zeroHosts = True
- else:
- for host in hosts[ controller ]:
- mac = None
- location = None
- device = None
- port = None
- try:
- mac = host.get( 'mac' )
- assert mac, "mac field could not be found for this host object"
-
- location = host.get( 'location' )
- assert location, "location field could not be found for this host object"
-
- # Trim the protocol identifier off deviceId
- device = str( location.get( 'elementId' ) ).split(':')[1]
- assert device, "elementId field could not be found for this host location object"
-
- port = location.get( 'port' )
- assert port, "port field could not be found for this host location object"
-
- # Now check if this matches where they should be
- if mac and device and port:
- if str( port ) != "1":
- main.log.error( "The attachment port is incorrect for " +
- "host " + str( mac ) +
- ". Expected: 1 Actual: " + str( port) )
- hostAttachment = False
- if device != mappings[ str( mac ) ]:
- main.log.error( "The attachment device is incorrect for " +
- "host " + str( mac ) +
- ". Expected: " + mappings[ str( mac ) ] +
- " Actual: " + device )
- hostAttachment = False
- else:
- hostAttachment = False
- except AssertionError:
- main.log.exception( "Json object not as expected" )
- main.log.error( repr( host ) )
- hostAttachment = False
- else:
- main.log.error( "No hosts json output or \"Error\"" +
- " in output. hosts = " +
- repr( hosts[ controller ] ) )
- if zeroHosts is False:
- hostAttachment = True
-
-
- devicesResults = devicesResults and currentDevicesResult
- linksResults = linksResults and currentLinksResult
- hostsResults = hostsResults and currentHostsResult
- hostAttachmentResults = hostAttachmentResults and\
- hostAttachment
-
- # "consistent" results don't make sense for single instance
- # there should always only be one cluster
- numClusters = len( json.loads( clusters[ 0 ] ) )
- clusterResults = main.FALSE
- if numClusters == 1:
- clusterResults = main.TRUE
- utilities.assert_equals(
- expect=1,
- actual=numClusters,
- onpass="ONOS shows 1 SCC",
- onfail="ONOS shows " + str( numClusters ) + " SCCs" )
-
- topoResult = ( devicesResults and linksResults
- and hostsResults and ipResult and clusterResults and
- hostAttachmentResults )
-
- topoResult = topoResult and int( count <= 2 )
- note = "note it takes about " + str( int( cliTime ) ) + \
- " seconds for the test to make all the cli calls to fetch " +\
- "the topology from each ONOS instance"
- main.log.info(
- "Very crass estimate for topology discovery/convergence( " +
- str( note ) + " ): " + str( elapsed ) + " seconds, " +
- str( count ) + " tries" )
- utilities.assert_equals( expect=main.TRUE, actual=topoResult,
- onpass="Topology Check Test successful",
- onfail="Topology Check Test NOT successful" )
-
- def CASE9( self, main ):
- """
- Link s3-s28 down
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- # NOTE: You should probably run a topology check after this
-
- linkSleep = float( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- description = "Turn off a link to ensure that Link Discovery " +\
- "is working properly"
- main.case( description )
-
- main.step( "Kill Link between s3 and s28" )
- LinkDown = main.Mininet1.link( END1="s3", END2="s28", OPTION="down" )
- main.log.info( "Waiting " + str( linkSleep ) +
- " seconds for link down to be discovered" )
- time.sleep( linkSleep )
- utilities.assert_equals( expect=main.TRUE, actual=LinkDown,
- onpass="Link down successful",
- onfail="Failed to bring link down" )
- # TODO do some sort of check here
-
- def CASE10( self, main ):
- """
- Link s3-s28 up
- """
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- # NOTE: You should probably run a topology check after this
-
- linkSleep = float( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- description = "Restore a link to ensure that Link Discovery is " + \
- "working properly"
- main.case( description )
-
- main.step( "Bring link between s3 and s28 back up" )
- LinkUp = main.Mininet1.link( END1="s3", END2="s28", OPTION="up" )
- main.log.info( "Waiting " + str( linkSleep ) +
- " seconds for link up to be discovered" )
- time.sleep( linkSleep )
- utilities.assert_equals( expect=main.TRUE, actual=LinkUp,
- onpass="Link up successful",
- onfail="Failed to bring link up" )
- # TODO do some sort of check here
-
- def CASE11( self, main ):
- """
- Switch Down
- """
- # NOTE: You should probably run a topology check after this
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
-
- switchSleep = float( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
-
- description = "Killing a switch to ensure it is discovered correctly"
- main.case( description )
- switch = main.params[ 'kill' ][ 'switch' ]
- switchDPID = main.params[ 'kill' ][ 'dpid' ]
-
- # TODO: Make this switch parameterizable
- main.step( "Kill " + switch )
- main.log.info( "Deleting " + switch )
- main.Mininet1.delSwitch( switch )
- main.log.info( "Waiting " + str( switchSleep ) +
- " seconds for switch down to be discovered" )
- time.sleep( switchSleep )
- device = main.ONOScli1.getDevice( dpid=switchDPID )
- # Peek at the deleted switch
- main.log.warn( str( device ) )
- result = main.FALSE
- if device and device[ 'available' ] is False:
- result = main.TRUE
- utilities.assert_equals( expect=main.TRUE, actual=result,
- onpass="Kill switch successful",
- onfail="Failed to kill switch?" )
-
- def CASE12( self, main ):
- """
- Switch Up
- """
- # NOTE: You should probably run a topology check after this
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert ONOS1Port, "ONOS1Port not defined"
- assert ONOS2Port, "ONOS2Port not defined"
- assert ONOS3Port, "ONOS3Port not defined"
- assert ONOS4Port, "ONOS4Port not defined"
- assert ONOS5Port, "ONOS5Port not defined"
- assert ONOS6Port, "ONOS6Port not defined"
- assert ONOS7Port, "ONOS7Port not defined"
-
- switchSleep = float( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
- switch = main.params[ 'kill' ][ 'switch' ]
- switchDPID = main.params[ 'kill' ][ 'dpid' ]
- links = main.params[ 'kill' ][ 'links' ].split()
- description = "Adding a switch to ensure it is discovered correctly"
- main.case( description )
-
- main.step( "Add back " + switch )
- main.Mininet1.addSwitch( switch, dpid=switchDPID )
- for peer in links:
- main.Mininet1.addLink( switch, peer )
- ipList = []
- for i in range( numControllers ):
- ipList.append( nodes[ i ].ip_address )
- main.Mininet1.assignSwController( sw=switch, ip=ipList )
- main.log.info( "Waiting " + str( switchSleep ) +
- " seconds for switch up to be discovered" )
- time.sleep( switchSleep )
- device = main.ONOScli1.getDevice( dpid=switchDPID )
- # Peek at the deleted switch
- main.log.warn( str( device ) )
- result = main.FALSE
- if device and device[ 'available' ]:
- result = main.TRUE
- utilities.assert_equals( expect=main.TRUE, actual=result,
- onpass="add switch successful",
- onfail="Failed to add switch?" )
-
- def CASE13( self, main ):
- """
- Clean up
- """
- import os
- import time
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- # printing colors to terminal
- colors = { 'cyan': '\033[96m', 'purple': '\033[95m',
- 'blue': '\033[94m', 'green': '\033[92m',
- 'yellow': '\033[93m', 'red': '\033[91m', 'end': '\033[0m' }
- main.case( "Test Cleanup" )
- main.step( "Killing tcpdumps" )
- main.Mininet2.stopTcpdump()
-
- main.step( "Copying MN pcap and ONOS log files to test station" )
- testname = main.TEST
- teststationUser = main.params[ 'TESTONUSER' ]
- teststationIP = main.params[ 'TESTONIP' ]
- # NOTE: MN Pcap file is being saved to ~/packet_captures
- # scp this file as MN and TestON aren't necessarily the same vm
- # FIXME: scp
- # mn files
- # TODO: Load these from params
- # NOTE: must end in /
- logFolder = "/opt/onos/log/"
- logFiles = [ "karaf.log", "karaf.log.1" ]
- # NOTE: must end in /
- dstDir = "~/packet_captures/"
- for f in logFiles:
- main.ONOSbench.handle.sendline( "scp sdn@" + ONOS1Ip + ":" +
- logFolder + f + " " +
- teststationUser + "@" +
- teststationIP + ":" + dstDir +
- str( testname ) + "-ONOS1-" + f )
- main.ONOSbench.handle.expect( "\$" )
-
- # std*.log's
- # NOTE: must end in /
- logFolder = "/opt/onos/var/"
- logFiles = [ "stderr.log", "stdout.log" ]
- # NOTE: must end in /
- dstDir = "~/packet_captures/"
- for f in logFiles:
- main.ONOSbench.handle.sendline( "scp sdn@" + ONOS1Ip + ":" +
- logFolder + f + " " +
- teststationUser + "@" +
- teststationIP + ":" + dstDir +
- str( testname ) + "-ONOS1-" + f )
- main.ONOSbench.handle.expect( "\$" )
- # sleep so scp can finish
- time.sleep( 10 )
-
- main.step( "Stopping Mininet" )
- mnResult = main.Mininet1.stopNet()
- utilities.assert_equals( expect=main.TRUE, actual=mnResult,
- onpass="Mininet stopped",
- onfail="MN cleanup NOT successful" )
-
- main.step( "Checking ONOS Logs for errors" )
- print colors[ 'purple' ] + "Checking logs for errors on ONOS1:" + \
- colors[ 'end' ]
- print main.ONOSbench.checkLogs( ONOS1Ip, restart=True )
-
- main.step( "Packing and rotating pcap archives" )
- os.system( "~/TestON/dependencies/rotate.sh " + str( testname ) )
-
- try:
- timerLog = open( main.logdir + "/Timers.csv", 'w')
- # Overwrite with empty line and close
- labels = "Gossip Intents, Restart"
- data = str( gossipTime ) + ", " + str( main.restartTime )
- timerLog.write( labels + "\n" + data )
- timerLog.close()
- except NameError, e:
- main.log.exception(e)
-
- def CASE14( self, main ):
- """
- start election app on all onos nodes
- """
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
-
- main.case("Start Leadership Election app")
- main.step( "Install leadership election app" )
- appResult = main.ONOScli1.activateApp( "org.onosproject.election" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=appResult,
- onpass="Election app installed",
- onfail="Something went wrong with installing Leadership election" )
-
- main.step( "Run for election on each node" )
- leaderResult = main.ONOScli1.electionTestRun()
- # check for leader
- leader = main.ONOScli1.electionTestLeader()
- # verify leader is ONOS1
- if leader == ONOS1Ip:
- # all is well
- pass
- elif leader is None:
- # No leader elected
- main.log.error( "No leader was elected" )
- leaderResult = main.FALSE
- elif leader == main.FALSE:
- # error in response
- # TODO: add check for "Command not found:" in the driver, this
- # means the app isn't loaded
- main.log.error( "Something is wrong with electionTestLeader" +
- " function, check the error logs" )
- leaderResult = main.FALSE
- else:
- # error in response
- main.log.error(
- "Unexpected response from electionTestLeader function:'" +
- str( leader ) +
- "'" )
- leaderResult = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Successfully ran for leadership",
- onfail="Failed to run for leadership" )
-
- def CASE15( self, main ):
- """
- Check that Leadership Election is still functional
- """
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- leaderResult = main.TRUE
- description = "Check that Leadership Election is still functional"
- main.case( description )
- main.step( "Find current leader and withdraw" )
- leader = main.ONOScli1.electionTestLeader()
- # do some sanity checking on leader before using it
- withdrawResult = main.FALSE
- if leader == ONOS1Ip:
- oldLeader = getattr( main, "ONOScli1" )
- elif leader is None or leader == main.FALSE:
- main.log.error(
- "Leader for the election app should be an ONOS node," +
- "instead got '" + str( leader ) + "'" )
- leaderResult = main.FALSE
- oldLeader = None
- else:
- main.log.error( "Leader election --- why am I HERE?!?")
- leaderResult = main.FALSE
- oldLeader = None
- if oldLeader:
- withdrawResult = oldLeader.electionTestWithdraw()
- utilities.assert_equals(
- expect=main.TRUE,
- actual=withdrawResult,
- onpass="Node was withdrawn from election",
- onfail="Node was not withdrawn from election" )
-
- main.step( "Make sure new leader is elected" )
- leaderN = main.ONOScli1.electionTestLeader()
- if leaderN == leader:
- main.log.error( "ONOS still sees " + str( leaderN ) +
- " as leader after they withdrew" )
- leaderResult = main.FALSE
- elif leaderN == main.FALSE:
- # error in response
- # TODO: add check for "Command not found:" in the driver, this
- # means the app isn't loaded
- main.log.error( "Something is wrong with electionTestLeader " +
- "function, check the error logs" )
- leaderResult = main.FALSE
- elif leaderN is None:
- main.log.info(
- "There is no leader after the app withdrew from election" )
- leaderResult = main.TRUE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=leaderResult,
- onpass="Leadership election passed",
- onfail="Something went wrong with Leadership election" )
-
- main.step( "Run for election on old leader( just so everyone " +
- "is in the hat )" )
- if oldLeader:
- runResult = oldLeader.electionTestRun()
- else:
- runResult = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=runResult,
- onpass="App re-ran for election",
- onfail="App failed to run for election" )
-
- main.step( "Node became leader when it ran for election" )
- afterRun = main.ONOScli1.electionTestLeader()
- # verify leader is ONOS1
- if afterRun == ONOS1Ip:
- afterResult = main.TRUE
- else:
- afterResult = main.FALSE
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=afterResult,
- onpass="Old leader successfully re-ran for election",
- onfail="Something went wrong with Leadership election after " +
- "the old leader re-ran for election" )
-
- def CASE16( self, main ):
- """
- Install Distributed Primitives app
- """
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
-
- # Variables for the distributed primitives tests
- global pCounterName
- global iCounterName
- global pCounterValue
- global iCounterValue
- global onosSet
- global onosSetName
- pCounterName = "TestON-Partitions"
- iCounterName = "TestON-inMemory"
- pCounterValue = 0
- iCounterValue = 0
- onosSet = set([])
- onosSetName = "TestON-set"
-
- description = "Install Primitives app"
- main.case( description )
- main.step( "Install Primitives app" )
- appName = "org.onosproject.distributedprimitives"
- appResults = CLIs[0].activateApp( appName )
- utilities.assert_equals( expect=main.TRUE,
- actual=appResults,
- onpass="Primitives app activated",
- onfail="Primitives app not activated" )
-
- def CASE17( self, main ):
- """
- Check for basic functionality with distributed primitives
- """
- import json
- # Make sure variables are defined/set
- assert numControllers, "numControllers not defined"
- assert main, "main not defined"
- assert utilities.assert_equals, "utilities.assert_equals not defined"
- assert CLIs, "CLIs not defined"
- assert nodes, "nodes not defined"
- assert pCounterName, "pCounterName not defined"
- assert iCounterName, "iCounterName not defined"
- assert onosSetName, "onosSetName not defined"
- # NOTE: assert fails if value is 0/None/Empty/False
- try:
- pCounterValue
- except NameError:
- main.log.error( "pCounterValue not defined, setting to 0" )
- pCounterValue = 0
- try:
- iCounterValue
- except NameError:
- main.log.error( "iCounterValue not defined, setting to 0" )
- iCounterValue = 0
- try:
- onosSet
- except NameError:
- main.log.error( "onosSet not defined, setting to empty Set" )
- onosSet = set([])
- # Variables for the distributed primitives tests. These are local only
- addValue = "a"
- addAllValue = "a b c d e f"
- retainValue = "c d e f"
-
- description = "Check for basic functionality with distributed " +\
- "primitives"
- main.case( description )
- main.caseExplaination = "Test the methods of the distributed primitives (counters and sets) throught the cli"
- # DISTRIBUTED ATOMIC COUNTERS
- main.step( "Increment and get a default counter on each node" )
- pCounters = []
- threads = []
- addedPValues = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].counterTestIncrement,
- name="counterIncrement-" + str( i ),
- args=[ pCounterName ] )
- pCounterValue += 1
- addedPValues.append( pCounterValue )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- pCounters.append( t.result )
- # Check that counter incremented numController times
- pCounterResults = True
- for i in addedPValues:
- tmpResult = i in pCounters
- pCounterResults = pCounterResults and tmpResult
- if not tmpResult:
- main.log.error( str( i ) + " is not in partitioned "
- "counter incremented results" )
- utilities.assert_equals( expect=True,
- actual=pCounterResults,
- onpass="Default counter incremented",
- onfail="Error incrementing default" +
- " counter" )
-
- main.step( "Increment and get an in memory counter on each node" )
- iCounters = []
- addedIValues = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].counterTestIncrement,
- name="icounterIncrement-" + str( i ),
- args=[ iCounterName ],
- kwargs={ "inMemory": True } )
- iCounterValue += 1
- addedIValues.append( iCounterValue )
- threads.append( t )
- t.start()
-
- for t in threads:
- t.join()
- iCounters.append( t.result )
- # Check that counter incremented numController times
- iCounterResults = True
- for i in addedIValues:
- tmpResult = i in iCounters
- iCounterResults = iCounterResults and tmpResult
- if not tmpResult:
- main.log.error( str( i ) + " is not in the in-memory "
- "counter incremented results" )
- utilities.assert_equals( expect=True,
- actual=iCounterResults,
- onpass="In memory counter incremented",
- onfail="Error incrementing in memory" +
- " counter" )
-
- main.step( "Check counters are consistant across nodes" )
- onosCounters = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].counters,
- name="counters-" + str( i ) )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- onosCounters.append( t.result )
- tmp = [ i == onosCounters[ 0 ] for i in onosCounters ]
- if all( tmp ):
- main.log.info( "Counters are consistent across all nodes" )
- consistentCounterResults = main.TRUE
- else:
- main.log.error( "Counters are not consistent across all nodes" )
- consistentCounterResults = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=consistentCounterResults,
- onpass="ONOS counters are consistent " +
- "across nodes",
- onfail="ONOS Counters are inconsistent " +
- "across nodes" )
-
- main.step( "Counters we added have the correct values" )
- correctResults = main.TRUE
- for i in range( numControllers ):
- current = json.loads( onosCounters[i] )
- pValue = None
- iValue = None
- try:
- for database in current:
- partitioned = database.get( 'partitionedDatabaseCounters' )
- if partitioned:
- for value in partitioned:
- if value.get( 'name' ) == pCounterName:
- pValue = value.get( 'value' )
- break
- inMemory = database.get( 'inMemoryDatabaseCounters' )
- if inMemory:
- for value in inMemory:
- if value.get( 'name' ) == iCounterName:
- iValue = value.get( 'value' )
- break
- except AttributeError, e:
- main.log.error( "ONOS" + str( i + 1 ) + " counters result " +
- "is not as expected" )
- correctResults = main.FALSE
- if pValue == pCounterValue:
- main.log.info( "Partitioned counter value is correct" )
- else:
- main.log.error( "Partitioned counter value is incorrect," +
- " expected value: " + str( pCounterValue )
- + " current value: " + str( pValue ) )
- correctResults = main.FALSE
- if iValue == iCounterValue:
- main.log.info( "In memory counter value is correct" )
- else:
- main.log.error( "In memory counter value is incorrect, " +
- "expected value: " + str( iCounterValue ) +
- " current value: " + str( iValue ) )
- correctResults = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=correctResults,
- onpass="Added counters are correct",
- onfail="Added counters are incorrect" )
- # DISTRIBUTED SETS
- main.step( "Distributed Set get" )
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
-
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- utilities.assert_equals( expect=main.TRUE,
- actual=getResults,
- onpass="Set elements are correct",
- onfail="Set elements are incorrect" )
-
- main.step( "Distributed Set size" )
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
-
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- utilities.assert_equals( expect=main.TRUE,
- actual=sizeResults,
- onpass="Set sizes are correct",
- onfail="Set sizes are incorrect" )
-
- main.step( "Distributed Set add()" )
- onosSet.add( addValue )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAdd-" + str( i ),
- args=[ onosSetName, addValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addResults = main.FALSE
- else:
- # unexpected result
- addResults = main.FALSE
- if addResults != main.TRUE:
- main.log.error( "Error executing set add" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addResults = addResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addResults,
- onpass="Set add correct",
- onfail="Set add was incorrect" )
-
- main.step( "Distributed Set addAll()" )
- onosSet.update( addAllValue.split() )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAddAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addAllResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addAllResults = main.FALSE
- else:
- # unexpected result
- addAllResults = main.FALSE
- if addAllResults != main.TRUE:
- main.log.error( "Error executing set addAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addAllResults = addAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addAllResults,
- onpass="Set addAll correct",
- onfail="Set addAll was incorrect" )
-
- main.step( "Distributed Set contains()" )
- containsResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setContains-" + str( i ),
- args=[ onosSetName ],
- kwargs={ "values": addValue } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- # NOTE: This is the tuple
- containsResponses.append( t.result )
-
- containsResults = main.TRUE
- for i in range( numControllers ):
- if containsResponses[ i ] == main.ERROR:
- containsResults = main.FALSE
- else:
- containsResults = containsResults and\
- containsResponses[ i ][ 1 ]
- utilities.assert_equals( expect=main.TRUE,
- actual=containsResults,
- onpass="Set contains is functional",
- onfail="Set contains failed" )
-
- main.step( "Distributed Set containsAll()" )
- containsAllResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setContainsAll-" + str( i ),
- args=[ onosSetName ],
- kwargs={ "values": addAllValue } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- # NOTE: This is the tuple
- containsAllResponses.append( t.result )
-
- containsAllResults = main.TRUE
- for i in range( numControllers ):
- if containsResponses[ i ] == main.ERROR:
- containsResults = main.FALSE
- else:
- containsResults = containsResults and\
- containsResponses[ i ][ 1 ]
- utilities.assert_equals( expect=main.TRUE,
- actual=containsAllResults,
- onpass="Set containsAll is functional",
- onfail="Set containsAll failed" )
-
- main.step( "Distributed Set remove()" )
- onosSet.remove( addValue )
- removeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestRemove-" + str( i ),
- args=[ onosSetName, addValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- removeResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- removeResults = main.TRUE
- for i in range( numControllers ):
- if removeResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif removeResponses[ i ] == main.FALSE:
- # not in set, probably fine
- pass
- elif removeResponses[ i ] == main.ERROR:
- # Error in execution
- removeResults = main.FALSE
- else:
- # unexpected result
- removeResults = main.FALSE
- if removeResults != main.TRUE:
- main.log.error( "Error executing set remove" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- removeResults = removeResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=removeResults,
- onpass="Set remove correct",
- onfail="Set remove was incorrect" )
-
- main.step( "Distributed Set removeAll()" )
- onosSet.difference_update( addAllValue.split() )
- removeAllResponses = []
- threads = []
- try:
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestRemoveAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- removeAllResponses.append( t.result )
- except Exception, e:
- main.log.exception(e)
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- removeAllResults = main.TRUE
- for i in range( numControllers ):
- if removeAllResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif removeAllResponses[ i ] == main.FALSE:
- # not in set, probably fine
- pass
- elif removeAllResponses[ i ] == main.ERROR:
- # Error in execution
- removeAllResults = main.FALSE
- else:
- # unexpected result
- removeAllResults = main.FALSE
- if removeAllResults != main.TRUE:
- main.log.error( "Error executing set removeAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- removeAllResults = removeAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=removeAllResults,
- onpass="Set removeAll correct",
- onfail="Set removeAll was incorrect" )
-
- main.step( "Distributed Set addAll()" )
- onosSet.update( addAllValue.split() )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAddAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addAllResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addAllResults = main.FALSE
- else:
- # unexpected result
- addAllResults = main.FALSE
- if addAllResults != main.TRUE:
- main.log.error( "Error executing set addAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addAllResults = addAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addAllResults,
- onpass="Set addAll correct",
- onfail="Set addAll was incorrect" )
-
- main.step( "Distributed Set clear()" )
- onosSet.clear()
- clearResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestClear-" + str( i ),
- args=[ onosSetName, " "], # Values doesn't matter
- kwargs={ "clear": True } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- clearResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- clearResults = main.TRUE
- for i in range( numControllers ):
- if clearResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif clearResponses[ i ] == main.FALSE:
- # Nothing set, probably fine
- pass
- elif clearResponses[ i ] == main.ERROR:
- # Error in execution
- clearResults = main.FALSE
- else:
- # unexpected result
- clearResults = main.FALSE
- if clearResults != main.TRUE:
- main.log.error( "Error executing set clear" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- clearResults = clearResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=clearResults,
- onpass="Set clear correct",
- onfail="Set clear was incorrect" )
-
- main.step( "Distributed Set addAll()" )
- onosSet.update( addAllValue.split() )
- addResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestAdd,
- name="setTestAddAll-" + str( i ),
- args=[ onosSetName, addAllValue ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- addResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- addAllResults = main.TRUE
- for i in range( numControllers ):
- if addResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif addResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif addResponses[ i ] == main.ERROR:
- # Error in execution
- addAllResults = main.FALSE
- else:
- # unexpected result
- addAllResults = main.FALSE
- if addAllResults != main.TRUE:
- main.log.error( "Error executing set addAll" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " + str( size ) +
- " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- addAllResults = addAllResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=addAllResults,
- onpass="Set addAll correct",
- onfail="Set addAll was incorrect" )
-
- main.step( "Distributed Set retain()" )
- onosSet.intersection_update( retainValue.split() )
- retainResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestRemove,
- name="setTestRetain-" + str( i ),
- args=[ onosSetName, retainValue ],
- kwargs={ "retain": True } )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- retainResponses.append( t.result )
-
- # main.TRUE = successfully changed the set
- # main.FALSE = action resulted in no change in set
- # main.ERROR - Some error in executing the function
- retainResults = main.TRUE
- for i in range( numControllers ):
- if retainResponses[ i ] == main.TRUE:
- # All is well
- pass
- elif retainResponses[ i ] == main.FALSE:
- # Already in set, probably fine
- pass
- elif retainResponses[ i ] == main.ERROR:
- # Error in execution
- retainResults = main.FALSE
- else:
- # unexpected result
- retainResults = main.FALSE
- if retainResults != main.TRUE:
- main.log.error( "Error executing set retain" )
-
- # Check if set is still correct
- size = len( onosSet )
- getResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestGet,
- name="setTestGet-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- getResponses.append( t.result )
- getResults = main.TRUE
- for i in range( numControllers ):
- if isinstance( getResponses[ i ], list):
- current = set( getResponses[ i ] )
- if len( current ) == len( getResponses[ i ] ):
- # no repeats
- if onosSet != current:
- main.log.error( "ONOS" + str( i + 1 ) +
- " has incorrect view" +
- " of set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- main.log.debug( "Expected: " + str( onosSet ) )
- main.log.debug( "Actual: " + str( current ) )
- getResults = main.FALSE
- else:
- # error, set is not a set
- main.log.error( "ONOS" + str( i + 1 ) +
- " has repeat elements in" +
- " set " + onosSetName + ":\n" +
- str( getResponses[ i ] ) )
- getResults = main.FALSE
- elif getResponses[ i ] == main.ERROR:
- getResults = main.FALSE
- sizeResponses = []
- threads = []
- for i in range( numControllers ):
- t = main.Thread( target=CLIs[i].setTestSize,
- name="setTestSize-" + str( i ),
- args=[ onosSetName ] )
- threads.append( t )
- t.start()
- for t in threads:
- t.join()
- sizeResponses.append( t.result )
- sizeResults = main.TRUE
- for i in range( numControllers ):
- if size != sizeResponses[ i ]:
- sizeResults = main.FALSE
- main.log.error( "ONOS" + str( i + 1 ) +
- " expected a size of " +
- str( size ) + " for set " + onosSetName +
- " but got " + str( sizeResponses[ i ] ) )
- retainResults = retainResults and getResults and sizeResults
- utilities.assert_equals( expect=main.TRUE,
- actual=retainResults,
- onpass="Set retain correct",
- onfail="Set retain was incorrect" )
-
diff --git a/TestON/tests/HATestSingleInstanceRestart/HATestSingleInstanceRestart.topo b/TestON/tests/HATestSingleInstanceRestart/HATestSingleInstanceRestart.topo
deleted file mode 100644
index 9305025..0000000
--- a/TestON/tests/HATestSingleInstanceRestart/HATestSingleInstanceRestart.topo
+++ /dev/null
@@ -1,169 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOScli1>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli1>
-
- <ONOScli2>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli2>
-
- <ONOScli3>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli3>
-
-
- <ONOScli4>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli4>
-
-
- <ONOScli5>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli5>
-
-
- <ONOScli6>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli6>
-
-
- <ONOScli7>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli7>
-
- <ONOS1>
- <host>10.128.30.11</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.128.30.12</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>10</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.128.30.13</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>11</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
- <ONOS4>
- <host>10.128.30.14</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>12</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4>
-
- <ONOS5>
- <host>10.128.30.15</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>13</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5>
-
- <ONOS6>
- <host>10.128.30.16</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>14</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6>
-
- <ONOS7>
- <host>10.128.30.17</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>15</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7>
-
- <Mininet1>
- <host>10.128.30.9</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>16</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> </arg3>
- <controller> none </controller>
- </COMPONENTS>
- </Mininet1>
-
- <Mininet2>
- <host>10.128.30.9</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>17</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </Mininet2>
-
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/HATestSingleInstanceRestart/__init__.py b/TestON/tests/HATestSingleInstanceRestart/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/HATestSingleInstanceRestart/__init__.py
+++ /dev/null
diff --git a/TestON/tests/IntentEventTP/__init__.py b/TestON/tests/IntentEventTP/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/IntentEventTP/__init__.py
+++ /dev/null
diff --git a/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.params b/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.params
deleted file mode 100644
index 8aad63b..0000000
--- a/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.params
+++ /dev/null
@@ -1,66 +0,0 @@
-<PARAMS>
-
- <testcases>1,2,1,2,1,2,1,2</testcases>
-
- <SCALE>1,3,5,7</SCALE>
- <availableNodes>7</availableNodes>
-
- <ENV>
- <cellName>IntentInstallWithdrawCell</cellName>
- <cellApps>drivers,null</cellApps>
- </ENV>
-
- <TEST>
- <skipCleanInstall>yes</skipCleanInstall>
- <switchCount>7</switchCount>
- <warmUp>10</warmUp>
- <sampleSize>20</sampleSize>
- <wait></wait>
- <intents>1,100,1000</intents> #list format, will be split on ','
- <debug>True</debug> #"True" for true
- </TEST>
-
- <GIT>
- <autopull>off</autopull>
- <checkout>master</checkout>
- </GIT>
-
- <CTRL>
- <USER>admin</USER>
-
- <ip1>OC1</ip1>
- <port1>6633</port1>
-
- <ip2>OC2</ip2>
- <port2>6633</port2>
-
- <ip3>OC3</ip3>
- <port3>6633</port3>
-
- <ip4>OC4</ip4>
- <port4>6633</port4>
-
- <ip5>OC5</ip5>
- <port5>6633</port5>
-
- <ip6>OC6</ip6>
- <port6>6633</port6>
-
- <ip7>OC7</ip7>
- <port7>6633</port7>
-
- </CTRL>
-
- <MN>
- <ip1>OCN</ip1>
- </MN>
-
- <BENCH>
- <user>admin</user>
- <ip1>OCN</ip1>
- </BENCH>
-
- <JSON>
- </JSON>
-
-</PARAMS>
diff --git a/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.py b/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.py
deleted file mode 100644
index e96307d..0000000
--- a/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.py
+++ /dev/null
@@ -1,293 +0,0 @@
-# ScaleOutTemplate
-#
-# CASE1 starts number of nodes specified in param file
-#
-# cameron@onlab.us
-
-import sys
-import os.path
-
-
-class IntentInstallWithdrawLat:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
-
- import time
- global init
- try:
- if type(init) is not bool:
- init = False
- except NameError:
- init = False
-
- #Load values from params file
- checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
- gitPull = main.params[ 'GIT' ][ 'autopull' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- Apps = main.params[ 'ENV' ][ 'cellApps' ]
- BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
- BENCHUser = main.params[ 'BENCH' ][ 'user' ]
- MN1Ip = main.params[ 'MN' ][ 'ip1' ]
- maxNodes = int(main.params[ 'availableNodes' ])
- skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- switchCount = main.params[ 'TEST' ][ 'switchCount' ]
-
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
- init = True
- global clusterCount #number of nodes running
- global ONOSIp #list of ONOS IP addresses
- global scale
- global commit
-
- clusterCount = 0
- ONOSIp = [ 0 ]
- scale = (main.params[ 'SCALE' ]).split(",")
- clusterCount = int(scale[0])
-
- #Populate ONOSIp with ips from params
- ONOSIp = [0]
- ONOSIp.extend(main.ONOSbench.getOnosIps())
-
- #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
- if skipMvn != "yes":
- mvnResult = main.ONOSbench.cleanInstall()
-
- #git
- main.step( "Git checkout and pull " + checkoutBranch )
- if gitPull == 'on':
- checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
- pullResult = main.ONOSbench.gitPull()
-
- else:
- checkoutResult = main.TRUE
- pullResult = main.TRUE
- main.log.info( "Skipped git checkout and pull" )
-
- commit = main.ONOSbench.getVersion()
- commit = (commit.split(" "))[1]
-
- resultsDB = open("IntentInstallWithdrawLatDB", "w+")
- resultsDB.close()
-
- # -- END OF INIT SECTION --#
-
- clusterCount = int(scale[0])
- scale.remove(scale[0])
-
- MN1Ip = ONOSIps[len(ONOSIp)-1]
- BENCHIp = ONOSIps[len(ONOSIp)-2]
-
- #kill off all onos processes
- main.log.step("Safety check, killing all ONOS processes")
- main.log.step("before initiating enviornment setup")
- for node in range(1, maxNodes + 1):
- main.ONOSbench.onosDie(ONOSIp[node])
-
- #Uninstall everywhere
- main.log.step( "Cleaning Enviornment..." )
- for i in range(1, maxNodes + 1):
- main.log.info(" Uninstalling ONOS " + str(i) )
- main.ONOSbench.onosUninstall( ONOSIp[i] )
-
- #construct the cell file
- main.log.info("Creating cell file")
- cellIp = []
- for node in range (1, clusterCount + 1):
- cellIp.append(ONOSIp[node])
-
- main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), *cellIp)
-
- main.step( "Set Cell" )
- main.ONOSbench.setCell(cellName)
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "verify cells" )
- verifyCellResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
- for node in range(1, clusterCount + 1):
- main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
- main.ONOSbench.onosInstall( ONOSIp[node])
-
- for node in range(1, clusterCount + 1):
- for i in range( 2 ):
- isup = main.ONOSbench.isup( ONOSIp[node] )
- if isup:
- main.log.info("ONOS " + str(node) + " is up\n")
- break
- if not isup:
- main.log.report( "ONOS " + str(node) + " didn't start!" )
-
- main.ONOS1cli.startOnosCli( ONOSIp[1] )
- main.log.info("Startup sequence complete")
-
- time.sleep(30)
-
- for i in range(5):
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg setorg.onosproject.provider.nil.NullProviders enabled true" """)
- main.ONOSbench.handle.expect(":~")
- print main.ONOSbench.handle.before
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders deviceCount """ + str(switchCount) + """ " """)
- main.ONOSbench.handle.expect(":~")
- print main.ONOSbench.handle.before
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders topoShape linear" """)
- main.ONOSbench.handle.expect(":~")
- print main.ONOSbench.handle.before
- main.ONOSbench.handle.sendline("""onos $OC1 "null-simulation start" """)
- main.ONOSbench.handle.expect(":~")
- print main.ONOSbench.handle.before
- main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
- main.ONOSbench.handle.expect(":~")
- print main.ONOSbench.handle.before
-
- main.ONOSbench.handle.sendline("onos $OC1 summary")
- main.ONOSbench.handle.expect(":~")
- check = main.ONOSbench.handle.before
- main.log.info(check)
- if "SSC(s)=1," in check:
- break
-
-
-
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
-
- def CASE2( self, main ):
-
- import time
- import numpy
-
- testStatus = "pass"
- sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
- warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
- intentsList = (main.params[ 'TEST' ][ 'intents' ]).split(",")
- switchCount = int(main.params[ 'TEST' ][ 'switchCount' ])
- debug = main.params[ 'TEST' ][ 'switchCount' ]
- for i in range(0,len(intentsList)):
- intentsList[i] = int(intentsList[i])
-
- ######################
- debug = True
- ######################
-
- linkCount = 0
- for i in range(0,10):
- main.ONOSbench.handle.sendline("onos $OC1 links|wc -l")
- main.ONOSbench.handle.expect(":~")
- linkCount = main.ONOSbench.handle.before
- if debug: main.log.info("Link Count check: " + linkCount)
- if str((switchCount*2)-2) in linkCount:
- break
- time.sleep(2)
-
- links = "--"
- for i in range(8):
- if debug: main.log.info("top of loop")
- main.ONOSbench.handle.sendline("onos $OC1 links")
- main.ONOSbench.handle.expect(":~")
- links = main.ONOSbench.handle.before
- if "=null:" in links:
- break
- if debug: main.log.info(str(links))
- if i > 3:
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], "d")
- if i == 7:
- main.log.error("link data missing")
- time.sleep(3)
-
- links = links.splitlines()
- templinks = links
-
- tempDevices = []
- for line in links:
- temp = line.split(" ")
- temp[0].replace("src=","")
- temp[0] = (temp[0].split("/"))[0]
- tempDevices.append(temp[0])
-
- tempDevices.sort()
- devices = []
- for i in tempDevices:
- if "src=null" in i:
- devices.append(i.replace("src=", ""))
- if debug: main.log.info(str(devices))
-
- ingress = devices[0]
- egress = devices.pop()
- if debug: main.log.info(ingress)
- if debug: main.log.info(egress)
-
- for intentSize in intentsList:
- cmd = "onos $OC1 push-test-intents "
- cmd += ingress + "/6 "
- cmd += egress + "/5 "
- cmd += str(intentSize) + " 1"
- installed = []
- withdrawn = []
-
- for run in range(0, (warmUp + sampleSize)):
- if run > warmUp:
- time.sleep(5)
-
- myRawResult = "--"
- while "ms" not in myRawResult:
- main.ONOSbench.handle.sendline(cmd)
- main.ONOSbench.handle.expect(":~")
- myRawResult = main.ONOSbench.handle.before
- if debug: main.log.info(myRawResult)
-
- if debug: main.log.info(myRawResult)
-
- if run >= warmUp:
- myRawResult = myRawResult.splitlines()
- for line in myRawResult:
- if "install" in line:
- installed.append(int(line.split(" ")[5]))
-
- for line in myRawResult:
- if "withdraw" in line:
- withdrawn.append(int(line.split(" ")[5]))
-
- for line in myRawResult:
- if "Failure:" in line:
- main.log.error("INTENT TEST FAILURE, ABORTING TESTCASE")
- testStatus = "fail"
- if testStatus == "fail":
- break
-
- print("installed: " + str(installed))
- print("withraw: " + str(withdrawn) + "\n")
- if withdrawn[len(withdrawn) -1] > 1000 or installed[len(installed) -1] > 1000:
- main.log.info("ABNORMAL VALUE, CHECKING LOG")
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
-
- if testStatus == "fail":
- break
- main.log.report("----------------------------------------------------")
- main.log.report("Scale: " + str(clusterCount) + "\tIntent batch size: " + str(intentSize))
- main.log.report("Data samples: " + str(sampleSize) + "\tWarm up tests: " + str(warmUp))
- main.log.report("Installed average: " + str(numpy.mean(installed)))
- main.log.report("Installed standard deviation: " + str(numpy.std(installed)))
- main.log.report("Withdraw average: " + str(numpy.mean(withdrawn)))
- main.log.report("Withdraw standard deviation: " + str(numpy.std(withdrawn)))
- main.log.report(" ")
-
- resultString = "'" + commit + "',"
- resultString += str(clusterCount) + ","
- resultString += str(intentSize) + ","
- resultString += str(numpy.mean(installed)) + ","
- resultString += str(numpy.std(installed)) + ","
- resultString += str(numpy.mean(withdrawn)) + ","
- resultString += str(numpy.std(withdrawn)) + "\n"
- resultsDB = open("IntentInstallWithdrawLatDB", "a")
- resultsDB.write(resultString)
- resultsDB.close()
-
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
- time.sleep(20)
diff --git a/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.topo b/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.topo
deleted file mode 100644
index d82f3fd..0000000
--- a/TestON/tests/IntentInstallWithdrawLat/IntentInstallWithdrawLat.topo
+++ /dev/null
@@ -1,144 +0,0 @@
-<TOPOLOGY>
-
- <COMPONENT>
-
- <ONOSbench>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS><home>~/onos</home></COMPONENTS>
- </ONOSbench>
-
- <ONOS1cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1cli>
-
- <ONOS2cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2cli>
-
- <ONOS3cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3cli>
-
- <ONOS4cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4cli>
-
- <ONOS5cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5cli>
-
- <ONOS6cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6cli>
-
- <ONOS7cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7cli>
-
- <ONOS1>
- <host>OC1</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>OC2</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>10</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>OC3</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>11</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
- <ONOS4>
- <host>OC4</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>12</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4>
-
-
- <ONOS5>
- <host>OC5</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>13</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5>
-
- <ONOS6>
- <host>OC6</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>14</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6>
-
- <ONOS7>
- <host>OC7</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>15</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7>
-
- </COMPONENT>
-
-</TOPOLOGY>
-
diff --git a/TestON/tests/IntentInstallWithdrawLat/__init__.py b/TestON/tests/IntentInstallWithdrawLat/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/IntentInstallWithdrawLat/__init__.py
+++ /dev/null
diff --git a/TestON/tests/IntentPerfNextBM/IntentPerfNextBM.params b/TestON/tests/IntentPerfNextBM/IntentPerfNextBM.params
deleted file mode 100644
index f01f017..0000000
--- a/TestON/tests/IntentPerfNextBM/IntentPerfNextBM.params
+++ /dev/null
@@ -1,67 +0,0 @@
-<PARAMS>
- <testcases>1,2,4,2,4,2,4,2</testcases>
-
- <ENV>
- <cellName>intent_perf_test</cellName>
- </ENV>
-
- <GIT>
- #autoPull 'on' or 'off'
- <autoPull>off</autoPull>
- <checkout>master</checkout>
- </GIT>
-
- <CTRL>
- <user>sdn</user>
- <ip1>10.254.1.201</ip1>
- <port1>6633</port1>
- <ip2>10.254.1.202</ip2>
- <port2>6633</port2>
- <ip3>10.254.1.203</ip3>
- <port3>6633</port3>
- <ip4>10.254.1.204</ip4>
- <ip5>10.254.1.205</ip5>
- <ip6>10.254.1.206</ip6>
- <ip7>10.254.1.207</ip7>
- </CTRL>
-
- <TSHARK>
- <ofpPortStatus>OF 1.3 146</ofpPortStatus>
- </TSHARK>
-
- <MN>
- <ip1>10.254.1.200</ip1>
- <ip2>10.254.1.200</ip2>
- </MN>
-
- <BENCH>
- <ip>10.254.1.200</ip>
- </BENCH>
-
- <TEST>
- #Number of times to iterate each case
- <numIter>8</numIter>
- <numIgnore>2</numIgnore>
- <numSwitch>8</numSwitch>
- <batchThresholdMin>0</batchThresholdMin>
- <batchThresholdMax>1000</batchThresholdMax>
- <batchIntentSize>1</batchIntentSize>
- <numMult>1</numMult>
- #Interface to bring down for intent reroute case
- <intfs>s3-eth2</intfs>
- <cellStr>webconsole,onos-core,onos-api,onos-app-metrics,onos-app-gui,onos-cli,onos-openflow</cellStr>
- </TEST>
-
- <DB>
- <intentFilePath>
- /home/admin/ONLabTest/TestON/tests/IntentPerfNextBM/intentLatencyResultDb.log
- </intentFilePath>
- </DB>
-
- <JSON>
- <submittedTime>intentSubmittedTimestamp</submittedTime>
- <installedTime>intentInstalledTimestamp</installedTime>
- <wdRequestTime>intentWithdrawRequestedTimestamp</wdRequestTime>
- <withdrawnTime>intentWithdrawnTimestamp</withdrawnTime>
- </JSON>
-</PARAMS>
diff --git a/TestON/tests/IntentPerfNextBM/IntentPerfNextBM.py b/TestON/tests/IntentPerfNextBM/IntentPerfNextBM.py
deleted file mode 100644
index 7ddc70f..0000000
--- a/TestON/tests/IntentPerfNextBM/IntentPerfNextBM.py
+++ /dev/null
@@ -1,746 +0,0 @@
-# 2015.03.12 10:28:21 PDT
-#Embedded file name: ../tests/IntentPerfNextBM/IntentPerfNextBM.py
-
-
-class IntentPerfNextBM:
-
- def __init__(self):
- self.default = ''
-
- def CASE1(self, main):
- """
- ONOS startup sequence
- """
- global clusterCount
- global timeToPost
- global runNum
- import time
-
- clusterCount = 1
- timeToPost = time.strftime('%Y-%m-%d %H:%M:%S')
- runNum = time.strftime('%d%H%M%S')
- cellName = main.params['ENV']['cellName']
- gitPull = main.params['GIT']['autoPull']
- checkoutBranch = main.params['GIT']['checkout']
- intentFilePath = main.params['DB']['intentFilePath']
- cellStr = main.params[ 'TEST' ][ 'cellStr' ]
- ONOSIp = []
-
- for i in range(1, 8):
- ONOSIp.append(main.params['CTRL']['ip' + str(i)])
- main.ONOSbench.onosUninstall(nodeIp=ONOSIp[i - 1])
-
- MN1Ip = main.params['MN']['ip1']
- BENCHIp = main.params['BENCH']['ip']
- main.case('Setting up test environment')
- main.step('Clearing previous DB log file')
- fIntentLog = open(intentFilePath, 'w')
- fIntentLog.write('')
- fIntentLog.close()
- main.step('Starting mininet topology')
- main.Mininet1.startNet()
- main.step('Creating cell file')
- cellFileResult = main.ONOSbench.createCellFile(
- BENCHIp, cellName, MN1Ip, cellStr, ONOSIp[0])
- main.step('Applying cell file to environment')
- cellApplyResult = main.ONOSbench.setCell(cellName)
- verifyCellResult = main.ONOSbench.verifyCell()
- main.step('Removing raft logs')
- main.ONOSbench.onosRemoveRaftLogs()
- main.step('Git checkout and pull ' + checkoutBranch)
-
- if gitPull == 'on':
- checkoutResult = main.ONOSbench.gitCheckout(checkoutBranch)
- pullResult = main.ONOSbench.gitPull()
- main.step('Using onos-build to compile ONOS')
- buildResult = main.ONOSbench.onosBuild()
- else:
- checkoutResult = main.TRUE
- pullResult = main.TRUE
- buildResult = main.TRUE
- main.log.info('Git pull skipped by configuration')
-
- main.log.report('Commit information - ')
- main.ONOSbench.getVersion(report=True)
- main.step('Creating ONOS package')
- packageResult = main.ONOSbench.onosPackage()
- main.step('Installing ONOS package')
- install1Result = main.ONOSbench.onosInstall(node=ONOSIp[0])
- main.step('Set cell for ONOScli env')
- main.ONOS1cli.setCell(cellName)
- time.sleep(5)
- main.step('Start onos cli')
- cli1 = main.ONOS1cli.startOnosCli(ONOSIp[0])
- utilities.assert_equals(expect=main.TRUE,
- actual=cellFileResult and cellApplyResult and\
- verifyCellResult and checkoutResult and\
- pullResult and buildResult and install1Result,
- onpass='ONOS started successfully',
- onfail='Failed to start ONOS')
-
- def CASE2(self, main):
- """
- Batch intent install
-
- Supports scale-out scenarios and increasing
- number of intents within each iteration
- """
- import time
- import json
- import requests
- import os
- import numpy
- ONOS1Ip = main.params['CTRL']['ip1']
- ONOS2Ip = main.params['CTRL']['ip2']
- ONOS3Ip = main.params['CTRL']['ip3']
- ONOS4Ip = main.params['CTRL']['ip4']
- ONOS5Ip = main.params['CTRL']['ip5']
- ONOS6Ip = main.params['CTRL']['ip6']
- ONOS7Ip = main.params['CTRL']['ip7']
- assertion = main.TRUE
- ONOSIpList = []
-
- for i in range(1, 8):
- ONOSIpList.append(main.params['CTRL']['ip' + str(i)])
-
- ONOSUser = main.params['CTRL']['user']
- defaultSwPort = main.params['CTRL']['port1']
- batchIntentSize = int(main.params['TEST']['batchIntentSize'])
- batchThreshMin = int(main.params['TEST']['batchThresholdMin'])
- batchThreshMax = int(main.params['TEST']['batchThresholdMax'])
- numIter = main.params['TEST']['numIter']
- numIgnore = int(main.params['TEST']['numIgnore'])
- numSwitch = int(main.params['TEST']['numSwitch'])
- nThread = main.params['TEST']['numMult']
- intentFilePath = main.params['DB']['intentFilePath']
-
- if clusterCount == 1:
- for i in range(1, numSwitch + 1):
- main.Mininet1.assignSwController(sw="s" + str(i),
- ip=ONOS1Ip, port=defaultSwPort)
- if clusterCount == 3:
- for i in range(1, 3):
- main.Mininet1.assignSwController(sw="s" + str(i),
- ip=ONOS1Ip, port=defaultSwPort)
- for i in range(3, 6):
- main.Mininet1.assignSwController(sw="s" + str(i),
- ip=ONOS2Ip, port=defaultSwPort)
- for i in range(6, 9):
- main.Mininet1.assignSwController(sw="s" + str(i),
- ip=ONOS3Ip, port=defaultSwPort)
- if clusterCount == 5:
- main.Mininet1.assignSwController(sw='s1',
- ip=ONOS1Ip, port=defaultSwPort)
- main.Mininet1.assignSwController(sw='s2',
- ip=ONOS2Ip, port=defaultSwPort)
- for i in range(3, 6):
- main.Mininet1.assignSwController(sw="s" + str(i),
- ip=ONOS3Ip, port=defaultSwPort)
- main.Mininet1.assignSwController(sw='s6',
- ip=ONOS4Ip, port=defaultSwPort)
- main.Mininet1.assignSwController(sw='s7',
- ip=ONOS5Ip, port=defaultSwPort)
- main.Mininet1.assignSwController(sw='s8',
- ip=ONOS5Ip, port=defaultSwPort)
- if clusterCount == 7:
- for i in range(1, 9):
- if i < 8:
- main.Mininet1.assignSwController(sw="s" + str(i),
- ip=ONOSIpList[i - 1], port=defaultSwPort)
- elif i >= 8:
- main.Mininet1.assignSwController(sw="s" + str(i),
- ip=ONOSIpList[6], port=defaultSwPort)
-
- time.sleep(20)
-
- deviceIdList = []
- batchInstallLat = []
- batchWithdrawLat = []
-
- main.log.report('Batch intent installation test of ' +
- str(batchIntentSize) + ' intent(s)')
- main.log.info('Getting list of available devices')
-
- jsonStr = main.ONOS1cli.devices()
- jsonObj = json.loads(jsonStr)
- for device in jsonObj:
- deviceIdList.append(device['id'])
-
- if not jsonObj:
- main.log.warn( "Devices not found, check topology" )
-
- sleepTime = 10
- baseDir = '/tmp/'
- for batch in range(0, 5):
- maxInstallLat = []
- maxWithdrawLat = []
- maxSingleInstallLat = []
- maxSingleWithdrawLat = []
- for i in range(0, int(numIter)):
- main.log.info('Pushing ' + str(
- int(batchIntentSize) * int(nThread)) +
- ' intents. Iteration ' + str(i))
- saveDir = baseDir + 'batch_intent_1.txt'
- main.ONOSbench.pushTestIntentsShell(deviceIdList[0] +
- '/2', deviceIdList[7] + '/2', batchIntentSize,
- saveDir, ONOSIpList[0], numMult=nThread)
- time.sleep(sleepTime)
- intent = ''
- counter = 300
- while len(intent) > 0 and counter > 0:
- main.ONOS1cli.handle.sendline('intents | wc -l')
- main.ONOS1cli.handle.expect('intents | wc -l')
- main.ONOS1cli.handle.expect('onos>')
- intentTemp = main.ONOS1cli.handle.before()
- intent = main.ONOS1cli.intents()
- intent = json.loads(intent)
- counter = counter - 1
- time.sleep(1)
-
- time.sleep(5)
- saveDir = baseDir + 'batch_intent_1.txt'
- with open(saveDir) as fOnos:
- lineCount = 0
- for line in fOnos:
- line_temp = ''
- main.log.info('Line read: ' + str(line))
- line_temp = line[1:]
- line_temp = line_temp.split(': ')
- if ' ' in str(line_temp):
- result = line_temp[1].split(' ')[0]
- else:
- main.log.warn('Empty line read')
- result = 0
- if lineCount == 0:
- if 'Failure' in str(line):
- main.log.warn('Intent installation failed')
- result = 'NA'
- else:
- main.log.info('Install result: ' + result)
- batchInstallLat.append(int(result))
- installResult = result
- elif lineCount == 1:
- if 'Failure' in str(line):
- main.log.warn('Intent withdraw failed')
- result = 'NA'
- else:
- main.log.info('Withdraw result: ' + result)
- batchWithdrawLat.append(int(result))
- withdrawResult = result
- else:
- main.log.warn('Invalid results')
- installResult = 'NA'
- withdrawResult = 'NA'
- lineCount += 1
-
- main.log.info('Batch install latency with' +
- str(batchIntentSize) + 'intents: ' +
- str(installResult) + ' ms')
- main.log.info('Batch withdraw latency with' +
- str(batchIntentSize) + 'intents: ' +
- str(withdrawResult) + ' ms')
- main.log.info('Single intent install latency with' +
- str(batchIntentSize) + 'intents: ' +
- str(float(installResult) / int(batchIntentSize))+' ms')
- main.log.info('Single intent withdraw latency with' +
- str(batchIntentSize) + 'intents: ' +
- str(float(withdrawResult)/ int(batchIntentSize))+' ms')
- if len(batchInstallLat) > 0 and int(i) > numIgnore:
- maxInstallLat.append(max(batchInstallLat))
- maxSingleInstallLat.append(
- max(batchInstallLat) / int(batchIntentSize))
- elif len(batchInstallLat) == 0:
- sleepTime += 30
- if len(batchWithdrawLat) > 0 and int(i) > numIgnore:
- maxWithdrawLat.append(max(batchWithdrawLat))
- maxSingleWithdrawLat.append(
- max(batchWithdrawLat) / int(batchIntentSize))
- batchInstallLat = []
- batchWithdrawLat = []
- time.sleep(5)
-
- if maxInstallLat:
- avgInstallLat = str(round(
- numpy.average(maxInstallLat), 2))
- stdInstallLat = str(round(
- numpy.std(maxInstallLat), 2))
- avgSingleInstallLat = str(round(
- numpy.average(maxSingleInstallLat), 3))
- stdSingleInstallLat = str(round(
- numpy.std(maxSingleInstallLat), 3))
- else:
- avgInstallLat = 'NA'
- stdInstallLat = 'NA'
- main.log.report('Batch installation failed')
- assertion = main.FALSE
- if maxWithdrawLat:
- avgWithdrawLat = str(round(
- numpy.average(maxWithdrawLat), 2))
- stdWithdrawLat = str(round(
- numpy.std(maxWithdrawLat), 2))
- avgSingleWithdrawLat = str(round(
- numpy.average(maxSingleWithdrawLat), 3))
- stdSingleWithdrawLat = str(round(
- numpy.std(maxSingleWithdrawLat), 3))
- else:
- avgWithdrawLat = 'NA'
- stdWithdrawLat = 'NA'
- main.log.report('Batch withdraw failed')
- assertion = main.FALSE
-
- main.log.report('Avg of batch installation latency ' +
- 'of size ' + str(batchIntentSize) + ': ' +
- str(avgInstallLat) + ' ms')
- main.log.report('Std Deviation of batch installation latency ' +
- ': ' + str(round(numpy.std(maxInstallLat), 2)) + ' ms')
- main.log.report('Avg of batch withdraw latency ' +
- 'of size ' + str(batchIntentSize) + ': ' +
- str(avgWithdrawLat) + ' ms')
- main.log.report('Std Deviation of batch withdraw latency ' +
- ': ' + str(round(numpy.std(maxWithdrawLat), 2)) + ' ms')
-
- main.log.report('Avg of batch withdraw latency ' + 'of size ' +
- str(batchIntentSize) + ': ' + str(avgWithdrawLat) + ' ms')
- main.log.report('Std Deviation of batch withdraw latency ' +
- ': ' + str(stdWithdrawLat) + ' ms')
- main.log.report('Avg of single withdraw latency ' + 'of size ' +
- str(batchIntentSize) + ': ' +
- str(avgSingleWithdrawLat) + ' ms')
- main.log.report('Std Deviation of single withdraw latency ' +
- ': ' + str(stdSingleWithdrawLat) + ' ms')
-
- dbCmd = "INSERT INTO intents_latency_tests VALUES('" +\
- timeToPost + "','intents_latency_results'," +\
- runNum + ',' + str(clusterCount) + ',' +\
- str(batchIntentSize) + ',' + str(avgInstallLat) +\
- ',' + str(stdInstallLat) + ',' + str(avgWithdrawLat) +\
- ',' + str(stdWithdrawLat) + ');'
-
- fResult = open(intentFilePath, 'a')
- if dbCmd:
- fResult.write(dbCmd + '\n')
- fResult.close()
- if batch == 0:
- batchIntentSize = 10
- elif batch == 1:
- batchIntentSize = 100
- elif batch == 2:
- batchIntentSize = 1000
- elif batch == 3:
- batchIntentSize = 1500
- if batch < 4:
- main.log.report('Increasing batch intent size to ' +
- str(batchIntentSize))
-
- utilities.assert_equals(expect=main.TRUE, actual=assertion,
- onpass='Batch intent install/withdraw test successful',
- onfail='Batch intent install/withdraw test failed')
-
- def CASE3(self, main):
- """
- Batch intent reroute latency
- """
- import time
- import json
- import requests
- import os
- import numpy
-
- ONOS1Ip = main.params['CTRL']['ip1']
- ONOS2Ip = main.params['CTRL']['ip2']
- ONOS3Ip = main.params['CTRL']['ip3']
- ONOS4Ip = main.params['CTRL']['ip4']
- ONOS5Ip = main.params['CTRL']['ip5']
- ONOS6Ip = main.params['CTRL']['ip6']
- ONOS7Ip = main.params['CTRL']['ip7']
-
- ONOSIpList = []
- for i in range(1, 8):
- ONOSIpList.append(main.params['CTRL']['ip' + str(i)])
-
- ONOSUser = main.params['CTRL']['user']
- defaultSwPort = main.params['CTRL']['port1']
- batchIntentSize = main.params['TEST']['batchIntentSize']
- thresholdMin = int(main.params['TEST']['batchThresholdMin'])
- thresholdMax = int(main.params['TEST']['batchThresholdMax'])
-
- intfs = main.params['TEST']['intfs']
- installTime = main.params['JSON']['installedTime']
- numIter = main.params['TEST']['numIter']
- numIgnore = int(main.params['TEST']['numIgnore'])
- numSwitch = int(main.params['TEST']['numSwitch'])
- nThread = main.params['TEST']['numMult']
-
- tsharkPortStatus = main.params[ 'TSHARK' ][ 'ofpPortStatus' ]
- tsharkPortDown = '/tmp/tshark_port_down_reroute.txt'
-
- if clusterCount == 1:
- for i in range(1, numSwitch + 1):
- main.Mininet1.assignSwController(sw="s" + str(i),
- ip=ONOS1Ip, port=defaultSwPort)
- if clusterCount == 3:
- for i in range(1, 3):
- main.Mininet1.assignSwController(sw="s" + str(i),
- ip=ONOS1Ip, port=defaultSwPort)
- for i in range(3, 6):
- main.Mininet1.assignSwController(sw="s" + str(i),
- ip=ONOS2Ip, port=defaultSwPort)
- for i in range(6, 9):
- main.Mininet1.assignSwController(sw="s" + str(i),
- ip=ONOS3Ip, port=defaultSwPort)
- if clusterCount == 5:
- main.Mininet1.assignSwController(sw='s1',
- ip=ONOS1Ip, port=defaultSwPort)
- main.Mininet1.assignSwController(sw='s2',
- ip=ONOS2Ip, port=defaultSwPort)
- for i in range(3, 6):
- main.Mininet1.assignSwController(sw="s" + str(i),
- ip=ONOS3Ip, port=defaultSwPort)
- main.Mininet1.assignSwController(sw='s6',
- ip=ONOS4Ip, port=defaultSwPort)
- main.Mininet1.assignSwController(sw='s7',
- ip=ONOS5Ip, port=defaultSwPort)
- main.Mininet1.assignSwController(sw='s8',
- ip=ONOS5Ip, port=defaultSwPort)
- if clusterCount == 7:
- for i in range(1, 9):
- if i < 8:
- main.Mininet1.assignSwController(sw="s" + str(i),
- ip=ONOSIpList[i - 1], port=defaultSwPort)
- elif i >= 8:
- main.Mininet1.assignSwController(sw="s" + str(i),
- ip=ONOSIpList[6], port=defaultSwPort)
-
- main.log.report('Batch intent reroute test ')
-
- batchIntentRerouteAvgSystem = numpy.zeros((
- clusterCount, int(numIter)))
- batchIntentRerouteStdSystem = numpy.zeros((
- clusterCount, int(numIter)))
- batchIntentRerouteAvgPort = numpy.zeros((
- clusterCount, int(numIter)))
- batchIntentRerouteStdSystem = numpy.zeros((
- clusterCount, int(numIter)))
-
- time.sleep(10)
-
- main.log.info('Getting list of available devices')
-
- deviceIdList = []
- jsonStr = main.ONOS1cli.devices()
- jsonObj = json.loads(jsonStr)
- for device in jsonObj:
- deviceIdList.append(device['id'])
- if not jsonObj:
- main.log.warn('No devices have been discovered')
- assertion = main.FALSE
-
- sleepTime = 10
-
- baseDir = '/tmp/'
- for batch in range(0, 5):
- maxRerouteLatSystem = []
- maxRerouteLatPort = []
- for i in range(0, int(numIter)):
- rerouteLatSystem = []
- rerouteLatPort = []
- main.log.info('Pushing ' + str(
- int(batchIntentSize) * int(nThread)) +
- ' intents. Iteration ' + str(i))
- main.ONOSbench.pushTestIntentsShell(
- deviceIdList[0] + '/2', deviceIdList[7] +
- '/2', batchIntentSize, '/tmp/batch_install.txt',
- ONOSIpList[0], numMult='1', report=False,
- options='-i')
-
- time.sleep(10)
-
- main.ONOS1.tsharkGrep(tsharkPortStatus, tsharkPortDown)
- main.log.info('Disabling interface ' + intfs)
- main.Mininet1.handle.sendline(
- 'sh ifconfig ' + intfs + ' down')
- t0System = time.time() * 1000
-
- time.sleep(3)
-
- main.ONOS1.tsharkStop()
-
- time.sleep(2)
-
- os.system('scp ' + ONOSUser + '@' + ONOSIpList[0] +
- ':' + tsharkPortDown + ' /tmp/')
- time.sleep(5)
-
- fPortDown = open(tsharkPortDown, 'r')
- fLine = fPortDown.readline()
- objDown = fLine.split(' ')
- if len(fLine) > 0:
- timestampBeginPtDown = int(float(objDown[1]) * 1000)
- if timestampBeginPtDown < 1400000000000:
- timestampBeginPtDown = int(float(objDown[2]) * 1000)
- main.log.info('Port down begin timestamp: ' +
- str(timestampBeginPtDown))
- else:
- main.log.info('Tshark output file returned unexpected' +
- ' results: ' + str(fLine))
- fPortDown.close()
-
- intentsJsonStr1 = main.ONOS1cli.intentsEventsMetrics()
- intentsJsonObj1 = json.loads(intentsJsonStr1)
- intentInstall1 = intentsJsonObj1[installTime]['value']
- intentRerouteLat1 = int(intentInstall1) - int(t0System)
- intentRerouteLatPort1 =\
- int(intentInstall1) - int(timestampBeginPtDown)
-
- if intentRerouteLat1 > thresholdMin and \
- intentRerouteLat1 < thresholdMax and\
- i > numIgnore:
- rerouteLatSystem.append(intentRerouteLat1)
- main.log.info('ONOS1 Intent Reroute Lat ' +
- ' size: ' + str(batchIntentSize) +
- ' system-to-install: ' +
- str(intentRerouteLat1) + ' ms')
- if intentRerouteLatPort1 > thresholdMin and\
- intentRerouteLatPort1 < thresholdMax and\
- i > numIgnore:
- rerouteLatPort.append(intentRerouteLatPort1)
-
- main.log.info('ONOS1 Intent Reroute Lat ' +
- ' size: ' + str(batchIntentSize) +
- ' system-to-install: ' +
- str(intentRerouteLatPort1) + ' ms')
-
- if clusterCount == 3:
- intentsJsonStr2 = main.ONOS2cli.intentsEventsMetrics()
- intentsJsonStr3 = main.ONOS3cli.intentsEventsMetrics()
- intentsJsonObj2 = json.loads(intentsJsonStr2)
- intentsJsonObj3 = json.loads(intentsJsonStr3)
- intentInstall2 = intentsJsonObj2[installTime]['value']
- intentInstall3 = intentsJsonObj3[installTime]['value']
- intentRerouteLat2 = int(intentInstall2) - int(t0System)
- intentRerouteLat3 = int(intentInstall3) - int(t0System)
- intentRerouteLatPort2 = int(intentInstall2) - int(timestampBeginPtDown)
- intentRerouteLatPort3 = int(intentInstall3) - int(timestampBeginPtDown)
-
- if intentRerouteLat2 > thresholdMin and\
- intentRerouteLat2 < thresholdMax and\
- i > numIgnore:
- rerouteLatSystem.append(intentRerouteLat2)
- main.log.info('ONOS2 Intent Reroute Lat' +
- ' size: ' + str(batchIntentSize) +
- ' system-to-install: ' + str(intentRerouteLat2) + ' ms')
- if intentRerouteLat3 > thresholdMin and\
- intentRerouteLat3 < thresholdMax and\
- i > numIgnore:
- rerouteLatSystem.append(intentRerouteLat3)
- main.log.info('ONOS3 Intent Reroute Lat' +
- ' size: ' + str(batchIntentSize) +
- ' system-to-install: ' + str(intentRerouteLat3) +
- ' ms')
- if intentRerouteLatPort2 > thresholdMin and\
- intentRerouteLatPort2 < thresholdMax and\
- i > numIgnore:
- rerouteLatPort.append(intentRerouteLatPort2)
- main.log.info('ONOS2 Intent Reroute Lat' +
- ' size: ' + str(batchIntentSize) +
- ' port-to-install: ' +
- str(intentRerouteLatPort2) + ' ms')
- if intentRerouteLatPort3 > thresholdMin and\
- intentRerouteLatPort3 < thresholdMax and\
- i > numIgnore:
- rerouteLatPort.append(intentRerouteLatPort3)
- main.log.info('ONOS3 Intent Reroute Lat' +
- ' size: ' + str(batchIntentSize) +
- ' port-to-install: ' +
- str(intentRerouteLatPort2) + ' ms')
-
- if clusterCount == 5:
- intentsJsonStr4 = main.ONOS4cli.intentsEventsMetrics()
- intentsJsonStr5 = main.ONOS5cli.intentsEventsMetrics()
- intentsJsonObj4 = json.loads(intentsJsonStr4)
- intentsJsonObj5 = json.loads(intentsJsonStr5)
- intentInstall4 = intentsJsonObj4[installTime]['value']
- intentInstall5 = intentsJsonObj5[installTime]['value']
- intentRerouteLat4 = int(intentInstall4) - int(t0System)
- intentRerouteLat5 = int(intentInstall5) - int(t0System)
- intentRerouteLatPort4 =\
- int(intentInstall4) - int(timestampBeginPtDown)
- intentRerouteLatPort5 =\
- int(intentInstall5) - int(timestampBeginPtDown)
- if intentRerouteLat4 > thresholdMin and\
- intentRerouteLat4 < thresholdMax and \
- i > numIgnore:
- rerouteLatSystem.append(intentRerouteLat4)
- main.log.info('ONOS4 Intent Reroute Lat' +
- ' size: ' + str(batchIntentSize) +
- ' system-to-install: ' + str(intentRerouteLat4) +
- ' ms')
- if intentRerouteLat5 > thresholdMin and\
- intentRerouteLat5 < thresholdMax and\
- i > numIgnore:
- rerouteLatSystem.append(intentRerouteLat5)
- main.log.info('ONOS5 Intent Reroute Lat' +
- ' size: ' + str(batchIntentSize) +
- ' system-to-install: ' +
- str(intentRerouteLat5) + ' ms')
- if intentRerouteLatPort4 > thresholdMin and\
- intentRerouteLatPort4 < thresholdMax and\
- i > numIgnore:
- rerouteLatPort.append(intentRerouteLatPort4)
- main.log.info('ONOS4 Intent Reroute Lat' +
- ' size: ' + str(batchIntentSize) +
- ' port-to-install: ' +
- str(intentRerouteLatPort4) + ' ms')
- if intentRerouteLatPort5 > thresholdMin and\
- intentRerouteLatPort5 < thresholdMax and\
- i > numIgnore:
- rerouteLatPort.append(intentRerouteLatPort5)
- main.log.info('ONOS5 Intent Reroute Lat' +
- ' size: ' + str(batchIntentSize) +
- ' port-to-install: ' +
- str(intentRerouteLatPort5) + ' ms')
-
- if clusterCount == 7:
- intentsJsonStr6 = main.ONOS6cli.intentsEventsMetrics()
- intentsJsonStr7 = main.ONOS7cli.intentsEventsMetrics()
- intentsJsonObj6 = json.loads(intentsJsonStr6)
- intentsJsonObj7 = json.loads(intentsJsonStr7)
- intentInstall6 = intentsJsonObj6[installTime]['value']
- intentInstall7 = intentsJsonObj7[installTime]['value']
- intentRerouteLat6 = int(intentInstall6) - int(t0System)
- intentRerouteLat7 = int(intentInstall7) - int(t0System)
- intentRerouteLatPort4 =\
- int(intentInstall4) - int(timestampBeginPtDown)
- intentRerouteLatPort5 =\
- int(intentInstall5) - int(timestampBeginPtDown)
- if intentRerouteLat6 > thresholdMin and\
- intentRerouteLat6 < thresholdMax and\
- i > numIgnore:
- rerouteLatSystem.append(intentRerouteLat6)
- main.log.info('ONOS6 Intent Reroute Lat' +
- ' size: ' + str(batchIntentSize) +
- ' system-to-install: ' +
- str(intentRerouteLat6) + ' ms')
- if intentRerouteLat7 > thresholdMin and\
- intentRerouteLat7 < thresholdMax and\
- i > numIgnore:
- rerouteLatSystem.append(intentRerouteLat7)
- main.log.info('ONOS7 Intent Reroute Lat' +
- ' size: ' + str(batchIntentSize) +
- ' system-to-install: ' +
- str(intentRerouteLat7) + ' ms')
- if intentRerouteLatPort6 > thresholdMin and\
- intentRerouteLatPort6 < thresholdMax and\
- i > numIgnore:
- rerouteLatPort.append(intentRerouteLatPort6)
- main.log.info('ONOS6 Intent Reroute Lat' +
- ' size: ' + str(batchIntentSize) +
- ' port-to-install: ' +
- str(intentRerouteLatPort6) + ' ms')
- if intentRerouteLatPort7 > thresholdMin and\
- intentRerouteLatPort7 < thresholdMax and\
- i > numIgnore:
- rerouteLatPort.append(intentRerouteLatPort7)
- main.log.info('ONOS7 Intent Reroute Lat' +
- ' size: ' + str(batchIntentSize) +
- ' port-to-install: ' +
- str(intentRerouteLatPort7) + ' ms')
-
- time.sleep(5)
-
- main.log.info('System: ' + str(rerouteLatSystem))
- main.log.info('Port: ' + str(rerouteLatPort))
- if rerouteLatSystem:
- maxRerouteLatSystem = max(rerouteLatSystem)
- main.log.info('Max system: ' + str(maxRerouteLatSystem))
- if rerouteLatPort:
- maxRerouteLatPort = max(rerouteLatPort)
- main.log.info('Max port: ' + str(maxRerouteLatPort))
-
- # Bring port back up for next iteration
- main.Mininet1.handle.sendline('sh ifconfig ' + intfs + ' up')
- time.sleep(5)
-
- # Use 'withdraw' option to withdraw batch intents
- main.ONOSbench.pushTestIntentsShell(
- deviceIdList[0] + '/2', deviceIdList[7] + '/2',
- batchIntentSize, '/tmp/batch_install.txt',
- ONOSIpList[0], numMult='1', report=False, options='-w')
- main.log.info('Intents removed and port back up')
-
- # NOTE: End iteration loop
- if batch == 1:
- batchIntentSize = 10
- elif batch == 2:
- batchIntentSize = 100
- elif batch == 3:
- batchIntentSize = 500
- elif batch == 4:
- batchIntentSize = 1000
- main.log.info('Batch intent size increased to ' + str(batchIntentSize))
-
- def CASE4(self, main):
- """
- Increase number of nodes and initiate CLI
- """
- global clusterCount
- import time
- import json
-
- clusterCount += 2
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- features = main.params[ 'TEST' ][ 'cellStr' ]
- benchIp = main.params[ 'BENCH' ][ 'ip' ]
- mininetIp = main.params[ 'MN' ][ 'ip1' ]
-
- main.log.report('Increasing cluster size to ' + str(clusterCount))
-
- ONOSIp = []
- for i in range( 1, 8 ):
- ONOSIp.append( main.params[ 'CTRL' ][ 'ip'+str(i) ] )
-
- main.step( "Cleaning environment" )
- for i in range( 0, 7 ):
- main.ONOSbench.onosDie( ONOSIp[i] )
- main.log.info( "Uninstalling ONOS "+str(i+1) )
- main.ONOSbench.onosUninstall( ONOSIp[i] )
-
- main.step( "Creating new cell file" )
- cellIp = []
- for node in range( 1, clusterCount + 1 ):
- cellIp.append( ONOSIp[node] )
- main.ONOSbench.createCellFile( benchIp, cellName,
- mininetIp, str(features), *cellIp )
-
- main.step( "Setting cell definition" )
- main.ONOSbench.setCell( cellName )
-
- main.step( "Packaging cell definition" )
- main.ONOSbench.onosPackage()
-
- for node in range( 1, clusterCount + 1 ):
- main.ONOSbench.onosInstall( node = ONOSIp[node] )
-
- time.sleep( 20 )
-
- for node in range( 1, clusterCount + 1 ):
- for i in range( 2 ):
- isup = main.ONOSbench.isup( ONOSIp[node] )
- if isup:
- main.log.info( "ONOS "+str(node) + " is up\n")
- assertion = main.TRUE
- break
- if not isup:
- main.log.info( "ONOS" + str(node) + " did not start")
-
- for node in range( 1, clusterCount + 1 ):
- exec "a = main.ONOS%scli.startOnosCli" %str(node)
- a( ONOSIp[node] )
-
- time.sleep(30)
-
- utilities.assert_equals(expect=main.TRUE, actual=assertion,
- onpass='Scale out to ' + str(clusterCount) + ' nodes successful',
- onfail='Scale out to ' + str(clusterCount) + ' nodes failed')
-
diff --git a/TestON/tests/IntentPerfNextBM/IntentPerfNextBM.topo b/TestON/tests/IntentPerfNextBM/IntentPerfNextBM.topo
deleted file mode 100644
index 197acfa..0000000
--- a/TestON/tests/IntentPerfNextBM/IntentPerfNextBM.topo
+++ /dev/null
@@ -1,109 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOS1cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1cli>
-
- <ONOS2cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2cli>
-
- <ONOS3cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3cli>
-
- <ONOS4cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4cli>
-
- <ONOS5cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5cli>
-
- <ONOS6cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6cli>
-
- <ONOS7cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7cli>
-
- <ONOS1>
- <host>10.254.1.201</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <Mininet1>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>10</connect_order>
- <COMPONENTS>
- <arg1> --custom topo-intent-8sw.py </arg1>
- <arg2> --arp --mac --topo mytopo </arg2>
- <arg3> </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet1>
-
- <Mininet2>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>11</connect_order>
- <COMPONENTS> </COMPONENTS>
- </Mininet2>
-
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/IntentRerouteLat/IntentRerouteLat.params b/TestON/tests/IntentRerouteLat/IntentRerouteLat.params
deleted file mode 100644
index 2e43679..0000000
--- a/TestON/tests/IntentRerouteLat/IntentRerouteLat.params
+++ /dev/null
@@ -1,79 +0,0 @@
-<PARAMS>
-
- <testcases>1,2,1,2,1,2,1,2</testcases>
-
- <SCALE>1,3,5,7</SCALE>
- <availableNodes>7</availableNodes>
-
- <ENV>
- <cellName>intentRerouteCell</cellName>
- <cellApps>drivers,null,intentperf,metrics</cellApps>
- </ENV>
-
- <TEST>
- <skipCleanInstall>yes</skipCleanInstall>
- <warmUp>5</warmUp>
- <sampleSize>20</sampleSize>
- <wait></wait>
- <intents>1,100,1000</intents> #list format, will be split on ','
- <debug>True</debug>
-
- <s1>1,1,1,1,1,1,1,1</s1>
- <s3>2,2,1,1,3,3,3,1</s3>
- <s5>2,2,1,1,3,4,5,3</s5>
- <s7>2,3,1,1,5,6,7,4</s7>
-
- </TEST>
-
- <METRICS>
- <Submitted>0</Submitted>
- <Installed>1</Installed>
- <Failed>0</Failed>
- <Withdraw>0</Withdraw>
- <Withdrawn>0</Withdrawn>
- </METRICS>
-
- <GIT>
- <autopull>off</autopull>
- <checkout>master</checkout>
- </GIT>
-
- <CTRL>
- <USER>admin</USER>
-
- <ip1>OC1</ip1>
- <port1>6633</port1>
-
- <ip2>OC2</ip2>
- <port2>6633</port2>
-
- <ip3>OC3</ip3>
- <port3>6633</port3>
-
- <ip4>OC4</ip4>
- <port4>6633</port4>
-
- <ip5>OC5</ip5>
- <port5>6633</port5>
-
- <ip6>OC6</ip6>
- <port6>6633</port6>
-
- <ip7>OC7</ip7>
- <port7>6633</port7>
-
- </CTRL>
-
- <MN>
- <ip1>OCN</ip1>
- </MN>
-
- <BENCH>
- <user>admin</user>
- <ip1>OCN</ip1>
- </BENCH>
-
- <JSON>
- </JSON>
-
-</PARAMS>
diff --git a/TestON/tests/IntentRerouteLat/IntentRerouteLat.py b/TestON/tests/IntentRerouteLat/IntentRerouteLat.py
deleted file mode 100644
index 9127690..0000000
--- a/TestON/tests/IntentRerouteLat/IntentRerouteLat.py
+++ /dev/null
@@ -1,427 +0,0 @@
-# ScaleOutTemplate
-#
-# CASE1 starts number of nodes specified in param file
-#
-# cameron@onlab.us
-
-import sys
-import os.path
-
-
-class IntentRerouteLat:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
-
- import time
- global init
- try:
- if type(init) is not bool:
- init = False
- except NameError:
- init = False
-
- #Load values from params file
- checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
- gitPull = main.params[ 'GIT' ][ 'autopull' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- Apps = main.params[ 'ENV' ][ 'cellApps' ]
- BENCHUser = main.params[ 'BENCH' ][ 'user' ]
- maxNodes = int(main.params[ 'availableNodes' ])
- skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
-
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
- init = True
- global clusterCount #number of nodes running
- global ONOSIp #list of ONOS IP addresses
- global scale
- global commit
-
- clusterCount = 0
- ONOSIp = [ 0 ]
- scale = (main.params[ 'SCALE' ]).split(",")
- clusterCount = int(scale[0])
-
- #Populate ONOSIp with ips from params
- ONOSIp = [0]
- ONOSIp.extend(main.ONOSbench.getOnosIps())
-
- print("-----------------" + str(ONOSIp))
- #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
- if skipMvn != "yes":
- mvnResult = main.ONOSbench.cleanInstall()
-
- #git
- main.step( "Git checkout and pull " + checkoutBranch )
- if gitPull == 'on':
- checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
- pullResult = main.ONOSbench.gitPull()
-
- else:
- checkoutResult = main.TRUE
- pullResult = main.TRUE
- main.log.info( "Skipped git checkout and pull" )
-
- commit = main.ONOSbench.getVersion()
- commit = (commit.split(" "))[1]
-
- resultsDB = open("IntentRerouteLatDB", "w+")
- resultsDB.close()
-
- # -- END OF INIT SECTION --#
-
- clusterCount = int(scale[0])
- scale.remove(scale[0])
-
- MN1Ip = ONOSIp[len(ONOSIp)-1]
- BENCHIp = ONOSIp[len(ONOSIp)-2]
-
- #kill off all onos processes
- main.log.step("Safety check, killing all ONOS processes")
- main.log.step("before initiating enviornment setup")
- for node in range(1, maxNodes + 1):
- main.ONOSbench.onosDie(ONOSIp[node])
-
- #Uninstall everywhere
- main.log.step( "Cleaning Enviornment..." )
- for i in range(1, maxNodes + 1):
- main.log.info(" Uninstalling ONOS " + str(i) )
- main.ONOSbench.onosUninstall( ONOSIp[i] )
-
- #construct the cell file
- main.log.info("Creating cell file")
- cellIp = []
- for node in range (1, clusterCount + 1):
- cellIp.append(ONOSIp[node])
-
- print "Cell ip" + str(cellIp)
- print cellName
- print MN1Ip
- print Apps
-
-
- main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), *cellIp)
-
- main.step( "Set Cell" )
- main.ONOSbench.setCell(cellName)
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "verify cells" )
- verifyCellResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Initializing " + str( clusterCount ) + " node cluster." )
- for node in range(1, clusterCount + 1):
- main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
- main.ONOSbench.onosInstall( ONOSIp[node])
-
- for node in range(1, clusterCount + 1):
- for i in range( 2 ):
- isup = main.ONOSbench.isup( ONOSIp[node] )
- if isup:
- main.log.info("ONOS " + str(node) + " is up\n")
- break
- if not isup:
- main.log.report( "ONOS " + str(node) + " didn't start!" )
- main.log.info("Startup sequence complete")
-
- deviceMastership = (main.params[ 'TEST' ][ "s" + str(clusterCount) ]).split(",")
- print("Device mastership list: " + str(deviceMastership))
-
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders deviceCount 8 " """)
- main.ONOSbench.handle.expect(":~")
- print repr(main.ONOSbench.handle.before)
- time.sleep(3)
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders topoShape reroute" """)
- main.ONOSbench.handle.expect(":~")
- print repr(main.ONOSbench.handle.before)
- time.sleep(3)
-
- time.sleep(10)
-
- once = True
- for attempt in range(0,10):
- main.ONOSbench.handle.sendline("onos $OC1 summary")
- main.ONOSbench.handle.expect(":~")
- x = main.ONOSbench.handle.before
- main.log.info("Initial setup. ONOS summary response: \n" + x + "\n")
-
- if "devices=8" in x and "links=16," in x:
- break
- else:
- if once == False:
- main.log.error("Null provider start failed, retrying..")
- once = False
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders enabled false" """)
- main.ONOSbench.handle.expect(":~")
- time.sleep(3)
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders enabled true" """)
- main.ONOSbench.handle.expect(":~")
- time.sleep(8)
-
- index = 1
- for node in deviceMastership:
- for attempt in range(0,10):
- cmd = ( "onos $OC" + node + """ "device-role null:000000000000000""" + str(index) + " " + ONOSIp[int(node)] + """ master" """)
- main.log.info("assigning mastership of device " + str(index) + " to node " + node + ": \n " + cmd + "\n")
- main.ONOSbench.handle.sendline(cmd)
- main.ONOSbench.handle.expect(":~")
- time.sleep(4)
-
- cmd = ( "onos $OC" + node + " roles|grep 00000" + str(index))
- main.log.info(cmd)
- main.ONOSbench.handle.sendline(cmd)
- main.ONOSbench.handle.expect(":~")
- check = main.ONOSbench.handle.before
- main.log.info("CHECK:\n" + check)
- if ("master=" + ONOSIp[int(node)]) in check:
- break
- index += 1
-
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
-
- def CASE2( self, main ):
-
- import time
- import numpy
- import datetime
- #from scipy import stats
-
- ts = time.time()
- date = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d')
-
- sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
- warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
- intentsList = (main.params[ 'TEST' ][ 'intents' ]).split(",")
- debug = main.params[ 'TEST' ][ 'debug' ]
- for i in range(0,len(intentsList)):
- intentsList[i] = int(intentsList[i])
-
- timestampMetrics = []
- if main.params['METRICS']['Submitted'] == "1":
- timestampMetrics.append("Submitted")
- if main.params['METRICS']['Installed'] == "1":
- timestampMetrics.append("Installed")
- if main.params['METRICS']['Failed'] == "1":
- timestampMetrics.append("Failed")
- if main.params['METRICS']['Withdraw'] == "1":
- timestampMetrics.append("Withdraw")
- if main.params['METRICS']['Withdrawn'] == "1":
- timestampMetrics.append("Withdrawn")
- if debug: main.log.info(timestampMetrics)
-
- if debug == "True":
- debug = True
- else:
- debug = False
-
- ingress = "null:0000000000000001"
- egress = "null:0000000000000007"
-
- for intents in intentsList:
- main.log.report("Intent Batch size: " + str(intents) + "\n ")
- myResult = [["latency", "lastNode"] for x in range(sampleSize)]
-
- for run in range(0, (warmUp + sampleSize)):
- if run > warmUp:
- main.log.info("Starting test iteration " + str(run-warmUp))
-
- cmd = """onos $OC1 "push-test-intents -i """
- cmd += ingress + "/0 "
- cmd += egress + "/0 "
- cmd += str(intents) +""" 1" """
- if debug: main.log.info(cmd)
-
- withdrawCmd = cmd.replace("intents -i", "intents -w ")
-
- #push-test-intents
- main.ONOSbench.handle.sendline(cmd)
- main.ONOSbench.handle.expect(":~")
- myRawResult = main.ONOSbench.handle.before
-
- for i in range(0, 40):
- main.ONOSbench.handle.sendline("onos $OC1 summary")
- main.ONOSbench.handle.expect(":~")
- linkCheck = main.ONOSbench.handle.before
- if ("links=16,") in linkCheck and ("flows=" + str(intents*7) + ","):
- break
- if i == 39:
- main.log.error("Flow/link count incorrect, data invalid."+ linkCheck)
-
-
- #collect timestamp from link cut
- cmd = """onos $OC1 null-link "null:0000000000000004/1 null:0000000000000003/2 down" """
- if debug: main.log.info("COMMAND: " + str(cmd))
- main.ONOSbench.handle.sendline(cmd)
- main.ONOSbench.handle.expect(":~")
-
- cmd = "onos-ssh $OC1 cat /opt/onos/log/karaf.log | grep TopologyManager| tail -1"
- for i in range(0,10):
- main.ONOSbench.handle.sendline(cmd)
- time.sleep(2)
- main.ONOSbench.handle.expect(":~")
- raw = main.ONOSbench.handle.before
- #if "NullLinkProvider" in raw and "links=14" in raw:
- if "links=14" in raw:
- break
- if i >= 9:
- main.log.error("Expected output not being recieved... continuing")
- main.log.info(raw)
- break
- time.sleep(2)
-
- temp = raw.splitlines()
- for line in temp:
- if str(date) in line:
- temp = line
- break
-
- cutTimestamp = (temp.split(" "))[0] + " " + (temp.split(" "))[1]
- if debug: main.log.info("Cut timestamp: " + cutTimestamp)
-
- #validate link count and flow count
- for i in range(0, 40):
- main.ONOSbench.handle.sendline("onos $OC1 summary")
- main.ONOSbench.handle.expect(":~")
- linkCheck = main.ONOSbench.handle.before
- #if "links=" + str(7*intents)+ "," in linkCheck and ("flows=" + str(7*intents) + ",") in linkCheck:
- if "links=14," in linkCheck and ("flows=" + str(8*intents) + ",") in linkCheck:
- break
- if i == 39:
- main.log.error("Link or flow count incorrect, data invalid." + linkCheck)
-
- time.sleep(5) #trying to avoid negative values
-
- #intents events metrics installed timestamp
- IEMtimestamps = [0]*(clusterCount + 1)
- installedTemp = [0]*(clusterCount + 1)
- for node in range(1, clusterCount +1):
- cmd = "onos $OC" + str(node) + """ "intents-events-metrics"|grep Timestamp """
- raw = ""
- while "epoch)" not in raw:
- main.ONOSbench.handle.sendline(cmd)
- main.ONOSbench.handle.expect(":~")
- raw = main.ONOSbench.handle.before
-
- print(raw)
-
- intentsTimestamps = {}
- rawTimestamps = raw.splitlines()
- for line in rawTimestamps:
- if "Timestamp" in line and "grep" not in line:
- metricKey = (line.split(" "))[1]
- metricTimestamp = (line.split(" ")[len(line.split(" ")) -1]).replace("epoch)=","")
- metricTimestamp = float(metricTimestamp)
- metricTimestamp = numpy.divide(metricTimestamp, 1000)
- if debug: main.log.info(repr(metricTimestamp))
- intentsTimestamps[metricKey] = metricTimestamp
- if metricKey == "Installed":
- installedTemp[node] = metricTimestamp
-
- main.log.info("Node: " + str(node) + " Timestamps: " + str(intentsTimestamps))
- IEMtimestamps[node] = intentsTimestamps
-
- myMax = max(installedTemp)
- indexOfMax = installedTemp.index(myMax)
-
- #number crunch
- for metric in timestampMetrics: #this is where we sould add support for computing other timestamp metrics
- if metric == "Installed":
- if run >= warmUp:
- main.log.report("link cut timestamp: " + cutTimestamp)
- #readableInstalledTimestamp = str(intentsTimestamps["Installed"])
- readableInstalledTimestamp = str(myMax)
-
- #main.log.report("Intent Installed timestamp: " + str(intentsTimestamps["Installed"]))
- main.log.report("Intent Installed timestamp: " + str(myMax))
-
- cutEpoch = time.mktime(time.strptime(cutTimestamp, "%Y-%m-%d %H:%M:%S,%f"))
- if debug: main.log.info("cutEpoch=" + str(cutEpoch))
- #rerouteLatency = float(intentsTimestamps["Installed"] - cutEpoch)
- rerouteLatency = float(myMax - cutEpoch)
-
- rerouteLatency = numpy.divide(rerouteLatency, 1000)
- main.log.report("Reroute latency:" + str(rerouteLatency) + " (seconds)\n ")
- myResult[run-warmUp][0] = rerouteLatency
- myResult[run-warmUp][1] = indexOfMax
- if debug: main.log.info("Latency: " + str(myResult[run-warmUp][0]))
- if debug: main.log.info("last node: " + str(myResult[run-warmUp][1]))
-
- cmd = """ onos $OC1 null-link "null:0000000000000004/1 null:0000000000000003/2 up" """
- if debug: main.log.info(cmd)
- main.ONOSbench.handle.sendline(cmd)
- main.ONOSbench.handle.expect(":~")
-
-
-
- #wait for intent withdraw
- main.ONOSbench.handle.sendline(withdrawCmd)
- main.log.info(withdrawCmd)
- main.ONOSbench.handle.expect(":~")
- if debug: main.log.info(main.ONOSbench.handle.before)
- main.ONOSbench.handle.sendline("onos $OC1 intents|grep WITHDRAWN|wc -l")
- main.ONOSbench.handle.expect(":~")
- intentWithdrawCheck = main.ONOSbench.handle.before
- if (str(intents)) in intentWithdrawCheck:
- main.log.info("intents withdrawn")
- if debug: main.log.info(intentWithdrawCheck)
-
- # wait for links to be reestablished
- for i in range(0, 10):
- main.ONOSbench.handle.sendline("onos $OC1 summary")
- main.ONOSbench.handle.expect(":~")
- linkCheck = main.ONOSbench.handle.before
- if "links=16," in linkCheck:
- break
- time.sleep(1)
- if i == 9:
- main.log.info("Links Failed to reconnect, next iteration of data invalid." + linkCheck)
-
- if run < warmUp:
- main.log.info("Warm up run " + str(run+1) + " completed")
-
- if debug: main.log.info(myResult)
- latTemp = []
- nodeTemp = []
- for i in myResult:
- latTemp.append(i[0])
- nodeTemp.append(i[1])
-
- mode = {}
- for i in nodeTemp:
- if i in mode:
- mode[i] += 1
- else:
- mode[i] = 1
-
- for i in mode.keys():
- if mode[i] == max(mode.values()):
- nodeMode = i
-
- average = numpy.average(latTemp)
- stdDev = numpy.std(latTemp)
-
- average = numpy.multiply(average, 1000)
- stdDev = numpy.multiply(stdDev, 1000)
-
- main.log.report("Scale: " + str(clusterCount) + " \tIntent batch: " + str(intents))
- main.log.report("Latency average:................" + str(average))
- main.log.report("Latency standard deviation:....." + str(stdDev))
- main.log.report("Mode of last node to respond:..." + str(nodeMode))
- main.log.report("________________________________________________________")
-
- resultsDB = open("IntentRerouteLatDB", "a")
- resultsDB.write("'" + commit + "',")
- resultsDB.write(str(clusterCount) + ",")
- resultsDB.write(str(intents) + ",")
- resultsDB.write(str(average) + ",")
- resultsDB.write(str(stdDev) + "\n")
- resultsDB.close()
-
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"])
-
diff --git a/TestON/tests/IntentRerouteLat/IntentRerouteLat.topo b/TestON/tests/IntentRerouteLat/IntentRerouteLat.topo
deleted file mode 100644
index d82f3fd..0000000
--- a/TestON/tests/IntentRerouteLat/IntentRerouteLat.topo
+++ /dev/null
@@ -1,144 +0,0 @@
-<TOPOLOGY>
-
- <COMPONENT>
-
- <ONOSbench>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS><home>~/onos</home></COMPONENTS>
- </ONOSbench>
-
- <ONOS1cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1cli>
-
- <ONOS2cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2cli>
-
- <ONOS3cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3cli>
-
- <ONOS4cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4cli>
-
- <ONOS5cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5cli>
-
- <ONOS6cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6cli>
-
- <ONOS7cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7cli>
-
- <ONOS1>
- <host>OC1</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>OC2</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>10</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>OC3</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>11</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
- <ONOS4>
- <host>OC4</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>12</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4>
-
-
- <ONOS5>
- <host>OC5</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>13</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5>
-
- <ONOS6>
- <host>OC6</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>14</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6>
-
- <ONOS7>
- <host>OC7</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>15</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7>
-
- </COMPONENT>
-
-</TOPOLOGY>
-
diff --git a/TestON/tests/IntentRerouteLat/__init__.py b/TestON/tests/IntentRerouteLat/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/IntentRerouteLat/__init__.py
+++ /dev/null
diff --git a/TestON/tests/IpOptical/IpOptical.params b/TestON/tests/IpOptical/IpOptical.params
deleted file mode 100755
index 62e44a8..0000000
--- a/TestON/tests/IpOptical/IpOptical.params
+++ /dev/null
@@ -1,41 +0,0 @@
-<PARAMS>
- #20,21,22,25,10,23,24
- <testcases>20,21,22,10,25,23,24</testcases>
- #Environment variables
- <ENV>
- <cellName>driver_test</cellName>
- </ENV>
-
- <CTRL>
- <ip1>10.128.20.11</ip1>
- <port1>6633</port1>
- </CTRL>
-
- <PING>
- <source1>h8</source1>
- <source2>h9</source2>
- <source3>h10</source3>
- <source4>h11</source4>
- <source5>h12</source5>
- <source6>h13</source6>
- <source7>h14</source7>
- <source8>h15</source8>
- <source9>h16</source9>
- <source10>h17</source10>
- <target1>10.0.0.18</target1>
- <target2>10.0.0.19</target2>
- <target3>10.0.0.20</target3>
- <target4>10.0.0.21</target4>
- <target5>10.0.0.22</target5>
- <target6>10.0.0.23</target6>
- <target7>10.0.0.24</target7>
- <target8>10.0.0.25</target8>
- <target9>10.0.0.26</target9>
- <target10>10.0.0.27</target10>
- </PING>
-
- <timers>
- <LinkDiscovery>5</LinkDiscovery>
- <SwitchDiscovery>15</SwitchDiscovery>
- </timers>
-</PARAMS>
diff --git a/TestON/tests/IpOptical/IpOptical.py b/TestON/tests/IpOptical/IpOptical.py
deleted file mode 100644
index c4a4eb6..0000000
--- a/TestON/tests/IpOptical/IpOptical.py
+++ /dev/null
@@ -1,630 +0,0 @@
-
-# Testing the basic functionality of ONOS Next
-# For sanity and driver functionality excercises only.
-
-import time
-# import sys
-# import os
-# import re
-import json
-
-time.sleep( 1 )
-
-class IpOptical:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- import time
- """
- Startup sequence:
- cell <name>
- onos-verify-cell
- onos-remove-raft-log
- git pull
- mvn clean install
- onos-package
- onos-install -f
- onos-wait-for-start
- """
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-
- main.case( "Setting up test environment" )
- main.log.report(
- "This testcase is testing setting up test environment" )
- main.log.report( "__________________________________" )
-
- main.step( "Applying cell variable to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- main.step( "Removing raft logs before a clen installation of ONOS" )
- main.ONOSbench.onosRemoveRaftLogs()
-
- main.step( "Git checkout and get version" )
- #main.ONOSbench.gitCheckout( "master" )
- gitPullResult = main.ONOSbench.gitPull()
- main.log.info( "git_pull_result = " + str( gitPullResult ))
- main.ONOSbench.getVersion( report=True )
-
- if gitPullResult == 100:
- main.step( "Using mvn clean & install" )
- main.ONOSbench.cleanInstall()
- elif gitPullResult == 0:
- main.log.report(
- "Git Pull Failed, look into logs for detailed reason" )
- main.cleanup()
- main.exit()
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Uninstalling ONOS package" )
- ONOSip1 = main.params[ 'CTRL' ][ 'ip1' ]
- onosUninstallResult = main.ONOSbench.onosUninstall( nodeIp = ONOSip1)
- if onosUninstallResult:
- main.log.report( "Uninstalling ONOS package successful" )
- else:
- main.log.report( "Uninstalled ONOS package unsucessful" )
- time.sleep( 5 )
- main.step( "Installing ONOS package" )
- onosInstallResult = main.ONOSbench.onosInstall( node = ONOSip1 )
- if onosInstallResult == main.TRUE:
- main.log.report( "Installing ONOS package successful" )
- else:
- main.log.report( "Installing ONOS package failed" )
-
- onos1Isup = main.ONOSbench.isup()
- if onos1Isup == main.TRUE:
- main.log.report( "ONOS instance is up and ready" )
- else:
- main.log.report( "ONOS instance may not be up" )
-
- main.step( "Starting ONOS service" )
- startResult = main.ONOSbench.onosStart( ONOS1Ip )
-
- main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
- main.step( "Starting Mininet CLI..." )
-
- def CASE20( self ):
- """
- Exit from mininet cli
- reinstall ONOS
- """
- import time
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-
- main.log.report( "This testcase exits the mininet cli and reinstalls" +
- "ONOS to switch over to Packet Optical topology" )
- main.log.report( "_____________________________________________" )
- main.case( "Disconnecting mininet and restarting ONOS" )
-
- main.step( "Disconnecting mininet and restarting ONOS" )
- step1Result = main.TRUE
- mininetDisconnect = main.Mininet1.disconnect()
- print "mininetDisconnect = ", mininetDisconnect
- step1Result = mininetDisconnect
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Mininet disconnect successfully",
- onfail="Mininet failed to disconnect")
- """
- main.step( "Removing raft logs before a clean installation of ONOS" )
- step2Result = main.TRUE
- removeRaftLogsResult = main.ONOSbench.onosRemoveRaftLogs()
- step2Result = removeRaftLogsResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Raft logs removed successfully",
- onfail="Failed to remove raft logs")
- """
- main.step( "Applying cell variable to environment" )
- step3Result = main.TRUE
- setCellResult = main.ONOSbench.setCell( cellName )
- verifyCellResult = main.ONOSbench.verifyCell()
- step3Result = setCellResult and verifyCellResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step3Result,
- onpass="Cell applied successfully",
- onfail="Failed to apply cell")
-
- main.step( "Uninstalling ONOS package" )
- step4Result = main.TRUE
- ONOSip1 = main.params[ 'CTRL' ][ 'ip1' ]
- onosUninstallResult = main.ONOSbench.onosUninstall( nodeIp = ONOSip1)
- step4Result = onosUninstallResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step4Result,
- onpass="Successfully uninstalled ONOS",
- onfail="Failed to uninstall ONOS")
-
- time.sleep( 5 )
- main.step( "Installing ONOS package" )
- step5Result = main.TRUE
- onosInstallResult = main.ONOSbench.onosInstall( node = ONOSip1 )
- step5Result = onosInstallResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step5Result,
- onpass="Successfully installed ONOS",
- onfail="Failed to install ONOS")
-
- onos1Isup = main.ONOSbench.isup()
- if onos1Isup == main.TRUE:
- main.log.report( "ONOS instance is up and ready" )
- else:
- main.log.report( "ONOS instance may not be up" )
-
- main.step( "Starting ONOS service" )
- step6Result = main.TRUE
- startResult = main.ONOSbench.onosStart( ONOS1Ip )
- step6Result = startResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step6Result,
- onpass="Successfully started ONOS",
- onfail="Failed to start ONOS")
-
- main.step( "Starting ONOS cli" )
- step7Result = main.TRUE
- cliResult = main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
- step7Result = cliResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step7Result,
- onpass="Successfully started ONOS cli",
- onfail="Failed to start ONOS cli")
-
- def CASE21( self, main ):
- """
- On ONOS bench, run this command:
- sudo -E python ~/onos/tools/test/topos/opticalTest.py -OC1
- which spawns packet optical topology and copies the links
- json file to the onos instance.
- Note that in case of Packet Optical, the links are not learnt
- from the topology, instead the links are learnt
- from the json config file
- """
- import time
- main.log.report(
- "This testcase starts the packet layer topology and REST" )
- main.log.report( "_____________________________________________" )
- main.case( "Starting LINC-OE and other components" )
-
- main.step( "Activate optical app" )
- step1Result = main.TRUE
- activateOpticalResult = main.ONOS2.activateApp( "org.onosproject.optical" )
- step1Result = activateOpticalResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully activated optical app",
- onfail="Failed to activate optical app")
-
- appCheck = main.ONOS2.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOS2.apps() )
- main.log.warn( main.ONOS2.appIDs() )
-
- main.step( "Starting mininet and LINC-OE" )
- step2Result = main.TRUE
- time.sleep( 10 )
- opticalMnScript = main.LincOE2.runOpticalMnScript(ctrllerIP = main.params[ 'CTRL' ][ 'ip1' ])
- step2Result = opticalMnScript
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Started the topology successfully ",
- onfail="Failed to start the topology")
-
- def CASE22( self, main ):
- """
- Curretly we use, 10 optical switches(ROADM's) and
- 6 packet layer mininet switches each with one host.
- Therefore, the roadmCount variable = 10,
- packetLayerSWCount variable = 6, hostCount=6 and
- links=46.
- All this is hardcoded in the testcase. If the topology changes,
- these hardcoded values need to be changed
- """
- import time
- main.log.report(
- "This testcase compares the optical+packet topology against what" +
- " is expected" )
- main.case( "Topology comparision" )
-
- main.step( "Starts new ONOS cli" )
- step1Result = main.TRUE
- cliResult = main.ONOS3.startOnosCli( ONOSIp=main.params[ 'CTRL' ]\
- [ 'ip1' ] )
- step1Result = cliResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully starts a new cli",
- onfail="Failed to start new cli" )
-
- main.step( "Compare topology" )
- step2Result = main.TRUE
- devicesResult = main.ONOS3.devices( jsonFormat=False )
- print "devices_result :\n", devicesResult
- devicesLinewise = devicesResult.split( "\n" )
- roadmCount = 0
- packetLayerSWCount = 0
- for line in devicesLinewise:
- components = line.split( "," )
- availability = components[ 1 ].split( "=" )[ 1 ]
- type = components[ 3 ].split( "=" )[ 1 ]
- if availability == 'true' and type == 'ROADM':
- roadmCount += 1
- elif availability == 'true' and type == 'SWITCH':
- packetLayerSWCount += 1
- if roadmCount == 10:
- print "Number of Optical Switches = %d and is" % roadmCount +\
- " correctly detected"
- main.log.info(
- "Number of Optical Switches = " +
- str( roadmCount ) +
- " and is correctly detected" )
- opticalSWResult = main.TRUE
- else:
- print "Number of Optical Switches = %d and is wrong" % roadmCount
- main.log.info(
- "Number of Optical Switches = " +
- str( roadmCount ) +
- " and is wrong" )
- opticalSWResult = main.FALSE
- if packetLayerSWCount == 6:
- print "Number of Packet layer or mininet Switches = %d "\
- % packetLayerSWCount + "and is correctly detected"
- main.log.info(
- "Number of Packet layer or mininet Switches = " +
- str( packetLayerSWCount ) +
- " and is correctly detected" )
- packetSWResult = main.TRUE
- else:
- print "Number of Packet layer or mininet Switches = %d and"\
- % packetLayerSWCount + " is wrong"
- main.log.info(
- "Number of Packet layer or mininet Switches = " +
- str( packetLayerSWCount ) +
- " and is wrong" )
- packetSWResult = main.FALSE
- # sleeps for sometime so the state of the switches will be active
- time.sleep( 30 )
- print "_________________________________"
- linksResult = main.ONOS3.links( jsonFormat=False )
- print "links_result = ", linksResult
- print "_________________________________"
- linkActiveCount = linksResult.count("state=ACTIVE")
- main.log.info( "linkActiveCount = " + str( linkActiveCount ))
- if linkActiveCount == 46:
- linkActiveResult = main.TRUE
- main.log.info(
- "Number of links in ACTIVE state are correct")
- else:
- linkActiveResult = main.FALSE
- main.log.info(
- "Number of links in ACTIVE state are wrong")
- step2Result = opticalSWResult and packetSWResult and \
- linkActiveResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Successfully loaded packet optical topology",
- onfail="Failed to load packet optical topology" )
-
- def CASE23( self, main ):
- import time
- """
- Add bidirectional point intents between 2 packet layer( mininet )
- devices and
- ping mininet hosts
- """
- main.log.report(
- "This testcase adds bidirectional point intents between 2 " +
- "packet layer( mininet ) devices and ping mininet hosts" )
- main.case( "Install point intents between 2 packet layer device and " +
- "ping the hosts" )
-
- main.step( "Adding point intents" )
- checkFlowResult = main.TRUE
- step1Result = main.TRUE
- main.pIntentsId = []
- pIntent1 = main.ONOS3.addPointIntent(
- "of:0000ffffffff0001/1",
- "of:0000ffffffff0005/1" )
- time.sleep( 10 )
- pIntent2 = main.ONOS3.addPointIntent(
- "of:0000ffffffff0005/1",
- "of:0000ffffffff0001/1" )
- main.pIntentsId.append( pIntent1 )
- main.pIntentsId.append( pIntent2 )
- time.sleep( 10 )
- main.log.info( "Checking intents state")
- checkStateResult = main.ONOS3.checkIntentState(
- intentsId = main.pIntentsId )
- time.sleep( 10 )
- main.log.info( "Checking flows state")
- checkFlowResult = main.ONOS3.checkFlowsState()
- # Sleep for 30 seconds to provide time for the intent state to change
- time.sleep( 10 )
- main.log.info( "Checking intents state one more time")
- checkStateResult = main.ONOS3.checkIntentState(
- intentsId = main.pIntentsId )
- step1Result = checkStateResult and checkFlowResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully added point intents",
- onfail="Failed to add point intents")
-
- print main.ONOS3.intents()
-
- main.step( "Ping h1 and h5" )
- step2Result = main.TRUE
- main.log.info( "\n\nh1 is Pinging h5" )
- pingResult = main.LincOE2.pingHostOptical( src="h1", target="h5" )
- step2Result = pingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Successfully pinged h1 and h5",
- onfail="Failed to ping between h1 and h5")
-
- def CASE24( self, main ):
- import time
- import json
- """
- LINC uses its own switch IDs. You can use the following
- command on the LINC console to find the mapping between
- DPIDs and LINC IDs.
- rp(application:get_all_key(linc)).
-
- Test Rerouting of Packet Optical by bringing a port down
- ( port 20 ) of a switch( switchID=1, or LincOE switchID =9 ),
- so that link
- ( between switch1 port20 - switch5 port50 ) is inactive
- and do a ping test. If rerouting is successful,
- ping should pass. also check the flows
- """
- main.log.report(
- "This testcase tests rerouting and pings mininet hosts" )
- main.case( "Test rerouting and pings mininet hosts" )
-
- main.step( "Attach to the Linc-OE session" )
- step1Result = main.TRUE
- attachConsole = main.LincOE1.attachLincOESession()
- step1Result = attachConsole
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully attached Linc-OE session",
- onfail="Failed to attached Linc-OE session")
-
- main.step( "Bring a port down and verify the link state" )
- step2Result = main.TRUE
- main.LincOE1.portDown( swId="9", ptId="20" )
- linksNonjson = main.ONOS3.links( jsonFormat=False )
- main.log.info( "links = " + linksNonjson )
- linkInactiveCount = linksNonjson.count( "state=INACTIVE" )
- main.log.info( "linkInactiveCount = " + str( linkInactiveCount ))
- if linkInactiveCount == 2:
- main.log.info(
- "Number of links in INACTIVE state are correct")
- else:
- main.log.info(
- "Number of links in INACTIVE state are wrong")
- links = main.ONOS3.links()
- main.log.info( "links = " + links )
- linksResult = json.loads( links )
- linksStateResult = main.FALSE
- for item in linksResult:
- if item[ 'src' ][ 'device' ] == "of:0000ffffffffff01" and item[
- 'src' ][ 'port' ] == "20":
- if item[ 'dst' ][ 'device' ] == "of:0000ffffffffff05" and item[
- 'dst' ][ 'port' ] == "50":
- linksState = item[ 'state' ]
- if linksState == "INACTIVE":
- main.log.info(
- "Links state is inactive as expected due to one" +
- " of the ports being down" )
- main.log.report(
- "Links state is inactive as expected due to one" +
- " of the ports being down" )
- linksStateResult = main.TRUE
- break
- else:
- main.log.info(
- "Links state is not inactive as expected" )
- main.log.report(
- "Links state is not inactive as expected" )
- linksStateResult = main.FALSE
- time.sleep( 10 )
- #checkFlowsState = main.ONOS3.checkFlowsState()
- step2Result = linksStateResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Successfuly brought down a link",
- onfail="Failed to bring down a link")
-
- main.step( "Verify Rerouting by a ping test" )
- step3Result = main.TRUE
- main.log.info( "\n\nh1 is Pinging h5" )
- pingResult = main.LincOE2.pingHostOptical( src="h1", target="h5" )
- step3Result = pingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step3Result,
- onpass="Successfully pinged h1 and h5",
- onfail="Failed to ping between h1 and h5")
-
- main.step( "Bring the downed port up and verify the link state" )
- step4Result = main.TRUE
- main.LincOE1.portUp( swId="9", ptId="20" )
- linksNonjson = main.ONOS3.links( jsonFormat=False )
- main.log.info( "links = " + linksNonjson )
- linkInactiveCount = linksNonjson.count( "state=INACTIVE" )
- time.sleep( 30 )
- main.log.info( "linkInactiveCount = " + str( linkInactiveCount ))
- if linkInactiveCount == 0:
- main.log.info(
- "Number of links in INACTIVE state are correct")
- else:
- main.log.info(
- "Number of links in INACTIVE state are wrong")
- step4Result = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step4Result,
- onpass="Successfully brought the port up",
- onfail="Failed to bring the port up")
- """
- main.step( "Removing host intents" )
- step5Result = main.TRUE
- removeResult = main.TRUE
- # Check remaining intents
- intentsJson = json.loads( main.ONOS3.intents() )
- main.ONOS3.removeIntent( intentId=intent1, purge=True )
- main.ONOS3.removeIntent( intentId=intent2, purge=True )
- for intents in intentsJson:
- main.ONOS3.removeIntent( intentId=intents.get( 'id' ),
- app='org.onosproject.optical',
- purge=True )
- print json.loads( main.ONOS3.intents() )
- if len( json.loads( main.ONOS3.intents() ) ):
- removeResult = main.FALSE
- step5Result = removeResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step5Result,
- onpass="Successfully removed host intents",
- onfail="Failed to remove host intents" )
- """
- def CASE10( self ):
- main.log.report(
- "This testcase uninstalls the reactive forwarding app" )
- main.log.report( "__________________________________" )
- main.case( "Uninstalling reactive forwarding app" )
- main.step( "Uninstalling reactive forwarding app" )
- step1Result = main.TRUE
- # Unistall onos-app-fwd app to disable reactive forwarding
- main.log.info( "deactivate reactive forwarding app" )
- appUninstallResult = main.ONOS2.deactivateApp( "org.onosproject.fwd" )
- appCheck = main.ONOS2.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOS2.apps() )
- main.log.warn( main.ONOS2.appIDs() )
- step1Result = appUninstallResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully deactivate reactive forwarding app",
- onfail="Failed to deactivate reactive forwarding app")
- # After reactive forwarding is disabled, the reactive flows on
- # switches timeout in 10-15s
- # So sleep for 15s
- time.sleep( 15 )
- flows = main.ONOS2.flows()
- main.log.info( flows )
-
- def CASE25( self ):
- """
- Add host intents between 2 packet layer host
- """
- import time
- import json
- main.log.report( "Adding host intents between 2 optical layer host" )
- main.case( "Test add host intents between optical layer host" )
-
- main.step( "Discover host using arping" )
- step1Result = main.TRUE
- main.hostMACs = []
- main.hostId = []
- #Listing host MAC addresses
- for i in range( 1 , 7 ):
- main.hostMACs.append( "00:00:00:00:00:" +
- str( hex( i )[ 2: ] ).zfill( 2 ).upper() )
- for macs in main.hostMACs:
- main.hostId.append( macs + "/-1" )
- host1 = main.hostId[ 0 ]
- host2 = main.hostId[ 1 ]
- # Use arping to discover the hosts
- main.LincOE2.arping( host = "h1" )
- main.LincOE2.arping( host = "h2" )
- time.sleep( 5 )
- hostsDict = main.ONOS3.hosts()
- if not len( hostsDict ):
- step1Result = main.FALSE
- # Adding host intent
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Hosts discovered",
- onfail="Failed to discover hosts")
-
- main.step( "Adding host intents to h1 and h2" )
- step2Result = main.TRUE
- intentsId = []
- intent1 = main.ONOS3.addHostIntent( hostIdOne = host1,
- hostIdTwo = host2 )
- intentsId.append( intent1 )
- """
- intent2 = main.ONOS3.addHostIntent( hostIdOne = host2,
- hostIdTwo = host1 )
- intentsId.append( intent2 )
- """
- # Checking intents state before pinging
- main.log.info( "Checking intents state" )
- time.sleep( 15 )
- intentResult = main.ONOS3.checkIntentState( intentsId = intentsId )
- #check intent state again if intents are not in installed state
- print main.ONOS3.intents()
- if not intentResult:
- intentResult = main.ONOS3.checkIntentState( intentsId = intentsId )
- step2Result = intentResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step2Result,
- onpass="All intents are in INSTALLED state ",
- onfail="Some of the intents are not in " +
- "INSTALLED state " )
-
- # pinging h1 to h2 and then ping h2 to h1
- main.step( "Pinging h1 and h2" )
- step3Result = main.TRUE
- pingResult = main.TRUE
- pingResult = main.LincOE2.pingHostOptical( src="h1", target="h2" )
- pingResult = pingResult and main.LincOE2.pingHostOptical( src="h2",
- target="h1" )
- step3Result = pingResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step3Result,
- onpass="Pinged successfully between h1 and h2",
- onfail="Pinged failed between h1 and h2" )
- # Removed all added host intents
- main.step( "Removing host intents" )
- step4Result = main.TRUE
- removeResult = main.TRUE
- # Check remaining intents
- intentsJson = json.loads( main.ONOS3.intents() )
- main.ONOS3.removeIntent( intentId=intent1, purge=True )
- #main.ONOS3.removeIntent( intentId=intent2, purge=True )
- for intents in intentsJson:
- main.ONOS3.removeIntent( intentId=intents.get( 'id' ),
- app='org.onosproject.optical',
- purge=True )
- print json.loads( main.ONOS3.intents() )
- if len( json.loads( main.ONOS3.intents() ) ):
- removeResult = main.FALSE
- step4Result = removeResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step4Result,
- onpass="Successfully removed host intents",
- onfail="Failed to remove host intents" )
diff --git a/TestON/tests/IpOptical/IpOptical.topo b/TestON/tests/IpOptical/IpOptical.topo
deleted file mode 100755
index 9cef3f7..0000000
--- a/TestON/tests/IpOptical/IpOptical.topo
+++ /dev/null
@@ -1,92 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOS1>
- <host>10.128.10.11</host>
- <user>sdn</user>
- <password>sdn</password>
- <type>OnosDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
-
- <Mininet1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> --switch ovs,protocols=OpenFlow13 </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet1>
-
- <Mininet2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> --switch ovs,protocols=OpenFlow13 </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet2>
-
- <LincOE1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>LincOEDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </LincOE1>
-
- <LincOE2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </LincOE2>
-
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/IpOptical/__init__.py b/TestON/tests/IpOptical/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/IpOptical/__init__.py
+++ /dev/null
diff --git a/TestON/tests/IpOpticalMulti/IpOpticalMulti.params b/TestON/tests/IpOpticalMulti/IpOpticalMulti.params
deleted file mode 100755
index c17bf21..0000000
--- a/TestON/tests/IpOpticalMulti/IpOpticalMulti.params
+++ /dev/null
@@ -1,64 +0,0 @@
-<PARAMS>
-
- <testcases>20,21,22,10,25,23,24</testcases>
- #Environment variables
- <ENV>
- <cellName>multi_test</cellName>
- </ENV>
-
- <CTRL>
- <ip1>10.128.20.11</ip1>
- <ip2>10.128.20.12</ip2>
- <ip3>10.128.20.13</ip3>
- <port1>6633</port1>
- <port2>6633</port2>
- <port3>6633</port3>
- </CTRL>
-
- <SDNIP>
- <ethType>IPV4</ethType>
- <tcpProto>6</tcpProto>
- <icmpProto>1</icmpProto>
- <srcPort>5001</srcPort>
- <dstPort>5001</dstPort>
- </SDNIP>
-
- <MULTIPOINT_INTENT>
- <device1>of:0000000000003008/1 </device1>
- <device2>of:0000000000003009/1 </device2>
- <device3>of:0000000000003010/1 </device3>
- <mac1>00:00:00:00:00:0A </mac1>
- <mac2>00:00:00:00:00:08 </mac2>
- <ip1>10.0.3.0/24 </ip1>
- <ip2>10.0.1.0/24 </ip2>
- </MULTIPOINT_INTENT>
-
- <PING>
- <source1>h8</source1>
- <source2>h9</source2>
- <source3>h10</source3>
- <source4>h11</source4>
- <source5>h12</source5>
- <source6>h13</source6>
- <source7>h14</source7>
- <source8>h15</source8>
- <source9>h16</source9>
- <source10>h17</source10>
- <target1>10.0.0.18</target1>
- <target2>10.0.0.19</target2>
- <target3>10.0.0.20</target3>
- <target4>10.0.0.21</target4>
- <target5>10.0.0.22</target5>
- <target6>10.0.0.23</target6>
- <target7>10.0.0.24</target7>
- <target8>10.0.0.25</target8>
- <target9>10.0.0.26</target9>
- <target10>10.0.0.27</target10>
- </PING>
-
- <timers>
- <LinkDiscovery>5</LinkDiscovery>
- <SwitchDiscovery>31</SwitchDiscovery>
- </timers>
-
-</PARAMS>
diff --git a/TestON/tests/IpOpticalMulti/IpOpticalMulti.py b/TestON/tests/IpOpticalMulti/IpOpticalMulti.py
deleted file mode 100644
index ff09766..0000000
--- a/TestON/tests/IpOpticalMulti/IpOpticalMulti.py
+++ /dev/null
@@ -1,703 +0,0 @@
-
-# Testing the basic functionality of ONOS Next
-# For sanity and driver functionality excercises only.
-
-import time
-import sys
-import os
-import re
-import time
-import json
-
-time.sleep( 1 )
-
-class IpOpticalMulti:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- """
- Startup sequence:
- cell <name>
- onos-verify-cell
- onos-remove-raft-logs
- git pull
- mvn clean install
- onos-package
- onos-install -f
- onos-wait-for-start
- """
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
-
- main.case( "Setting up test environment" )
- main.log.report(
- "This testcase is testing setting up test environment" )
- main.log.report( "__________________________________" )
-
- main.step( "Applying cell variable to environment" )
- cellResult1 = main.ONOSbench.setCell( cellName )
- # cellResult2 = main.ONOScli1.setCell( cellName )
- # cellResult3 = main.ONOScli2.setCell( cellName )
- # cellResult4 = main.ONOScli3.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
- cellResult = cellResult1
-
- main.step( "Removing raft logs before a clen installation of ONOS" )
- removeLogResult = main.ONOSbench.onosRemoveRaftLogs()
-
- main.step( "Git checkout, pull and get version" )
- #main.ONOSbench.gitCheckout( "master" )
- gitPullResult = main.ONOSbench.gitPull()
- main.log.info( "git_pull_result = " + str( gitPullResult ))
- versionResult = main.ONOSbench.getVersion( report=True )
-
- if gitPullResult == 100:
- main.step( "Using mvn clean & install" )
- cleanInstallResult = main.ONOSbench.cleanInstall()
- # cleanInstallResult = main.TRUE
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- # main.step( "Creating a cell" )
- # cellCreateResult = main.ONOSbench.createCellFile( **************
- # )
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS1Ip )
- onos2InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS2Ip )
- onos3InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS3Ip )
- onosInstallResult = onos1InstallResult and onos2InstallResult and\
- onos3InstallResult
- if onosInstallResult == main.TRUE:
- main.log.report( "Installing ONOS package successful" )
- else:
- main.log.report( "Installing ONOS package failed" )
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- onos2Isup = main.ONOSbench.isup( ONOS2Ip )
- onos3Isup = main.ONOSbench.isup( ONOS3Ip )
- onosIsup = onos1Isup and onos2Isup and onos3Isup
- if onosIsup == main.TRUE:
- main.log.report( "ONOS instances are up and ready" )
- else:
- main.log.report( "ONOS instances may not be up" )
-
- main.step( "Starting ONOS service" )
- startResult = main.TRUE
- # startResult = main.ONOSbench.onosStart( ONOS1Ip )
- startcli1 = main.ONOScli1.startOnosCli( ONOSIp=ONOS1Ip )
- startcli2 = main.ONOScli2.startOnosCli( ONOSIp=ONOS2Ip )
- startcli3 = main.ONOScli3.startOnosCli( ONOSIp=ONOS3Ip )
- print startcli1
- print startcli2
- print startcli3
-
- case1Result = ( packageResult and
- cellResult and verifyResult and onosInstallResult and
- onosIsup and startResult )
- utilities.assertEquals( expect=main.TRUE, actual=case1Result,
- onpass="Test startup successful",
- onfail="Test startup NOT successful" )
-
- def CASE20( self ):
- """
- Exit from mininet cli
- reinstall ONOS
- """
- import time
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
-
-
- main.log.report( "This testcase exits the mininet cli and reinstalls" +
- "ONOS to switch over to Packet Optical topology" )
- main.log.report( "_____________________________________________" )
- main.case( "Disconnecting mininet and restarting ONOS" )
-
- main.step( "Disconnecting mininet and restarting ONOS" )
- step1Result = main.TRUE
- mininetDisconnect = main.Mininet1.disconnect()
- print "mininetDisconnect = ", mininetDisconnect
- step1Result = mininetDisconnect
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Mininet disconnect successfully",
- onfail="Mininet failed to disconnect")
- """
- main.step( "Removing raft logs before a clean installation of ONOS" )
- step2Result = main.TRUE
- removeRaftLogsResult = main.ONOSbench.onosRemoveRaftLogs()
- step2Result = removeRaftLogsResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Raft logs removed successfully",
- onfail="Failed to remove raft logs")
- """
- main.step( "Applying cell variable to environment" )
- step3Result = main.TRUE
- setCellResult = main.ONOSbench.setCell( cellName )
- verifyCellResult = main.ONOSbench.verifyCell()
- step3Result = setCellResult and verifyCellResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step3Result,
- onpass="Cell applied successfully",
- onfail="Failed to apply cell")
-
- main.step( "Uninstalling ONOS package" )
- step4Result = main.TRUE
- onos1UninstallResult = main.ONOSbench.onosUninstall( nodeIp = ONOS1Ip)
- onos2UninstallResult = main.ONOSbench.onosUninstall( nodeIp = ONOS2Ip)
- onos3UninstallResult = main.ONOSbench.onosUninstall( nodeIp = ONOS3Ip)
- onosUninstallResult = onos1UninstallResult and onos2UninstallResult \
- and onos3UninstallResult
- step4Result = onosUninstallResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step4Result,
- onpass="Successfully uninstalled ONOS",
- onfail="Failed to uninstall ONOS")
-
- time.sleep( 5 )
- main.step( "Installing ONOS package" )
- step5Result = main.TRUE
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS1Ip )
- onos2InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS2Ip )
- onos3InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS3Ip )
- onosInstallResult = onos1InstallResult and onos2InstallResult and\
- onos3InstallResult
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- onos2Isup = main.ONOSbench.isup( ONOS2Ip )
- onos3Isup = main.ONOSbench.isup( ONOS3Ip )
- onosIsUp = onos1Isup and onos2Isup and onos3Isup
- if onosIsUp == main.TRUE:
- main.log.report( "ONOS instances are up and ready" )
- else:
- main.log.report( "ONOS instances may not be up" )
- step5Result = onosInstallResult and onosIsUp
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step5Result,
- onpass="Successfully installed ONOS",
- onfail="Failed to install ONOS")
-
- main.step( "Starting ONOS service" )
- step6Result = main.TRUE
- startResult = main.ONOSbench.onosStart( ONOS1Ip )
- step6Result = startResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step6Result,
- onpass="Successfully started ONOS",
- onfail="Failed to start ONOS")
-
- main.step( "Starting ONOS cli" )
- step7Result = main.TRUE
- startcli1 = main.ONOScli1.startOnosCli( ONOSIp=ONOS1Ip )
- startcli2 = main.ONOScli2.startOnosCli( ONOSIp=ONOS2Ip )
- startcli3 = main.ONOScli3.startOnosCli( ONOSIp=ONOS3Ip )
- startResult = startcli1 and startcli2 and startcli3
- step7Result = startResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step7Result,
- onpass="Successfully started ONOS cli",
- onfail="Failed to start ONOS cli")
-
- case20Result = step1Result and step3Result and\
- step4Result and step5Result and step6Result and\
- step7Result
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case20Result,
- onpass= "Exiting functionality mininet topology and reinstalling" +
- " ONOS successful",
- onfail= "Exiting functionality mininet topology and reinstalling" +
- " ONOS failed" )
-
- def CASE21( self, main ):
- """
- On ONOS bench, run this command:
- sudo -E python ~/onos/tools/test/topos/opticalTest.py -OC1
- which spawns packet optical topology and copies the links
- json file to the onos instance.
- Note that in case of Packet Optical, the links are not learnt
- from the topology, instead the links are learnt
- from the json config file
- """
- import time
- main.log.report(
- "This testcase starts the packet layer topology and REST" )
- main.log.report( "_____________________________________________" )
- main.case( "Starting LINC-OE and other components" )
-
- main.step( "Activate optical app" )
- step1Result = main.TRUE
- activateOpticalResult = main.ONOScli2.activateApp( "org.onosproject.optical" )
- step1Result = activateOpticalResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully activated optical app",
- onfail="Failed to activate optical app")
-
- appCheck = main.ONOScli2.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOScli2.apps() )
- main.log.warn( main.ONOScli2.appIDs() )
-
- main.step( "Starting mininet and LINC-OE" )
- step2Result = main.TRUE
- time.sleep( 10 )
- opticalMnScript = main.LincOE2.runOpticalMnScript(ctrllerIP = main.params[ 'CTRL' ][ 'ip1' ])
- step2Result = opticalMnScript
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Started the topology successfully ",
- onfail="Failed to start the topology")
-
- case21Result = step1Result and step2Result
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case21Result,
- onpass="Packet optical topology spawned successsfully",
- onfail="Packet optical topology spawning failed" )
-
- def CASE22( self, main ):
- """
- Curretly we use, 10 optical switches(ROADM's) and
- 6 packet layer mininet switches each with one host.
- Therefore, the roadmCount variable = 10,
- packetLayerSWCount variable = 6, hostCount=6 and
- links=46.
- All this is hardcoded in the testcase. If the topology changes,
- these hardcoded values need to be changed
- """
- import time
- main.log.report(
- "This testcase compares the optical+packet topology against what" +
- " is expected" )
- main.case( "Topology comparision" )
-
- main.step( "Starts new ONOS cli" )
- step1Result = main.TRUE
- cliResult = main.ONOScli1.startOnosCli( ONOSIp=main.params[ 'CTRL' ]\
- [ 'ip1' ] )
- step1Result = cliResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully starts a new cli",
- onfail="Failed to start new cli" )
-
- main.step( "Compare topology" )
- step2Result = main.TRUE
- devicesResult = main.ONOScli1.devices( jsonFormat=False )
- print "devices_result :\n", devicesResult
- devicesLinewise = devicesResult.split( "\n" )
- roadmCount = 0
- packetLayerSWCount = 0
- for line in devicesLinewise:
- components = line.split( "," )
- availability = components[ 1 ].split( "=" )[ 1 ]
- type = components[ 3 ].split( "=" )[ 1 ]
- if availability == 'true' and type == 'ROADM':
- roadmCount += 1
- elif availability == 'true' and type == 'SWITCH':
- packetLayerSWCount += 1
- if roadmCount == 10:
- print "Number of Optical Switches = %d and is" % roadmCount +\
- " correctly detected"
- main.log.info(
- "Number of Optical Switches = " +
- str( roadmCount ) +
- " and is correctly detected" )
- opticalSWResult = main.TRUE
- else:
- print "Number of Optical Switches = %d and is wrong" % roadmCount
- main.log.info(
- "Number of Optical Switches = " +
- str( roadmCount ) +
- " and is wrong" )
- opticalSWResult = main.FALSE
- if packetLayerSWCount == 6:
- print "Number of Packet layer or mininet Switches = %d "\
- % packetLayerSWCount + "and is correctly detected"
- main.log.info(
- "Number of Packet layer or mininet Switches = " +
- str( packetLayerSWCount ) +
- " and is correctly detected" )
- packetSWResult = main.TRUE
- else:
- print "Number of Packet layer or mininet Switches = %d and"\
- % packetLayerSWCount + " is wrong"
- main.log.info(
- "Number of Packet layer or mininet Switches = " +
- str( packetLayerSWCount ) +
- " and is wrong" )
- packetSWResult = main.FALSE
- # sleeps for sometime so the state of the switches will be active
- time.sleep( 30 )
- print "_________________________________"
- linksResult = main.ONOScli1.links( jsonFormat=False )
- print "links_result = ", linksResult
- print "_________________________________"
- linkActiveCount = linksResult.count("state=ACTIVE")
- main.log.info( "linkActiveCount = " + str( linkActiveCount ))
- if linkActiveCount == 46:
- linkActiveResult = main.TRUE
- main.log.info(
- "Number of links in ACTIVE state are correct")
- else:
- linkActiveResult = main.FALSE
- main.log.info(
- "Number of links in ACTIVE state are wrong")
- step2Result = opticalSWResult and packetSWResult and \
- linkActiveResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Successfully loaded packet optical topology",
- onfail="Failed to load packet optical topology" )
-
- case22Result = step1Result and step2Result
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case22Result,
- onpass="Packet optical topology discovery successful",
- onfail="Packet optical topology discovery failed" )
-
- def CASE23( self, main ):
- import time
- """
- Add bidirectional point intents between 2 packet layer( mininet )
- devices and
- ping mininet hosts
- """
- main.log.report(
- "This testcase adds bidirectional point intents between 2 " +
- "packet layer( mininet ) devices and ping mininet hosts" )
- main.case( "Install point intents between 2 packet layer device and " +
- "ping the hosts" )
-
- main.step( "Adding point intents" )
- step1Result = main.TRUE
- intentsId = []
- pIntent1 = main.ONOScli1.addPointIntent(
- "of:0000ffffffff0001/1",
- "of:0000ffffffff0005/1" )
- pIntent2 = main.ONOScli1.addPointIntent(
- "of:0000ffffffff0005/1",
- "of:0000ffffffff0001/1" )
- intentsId.append( pIntent1 )
- intentsId.append( pIntent2 )
- main.log.info( "Checking intents state")
- checkStateResult = main.ONOScli1.checkIntentState( intentsId = intentsId )
- time.sleep( 30 )
- main.log.info( "Checking flows state")
- checkFlowResult = main.ONOScli1.checkFlowsState()
- # Sleep for 30 seconds to provide time for the intent state to change
- time.sleep( 30 )
- main.log.info( "Checking intents state one more time")
- checkStateResult = main.ONOScli1.checkIntentState( intentsId = intentsId )
- step1Result = checkStateResult and checkFlowResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully added point intents",
- onfail="Failed to add point intents")
-
- main.step( "Ping h1 and h5" )
- step2Result = main.TRUE
- main.log.info( "\n\nh1 is Pinging h5" )
- pingResult = main.LincOE2.pingHostOptical( src="h1", target="h5" )
- step2Result = pingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Successfully pinged h1 and h5",
- onfail="Failed to ping between h1 and h5")
-
- case23Result = step1Result and step2Result
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case23Result,
- onpass="Point intents are installed properly",
- onfail="Failed to install point intents" )
-
- def CASE24( self, main ):
- import time
- import json
- """
- LINC uses its own switch IDs. You can use the following
- command on the LINC console to find the mapping between
- DPIDs and LINC IDs.
- rp(application:get_all_key(linc)).
-
- Test Rerouting of Packet Optical by bringing a port down
- ( port 20 ) of a switch( switchID=1, or LincOE switchID =9 ),
- so that link
- ( between switch1 port20 - switch5 port50 ) is inactive
- and do a ping test. If rerouting is successful,
- ping should pass. also check the flows
- """
- main.log.report(
- "This testcase tests rerouting and pings mininet hosts" )
- main.case( "Test rerouting and pings mininet hosts" )
-
- main.step( "Attach to the Linc-OE session" )
- step1Result = main.TRUE
- attachConsole = main.LincOE1.attachLincOESession()
- step1Result = attachConsole
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully attached Linc-OE session",
- onfail="Failed to attached Linc-OE session")
-
- main.step( "Bring a port down and verify the link state" )
- step2Result = main.TRUE
- main.LincOE1.portDown( swId="9", ptId="20" )
- linksNonjson = main.ONOScli1.links( jsonFormat=False )
- main.log.info( "links = " + linksNonjson )
- linkInactiveCount = linksNonjson.count( "state=INACTIVE" )
- main.log.info( "linkInactiveCount = " + str( linkInactiveCount ))
- if linkInactiveCount == 2:
- main.log.info(
- "Number of links in INACTIVE state are correct")
- else:
- main.log.info(
- "Number of links in INACTIVE state are wrong")
- links = main.ONOScli1.links()
- main.log.info( "links = " + links )
- linksResult = json.loads( links )
- linksStateResult = main.FALSE
- for item in linksResult:
- if item[ 'src' ][ 'device' ] == "of:0000ffffffffff01" and item[
- 'src' ][ 'port' ] == "20":
- if item[ 'dst' ][ 'device' ] == "of:0000ffffffffff05" and item[
- 'dst' ][ 'port' ] == "50":
- linksState = item[ 'state' ]
- if linksState == "INACTIVE":
- main.log.info(
- "Links state is inactive as expected due to one" +
- " of the ports being down" )
- main.log.report(
- "Links state is inactive as expected due to one" +
- " of the ports being down" )
- linksStateResult = main.TRUE
- break
- else:
- main.log.info(
- "Links state is not inactive as expected" )
- main.log.report(
- "Links state is not inactive as expected" )
- linksStateResult = main.FALSE
- time.sleep( 10 )
- checkFlowsState = main.ONOScli1.checkFlowsState()
- step2Result = linksStateResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Successfuly brought down a link",
- onfail="Failed to bring down a link")
-
- main.step( "Verify Rerouting by a ping test" )
- step3Result = main.TRUE
- main.log.info( "\n\nh1 is Pinging h5" )
- pingResult = main.LincOE2.pingHostOptical( src="h1", target="h5" )
- step3Result = pingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step3Result,
- onpass="Successfully pinged h1 and h5",
- onfail="Failed to ping between h1 and h5")
-
- main.step( "Bring the downed port up and verify the link state" )
- step4Result = main.TRUE
- main.LincOE1.portUp( swId="9", ptId="20" )
- linksNonjson = main.ONOScli1.links( jsonFormat=False )
- main.log.info( "links = " + linksNonjson )
- linkInactiveCount = linksNonjson.count( "state=INACTIVE" )
- main.log.info( "linkInactiveCount = " + str( linkInactiveCount ))
- if linkInactiveCount == 0:
- main.log.info(
- "Number of links in INACTIVE state are correct")
- else:
- main.log.info(
- "Number of links in INACTIVE state are wrong")
- step4Result = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step4Result,
- onpass="Successfully brought the port up",
- onfail="Failed to bring the port up")
-
- case24Result = step1Result and step2Result and step3Result \
- and step4Result
- utilities.assert_equals( expect=main.TRUE,
- actual=case24Result,
- onpass="Packet optical rerouting successful",
- onfail="Packet optical rerouting failed" )
-
- def CASE10( self ):
- main.log.report(
- "This testcase uninstalls the reactive forwarding app" )
- main.log.report( "__________________________________" )
- main.case( "Uninstalling reactive forwarding app" )
- main.step( "Uninstalling reactive forwarding app" )
- step1Result = main.TRUE
- # Unistall onos-app-fwd app to disable reactive forwarding
- main.log.info( "deactivate reactive forwarding app" )
- appUninstallResult = main.ONOScli2.deactivateApp( "org.onosproject.fwd" )
- appCheck = main.ONOScli2.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOScli2.apps() )
- main.log.warn( main.ONOScli2.appIDs() )
- step1Result = appUninstallResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully deactivate reactive forwarding app",
- onfail="Failed to deactivate reactive forwarding app")
- # After reactive forwarding is disabled, the reactive flows on
- # switches timeout in 10-15s
- # So sleep for 15s
- time.sleep( 15 )
- flows = main.ONOScli2.flows()
- main.log.info( flows )
-
- case10Result = step1Result
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case10Result,
- onpass="Reactive forwarding app uninstallation successful",
- onfail="Reactive forwarding app uninstallation failed" )
-
- def CASE25( self ):
- """
- Add host intents between 2 packet layer host
- """
- import time
- import json
- main.log.report( "Adding host intents between 2 optical layer host" )
- main.case( "Test add host intents between optical layer host" )
-
- main.step( "Discover host using arping" )
- step1Result = main.TRUE
- main.hostMACs = []
- main.hostId = []
- #Listing host MAC addresses
- for i in range( 1 , 7 ):
- main.hostMACs.append( "00:00:00:00:00:" +
- str( hex( i )[ 2: ] ).zfill( 2 ).upper() )
- for macs in main.hostMACs:
- main.hostId.append( macs + "/-1" )
- host1 = main.hostId[ 0 ]
- host2 = main.hostId[ 1 ]
- # Use arping to discover the hosts
- main.LincOE2.arping( host = "h1" )
- main.LincOE2.arping( host = "h2" )
- time.sleep( 5 )
- hostsDict = main.ONOScli1.hosts()
- if not len( hostsDict ):
- step1Result = main.FALSE
- # Adding host intent
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Hosts discovered",
- onfail="Failed to discover hosts")
-
- main.step( "Adding host intents to h1 and h2" )
- step2Result = main.TRUE
- intentsId = []
- intent1 = main.ONOScli1.addHostIntent( hostIdOne = host1,
- hostIdTwo = host2 )
- intentsId.append( intent1 )
- time.sleep( 5 )
- intent2 = main.ONOScli1.addHostIntent( hostIdOne = host2,
- hostIdTwo = host1 )
- intentsId.append( intent2 )
- # Checking intents state before pinging
- main.log.info( "Checking intents state" )
- time.sleep( 30 )
- intentResult = main.ONOScli1.checkIntentState( intentsId = intentsId )
- #check intent state again if intents are not in installed state
- if not intentResult:
- intentResult = main.ONOScli1.checkIntentState( intentsId = intentsId )
- step2Result = intentResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step2Result,
- onpass="All intents are in INSTALLED state ",
- onfail="Some of the intents are not in " +
- "INSTALLED state " )
-
- # pinging h1 to h2 and then ping h2 to h1
- main.step( "Pinging h1 and h2" )
- step3Result = main.TRUE
- pingResult = main.TRUE
- pingResult = main.LincOE2.pingHostOptical( src="h1", target="h2" )
- pingResult = pingResult and main.LincOE2.pingHostOptical( src="h2",
- target="h1" )
- step3Result = pingResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step3Result,
- onpass="Pinged successfully between h1 and h2",
- onfail="Pinged failed between h1 and h2" )
- # Removed all added host intents
- main.step( "Removing host intents" )
- step4Result = main.TRUE
- removeResult = main.TRUE
- # Check remaining intents
- intentsJson = json.loads( main.ONOScli1.intents() )
- main.ONOScli1.removeIntent( intentId=intent1, purge=True )
- main.ONOScli1.removeIntent( intentId=intent2, purge=True )
- for intents in intentsJson:
- main.ONOScli1.removeIntent( intentId=intents.get( 'id' ),
- app='org.onosproject.optical',
- purge=True )
- print json.loads( main.ONOScli1.intents() )
- if len( json.loads( main.ONOScli1.intents() ) ):
- removeResult = main.FALSE
- step4Result = removeResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step4Result,
- onpass="Successfully removed host intents",
- onfail="Failed to remove host intents" )
- case25Result = step1Result and step2Result and step3Result and \
- step4Result
- utilities.assert_equals( expect=main.TRUE,
- actual=case25Result,
- onpass="Add host intent successful",
- onfail="Add host intent failed" )
diff --git a/TestON/tests/IpOpticalMulti/IpOpticalMulti.topo b/TestON/tests/IpOpticalMulti/IpOpticalMulti.topo
deleted file mode 100755
index 4b1ab12..0000000
--- a/TestON/tests/IpOpticalMulti/IpOpticalMulti.topo
+++ /dev/null
@@ -1,118 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOScli1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli1>
-
- <ONOScli2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli2>
-
- <ONOScli3>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli3>
-
- <ONOS1>
- <host>10.128.10.11</host>
- <user>sdn</user>
- <password>sdn</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.128.10.11</host>
- <user>sdn</user>
- <password>sdn</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.128.10.11</host>
- <user>sdn</user>
- <password>sdn</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
-
- <Mininet1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> --switch ovs,protocols=OpenFlow13 </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet1>
-
- <Mininet2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> --switch ovs,protocols=OpenFlow13 </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet2>
-
- <LincOE1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>LincOEDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </LincOE1>
-
- <LincOE2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </LincOE2>
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/IpOpticalMulti/IpOpticalMultiOld.py b/TestON/tests/IpOpticalMulti/IpOpticalMultiOld.py
deleted file mode 100644
index d00410f..0000000
--- a/TestON/tests/IpOpticalMulti/IpOpticalMultiOld.py
+++ /dev/null
@@ -1,572 +0,0 @@
-
-# Testing the basic functionality of ONOS Next
-# For sanity and driver functionality excercises only.
-
-import time
-import sys
-import os
-import re
-import time
-import json
-
-time.sleep( 1 )
-
-class IpOpticalMulti:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- """
- Startup sequence:
- cell <name>
- onos-verify-cell
- onos-remove-raft-logs
- git pull
- mvn clean install
- onos-package
- onos-install -f
- onos-wait-for-start
- """
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
-
- main.case( "Setting up test environment" )
- main.log.report(
- "This testcase is testing setting up test environment" )
- main.log.report( "__________________________________" )
-
- main.step( "Applying cell variable to environment" )
- cellResult1 = main.ONOSbench.setCell( cellName )
- # cellResult2 = main.ONOScli1.setCell( cellName )
- # cellResult3 = main.ONOScli2.setCell( cellName )
- # cellResult4 = main.ONOScli3.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
- cellResult = cellResult1
-
- main.step( "Removing raft logs before a clen installation of ONOS" )
- removeLogResult = main.ONOSbench.onosRemoveRaftLogs()
-
- main.step( "Git checkout, pull and get version" )
- #main.ONOSbench.gitCheckout( "master" )
- gitPullResult = main.ONOSbench.gitPull()
- main.log.info( "git_pull_result = " + str( gitPullResult ))
- versionResult = main.ONOSbench.getVersion( report=True )
-
- if gitPullResult == 1:
- main.step( "Using mvn clean & install" )
- cleanInstallResult = main.ONOSbench.cleanInstall()
- # cleanInstallResult = main.TRUE
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- # main.step( "Creating a cell" )
- # cellCreateResult = main.ONOSbench.createCellFile( **************
- # )
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS1Ip )
- onos2InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS2Ip )
- onos3InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS3Ip )
- onosInstallResult = onos1InstallResult and onos2InstallResult and\
- onos3InstallResult
- if onosInstallResult == main.TRUE:
- main.log.report( "Installing ONOS package successful" )
- else:
- main.log.report( "Installing ONOS package failed" )
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- onos2Isup = main.ONOSbench.isup( ONOS2Ip )
- onos3Isup = main.ONOSbench.isup( ONOS3Ip )
- onosIsup = onos1Isup and onos2Isup and onos3Isup
- if onosIsup == main.TRUE:
- main.log.report( "ONOS instances are up and ready" )
- else:
- main.log.report( "ONOS instances may not be up" )
-
- main.step( "Starting ONOS service" )
- startResult = main.TRUE
- # startResult = main.ONOSbench.onosStart( ONOS1Ip )
- startcli1 = main.ONOScli1.startOnosCli( ONOSIp=ONOS1Ip )
- startcli2 = main.ONOScli2.startOnosCli( ONOSIp=ONOS2Ip )
- startcli3 = main.ONOScli3.startOnosCli( ONOSIp=ONOS3Ip )
- print startcli1
- print startcli2
- print startcli3
-
- case1Result = ( packageResult and
- cellResult and verifyResult and onosInstallResult and
- onosIsup and startResult )
- utilities.assertEquals( expect=main.TRUE, actual=case1Result,
- onpass="Test startup successful",
- onfail="Test startup NOT successful" )
-
- def CASE10( self ):
- import time
- main.log.report(
- "This testcase uninstalls the reactive forwarding app" )
- main.log.report( "__________________________________" )
- main.case( "Uninstalling reactive forwarding app" )
- # Unistall onos-app-fwd app to disable reactive forwarding
- appInstallResult = main.ONOScli1.deactivateApp( "org.onosproject.fwd" )
- appCheck = main.ONOScli1.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOScli1.apps() )
- main.log.warn( main.ONOScli1.appIDs() )
- main.log.info( "onos-app-fwd uninstalled" )
-
- # After reactive forwarding is disabled,
- # the reactive flows on switches timeout in 10-15s
- # So sleep for 15s
- time.sleep( 15 )
-
- hosts = main.ONOScli1.hosts()
- main.log.info( hosts )
- case10Result = appInstallResult
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case10Result,
- onpass="Reactive forwarding app uninstallation successful",
- onfail="Reactive forwarding app uninstallation failed" )
-
- def CASE20( self ):
- """
- Exit from mininet cli
- reinstall ONOS
- """
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
-
- main.log.report( "This testcase exits the mininet cli and reinstalls" +
- "ONOS to switch over to Packet Optical topology" )
- main.log.report( "_____________________________________________" )
- main.case( "Disconnecting mininet and restarting ONOS" )
- main.step( "Disconnecting mininet and restarting ONOS" )
- mininetDisconnect = main.Mininet1.disconnect()
- print "mininetDisconnect = ", mininetDisconnect
-
- main.step( "Removing raft logs before a clen installation of ONOS" )
- main.ONOSbench.onosRemoveRaftLogs()
-
- main.step( "Applying cell variable to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS1Ip )
- onos2InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS2Ip )
- onos3InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS3Ip )
- onosInstallResult = onos1InstallResult and onos2InstallResult and\
- onos3InstallResult
- if onosInstallResult == main.TRUE:
- main.log.report( "Installing ONOS package successful" )
- else:
- main.log.report( "Installing ONOS package failed" )
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- onos2Isup = main.ONOSbench.isup( ONOS2Ip )
- onos3Isup = main.ONOSbench.isup( ONOS3Ip )
- onosIsup = onos1Isup and onos2Isup and onos3Isup
- if onosIsup == main.TRUE:
- main.log.report( "ONOS instances are up and ready" )
- else:
- main.log.report( "ONOS instances may not be up" )
-
- main.step( "Starting ONOS service" )
- startResult = main.TRUE
- # startResult = main.ONOSbench.onosStart( ONOS1Ip )
- startcli1 = main.ONOScli1.startOnosCli( ONOSIp=ONOS1Ip )
- startcli2 = main.ONOScli2.startOnosCli( ONOSIp=ONOS2Ip )
- startcli3 = main.ONOScli3.startOnosCli( ONOSIp=ONOS3Ip )
- startResult = startcli1 and startcli2 and startcli3
- if startResult == main.TRUE:
- main.log.report( "ONOS cli starts properly" )
- case20Result = mininetDisconnect and cellResult and verifyResult \
- and onosInstallResult and onosIsup and startResult
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case20Result,
- onpass= "Exiting functionality mininet topology and reinstalling" +
- " ONOS successful",
- onfail= "Exiting functionality mininet topology and reinstalling" +
- " ONOS failed" )
-
- def CASE21( self, main ):
- """
- On ONOS bench, run this command:
- sudo -E python ~/onos/tools/test/topos/opticalTest.py -OC1 <Ctrls>
- which spawns packet optical topology and copies the links
- json file to the onos instance.
- Note that in case of Packet Optical, the links are not learnt
- from the topology, instead the links are learnt
- from the json config file
- """
- main.log.report(
- "This testcase starts the packet layer topology and REST" )
- main.log.report( "_____________________________________________" )
- main.case( "Starting LINC-OE and other components" )
- main.step( "Starting LINC-OE and other components" )
- main.log.info( "Activate optical app" )
- appInstallResult = main.ONOScli1.activateApp( "org.onosproject.optical" )
- appCheck = main.ONOScli1.appToIDCheck()
- appCheck = appCheck and main.ONOScli2.appToIDCheck()
- appCheck = appCheck and main.ONOScli3.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( "Checking ONOS application unsuccesful" )
-
- ctrllerIP = []
- ctrllerIP.append( main.params[ 'CTRL' ][ 'ip1' ] )
- #ctrllerIP.append( main.params[ 'CTRL' ][ 'ip2' ] )
- #ctrllerIP.append( main.params[ 'CTRL' ][ 'ip3' ] )
- opticalMnScript = main.LincOE2.runOpticalMnScript( ctrllerIP = ctrllerIP )
- case21Result = opticalMnScript and appInstallResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case21Result,
- onpass="Packet optical topology spawned successsfully",
- onfail="Packet optical topology spawning failed" )
-
- def CASE22( self, main ):
- """
- Curretly we use, 10 optical switches(ROADM's) and
- 6 packet layer mininet switches each with one host.
- Therefore, the roadmCount variable = 10,
- packetLayerSWCount variable = 6, hostCount=6 and
- links=42.
- All this is hardcoded in the testcase. If the topology changes,
- these hardcoded values need to be changed
- """
- main.log.report(
- "This testcase compares the optical+packet topology against what" +
- " is expected" )
- main.case( "Topology comparision" )
- main.step( "Topology comparision" )
- devicesResult = main.ONOScli3.devices( jsonFormat=False )
-
- print "devices_result = ", devicesResult
- devicesLinewise = devicesResult.split( "\n" )
- roadmCount = 0
- packetLayerSWCount = 0
- for line in devicesLinewise:
- components = line.split( "," )
- availability = components[ 1 ].split( "=" )[ 1 ]
- type = components[ 3 ].split( "=" )[ 1 ]
- if availability == 'true' and type == 'ROADM':
- roadmCount += 1
- elif availability == 'true' and type == 'SWITCH':
- packetLayerSWCount += 1
- if roadmCount == 10:
- print "Number of Optical Switches = %d and is" % roadmCount +\
- " correctly detected"
- main.log.info(
- "Number of Optical Switches = " +
- str( roadmCount ) +
- " and is correctly detected" )
- opticalSWResult = main.TRUE
- else:
- print "Number of Optical Switches = %d and is wrong" % roadmCount
- main.log.info(
- "Number of Optical Switches = " +
- str( roadmCount ) +
- " and is wrong" )
- opticalSWResult = main.FALSE
-
- if packetLayerSWCount == 6:
- print "Number of Packet layer or mininet Switches = %d "\
- % packetLayerSWCount + "and is correctly detected"
- main.log.info(
- "Number of Packet layer or mininet Switches = " +
- str( packetLayerSWCount ) +
- " and is correctly detected" )
- packetSWResult = main.TRUE
- else:
- print "Number of Packet layer or mininet Switches = %d and"\
- % packetLayerSWCount + " is wrong"
- main.log.info(
- "Number of Packet layer or mininet Switches = " +
- str( packetLayerSWCount ) +
- " and is wrong" )
- packetSWResult = main.FALSE
- print "_________________________________"
-
- linksResult = main.ONOScli3.links( jsonFormat=False )
- print "links_result = ", linksResult
- print "_________________________________"
- linkActiveCount = linksResult.count("state=ACTIVE")
- main.log.info( "linkActiveCount = " + str( linkActiveCount ))
- if linkActiveCount == 42:
- linkActiveResult = main.TRUE
- main.log.info(
- "Number of links in ACTIVE state are correct")
- else:
- linkActiveResult = main.FALSE
- main.log.info(
- "Number of links in ACTIVE state are wrong")
-
- case22Result = opticalSWResult and packetSWResult and \
- linkActiveResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case22Result,
- onpass="Packet optical topology discovery successful",
- onfail="Packet optical topology discovery failed" )
-
- def CASE23( self, main ):
- import time
- """
- Add bidirectional point intents between 2 packet layer( mininet )
- devices and
- ping mininet hosts
- """
- main.log.report(
- "This testcase adds bidirectional point intents between 2 " +
- "packet layer( mininet ) devices and ping mininet hosts" )
- main.case( "Topology comparision" )
- main.step( "Adding point intents" )
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000ffffffff0001/1",
- "of:0000ffffffff0005/1" )
- if ptpIntentResult == main.TRUE:
- main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "Point to point intent install successful" )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000ffffffff0005/1",
- "of:0000ffffffff0001/1" )
- if ptpIntentResult == main.TRUE:
- main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "Point to point intent install successful" )
-
- time.sleep( 30 )
- flowHandle = main.ONOScli1.flows()
- main.log.info( "flows :" + flowHandle )
-
- # Sleep for 30 seconds to provide time for the intent state to change
- time.sleep( 60 )
- intentHandle = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "intents :" + intentHandle )
-
- PingResult = main.TRUE
- count = 1
- main.log.info( "\n\nh1 is Pinging h5" )
- ping = main.LincOE2.pingHostOptical( src="h1", target="h5" )
- # ping = main.LincOE2.pinghost()
- if ping == main.FALSE and count < 5:
- count += 1
- PingResult = main.FALSE
- main.log.info(
- "Ping between h1 and h5 failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.info( "All ping attempts between h1 and h5 have failed" )
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h1 and h5 passed!" )
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
-
- if PingResult == main.FALSE:
- main.log.report(
- "Point intents for packet optical have not ben installed" +
- " correctly. Cleaning up" )
- if PingResult == main.TRUE:
- main.log.report(
- "Point Intents for packet optical have been " +
- "installed correctly" )
-
- case23Result = PingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case23Result,
- onpass= "Point intents addition for packet optical and" +
- "Pingall Test successful",
- onfail= "Point intents addition for packet optical and" +
- "Pingall Test NOT successful" )
-
- def CASE24( self, main ):
- import time
- import json
- """
- LINC uses its own switch IDs. You can use the following
- command on the LINC console to find the mapping between
- DPIDs and LINC IDs.
- rp(application:get_all_key(linc)).
-
- Test Rerouting of Packet Optical by bringing a port down
- ( port 20 ) of a switch( switchID=1, or LincOE switchID =9 ),
- so that link
- ( between switch1 port20 - switch5 port50 ) is inactive
- and do a ping test. If rerouting is successful,
- ping should pass. also check the flows
- """
- main.log.report(
- "This testcase tests rerouting and pings mininet hosts" )
- main.case( "Test rerouting and pings mininet hosts" )
- main.step( "Attach to the Linc-OE session" )
- attachConsole = main.LincOE1.attachLincOESession()
- print "attachConsole = ", attachConsole
-
- main.step( "Bring a port down and verify the link state" )
- main.LincOE1.portDown( swId="9", ptId="20" )
- linksNonjson = main.ONOScli3.links( jsonFormat=False )
- main.log.info( "links = " + linksNonjson )
-
- linkInactiveCount = linksNonjson.count("state=INACTIVE")
- main.log.info( "linkInactiveCount = " + str( linkInactiveCount ))
- if linkInactiveCount == 2:
- main.log.info(
- "Number of links in INACTIVE state are correct")
- else:
- main.log.info(
- "Number of links in INACTIVE state are wrong")
-
- links = main.ONOScli3.links()
- main.log.info( "links = " + links )
-
- linksResult = json.loads( links )
- linksStateResult = main.FALSE
- for item in linksResult:
- if item[ 'src' ][ 'device' ] == "of:0000ffffffffff01" and item[
- 'src' ][ 'port' ] == "20":
- if item[ 'dst' ][ 'device' ] == "of:0000ffffffffff05" and item[
- 'dst' ][ 'port' ] == "50":
- linksState = item[ 'state' ]
- if linksState == "INACTIVE":
- main.log.info(
- "Links state is inactive as expected due to one" +
- " of the ports being down" )
- main.log.report(
- "Links state is inactive as expected due to one" +
- " of the ports being down" )
- linksStateResult = main.TRUE
- break
- else:
- main.log.info(
- "Links state is not inactive as expected" )
- main.log.report(
- "Links state is not inactive as expected" )
- linksStateResult = main.FALSE
-
- print "links_state_result = ", linksStateResult
- time.sleep( 10 )
- flowHandle = main.ONOScli3.flows()
- main.log.info( "flows :" + flowHandle )
-
- main.step( "Verify Rerouting by a ping test" )
- PingResult = main.TRUE
- count = 1
- main.log.info( "\n\nh1 is Pinging h5" )
- ping = main.LincOE2.pingHostOptical( src="h1", target="h5" )
- # ping = main.LincOE2.pinghost()
- if ping == main.FALSE and count < 5:
- count += 1
- PingResult = main.FALSE
- main.log.info(
- "Ping between h1 and h5 failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.info( "All ping attempts between h1 and h5 have failed" )
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h1 and h5 passed!" )
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
-
- if PingResult == main.TRUE:
- main.log.report( "Ping test successful " )
- if PingResult == main.FALSE:
- main.log.report( "Ping test failed" )
-
- case24Result = PingResult and linksStateResult
- utilities.assert_equals( expect=main.TRUE, actual=case24Result,
- onpass="Packet optical rerouting successful",
- onfail="Packet optical rerouting failed" )
-
- def CASE25( self ):
- """
- Add host intents between 2 packet layer host
- """
- import time
- import json
- main.log.report( "Adding host intents between 2 packet layer host" )
- main.hostMACs = []
- main.hostId = []
- #Listing host MAC addresses
- for i in range( 1 , 7 ):
- main.hostMACs.append( "00:00:00:00:00:" +
- str( hex( i )[ 2: ] ).zfill( 2 ).upper() )
- for macs in main.hostMACs:
- main.hostId.append( macs + "/-1" )
-
- host1 = main.hostId[ 0 ]
- host2 = main.hostId[ 1 ]
- intentsId = []
- # Use arping to discover the hosts
- main.LincOE2.arping( host = "h1" )
- main.LincOE2.arping( host = "h2" )
- # Adding host intent
- main.log.step( "Adding host intents to h1 and h2" )
- intent1 = main.ONOScli1.addHostIntent( hostIdOne = host1,
- hostIdTwo = host2 )
- intentsId.append( intent1 )
- time.sleep( 5 )
- intent2 = main.ONOScli1.addHostIntent( hostIdOne = host2,
- hostIdTwo = host1 )
- intentsId.append( intent2 )
- # Checking intents state before pinging
- main.log.step( "Checking intents state" )
- time.sleep( 10 )
- intentResult = main.ONOScli1.checkIntentState( intentsId = intentsId )
- utilities.assert_equals( expect=main.TRUE, actual=intentResult,
- onpass="All intents are in INSTALLED state ",
- onfail="Some of the intents are not in " +
- "INSTALLED state " )
-
- # pinging h1 to h2 and then ping h2 to h1
- main.log.step( "Pinging h1 and h2" )
- pingResult = main.TRUE
- pingResult = main.LincOE2.pingHostOptical( src="h1", target="h2" )
- pingResult = pingResult and main.LincOE2.pingHostOptical( src="h2",
- target="h1" )
-
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
- onpass="Pinged successfully between h1 and h2",
- onfail="Pinged failed between h1 and h2" )
-
- case25Result = pingResult
- utilities.assert_equals( expect=main.TRUE, actual=case25Result,
- onpass="Add host intent successful",
- onfail="Add host intent failed" )
diff --git a/TestON/tests/IpOpticalMulti/__init__.py b/TestON/tests/IpOpticalMulti/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/IpOpticalMulti/__init__.py
+++ /dev/null
diff --git a/TestON/tests/MultiProd/MultiProd.params b/TestON/tests/MultiProd/MultiProd.params
deleted file mode 100755
index 3767ab9..0000000
--- a/TestON/tests/MultiProd/MultiProd.params
+++ /dev/null
@@ -1,68 +0,0 @@
-<PARAMS>
-
- <testcases>1,4,10,5,6,7,8,6,8,9,8,31,32,8,33,8,20,21,22,10,23,24</testcases>
- #Environment variables
- <ENV>
- <cellName>multi_test</cellName>
- </ENV>
-
- <GIT>
- <pull>False</pull>
- </GIT>
-
- <CTRL>
- <ip1>10.128.20.11</ip1>
- <ip2>10.128.20.12</ip2>
- <ip3>10.128.20.13</ip3>
- <port1>6633</port1>
- <port2>6633</port2>
- <port3>6633</port3>
- </CTRL>
-
- <SDNIP>
- <ethType>IPV4</ethType>
- <tcpProto>6</tcpProto>
- <icmpProto>1</icmpProto>
- <srcPort>5001</srcPort>
- <dstPort>5001</dstPort>
- </SDNIP>
-
- <MULTIPOINT_INTENT>
- <device1>of:0000000000003008/1 </device1>
- <device2>of:0000000000003009/1 </device2>
- <device3>of:0000000000003010/1 </device3>
- <mac1>00:00:00:00:00:0A </mac1>
- <mac2>00:00:00:00:00:08 </mac2>
- <ip1>10.0.3.0/24 </ip1>
- <ip2>10.0.1.0/24 </ip2>
- </MULTIPOINT_INTENT>
-
- <PING>
- <source1>h8</source1>
- <source2>h9</source2>
- <source3>h10</source3>
- <source4>h11</source4>
- <source5>h12</source5>
- <source6>h13</source6>
- <source7>h14</source7>
- <source8>h15</source8>
- <source9>h16</source9>
- <source10>h17</source10>
- <target1>10.0.0.18</target1>
- <target2>10.0.0.19</target2>
- <target3>10.0.0.20</target3>
- <target4>10.0.0.21</target4>
- <target5>10.0.0.22</target5>
- <target6>10.0.0.23</target6>
- <target7>10.0.0.24</target7>
- <target8>10.0.0.25</target8>
- <target9>10.0.0.26</target9>
- <target10>10.0.0.27</target10>
- </PING>
-
- <timers>
- <LinkDiscovery>5</LinkDiscovery>
- <SwitchDiscovery>31</SwitchDiscovery>
- </timers>
-
-</PARAMS>
diff --git a/TestON/tests/MultiProd/MultiProd.py b/TestON/tests/MultiProd/MultiProd.py
deleted file mode 100644
index 682b6f1..0000000
--- a/TestON/tests/MultiProd/MultiProd.py
+++ /dev/null
@@ -1,1997 +0,0 @@
-
-# Testing the basic functionality of ONOS Next
-# For sanity and driver functionality excercises only.
-
-import time
-import sys
-import os
-import re
-import time
-import json
-
-time.sleep( 1 )
-
-class MultiProd:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- """
- Startup sequence:
- cell <name>
- onos-verify-cell
- onos-remove-raft-logs
- git pull
- mvn clean install
- onos-package
- onos-install -f
- onos-wait-for-start
- """
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
- gitPull = main.params[ 'GIT' ][ 'pull' ]
-
- main.case( "Setting up test environment" )
- main.log.report(
- "This testcase is testing setting up test environment" )
- main.log.report( "__________________________________" )
-
- main.step( "Applying cell variable to environment" )
- cellResult1 = main.ONOSbench.setCell( cellName )
- # cellResult2 = main.ONOScli1.setCell( cellName )
- # cellResult3 = main.ONOScli2.setCell( cellName )
- # cellResult4 = main.ONOScli3.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
- cellResult = cellResult1
-
- main.step( "Removing raft logs before a clen installation of ONOS" )
- removeLogResult = main.ONOSbench.onosRemoveRaftLogs()
-
- main.step( "Git checkout and get version" )
- main.ONOSbench.gitCheckout( "master" )
- if gitPull == 'True':
- gitPullResult = main.ONOSbench.gitPull()
- if gitPullResult == 1:
- main.step( "Using mvn clean & install" )
- main.ONOSbench.cleanInstall()
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
- elif gitPullResult == 0:
- main.log.report(
- "Git Pull Failed, look into logs for detailed reason" )
- main.cleanup()
- main.exit()
- main.log.info( "git_pull_result = " + str( gitPullResult ))
- else:
- main.log.info( "Skipping git pull" )
- main.ONOSbench.getVersion( report=True )
- packageResult = main.TRUE
-
- # main.step( "Creating a cell" )
- # cellCreateResult = main.ONOSbench.createCellFile( **************
- # )
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS1Ip )
- onos2InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS2Ip )
- onos3InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS3Ip )
- onosInstallResult = onos1InstallResult and onos2InstallResult and\
- onos3InstallResult
- if onosInstallResult == main.TRUE:
- main.log.report( "Installing ONOS package successful" )
- else:
- main.log.report( "Installing ONOS package failed" )
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- onos2Isup = main.ONOSbench.isup( ONOS2Ip )
- onos3Isup = main.ONOSbench.isup( ONOS3Ip )
- onosIsup = onos1Isup and onos2Isup and onos3Isup
- if onosIsup == main.TRUE:
- main.log.report( "ONOS instances are up and ready" )
- else:
- main.log.report( "ONOS instances may not be up" )
-
- main.step( "Starting ONOS service" )
- startResult = main.TRUE
- # startResult = main.ONOSbench.onosStart( ONOS1Ip )
- startcli1 = main.ONOScli1.startOnosCli( ONOSIp=ONOS1Ip )
- startcli2 = main.ONOScli2.startOnosCli( ONOSIp=ONOS2Ip )
- startcli3 = main.ONOScli3.startOnosCli( ONOSIp=ONOS3Ip )
- print startcli1
- print startcli2
- print startcli3
-
- # Starting the mininet using the old way
- main.step( "Starting Mininet ..." )
- netIsUp = main.Mininet1.startNet()
- if netIsUp:
- main.log.info("Mininet CLI is up")
-
- case1Result = ( packageResult and
- cellResult and verifyResult and onosInstallResult and
- onosIsup and startResult )
- utilities.assertEquals( expect=main.TRUE, actual=case1Result,
- onpass="Test startup successful",
- onfail="Test startup NOT successful" )
-
- def CASE11( self, main ):
- """
- Cleanup sequence:
- onos-service <nodeIp> stop
- onos-uninstall
-
- TODO: Define rest of cleanup
-
- """
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
-
- main.case( "Cleaning up test environment" )
-
- main.step( "Testing ONOS kill function" )
- killResult1 = main.ONOSbench.onosKill( ONOS1Ip )
- killResult2 = main.ONOSbench.onosKill( ONOS2Ip )
- killResult3 = main.ONOSbench.onosKill( ONOS3Ip )
-
- main.step( "Stopping ONOS service" )
- stopResult1 = main.ONOSbench.onosStop( ONOS1Ip )
- stopResult2 = main.ONOSbench.onosStop( ONOS2Ip )
- stopResult3 = main.ONOSbench.onosStop( ONOS3Ip )
-
- main.step( "Uninstalling ONOS service" )
- uninstallResult = main.ONOSbench.onosUninstall()
-
- def CASE3( self, main ):
- """
- Test 'onos' command and its functionality in driver
- """
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
-
- main.case( "Testing 'onos' command" )
-
- main.step( "Sending command 'onos -w <onos-ip> system:name'" )
- cmdstr1 = "system:name"
- cmdResult1 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr1 )
- main.log.info( "onos command returned: " + cmdResult1 )
- cmdResult2 = main.ONOSbench.onosCli( ONOS2Ip, cmdstr1 )
- main.log.info( "onos command returned: " + cmdResult2 )
- cmdResult3 = main.ONOSbench.onosCli( ONOS3Ip, cmdstr1 )
- main.log.info( "onos command returned: " + cmdResult3 )
-
- main.step( "Sending command 'onos -w <onos-ip> onos:topology'" )
- cmdstr2 = "onos:topology"
- cmdResult4 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr2 )
- main.log.info( "onos command returned: " + cmdResult4 )
- cmdResult5 = main.ONOSbench.onosCli( ONOS2Ip, cmdstr2 )
- main.log.info( "onos command returned: " + cmdResult5 )
- cmdResult6 = main.ONOSbench.onosCli( ONOS6Ip, cmdstr2 )
- main.log.info( "onos command returned: " + cmdResult6 )
-
- def CASE4( self, main ):
- import re
- import time
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
-
- main.log.report(
- "This testcase is testing the assignment of all the switches" +
- " to all controllers and discovering the hosts in reactive mode" )
- main.log.report( "__________________________________" )
- main.case( "Pingall Test(No intents are added)" )
- main.step( "Assigning switches to controllers" )
- for i in range( 1, 29 ): # 1 to ( num of switches +1 )
- main.Mininet1.assignSwController(
- sw=str( i ),
- count=3,
- ip1=ONOS1Ip,
- port1=ONOS1Port,
- ip2=ONOS2Ip,
- port2=ONOS2Port,
- ip3=ONOS3Ip,
- port3=ONOS3Port )
-
- switchMastership = main.TRUE
- for i in range( 1, 29 ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- switchMastership = switchMastership and main.TRUE
- else:
- switchMastership = main.FALSE
-
- if switchMastership == main.TRUE:
- main.log.report( "Controller assignment successfull" )
- else:
- main.log.report( "Controller assignment failed" )
- appInstallResult = main.TRUE
- main.log.info( "Activating reactive forwarding app" )
- appInstallResult = main.ONOScli1.activateApp( "org.onosproject.fwd" )
- appCheck = main.ONOScli1.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOScli1.apps() )
- main.log.warn( main.ONOScli1.appIDs() )
- time.sleep( 30 )
- # REACTIVE FWD test
- main.step( "Pingall" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall()
- time2 = time.time()
- print "Time for pingall: %2f seconds" % ( time2 - time1 )
-
- case4Result = switchMastership and pingResult
- if pingResult == main.TRUE:
- main.log.report(
- "Pingall Test in reactive mode to" +
- " discover the hosts successful" )
- else:
- main.log.report(
- "Pingall Test in reactive mode to discover the hosts failed" )
-
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case4Result,
- onpass="Controller assignment and Pingall Test successful",
- onfail="Controller assignment and Pingall Test NOT successful" )
-
- def CASE5( self, main ):
- import json
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
-
- main.log.report(
- "This testcase is testing if all ONOS nodes are in topology" +
- " sync with mininet and its peer ONOS nodes" )
- main.log.report( "__________________________________" )
- main.case(
- "Testing Mininet topology with the" +
- " topology of multi instances ONOS" )
- main.step( "Collecting topology information from ONOS" )
- devices1 = main.ONOScli1.devices()
- devices2 = main.ONOScli2.devices()
- devices3 = main.ONOScli3.devices()
- # print "devices1 = ", devices1
- # print "devices2 = ", devices2
- # print "devices3 = ", devices3
- hosts1 = main.ONOScli1.hosts()
- hosts2 = main.ONOScli2.hosts()
- hosts3 = main.ONOScli3.hosts()
- # print "hosts1 = ", hosts1
- # print "hosts2 = ", hosts2
- # print "hosts3 = ", hosts3
- ports1 = main.ONOScli1.ports()
- ports2 = main.ONOScli2.ports()
- ports3 = main.ONOScli3.ports()
- # print "ports1 = ", ports1
- # print "ports2 = ", ports2
- # print "ports3 = ", ports3
- links1 = main.ONOScli1.links()
- links2 = main.ONOScli2.links()
- links3 = main.ONOScli3.links()
- # print "links1 = ", links1
- # print "links2 = ", links2
- # print "links3 = ", links3
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
-
- print "**************"
-
- main.step( "Start continuous pings" )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source1' ],
- target=main.params[ 'PING' ][ 'target1' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source2' ],
- target=main.params[ 'PING' ][ 'target2' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source3' ],
- target=main.params[ 'PING' ][ 'target3' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source4' ],
- target=main.params[ 'PING' ][ 'target4' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source5' ],
- target=main.params[ 'PING' ][ 'target5' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source6' ],
- target=main.params[ 'PING' ][ 'target6' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source7' ],
- target=main.params[ 'PING' ][ 'target7' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source8' ],
- target=main.params[ 'PING' ][ 'target8' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source9' ],
- target=main.params[ 'PING' ][ 'target9' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source10' ],
- target=main.params[ 'PING' ][ 'target10' ],
- pingTime=500 )
-
- TopologyCheck = main.TRUE
- main.step( "Compare ONOS Topology to MN Topology" )
-
- switchesResults1 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devices1 ), json.loads( ports1 ) )
- print "switches_Result1 = ", switchesResults1
- utilities.assertEquals( expect=main.TRUE, actual=switchesResults1,
- onpass="ONOS1 Switches view is correct",
- onfail="ONOS1 Switches view is incorrect" )
-
- switchesResults2 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devices2 ), json.loads( ports2 ) )
- utilities.assertEquals( expect=main.TRUE, actual=switchesResults2,
- onpass="ONOS2 Switches view is correct",
- onfail="ONOS2 Switches view is incorrect" )
-
- switchesResults3 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devices3 ), json.loads( ports3 ) )
- utilities.assertEquals( expect=main.TRUE, actual=switchesResults3,
- onpass="ONOS3 Switches view is correct",
- onfail="ONOS3 Switches view is incorrect" )
-
- linksResults1 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( links1 ) )
- utilities.assertEquals( expect=main.TRUE, actual=linksResults1,
- onpass="ONOS1 Links view is correct",
- onfail="ONOS1 Links view is incorrect" )
-
- linksResults2 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( links2 ) )
- utilities.assertEquals( expect=main.TRUE, actual=linksResults2,
- onpass="ONOS2 Links view is correct",
- onfail="ONOS2 Links view is incorrect" )
-
- linksResults3 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( links3 ) )
- utilities.assertEquals( expect=main.TRUE, actual=linksResults3,
- onpass="ONOS2 Links view is correct",
- onfail="ONOS2 Links view is incorrect" )
-
- topoResult = switchesResults1 and switchesResults2 and\
- switchesResults3 and linksResults1 and linksResults2 and\
- linksResults3
-
- if topoResult == main.TRUE:
- main.log.report(
- "Topology Check Test with mininet" +
- "and ONOS instances successful" )
- else:
- main.log.report(
- "Topology Check Test with mininet and ONOS instances failed" )
-
- utilities.assertEquals( expect=main.TRUE, actual=topoResult,
- onpass="Topology Check Test successful",
- onfail="Topology Check Test NOT successful" )
-
- def CASE10( self ):
- import time
- main.log.report(
- "This testcase uninstalls the reactive forwarding app" )
- main.log.report( "__________________________________" )
- main.case( "Uninstalling reactive forwarding app" )
- # Unistall onos-app-fwd app to disable reactive forwarding
- appInstallResult = main.ONOScli1.deactivateApp( "org.onosproject.fwd" )
- appCheck = main.ONOScli1.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOScli1.apps() )
- main.log.warn( main.ONOScli1.appIDs() )
- main.log.info( "onos-app-fwd uninstalled" )
-
- # After reactive forwarding is disabled,
- # the reactive flows on switches timeout in 10-15s
- # So sleep for 15s
- time.sleep( 15 )
-
- hosts = main.ONOScli1.hosts()
- main.log.info( hosts )
- case10Result = appInstallResult
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case10Result,
- onpass="Reactive forwarding app uninstallation successful",
- onfail="Reactive forwarding app uninstallation failed" )
-
- def CASE6( self ):
- main.log.report(
- "This testcase is testing the addition of" +
- " host intents and then doing pingall" )
- main.log.report( "__________________________________" )
- main.case( "Obtaining hostsfor adding host intents" )
- main.step( "Get hosts" )
- hosts = main.ONOScli1.hosts()
- main.log.info( hosts )
-
- main.step( "Get all devices id" )
- devicesIdList = main.ONOScli1.getAllDevicesId()
- main.log.info( devicesIdList )
-
- # ONOS displays the hosts in hex format
- # unlike mininet which does in decimal format
- # So take care while adding intents
-
- """
- main.step( "Add host intents for mn hosts(h8-h18,h9-h19,h10-h20,
- h11-h21,h12-h22,h13-h23,h14-h24,h15-h25,h16-h26,h17-h27)" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:08/-1",
- "00:00:00:00:00:12/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:09/-1",
- "00:00:00:00:00:13/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0A/-1",
- "00:00:00:00:00:14/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0B/-1",
- "00:00:00:00:00:15/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0C/-1",
- "00:00:00:00:00:16/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0D/-1",
- "00:00:00:00:00:17/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0E/-1",
- "00:00:00:00:00:18/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0F/-1",
- "00:00:00:00:00:19/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:10/-1",
- "00:00:00:00:00:1A/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:11/-1",
- "00:00:00:00:00:1B/-1" )
- """
- intentsId = []
- for i in range( 8, 18 ):
- main.log.info(
- "Adding host intent between h" + str( i ) +
- " and h" + str( i + 10 ) )
- host1 = "00:00:00:00:00:" + \
- str( hex( i )[ 2: ] ).zfill( 2 ).upper()
- host2 = "00:00:00:00:00:" + \
- str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
- # NOTE: get host can return None
- # TODO: handle this
- host1Id = main.ONOScli1.getHost( host1 )[ 'id' ]
- host2Id = main.ONOScli1.getHost( host2 )[ 'id' ]
- tmpResult = main.ONOScli1.addHostIntent( host1Id, host2Id )
- intentsId.append( tmpResult )
-
- checkIntent1 = main.ONOScli1.checkIntentState( intentsId )
- checkIntent2 = main.ONOScli2.checkIntentState( intentsId )
- checkIntent3 = main.ONOScli3.checkIntentState( intentsId )
-
- flowHandle = main.ONOScli1.flows()
-
- main.log.info( "flows:" + flowHandle )
-
- count = 1
- i = 8
- PingResult = main.TRUE
- while i < 18:
- main.log.info(
- "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- if ping == main.FALSE and count < 5:
- count += 1
- # i = 8
- PingResult = main.FALSE
- main.log.report( "Ping between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- " failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.report( "All ping attempts between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "have failed" )
- i = 19
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "passed!" )
- i += 1
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
- if PingResult == main.FALSE:
- main.log.report(
- "Host intents have not ben installed correctly. Cleaning up" )
- # main.cleanup()
- # main.exit()
- if PingResult == main.TRUE:
- main.log.report( "Host intents have been installed correctly" )
-
- checkIntent1 = main.ONOScli1.checkIntentState( intentsId )
- checkIntent2 = main.ONOScli2.checkIntentState( intentsId )
- checkIntent3 = main.ONOScli3.checkIntentState( intentsId )
-
- case6Result = PingResult
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case6Result,
- onpass="Host intent addition and Pingall Test successful",
- onfail="Host intent addition and Pingall Test NOT successful" )
-
- def CASE7( self, main ):
-
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-
- linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- main.log.report(
- "This testscase is killing a link to" +
- " ensure that link discovery is consistent" )
- main.log.report( "__________________________________" )
- main.case(
- "Killing a link to Ensure that Link" +
- " Discovery is Working Properly" )
- main.step( "Start continuous pings" )
-
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source1' ],
- target=main.params[ 'PING' ][ 'target1' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source2' ],
- target=main.params[ 'PING' ][ 'target2' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source3' ],
- target=main.params[ 'PING' ][ 'target3' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source4' ],
- target=main.params[ 'PING' ][ 'target4' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source5' ],
- target=main.params[ 'PING' ][ 'target5' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source6' ],
- target=main.params[ 'PING' ][ 'target6' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source7' ],
- target=main.params[ 'PING' ][ 'target7' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source8' ],
- target=main.params[ 'PING' ][ 'target8' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source9' ],
- target=main.params[ 'PING' ][ 'target9' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source10' ],
- target=main.params[ 'PING' ][ 'target10' ],
- pingTime=500 )
-
- main.step( "Determine the current number of switches and links" )
- topologyOutput = main.ONOScli1.topology()
- topologyResult = main.ONOSbench.getTopology( topologyOutput )
- activeSwitches = topologyResult[ 'devices' ]
- links = topologyResult[ 'links' ]
- main.log.info(
- "Currently there are %s switches and %s links" %
- ( str( activeSwitches ), str( links ) ) )
-
- main.step( "Kill Link between s3 and s28" )
- main.Mininet1.link( END1="s3", END2="s28", OPTION="down" )
- time.sleep( linkSleep )
- topologyOutput = main.ONOScli2.topology()
- LinkDown = main.ONOSbench.checkStatus(
- topologyOutput, activeSwitches, str(
- int( links ) - 2 ) )
- if LinkDown == main.TRUE:
- main.log.report( "Link Down discovered properly" )
- utilities.assertEquals(
- expect=main.TRUE,
- actual=LinkDown,
- onpass="Link Down discovered properly",
- onfail="Link down was not discovered in " +
- str( linkSleep ) +
- " seconds" )
-
- main.step( "Bring link between s3 and s28 back up" )
- LinkUp = main.Mininet1.link( END1="s3", END2="s28", OPTION="up" )
- time.sleep( linkSleep )
- topologyOutput = main.ONOScli2.topology()
- LinkUp = main.ONOSbench.checkStatus(
- topologyOutput,
- activeSwitches,
- str( links ) )
- if LinkUp == main.TRUE:
- main.log.report( "Link up discovered properly" )
- utilities.assertEquals(
- expect=main.TRUE,
- actual=LinkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( linkSleep ) +
- " seconds" )
-
- main.step( "Compare ONOS Topology to MN Topology" )
- main.case(
- "Testing Mininet topology with the" +
- " topology of multi instances ONOS" )
- main.step( "Collecting topology information from ONOS" )
- devices1 = main.ONOScli1.devices()
- devices2 = main.ONOScli2.devices()
- devices3 = main.ONOScli3.devices()
- print "devices1 = ", devices1
- print "devices2 = ", devices2
- print "devices3 = ", devices3
- hosts1 = main.ONOScli1.hosts()
- hosts2 = main.ONOScli2.hosts()
- hosts3 = main.ONOScli3.hosts()
- # print "hosts1 = ", hosts1
- # print "hosts2 = ", hosts2
- # print "hosts3 = ", hosts3
- ports1 = main.ONOScli1.ports()
- ports2 = main.ONOScli2.ports()
- ports3 = main.ONOScli3.ports()
- # print "ports1 = ", ports1
- # print "ports2 = ", ports2
- # print "ports3 = ", ports3
- links1 = main.ONOScli1.links()
- links2 = main.ONOScli2.links()
- links3 = main.ONOScli3.links()
- # print "links1 = ", links1
- # print "links2 = ", links2
- # print "links3 = ", links3
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
-
- print "**************"
-
- main.step( "Start continuous pings" )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source1' ],
- target=main.params[ 'PING' ][ 'target1' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source2' ],
- target=main.params[ 'PING' ][ 'target2' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source3' ],
- target=main.params[ 'PING' ][ 'target3' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source4' ],
- target=main.params[ 'PING' ][ 'target4' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source5' ],
- target=main.params[ 'PING' ][ 'target5' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source6' ],
- target=main.params[ 'PING' ][ 'target6' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source7' ],
- target=main.params[ 'PING' ][ 'target7' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source8' ],
- target=main.params[ 'PING' ][ 'target8' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source9' ],
- target=main.params[ 'PING' ][ 'target9' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source10' ],
- target=main.params[ 'PING' ][ 'target10' ],
- pingTime=500 )
-
- main.step( "Compare ONOS Topology to MN Topology" )
-
- switchesResults1 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devices1 ), json.loads( ports1 ) )
- print "switches_Result1 = ", switchesResults1
- utilities.assertEquals( expect=main.TRUE, actual=switchesResults1,
- onpass="ONOS1 Switches view is correct",
- onfail="ONOS1 Switches view is incorrect" )
-
- switchesResults2 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devices2 ), json.loads( ports2 ) )
- utilities.assertEquals( expect=main.TRUE, actual=switchesResults2,
- onpass="ONOS2 Switches view is correct",
- onfail="ONOS2 Switches view is incorrect" )
-
- switchesResults3 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devices3 ), json.loads( ports3 ) )
- utilities.assertEquals( expect=main.TRUE, actual=switchesResults3,
- onpass="ONOS3 Switches view is correct",
- onfail="ONOS3 Switches view is incorrect" )
-
- linksResults1 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( links1 ) )
- utilities.assertEquals( expect=main.TRUE, actual=linksResults1,
- onpass="ONOS1 Links view is correct",
- onfail="ONOS1 Links view is incorrect" )
-
- linksResults2 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( links2 ) )
-
- utilities.assertEquals( expect=main.TRUE, actual=linksResults2,
- onpass="ONOS2 Links view is correct",
- onfail="ONOS2 Links view is incorrect" )
-
- linksResults3 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( links3 ) )
-
- utilities.assertEquals( expect=main.TRUE, actual=linksResults3,
- onpass="ONOS2 Links view is correct",
- onfail="ONOS2 Links view is incorrect" )
-
- topoResult = switchesResults1 and switchesResults2\
- and switchesResults3 and linksResults1 and\
- linksResults2 and linksResults3
-
- utilities.assertEquals(
- expect=main.TRUE,
- actual=topoResult and LinkUp and LinkDown,
- onpass="Topology Check Test successful",
- onfail="Topology Check Test NOT successful" )
-
- def CASE8( self ):
- """
- Intent removal
- """
- main.log.report(
- "This testcase removes any previously added intents" )
- main.log.report( "__________________________________" )
- main.log.info( "Removing any previously installed intents" )
- main.case( "Removing intents" )
- main.step( "Obtain the intent id's" )
- intentResult = main.ONOScli1.intents( jsonFormat=False )
-
- intentLinewise = intentResult.split( "\n" )
- intentList = []
- for line in intentLinewise:
- if line.startswith( "id=" ):
- intentList.append( line )
-
- intentids = []
- for line in intentList:
- intentids.append( line.split( "," )[ 0 ].split( "=" )[ 1 ] )
- for id in intentids:
- main.log.info( "id = " + id )
-
- main.step(
- "Iterate through the intentids list and remove each intent" )
- for id in intentids:
- main.ONOScli1.removeIntent( intentId=id ,purge=True )
-
- remainingIntent = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "Remaining intents " + remainingIntent )
-
- case8Result = main.TRUE
- intentResult = main.TRUE
- if remainingIntent:
- main.log.error( "There are still remaining intent" )
- intentResult = main.FALSE
- i = 8
-
- PingResult = main.TRUE
- """
- while i < 18:
- main.log.info(
- "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- if ping == main.TRUE:
- i = 19
- PingResult = main.TRUE
- elif ping == main.FALSE:
- i += 1
- PingResult = main.FALSE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
- # Note: If the ping result failed, that means the intents have been
- # withdrawn correctly.
- if PingResult == main.TRUE:
- main.log.report( "Host intents have not been withdrawn correctly" )
- # main.cleanup()
- # main.exit()
- if PingResult == main.FALSE:
- main.log.report( "Host intents have been withdrawn correctly" )
- """
- case8Result = intentResult
-
- if case8Result == main.TRUE:
- main.log.report( "Intent removal successful" )
- else:
- main.log.report( "Intent removal failed" )
-
- utilities.assertEquals( expect=main.TRUE, actual=case8Result,
- onpass="Intent removal test successful",
- onfail="Intent removal test failed" )
-
- def CASE9( self ):
- """
- This test case adds point intents. Make sure you run test case 8
- which is host intent removal before executing this test case.
- Else the host intent's flows will persist on switches and the pings
- would work even if there is some issue with the point intent's flows
- """
- main.log.report(
- "This testcase adds point intents and then does pingall" )
- main.log.report( "__________________________________" )
- main.log.info( "Adding point intents" )
- main.case(
- "Adding bidirectional point for mn hosts(h8-h18,h9-h19,h10-h20," +
- "h11-h21,h12-h22,h13-h23,h14-h24,h15-h25,h16-h26,h17-h27)" )
- main.step(
- "Add point-to-point intents for mininet hosts" +
- " h8 and h18 or ONOS hosts h8 and h12" )
- macsDict = {}
- for i in range( 1,29 ):
- macsDict[ 'h' + str( i ) ]= main.Mininet1.getMacAddress( host='h'+ str( i ) )
- print macsDict
- # main.step(var1)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- ingressDevice="of:0000000000003008/1",
- egressDevice="of:0000000000006018/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h8' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- ingressDevice="of:0000000000006018/1",
- egressDevice="of:0000000000003008/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h18' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var2 = "Add point intents for mn hosts h9&h19 or ONOS hosts h9&h13"
- main.step(var2)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003009/1",
- "of:0000000000006019/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h9' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006019/1",
- "of:0000000000003009/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h19' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var3 = "Add point intents for MN hosts h10&h20 or ONOS hosts hA&h14"
- main.step(var3)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003010/1",
- "of:0000000000006020/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h10' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006020/1",
- "of:0000000000003010/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h20' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var4 = "Add point intents for mininet hosts h11 and h21 or" +\
- " ONOS hosts hB and h15"
- main.case(var4)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003011/1",
- "of:0000000000006021/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h11' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006021/1",
- "of:0000000000003011/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h21' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var5 = "Add point intents for mininet hosts h12 and h22 " +\
- "ONOS hosts hC and h16"
- main.case(var5)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003012/1",
- "of:0000000000006022/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h12' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006022/1",
- "of:0000000000003012/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h22' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var6 = "Add point intents for mininet hosts h13 and h23 or" +\
- " ONOS hosts hD and h17"
- main.case(var6)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003013/1",
- "of:0000000000006023/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h13' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006023/1",
- "of:0000000000003013/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h23' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var7 = "Add point intents for mininet hosts h14 and h24 or" +\
- " ONOS hosts hE and h18"
- main.case(var7)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003014/1",
- "of:0000000000006024/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h14' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006024/1",
- "of:0000000000003014/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h24' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var8 = "Add point intents for mininet hosts h15 and h25 or" +\
- " ONOS hosts hF and h19"
- main.case(var8)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003015/1",
- "of:0000000000006025/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h15' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006025/1",
- "of:0000000000003015/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h25' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var9 = "Add intents for mininet hosts h16 and h26 or" +\
- " ONOS hosts h10 and h1A"
- main.case(var9)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003016/1",
- "of:0000000000006026/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h16' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006026/1",
- "of:0000000000003016/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h26' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var10 = "Add point intents for mininet hosts h17 and h27 or" +\
- " ONOS hosts h11 and h1B"
- main.case(var10)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003017/1",
- "of:0000000000006027/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h17' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- #main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006027/1",
- "of:0000000000003017/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h27' ))
-
- print(
- "_______________________________________________________" +
- "________________________________" )
-
- flowHandle = main.ONOScli1.flows()
- print "flowHandle = ", flowHandle
- main.log.info( "flows :" + flowHandle )
-
- count = 1
- i = 8
- PingResult = main.TRUE
- while i < 18:
- main.log.info(
- "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- if ping == main.FALSE and count < 5:
- count += 1
- # i = 8
- PingResult = main.FALSE
- main.log.report( "Ping between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- " failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.report( "All ping attempts between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "have failed" )
- i = 19
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "passed!" )
- i += 1
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
- if PingResult == main.FALSE:
- main.log.report(
- "Ping all test after Point intents" +
- " addition failed. Cleaning up" )
- # main.cleanup()
- # main.exit()
- if PingResult == main.TRUE:
- main.log.report(
- "Ping all test after Point intents addition successful" )
-
- case8Result = PingResult
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case8Result,
- onpass="Ping all test after Point intents addition successful",
- onfail="Ping all test after Point intents addition failed" )
-
- def CASE31( self ):
- """
- This test case adds point intent related to
- SDN-IP matching on ICMP ( ethertype=IPV4, ipProto=1 )
- """
- import json
-
- main.log.report(
- "This test case adds point intent " +
- "related to SDN-IP matching on ICMP" )
- main.case(
- "Adding bidirectional point intent related" +
- " to SDN-IP matching on ICMP" )
- main.step( "Adding bidirectional point intent" )
- # add-point-intent --ipSrc=10.0.0.8/32 --ipDst=10.0.0.18/32
- # --ethType=IPV4 --ipProto=1 of:0000000000003008/1
- # of:0000000000006018/1
-
- hostsJson = json.loads( main.ONOScli1.hosts() )
- for i in range( 8, 11 ):
- main.log.info(
- "Adding point intent between h" + str( i ) +
- " and h" + str( i + 10 ) )
- host1 = "00:00:00:00:00:" + \
- str( hex( i )[ 2: ] ).zfill( 2 ).upper()
- host2 = "00:00:00:00:00:" + \
- str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
- host1Id = main.ONOScli1.getHost( host1 )[ 'id' ]
- host2Id = main.ONOScli1.getHost( host2 )[ 'id' ]
- for host in hostsJson:
- if host[ 'id' ] == host1Id:
- ip1 = host[ 'ipAddresses' ][ 0 ]
- ip1 = str( ip1 + "/32" )
- device1 = host[ 'location' ][ 'elementId' ]
- device1 = str( device1 + "/1" )
- elif host[ 'id' ] == host2Id:
- ip2 = str( host[ 'ipAddresses' ][ 0 ] ) + "/32"
- device2 = host[ 'location' ][ 'elementId' ]
- device2 = str( device2 + "/1" )
-
- pIntentResult1 = main.ONOScli1.addPointIntent(
- ingressDevice=device1,
- egressDevice=device2,
- ipSrc=ip1,
- ipDst=ip2,
- ethType=main.params[ 'SDNIP' ][ 'ethType' ],
- ipProto=main.params[ 'SDNIP' ][ 'icmpProto' ], )
-
- getIntentResult = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( getIntentResult )
-
- pIntentResult2 = main.ONOScli1.addPointIntent(
- ingressDevice=device2,
- egressDevice=device1,
- ipSrc=ip2,
- ipDst=ip1,
- ethType=main.params[ 'SDNIP' ][ 'ethType' ],
- ipProto=main.params[ 'SDNIP' ][ 'icmpProto' ] )
-
- getIntentResult = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( getIntentResult )
- if ( pIntentResult1 and pIntentResult2 ) :
- # getIntentResult = main.ONOScli1.intents()
- # main.log.info( getIntentResult )
- main.log.info(
- "Point intent related to SDN-IP matching" +
- " on ICMP install successful" )
-
- time.sleep( 15 )
- getIntentResult = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "intents = " + getIntentResult )
- getFlowsResult = main.ONOScli1.flows()
- main.log.info( "flows = " + getFlowsResult )
-
- count = 1
- i = 8
- PingResult = main.TRUE
- while i < 11:
- main.log.info(
- "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- if ping == main.FALSE and count < 3:
- count += 1
- # i = 8
- PingResult = main.FALSE
- main.log.report( "Ping between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- " failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.report( "All ping attempts between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "have failed" )
- i = 19
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "passed!" )
- i += 1
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
- if PingResult == main.FALSE:
- main.log.report(
- "Ping test after Point intents related to" +
- " SDN-IP matching on ICMP failed." )
- # main.cleanup()
- # main.exit()
- if PingResult == main.TRUE:
- main.log.report(
- "Ping all test after Point intents related to" +
- " SDN-IP matching on ICMP successful" )
-
- case31Result = PingResult
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case31Result,
- onpass="Point intent related to SDN-IP " +
- "matching on ICMP and ping test successful",
- onfail="Point intent related to SDN-IP" +
- " matching on ICMP and ping test failed" )
-
- def CASE32( self ):
- """
- This test case adds point intent related to SDN-IP matching on TCP
- ( ethertype=IPV4, ipProto=6, DefaultPort for iperf=5001 )
- Note: Although BGP port is 179, we are using 5001 because iperf
- is used for verifying and iperf's default port is 5001
- """
- import json
-
- main.log.report(
- "This test case adds point intent" +
- " related to SDN-IP matching on TCP" )
- main.case(
- "Adding bidirectional point intent related" +
- " to SDN-IP matching on TCP" )
- main.step( "Adding bidirectional point intent" )
- """
- add-point-intent --ipSrc=10.0.0.8/32 --ipDst=10.0.0.18/32
- --ethType=IPV4 --ipProto=6 --tcpDst=5001 of:0000000000003008/1
- of:0000000000006018/1
-
- add-point-intent --ipSrc=10.0.0.18/32 --ipDst=10.0.0.8/32
- --ethType=IPV4 --ipProto=6 --tcpDst=5001 of:0000000000006018/1
- of:0000000000003008/1
-
- add-point-intent --ipSrc=10.0.0.8/32 --ipDst=10.0.0.18/32
- --ethType=IPV4 --ipProto=6 --tcpSrc=5001 of:0000000000003008/1
- of:0000000000006018/1
-
- add-point-intent --ipSrc=10.0.0.18/32 --ipDst=10.0.0.8/32
- --ethType=IPV4 --ipProto=6 --tcpSrc=5001 of:0000000000006018/1
- of:0000000000003008/1
-
- """
- hostsJson = json.loads( main.ONOScli1.hosts() )
- for i in range( 8, 9 ):
- main.log.info(
- "Adding point intent between h" + str( i ) +
- " and h" + str( i + 10 ) )
- host1 = "00:00:00:00:00:" + \
- str( hex( i )[ 2: ] ).zfill( 2 ).upper()
- host2 = "00:00:00:00:00:" + \
- str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
- host1Id = main.ONOScli1.getHost( host1 )[ 'id' ]
- host2Id = main.ONOScli1.getHost( host2 )[ 'id' ]
- for host in hostsJson:
- if host[ 'id' ] == host1Id:
- ip1 = host[ 'ipAddresses' ][ 0 ]
- ip1 = str( ip1 + "/32" )
- device1 = host[ 'location' ][ 'elementId' ]
- device1 = str( device1 + "/1" )
- elif host[ 'id' ] == host2Id:
- ip2 = str( host[ 'ipAddresses' ][ 0 ] ) + "/32"
- device2 = host[ 'location' ][ 'elementId' ]
- device2 = str( device2 + "/1" )
-
- pIntentResult1 = main.ONOScli1.addPointIntent(
- ingressDevice=device1,
- egressDevice=device2,
- ipSrc=ip1,
- ipDst=ip2,
- ethType=main.params[ 'SDNIP' ][ 'ethType' ],
- ipProto=main.params[ 'SDNIP' ][ 'tcpProto' ],
- tcpDst=main.params[ 'SDNIP' ][ 'dstPort' ] )
- pIntentResult2 = main.ONOScli1.addPointIntent(
- ingressDevice=device2,
- egressDevice=device1,
- ipSrc=ip2,
- ipDst=ip1,
- ethType=main.params[ 'SDNIP' ][ 'ethType' ],
- ipProto=main.params[ 'SDNIP' ][ 'tcpProto' ],
- tcpDst=main.params[ 'SDNIP' ][ 'dstPort' ] )
-
- pIntentResult3 = main.ONOScli1.addPointIntent(
- ingressDevice=device1,
- egressDevice=device2,
- ipSrc=ip1,
- ipDst=ip2,
- ethType=main.params[ 'SDNIP' ][ 'ethType' ],
- ipProto=main.params[ 'SDNIP' ][ 'tcpProto' ],
- tcpSrc=main.params[ 'SDNIP' ][ 'srcPort' ] )
- pIntentResult4 = main.ONOScli1.addPointIntent(
- ingressDevice=device2,
- egressDevice=device1,
- ipSrc=ip2,
- ipDst=ip1,
- ethType=main.params[ 'SDNIP' ][ 'ethType' ],
- ipProto=main.params[ 'SDNIP' ][ 'tcpProto' ],
- tcpSrc=main.params[ 'SDNIP' ][ 'srcPort' ] )
-
- getIntentResult = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( getIntentResult )
- pIntentResult = main.TRUE
- if getIntentResult:
- main.log.report(
- "Point intent related to SDN-IP matching" +
- " on TCP install successful" )
- else:
- main.log.report(
- "Point intent related to SDN-IP matching" +
- " on TCP install failed" )
- pIntentResult = main.FALSE
-
- iperfResult = main.Mininet1.iperf( 'h8', 'h18' )
- if iperfResult == main.TRUE:
- main.log.report( "iperf test successful" )
- else:
- main.log.report( "iperf test failed" )
-
- case32Result = pIntentResult and iperfResult
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case32Result,
- onpass="Ping all test after Point intents addition related " +
- "to SDN-IP on TCP match successful",
- onfail="Ping all test after Point intents addition related " +
- "to SDN-IP on TCP match failed" )
-
- def CASE33( self ):
- """
- This test case adds multipoint to singlepoint intent related to
- SDN-IP matching on destination ip and the action is to rewrite
- the mac address
- Here the mac address to be rewritten is the mac address of the
- egress device
- """
- import json
- import time
-
- main.log.report(
- "This test case adds multipoint to singlepoint intent related to" +
- " SDN-IP matching on destination ip and " +
- "rewrite mac address action" )
- main.case(
- "Adding multipoint to singlepoint intent related to SDN-IP" +
- " matching on destination ip" )
- main.step( "Adding bidirectional multipoint to singlepoint intent" )
- """
- add-multi-to-single-intent --ipDst=10.0.3.0/24
- --setEthDst=00:00:00:00:00:12 of:0000000000003008/1 0000000000003009/1
- of:0000000000006018/1
-
- add-multi-to-single-intent --ipDst=10.0.1.0/24
- --setEthDst=00:00:00:00:00:08 of:0000000000006018/1 0000000000003009/1
- of:0000000000003008/1
- """
- main.case(
- "Installing multipoint to single point " +
- "intent with rewrite mac address" )
- main.step( "Uninstalling proxy arp app" )
- # deactivating proxyarp app
- appInstallResult = main.ONOScli1.deactivateApp( "org.onosproject.proxyarp" )
- appCheck = main.ONOScli1.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOScli1.apps() )
- main.log.warn( main.ONOScli1.appIDs() )
- time.sleep( 30 )
- main.log.info( "onos-app-proxyarp deactivated" )
-
- main.step( "Changing ipaddress of hosts h8,h9 and h18" )
- main.Mininet1.changeIP(
- host='h8',
- intf='h8-eth0',
- newIP='10.0.1.1',
- newNetmask='255.255.255.0' )
- main.Mininet1.changeIP(
- host='h9',
- intf='h9-eth0',
- newIP='10.0.2.1',
- newNetmask='255.255.255.0' )
- main.Mininet1.changeIP(
- host='h10',
- intf='h10-eth0',
- newIP='10.0.3.1',
- newNetmask='255.255.255.0' )
-
- main.step( "Changing default gateway of hosts h8,h9 and h18" )
- main.Mininet1.changeDefaultGateway( host='h8', newGW='10.0.1.254' )
- main.Mininet1.changeDefaultGateway( host='h9', newGW='10.0.2.254' )
- main.Mininet1.changeDefaultGateway( host='h10', newGW='10.0.3.254' )
-
- main.step(
- "Assigning random mac address to the default gateways " +
- "since proxyarp app is uninstalled" )
- main.Mininet1.addStaticMACAddress(
- host='h8',
- GW='10.0.1.254',
- macaddr='00:00:00:00:11:11' )
- main.Mininet1.addStaticMACAddress(
- host='h9',
- GW='10.0.2.254',
- macaddr='00:00:00:00:22:22' )
- main.Mininet1.addStaticMACAddress(
- host='h10',
- GW='10.0.3.254',
- macaddr='00:00:00:00:33:33' )
-
- main.step( "Verify static gateway and MAC address assignment" )
- main.Mininet1.verifyStaticGWandMAC( host='h8' )
- main.Mininet1.verifyStaticGWandMAC( host='h9' )
- main.Mininet1.verifyStaticGWandMAC( host='h10' )
-
- ingressDevice1=main.params[ 'MULTIPOINT_INTENT' ][ 'device1' ]
- ingressDevice2=main.params[ 'MULTIPOINT_INTENT' ][ 'device2' ]
- ingressDeviceList = []
- ingressDeviceList.append( ingressDevice1 )
- ingressDeviceList.append( ingressDevice2 )
-
- main.step( "Adding multipoint to singlepoint intent" )
- pIntentResult1 = main.ONOScli1.addMultipointToSinglepointIntent(
- ingressDeviceList,
- egressDevice=main.params[ 'MULTIPOINT_INTENT' ][ 'device3' ],
- ipDst=main.params[ 'MULTIPOINT_INTENT' ][ 'ip1' ],
- setEthDst=main.params[ 'MULTIPOINT_INTENT' ][ 'mac1' ] )
-
- ingressDevice1=main.params[ 'MULTIPOINT_INTENT' ][ 'device3' ]
- ingressDevice2=main.params[ 'MULTIPOINT_INTENT' ][ 'device2' ]
- ingressDeviceList = [ingressDevice1, ingressDevice2]
-
- pIntentResult2 = main.ONOScli1.addMultipointToSinglepointIntent(
- ingressDeviceList,
- egressDevice=main.params[ 'MULTIPOINT_INTENT' ][ 'device1' ],
- ipDst=main.params[ 'MULTIPOINT_INTENT' ][ 'ip2' ],
- setEthDst=main.params[ 'MULTIPOINT_INTENT' ][ 'mac2' ] )
-
- pIntentResult = pIntentResult1 and pIntentResult2
- if pIntentResult == main.FALSE:
- main.log.info(
- "Multi point to single point intent " +
- "installation failed" )
- else:
- pIntentResult = main.TRUE
- getIntentResult = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "intents = " + getIntentResult )
-
- time.sleep( 10 )
- getFlowsResult = main.ONOScli1.flows( jsonFormat=False )
- main.log.info( "flows = " + getFlowsResult )
-
- count = 1
- i = 8
- PingResult = main.TRUE
-
- main.log.info( "\n\nh" + str( i ) + " is Pinging h" + str( i + 2 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 2 ) )
- if ping == main.FALSE and count < 3:
- count += 1
- PingResult = main.FALSE
- main.log.report( "Ping between h" +
- str( i ) +
- " and h" +
- str( i +
- 2 ) +
- " failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.report( "All ping attempts between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "have failed" )
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h" +
- str( i ) +
- " and h" +
- str( i +
- 2 ) +
- " passed!" )
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
-
- if PingResult == main.FALSE:
- main.log.report( "Ping test failed." )
- # main.cleanup()
- # main.exit()
- if PingResult == main.TRUE:
- main.log.report( "Ping all successful" )
-
- if pIntentResult == main.TRUE:
- main.log.info(
- "Multi point intent with rewrite mac " +
- "address installation and ping successful" )
-
- case33Result = pIntentResult and PingResult
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case33Result,
- onpass="Ping all test after multipoint to single point" +
- " intent addition with rewrite mac address successful",
- onfail="Ping all test after multipoint to single point intent" +
- " addition with rewrite mac address failed" )
-
- def CASE20( self ):
- """
- Exit from mininet cli
- reinstall ONOS
- """
- import time
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
-
- main.log.report( "This testcase exits the mininet cli and reinstalls" +
- "ONOS to switch over to Packet Optical topology" )
- main.log.report( "_____________________________________________" )
- main.case( "Disconnecting mininet and restarting ONOS" )
- main.step( "Disconnecting mininet and restarting ONOS" )
- mininetDisconnect = main.Mininet1.disconnect()
- print "mininetDisconnect = ", mininetDisconnect
-
- main.step( "Removing raft logs before a clen installation of ONOS" )
- main.ONOSbench.onosRemoveRaftLogs()
-
- main.step( "Applying cell variable to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- time.sleep( 5 )
- main.step( "Uninstalling ONOS package" )
- onos1UninstallResult = main.ONOSbench.onosUninstall( nodeIp = ONOS1Ip)
- onos2UninstallResult = main.ONOSbench.onosUninstall( nodeIp = ONOS2Ip)
- onos3UninstallResult = main.ONOSbench.onosUninstall( nodeIp = ONOS3Ip)
- onosUninstallResult = onos1UninstallResult and onos2UninstallResult \
- and onos3UninstallResult
- time.sleep( 15 )
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS1Ip )
- onos2InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS2Ip )
- onos3InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS3Ip )
- onosInstallResult = onos1InstallResult and onos2InstallResult and\
- onos3InstallResult
- if onosInstallResult == main.TRUE:
- main.log.report( "Installing ONOS package successful" )
- else:
- main.log.report( "Installing ONOS package failed" )
-
- time.sleep( 10 )
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- onos2Isup = main.ONOSbench.isup( ONOS2Ip )
- onos3Isup = main.ONOSbench.isup( ONOS3Ip )
- onosIsup = onos1Isup and onos2Isup and onos3Isup
- if onosIsup == main.TRUE:
- main.log.report( "ONOS instances are up and ready" )
- else:
- main.log.report( "ONOS instances may not be up" )
-
- main.step( "Starting ONOS service" )
- time.sleep( 10 )
- startResult = main.TRUE
- # startResult = main.ONOSbench.onosStart( ONOS1Ip )
- startcli1 = main.ONOScli1.startOnosCli( ONOSIp=ONOS1Ip )
- startcli2 = main.ONOScli2.startOnosCli( ONOSIp=ONOS2Ip )
- startcli3 = main.ONOScli3.startOnosCli( ONOSIp=ONOS3Ip )
- startResult = startcli1 and startcli2 and startcli3
- if startResult == main.TRUE:
- main.log.report( "ONOS cli starts properly" )
- case20Result = mininetDisconnect and cellResult and verifyResult \
- and onosInstallResult and onosIsup and startResult
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case20Result,
- onpass= "Exiting functionality mininet topology and reinstalling" +
- " ONOS successful",
- onfail= "Exiting functionality mininet topology and reinstalling" +
- " ONOS failed" )
-
- def CASE21( self, main ):
- """
- On ONOS bench, run this command:
- sudo -E python ~/onos/tools/test/topos/opticalTest.py -OC1 <Ctrls>
- which spawns packet optical topology and copies the links
- json file to the onos instance.
- Note that in case of Packet Optical, the links are not learnt
- from the topology, instead the links are learnt
- from the json config file
- """
- main.log.report(
- "This testcase starts the packet layer topology and REST" )
- main.log.report( "_____________________________________________" )
- main.case( "Starting LINC-OE and other components" )
- main.step( "Starting LINC-OE and other components" )
- main.log.info( "Activate optical app" )
- appInstallResult = main.ONOScli1.activateApp( "org.onosproject.optical" )
- appCheck = main.ONOScli1.appToIDCheck()
- appCheck = appCheck and main.ONOScli2.appToIDCheck()
- appCheck = appCheck and main.ONOScli3.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( "Checking ONOS application unsuccesful" )
-
- ctrllerIP = []
- ctrllerIP.append( main.params[ 'CTRL' ][ 'ip1' ] )
- #ctrllerIP.append( main.params[ 'CTRL' ][ 'ip2' ] )
- #ctrllerIP.append( main.params[ 'CTRL' ][ 'ip3' ] )
- opticalMnScript = main.LincOE2.runOpticalMnScript( ctrllerIP = ctrllerIP )
- case21Result = opticalMnScript and appInstallResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case21Result,
- onpass="Packet optical topology spawned successsfully",
- onfail="Packet optical topology spawning failed" )
-
- def CASE22( self, main ):
- """
- Curretly we use, 10 optical switches(ROADM's) and
- 6 packet layer mininet switches each with one host.
- Therefore, the roadmCount variable = 10,
- packetLayerSWCount variable = 6, hostCount=6 and
- links=46.
- All this is hardcoded in the testcase. If the topology changes,
- these hardcoded values need to be changed
- """
- import time
- main.log.report(
- "This testcase compares the optical+packet topology against what" +
- " is expected" )
- main.case( "Topology comparision" )
- main.step( "Topology comparision" )
- devicesResult = main.ONOScli3.devices( jsonFormat=False )
- time.sleep( 15 )
- print "devices_result = ", devicesResult
- devicesLinewise = devicesResult.split( "\n" )
- roadmCount = 0
- packetLayerSWCount = 0
- for line in devicesLinewise:
- components = line.split( "," )
- availability = components[ 1 ].split( "=" )[ 1 ]
- type = components[ 3 ].split( "=" )[ 1 ]
- if availability == 'true' and type == 'ROADM':
- roadmCount += 1
- elif availability == 'true' and type == 'SWITCH':
- packetLayerSWCount += 1
- if roadmCount == 10:
- print "Number of Optical Switches = %d and is" % roadmCount +\
- " correctly detected"
- main.log.info(
- "Number of Optical Switches = " +
- str( roadmCount ) +
- " and is correctly detected" )
- opticalSWResult = main.TRUE
- else:
- print "Number of Optical Switches = %d and is wrong" % roadmCount
- main.log.info(
- "Number of Optical Switches = " +
- str( roadmCount ) +
- " and is wrong" )
- opticalSWResult = main.FALSE
-
- if packetLayerSWCount == 6:
- print "Number of Packet layer or mininet Switches = %d "\
- % packetLayerSWCount + "and is correctly detected"
- main.log.info(
- "Number of Packet layer or mininet Switches = " +
- str( packetLayerSWCount ) +
- " and is correctly detected" )
- packetSWResult = main.TRUE
- else:
- print "Number of Packet layer or mininet Switches = %d and"\
- % packetLayerSWCount + " is wrong"
- main.log.info(
- "Number of Packet layer or mininet Switches = " +
- str( packetLayerSWCount ) +
- " and is wrong" )
- packetSWResult = main.FALSE
- print "_________________________________"
-
- linksResult = main.ONOScli3.links( jsonFormat=False )
- print "links_result = ", linksResult
- print "_________________________________"
- linkActiveCount = linksResult.count("state=ACTIVE")
- main.log.info( "linkActiveCount = " + str( linkActiveCount ))
- if linkActiveCount == 46:
- linkActiveResult = main.TRUE
- main.log.info(
- "Number of links in ACTIVE state are correct")
- else:
- linkActiveResult = main.FALSE
- main.log.info(
- "Number of links in ACTIVE state are wrong")
-
- case22Result = opticalSWResult and packetSWResult and \
- linkActiveResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case22Result,
- onpass="Packet optical topology discovery successful",
- onfail="Packet optical topology discovery failed" )
-
- def CASE23( self, main ):
- import time
- """
- Add bidirectional point intents between 2 packet layer( mininet )
- devices and
- ping mininet hosts
- """
- main.log.report(
- "This testcase adds bidirectional point intents between 2 " +
- "packet layer( mininet ) devices and ping mininet hosts" )
- main.case( "Topology comparision" )
- main.step( "Adding point intents" )
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000ffffffff0001/1",
- "of:0000ffffffff0005/1" )
- if ptpIntentResult == main.TRUE:
- main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "Point to point intent install successful" )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000ffffffff0005/1",
- "of:0000ffffffff0001/1" )
- if ptpIntentResult == main.TRUE:
- main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "Point to point intent install successful" )
-
- time.sleep( 30 )
- #flowHandle = main.ONOScli1.flows()
- #main.log.info( "flows :" + flowHandle )
-
- # Sleep for 30 seconds to provide time for the intent state to change
- time.sleep( 60 )
- intentHandle = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "intents :" + intentHandle )
-
- PingResult = main.TRUE
- count = 1
- main.log.info( "\n\nh1 is Pinging h5" )
- ping = main.LincOE2.pingHostOptical( src="h1", target="h5" )
- # ping = main.LincOE2.pinghost()
- if ping == main.FALSE and count < 5:
- count += 1
- PingResult = main.FALSE
- main.log.info(
- "Ping between h1 and h5 failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.info( "All ping attempts between h1 and h5 have failed" )
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h1 and h5 passed!" )
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
-
- if PingResult == main.FALSE:
- main.log.report(
- "Point intents for packet optical have not ben installed" +
- " correctly. Cleaning up" )
- if PingResult == main.TRUE:
- main.log.report(
- "Point Intents for packet optical have been " +
- "installed correctly" )
-
- case23Result = PingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case23Result,
- onpass= "Point intents addition for packet optical and" +
- "Pingall Test successful",
- onfail= "Point intents addition for packet optical and" +
- "Pingall Test NOT successful" )
-
- def CASE24( self, main ):
- import time
- import json
- """
- LINC uses its own switch IDs. You can use the following
- command on the LINC console to find the mapping between
- DPIDs and LINC IDs.
- rp(application:get_all_key(linc)).
-
- Test Rerouting of Packet Optical by bringing a port down
- ( port 20 ) of a switch( switchID=1, or LincOE switchID =9 ),
- so that link
- ( between switch1 port20 - switch5 port50 ) is inactive
- and do a ping test. If rerouting is successful,
- ping should pass. also check the flows
- """
- main.log.report(
- "This testcase tests rerouting and pings mininet hosts" )
- main.case( "Test rerouting and pings mininet hosts" )
- main.step( "Attach to the Linc-OE session" )
- attachConsole = main.LincOE1.attachLincOESession()
- print "attachConsole = ", attachConsole
-
- main.step( "Bring a port down and verify the link state" )
- main.LincOE1.portDown( swId="9", ptId="20" )
- linksNonjson = main.ONOScli3.links( jsonFormat=False )
- main.log.info( "links = " + linksNonjson )
-
- linkInactiveCount = linksNonjson.count("state=INACTIVE")
- main.log.info( "linkInactiveCount = " + str( linkInactiveCount ))
- if linkInactiveCount == 2:
- main.log.info(
- "Number of links in INACTIVE state are correct")
- else:
- main.log.info(
- "Number of links in INACTIVE state are wrong")
-
- links = main.ONOScli3.links()
- main.log.info( "links = " + links )
-
- linksResult = json.loads( links )
- linksStateResult = main.FALSE
- for item in linksResult:
- if item[ 'src' ][ 'device' ] == "of:0000ffffffffff01" and item[
- 'src' ][ 'port' ] == "20":
- if item[ 'dst' ][ 'device' ] == "of:0000ffffffffff05" and item[
- 'dst' ][ 'port' ] == "50":
- linksState = item[ 'state' ]
- if linksState == "INACTIVE":
- main.log.info(
- "Links state is inactive as expected due to one" +
- " of the ports being down" )
- main.log.report(
- "Links state is inactive as expected due to one" +
- " of the ports being down" )
- linksStateResult = main.TRUE
- break
- else:
- main.log.info(
- "Links state is not inactive as expected" )
- main.log.report(
- "Links state is not inactive as expected" )
- linksStateResult = main.FALSE
-
- print "links_state_result = ", linksStateResult
- time.sleep( 10 )
- #flowHandle = main.ONOScli3.flows()
- #main.log.info( "flows :" + flowHandle )
-
- main.step( "Verify Rerouting by a ping test" )
- PingResult = main.TRUE
- count = 1
- main.log.info( "\n\nh1 is Pinging h5" )
- ping = main.LincOE2.pingHostOptical( src="h1", target="h5" )
- # ping = main.LincOE2.pinghost()
- if ping == main.FALSE and count < 5:
- count += 1
- PingResult = main.FALSE
- main.log.info(
- "Ping between h1 and h5 failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.info( "All ping attempts between h1 and h5 have failed" )
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h1 and h5 passed!" )
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
-
- if PingResult == main.TRUE:
- main.log.report( "Ping test successful " )
- if PingResult == main.FALSE:
- main.log.report( "Ping test failed" )
-
- case24Result = PingResult and linksStateResult
- utilities.assert_equals( expect=main.TRUE, actual=case24Result,
- onpass="Packet optical rerouting successful",
- onfail="Packet optical rerouting failed" )
diff --git a/TestON/tests/MultiProd/MultiProd.topo b/TestON/tests/MultiProd/MultiProd.topo
deleted file mode 100755
index 040ec67..0000000
--- a/TestON/tests/MultiProd/MultiProd.topo
+++ /dev/null
@@ -1,118 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOScli1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli1>
-
- <ONOScli2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli2>
-
- <ONOScli3>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli3>
-
- <ONOS1>
- <host>10.128.10.11</host>
- <user>sdn</user>
- <password>sdn</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.128.10.11</host>
- <user>sdn</user>
- <password>sdn</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.128.10.11</host>
- <user>sdn</user>
- <password>sdn</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
-
- <Mininet1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> --switch ovs,protocols=OpenFlow10 </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet1>
-
- <Mininet2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> --switch ovs,protocols=OpenFlow10 </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet2>
-
- <LincOE1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>LincOEDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </LincOE1>
-
- <LincOE2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </LincOE2>
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/MultiProd/__init__.py b/TestON/tests/MultiProd/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/MultiProd/__init__.py
+++ /dev/null
diff --git a/TestON/tests/MultiProd13/MultiProd13.params b/TestON/tests/MultiProd13/MultiProd13.params
deleted file mode 100755
index 3767ab9..0000000
--- a/TestON/tests/MultiProd13/MultiProd13.params
+++ /dev/null
@@ -1,68 +0,0 @@
-<PARAMS>
-
- <testcases>1,4,10,5,6,7,8,6,8,9,8,31,32,8,33,8,20,21,22,10,23,24</testcases>
- #Environment variables
- <ENV>
- <cellName>multi_test</cellName>
- </ENV>
-
- <GIT>
- <pull>False</pull>
- </GIT>
-
- <CTRL>
- <ip1>10.128.20.11</ip1>
- <ip2>10.128.20.12</ip2>
- <ip3>10.128.20.13</ip3>
- <port1>6633</port1>
- <port2>6633</port2>
- <port3>6633</port3>
- </CTRL>
-
- <SDNIP>
- <ethType>IPV4</ethType>
- <tcpProto>6</tcpProto>
- <icmpProto>1</icmpProto>
- <srcPort>5001</srcPort>
- <dstPort>5001</dstPort>
- </SDNIP>
-
- <MULTIPOINT_INTENT>
- <device1>of:0000000000003008/1 </device1>
- <device2>of:0000000000003009/1 </device2>
- <device3>of:0000000000003010/1 </device3>
- <mac1>00:00:00:00:00:0A </mac1>
- <mac2>00:00:00:00:00:08 </mac2>
- <ip1>10.0.3.0/24 </ip1>
- <ip2>10.0.1.0/24 </ip2>
- </MULTIPOINT_INTENT>
-
- <PING>
- <source1>h8</source1>
- <source2>h9</source2>
- <source3>h10</source3>
- <source4>h11</source4>
- <source5>h12</source5>
- <source6>h13</source6>
- <source7>h14</source7>
- <source8>h15</source8>
- <source9>h16</source9>
- <source10>h17</source10>
- <target1>10.0.0.18</target1>
- <target2>10.0.0.19</target2>
- <target3>10.0.0.20</target3>
- <target4>10.0.0.21</target4>
- <target5>10.0.0.22</target5>
- <target6>10.0.0.23</target6>
- <target7>10.0.0.24</target7>
- <target8>10.0.0.25</target8>
- <target9>10.0.0.26</target9>
- <target10>10.0.0.27</target10>
- </PING>
-
- <timers>
- <LinkDiscovery>5</LinkDiscovery>
- <SwitchDiscovery>31</SwitchDiscovery>
- </timers>
-
-</PARAMS>
diff --git a/TestON/tests/MultiProd13/MultiProd13.py b/TestON/tests/MultiProd13/MultiProd13.py
deleted file mode 100644
index a458dec..0000000
--- a/TestON/tests/MultiProd13/MultiProd13.py
+++ /dev/null
@@ -1,1993 +0,0 @@
-
-# Testing the basic functionality of ONOS Next
-# For sanity and driver functionality excercises only.
-
-import time
-import sys
-import os
-import re
-import time
-import json
-
-time.sleep( 1 )
-
-class MultiProd13:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- """
- Startup sequence:
- cell <name>
- onos-verify-cell
- onos-remove-raft-logs
- git pull
- mvn clean install
- onos-package
- onos-install -f
- onos-wait-for-start
- """
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
- gitPull = main.params[ 'GIT' ][ 'pull' ]
-
- main.case( "Setting up test environment" )
- main.log.report(
- "This testcase is testing setting up test environment" )
- main.log.report( "__________________________________" )
-
- main.step( "Applying cell variable to environment" )
- cellResult1 = main.ONOSbench.setCell( cellName )
- # cellResult2 = main.ONOScli1.setCell( cellName )
- # cellResult3 = main.ONOScli2.setCell( cellName )
- # cellResult4 = main.ONOScli3.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
- cellResult = cellResult1
-
- main.step( "Removing raft logs before a clen installation of ONOS" )
- removeLogResult = main.ONOSbench.onosRemoveRaftLogs()
-
- main.step( "Git checkout and get version" )
- main.ONOSbench.gitCheckout( "master" )
- if gitPull == 'True':
- gitPullResult = main.ONOSbench.gitPull()
- if gitPullResult == 1:
- main.step( "Using mvn clean & install" )
- main.ONOSbench.cleanInstall()
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
- elif gitPullResult == 0:
- main.log.report(
- "Git Pull Failed, look into logs for detailed reason" )
- main.cleanup()
- main.exit()
- main.log.info( "git_pull_result = " + str( gitPullResult ))
- else:
- main.log.info( "Skipping git pull" )
- main.ONOSbench.getVersion( report=True )
- packageResult = main.TRUE
-
- # main.step( "Creating a cell" )
- # cellCreateResult = main.ONOSbench.createCellFile( **************
- # )
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS1Ip )
- onos2InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS2Ip )
- onos3InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS3Ip )
- onosInstallResult = onos1InstallResult and onos2InstallResult and\
- onos3InstallResult
- if onosInstallResult == main.TRUE:
- main.log.report( "Installing ONOS package successful" )
- else:
- main.log.report( "Installing ONOS package failed" )
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- onos2Isup = main.ONOSbench.isup( ONOS2Ip )
- onos3Isup = main.ONOSbench.isup( ONOS3Ip )
- onosIsup = onos1Isup and onos2Isup and onos3Isup
- if onosIsup == main.TRUE:
- main.log.report( "ONOS instances are up and ready" )
- else:
- main.log.report( "ONOS instances may not be up" )
-
- main.step( "Starting ONOS service" )
- startResult = main.TRUE
- # startResult = main.ONOSbench.onosStart( ONOS1Ip )
- startcli1 = main.ONOScli1.startOnosCli( ONOSIp=ONOS1Ip )
- startcli2 = main.ONOScli2.startOnosCli( ONOSIp=ONOS2Ip )
- startcli3 = main.ONOScli3.startOnosCli( ONOSIp=ONOS3Ip )
- print startcli1
- print startcli2
- print startcli3
-
- # Starting the mininet using the old way
- main.step( "Starting Mininet ..." )
- netIsUp = main.Mininet1.startNet()
- if netIsUp:
- main.log.info("Mininet CLI is up")
-
- case1Result = ( packageResult and
- cellResult and verifyResult and onosInstallResult and
- onosIsup and startResult )
- utilities.assertEquals( expect=main.TRUE, actual=case1Result,
- onpass="Test startup successful",
- onfail="Test startup NOT successful" )
-
- def CASE11( self, main ):
- """
- Cleanup sequence:
- onos-service <nodeIp> stop
- onos-uninstall
-
- TODO: Define rest of cleanup
-
- """
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
-
- main.case( "Cleaning up test environment" )
-
- main.step( "Testing ONOS kill function" )
- killResult1 = main.ONOSbench.onosKill( ONOS1Ip )
- killResult2 = main.ONOSbench.onosKill( ONOS2Ip )
- killResult3 = main.ONOSbench.onosKill( ONOS3Ip )
-
- main.step( "Stopping ONOS service" )
- stopResult1 = main.ONOSbench.onosStop( ONOS1Ip )
- stopResult2 = main.ONOSbench.onosStop( ONOS2Ip )
- stopResult3 = main.ONOSbench.onosStop( ONOS3Ip )
-
- main.step( "Uninstalling ONOS service" )
- uninstallResult = main.ONOSbench.onosUninstall()
-
- def CASE3( self, main ):
- """
- Test 'onos' command and its functionality in driver
- """
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
-
- main.case( "Testing 'onos' command" )
-
- main.step( "Sending command 'onos -w <onos-ip> system:name'" )
- cmdstr1 = "system:name"
- cmdResult1 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr1 )
- main.log.info( "onos command returned: " + cmdResult1 )
- cmdResult2 = main.ONOSbench.onosCli( ONOS2Ip, cmdstr1 )
- main.log.info( "onos command returned: " + cmdResult2 )
- cmdResult3 = main.ONOSbench.onosCli( ONOS3Ip, cmdstr1 )
- main.log.info( "onos command returned: " + cmdResult3 )
-
- main.step( "Sending command 'onos -w <onos-ip> onos:topology'" )
- cmdstr2 = "onos:topology"
- cmdResult4 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr2 )
- main.log.info( "onos command returned: " + cmdResult4 )
- cmdResult5 = main.ONOSbench.onosCli( ONOS2Ip, cmdstr2 )
- main.log.info( "onos command returned: " + cmdResult5 )
- cmdResult6 = main.ONOSbench.onosCli( ONOS6Ip, cmdstr2 )
- main.log.info( "onos command returned: " + cmdResult6 )
-
- def CASE4( self, main ):
- import re
- import time
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
-
- main.log.report(
- "This testcase is testing the assignment of all the switches" +
- " to all controllers and discovering the hosts in reactive mode" )
- main.log.report( "__________________________________" )
- main.case( "Pingall Test(No intents are added)" )
- main.step( "Assigning switches to controllers" )
- for i in range( 1, 29 ): # 1 to ( num of switches +1 )
- main.Mininet1.assignSwController(
- sw=str( i ),
- count=3,
- ip1=ONOS1Ip,
- port1=ONOS1Port,
- ip2=ONOS2Ip,
- port2=ONOS2Port,
- ip3=ONOS3Ip,
- port3=ONOS3Port )
-
- switchMastership = main.TRUE
- for i in range( 1, 29 ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- switchMastership = switchMastership and main.TRUE
- else:
- switchMastership = main.FALSE
-
- if switchMastership == main.TRUE:
- main.log.report( "Controller assignment successfull" )
- else:
- main.log.report( "Controller assignment failed" )
- appInstallResult = main.TRUE
- main.log.info( "Activating reactive forwarding app" )
- appInstallResult = main.ONOScli1.activateApp( "org.onosproject.fwd" )
- appCheck = main.ONOScli1.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOScli1.apps() )
- main.log.warn( main.ONOScli1.appIDs() )
- time.sleep( 30 )
- # REACTIVE FWD test
- main.step( "Pingall" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall()
- time2 = time.time()
- print "Time for pingall: %2f seconds" % ( time2 - time1 )
-
- case4Result = switchMastership and pingResult
- if pingResult == main.TRUE:
- main.log.report(
- "Pingall Test in reactive mode to" +
- " discover the hosts successful" )
- else:
- main.log.report(
- "Pingall Test in reactive mode to discover the hosts failed" )
-
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case4Result,
- onpass="Controller assignment and Pingall Test successful",
- onfail="Controller assignment and Pingall Test NOT successful" )
-
- def CASE5( self, main ):
- import json
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
-
- main.log.report(
- "This testcase is testing if all ONOS nodes are in topology" +
- " sync with mininet and its peer ONOS nodes" )
- main.log.report( "__________________________________" )
- main.case(
- "Testing Mininet topology with the" +
- " topology of multi instances ONOS" )
- main.step( "Collecting topology information from ONOS" )
- devices1 = main.ONOScli1.devices()
- devices2 = main.ONOScli2.devices()
- devices3 = main.ONOScli3.devices()
- # print "devices1 = ", devices1
- # print "devices2 = ", devices2
- # print "devices3 = ", devices3
- hosts1 = main.ONOScli1.hosts()
- hosts2 = main.ONOScli2.hosts()
- hosts3 = main.ONOScli3.hosts()
- # print "hosts1 = ", hosts1
- # print "hosts2 = ", hosts2
- # print "hosts3 = ", hosts3
- ports1 = main.ONOScli1.ports()
- ports2 = main.ONOScli2.ports()
- ports3 = main.ONOScli3.ports()
- # print "ports1 = ", ports1
- # print "ports2 = ", ports2
- # print "ports3 = ", ports3
- links1 = main.ONOScli1.links()
- links2 = main.ONOScli2.links()
- links3 = main.ONOScli3.links()
- # print "links1 = ", links1
- # print "links2 = ", links2
- # print "links3 = ", links3
-
- print "**************"
-
- main.step( "Start continuous pings" )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source1' ],
- target=main.params[ 'PING' ][ 'target1' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source2' ],
- target=main.params[ 'PING' ][ 'target2' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source3' ],
- target=main.params[ 'PING' ][ 'target3' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source4' ],
- target=main.params[ 'PING' ][ 'target4' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source5' ],
- target=main.params[ 'PING' ][ 'target5' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source6' ],
- target=main.params[ 'PING' ][ 'target6' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source7' ],
- target=main.params[ 'PING' ][ 'target7' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source8' ],
- target=main.params[ 'PING' ][ 'target8' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source9' ],
- target=main.params[ 'PING' ][ 'target9' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source10' ],
- target=main.params[ 'PING' ][ 'target10' ],
- pingTime=500 )
-
- main.step( "Compare ONOS Topology to MN Topology" )
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
- switchesResults1 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devices1 ), json.loads( ports1 ) )
- print "switches_Result1 = ", switchesResults1
- utilities.assertEquals( expect=main.TRUE, actual=switchesResults1,
- onpass="ONOS1 Switches view is correct",
- onfail="ONOS1 Switches view is incorrect" )
-
- switchesResults2 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devices2 ), json.loads( ports2 ) )
- utilities.assertEquals( expect=main.TRUE, actual=switchesResults2,
- onpass="ONOS2 Switches view is correct",
- onfail="ONOS2 Switches view is incorrect" )
-
- switchesResults3 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devices3 ), json.loads( ports3 ) )
- utilities.assertEquals( expect=main.TRUE, actual=switchesResults3,
- onpass="ONOS3 Switches view is correct",
- onfail="ONOS3 Switches view is incorrect" )
-
- linksResults1 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( links1 ) )
- utilities.assertEquals( expect=main.TRUE, actual=linksResults1,
- onpass="ONOS1 Links view is correct",
- onfail="ONOS1 Links view is incorrect" )
-
- linksResults2 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( links2 ) )
- utilities.assertEquals( expect=main.TRUE, actual=linksResults2,
- onpass="ONOS2 Links view is correct",
- onfail="ONOS2 Links view is incorrect" )
-
- linksResults3 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( links3 ) )
- utilities.assertEquals( expect=main.TRUE, actual=linksResults3,
- onpass="ONOS2 Links view is correct",
- onfail="ONOS2 Links view is incorrect" )
-
- topoResult = switchesResults1 and switchesResults2 and\
- switchesResults3 and linksResults1 and linksResults2 and\
- linksResults3
-
- if topoResult == main.TRUE:
- main.log.report(
- "Topology Check Test with mininet" +
- "and ONOS instances successful" )
- else:
- main.log.report(
- "Topology Check Test with mininet and ONOS instances failed" )
-
- utilities.assertEquals( expect=main.TRUE, actual=topoResult,
- onpass="Topology Check Test successful",
- onfail="Topology Check Test NOT successful" )
-
- def CASE10( self ):
- import time
- main.log.report(
- "This testcase uninstalls the reactive forwarding app" )
- main.log.report( "__________________________________" )
- main.case( "Uninstalling reactive forwarding app" )
- # Unistall onos-app-fwd app to disable reactive forwarding
- appInstallResult = main.ONOScli1.deactivateApp( "org.onosproject.fwd" )
- appCheck = main.ONOScli1.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOScli1.apps() )
- main.log.warn( main.ONOScli1.appIDs() )
- main.log.info( "onos-app-fwd uninstalled" )
-
- # After reactive forwarding is disabled,
- # the reactive flows on switches timeout in 10-15s
- # So sleep for 15s
- time.sleep( 15 )
-
- hosts = main.ONOScli1.hosts()
- main.log.info( hosts )
- case10Result = appInstallResult
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case10Result,
- onpass="Reactive forwarding app uninstallation successful",
- onfail="Reactive forwarding app uninstallation failed" )
-
- def CASE6( self ):
- main.log.report(
- "This testcase is testing the addition of" +
- " host intents and then doing pingall" )
- main.log.report( "__________________________________" )
- main.case( "Obtaining hostsfor adding host intents" )
- main.step( "Get hosts" )
- hosts = main.ONOScli1.hosts()
- main.log.info( hosts )
-
- main.step( "Get all devices id" )
- devicesIdList = main.ONOScli1.getAllDevicesId()
- main.log.info( devicesIdList )
-
- # ONOS displays the hosts in hex format
- # unlike mininet which does in decimal format
- # So take care while adding intents
-
- """
- main.step( "Add host intents for mn hosts(h8-h18,h9-h19,h10-h20,
- h11-h21,h12-h22,h13-h23,h14-h24,h15-h25,h16-h26,h17-h27)" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:08/-1",
- "00:00:00:00:00:12/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:09/-1",
- "00:00:00:00:00:13/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0A/-1",
- "00:00:00:00:00:14/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0B/-1",
- "00:00:00:00:00:15/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0C/-1",
- "00:00:00:00:00:16/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0D/-1",
- "00:00:00:00:00:17/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0E/-1",
- "00:00:00:00:00:18/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:0F/-1",
- "00:00:00:00:00:19/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:10/-1",
- "00:00:00:00:00:1A/-1" )
- hthIntentResult = main.ONOScli1.addHostIntent( "00:00:00:00:00:11/-1",
- "00:00:00:00:00:1B/-1" )
- """
- intentsId = []
- for i in range( 8, 18 ):
- main.log.info(
- "Adding host intent between h" + str( i ) +
- " and h" + str( i + 10 ) )
- host1 = "00:00:00:00:00:" + \
- str( hex( i )[ 2: ] ).zfill( 2 ).upper()
- host2 = "00:00:00:00:00:" + \
- str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
- # NOTE: get host can return None
- # TODO: handle this
- host1Id = main.ONOScli1.getHost( host1 )[ 'id' ]
- host2Id = main.ONOScli1.getHost( host2 )[ 'id' ]
- tmpResult = main.ONOScli1.addHostIntent( host1Id, host2Id )
- intentsId.append( tmpResult )
-
- checkIntent1 = main.ONOScli1.checkIntentState( intentsId )
- checkIntent2 = main.ONOScli2.checkIntentState( intentsId )
- checkIntent3 = main.ONOScli3.checkIntentState( intentsId )
-
- flowHandle = main.ONOScli1.flows()
-
- main.log.info( "flows:" + flowHandle )
-
- count = 1
- i = 8
- PingResult = main.TRUE
- while i < 18:
- main.log.info(
- "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- if ping == main.FALSE and count < 5:
- count += 1
- # i = 8
- PingResult = main.FALSE
- main.log.report( "Ping between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- " failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.report( "All ping attempts between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "have failed" )
- i = 19
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "passed!" )
- i += 1
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
- if PingResult == main.FALSE:
- main.log.report(
- "Host intents have not ben installed correctly. Cleaning up" )
- # main.cleanup()
- # main.exit()
- if PingResult == main.TRUE:
- main.log.report( "Host intents have been installed correctly" )
-
- checkIntent1 = main.ONOScli1.checkIntentState( intentsId )
- checkIntent2 = main.ONOScli2.checkIntentState( intentsId )
- checkIntent3 = main.ONOScli3.checkIntentState( intentsId )
-
- case6Result = PingResult
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case6Result,
- onpass="Host intent addition and Pingall Test successful",
- onfail="Host intent addition and Pingall Test NOT successful" )
-
- def CASE7( self, main ):
-
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-
- linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- main.log.report(
- "This testscase is killing a link to" +
- " ensure that link discovery is consistent" )
- main.log.report( "__________________________________" )
- main.case(
- "Killing a link to Ensure that Link" +
- " Discovery is Working Properly" )
- main.step( "Start continuous pings" )
-
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source1' ],
- target=main.params[ 'PING' ][ 'target1' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source2' ],
- target=main.params[ 'PING' ][ 'target2' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source3' ],
- target=main.params[ 'PING' ][ 'target3' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source4' ],
- target=main.params[ 'PING' ][ 'target4' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source5' ],
- target=main.params[ 'PING' ][ 'target5' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source6' ],
- target=main.params[ 'PING' ][ 'target6' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source7' ],
- target=main.params[ 'PING' ][ 'target7' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source8' ],
- target=main.params[ 'PING' ][ 'target8' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source9' ],
- target=main.params[ 'PING' ][ 'target9' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source10' ],
- target=main.params[ 'PING' ][ 'target10' ],
- pingTime=500 )
-
- main.step( "Determine the current number of switches and links" )
- topologyOutput = main.ONOScli1.topology()
- topologyResult = main.ONOSbench.getTopology( topologyOutput )
- activeSwitches = topologyResult[ 'devices' ]
- links = topologyResult[ 'links' ]
- main.log.info(
- "Currently there are %s switches and %s links" %
- ( str( activeSwitches ), str( links ) ) )
-
- main.step( "Kill Link between s3 and s28" )
- main.Mininet1.link( END1="s3", END2="s28", OPTION="down" )
- time.sleep( linkSleep )
- topologyOutput = main.ONOScli2.topology()
- LinkDown = main.ONOSbench.checkStatus(
- topologyOutput, activeSwitches, str(
- int( links ) - 2 ) )
- if LinkDown == main.TRUE:
- main.log.report( "Link Down discovered properly" )
- utilities.assertEquals(
- expect=main.TRUE,
- actual=LinkDown,
- onpass="Link Down discovered properly",
- onfail="Link down was not discovered in " +
- str( linkSleep ) +
- " seconds" )
-
- main.step( "Bring link between s3 and s28 back up" )
- LinkUp = main.Mininet1.link( END1="s3", END2="s28", OPTION="up" )
- time.sleep( linkSleep )
- topologyOutput = main.ONOScli2.topology()
- LinkUp = main.ONOSbench.checkStatus(
- topologyOutput,
- activeSwitches,
- str( links ) )
- if LinkUp == main.TRUE:
- main.log.report( "Link up discovered properly" )
- utilities.assertEquals(
- expect=main.TRUE,
- actual=LinkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( linkSleep ) +
- " seconds" )
-
- main.step( "Compare ONOS Topology to MN Topology" )
- main.case(
- "Testing Mininet topology with the" +
- " topology of multi instances ONOS" )
- main.step( "Collecting topology information from ONOS" )
- devices1 = main.ONOScli1.devices()
- devices2 = main.ONOScli2.devices()
- devices3 = main.ONOScli3.devices()
- print "devices1 = ", devices1
- print "devices2 = ", devices2
- print "devices3 = ", devices3
- hosts1 = main.ONOScli1.hosts()
- hosts2 = main.ONOScli2.hosts()
- hosts3 = main.ONOScli3.hosts()
- # print "hosts1 = ", hosts1
- # print "hosts2 = ", hosts2
- # print "hosts3 = ", hosts3
- ports1 = main.ONOScli1.ports()
- ports2 = main.ONOScli2.ports()
- ports3 = main.ONOScli3.ports()
- # print "ports1 = ", ports1
- # print "ports2 = ", ports2
- # print "ports3 = ", ports3
- links1 = main.ONOScli1.links()
- links2 = main.ONOScli2.links()
- links3 = main.ONOScli3.links()
- # print "links1 = ", links1
- # print "links2 = ", links2
- # print "links3 = ", links3
-
- print "**************"
-
- main.step( "Start continuous pings" )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source1' ],
- target=main.params[ 'PING' ][ 'target1' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source2' ],
- target=main.params[ 'PING' ][ 'target2' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source3' ],
- target=main.params[ 'PING' ][ 'target3' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source4' ],
- target=main.params[ 'PING' ][ 'target4' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source5' ],
- target=main.params[ 'PING' ][ 'target5' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source6' ],
- target=main.params[ 'PING' ][ 'target6' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source7' ],
- target=main.params[ 'PING' ][ 'target7' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source8' ],
- target=main.params[ 'PING' ][ 'target8' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source9' ],
- target=main.params[ 'PING' ][ 'target9' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source10' ],
- target=main.params[ 'PING' ][ 'target10' ],
- pingTime=500 )
-
- main.step( "Compare ONOS Topology to MN Topology" )
-
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
- switchesResults1 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devices1 ), json.loads( ports1 ) )
- print "switches_Result1 = ", switchesResults1
- utilities.assertEquals( expect=main.TRUE, actual=switchesResults1,
- onpass="ONOS1 Switches view is correct",
- onfail="ONOS1 Switches view is incorrect" )
-
- switchesResults2 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devices1 ), json.loads( ports1 ) )
- utilities.assertEquals( expect=main.TRUE, actual=switchesResults2,
- onpass="ONOS2 Switches view is correct",
- onfail="ONOS2 Switches view is incorrect" )
-
- switchesResults3 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devices1 ), json.loads( ports1 ) )
- utilities.assertEquals( expect=main.TRUE, actual=switchesResults3,
- onpass="ONOS3 Switches view is correct",
- onfail="ONOS3 Switches view is incorrect" )
-
- linksResults1 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( links1 ) )
- utilities.assertEquals( expect=main.TRUE, actual=linksResults1,
- onpass="ONOS1 Links view is correct",
- onfail="ONOS1 Links view is incorrect" )
-
- linksResults2 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( links2 ) )
- utilities.assertEquals( expect=main.TRUE, actual=linksResults2,
- onpass="ONOS2 Links view is correct",
- onfail="ONOS2 Links view is incorrect" )
-
- linksResults3 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( links3 ) )
- utilities.assertEquals( expect=main.TRUE, actual=linksResults3,
- onpass="ONOS2 Links view is correct",
- onfail="ONOS2 Links view is incorrect" )
-
- topoResult = switchesResults1 and switchesResults2\
- and switchesResults3 and linksResults1 and\
- linksResults2 and linksResults3
-
- utilities.assertEquals(
- expect=main.TRUE,
- actual=topoResult and LinkUp and LinkDown,
- onpass="Topology Check Test successful",
- onfail="Topology Check Test NOT successful" )
-
- def CASE8( self ):
- """
- Intent removal
- """
- main.log.report(
- "This testcase removes any previously added intents" )
- main.log.report( "__________________________________" )
- main.log.info( "Removing any previously installed intents" )
- main.case( "Removing intents" )
- main.step( "Obtain the intent id's" )
- intentResult = main.ONOScli1.intents( jsonFormat=False )
-
- intentLinewise = intentResult.split( "\n" )
- intentList = []
- for line in intentLinewise:
- if line.startswith( "id=" ):
- intentList.append( line )
-
- intentids = []
- for line in intentList:
- intentids.append( line.split( "," )[ 0 ].split( "=" )[ 1 ] )
- for id in intentids:
- main.log.info( "id = " + id )
-
- main.step(
- "Iterate through the intentids list and remove each intent" )
- for id in intentids:
- main.ONOScli1.removeIntent( intentId=id ,purge=True )
-
- remainingIntent = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "Remaining intents " + remainingIntent )
-
- case8Result = main.TRUE
- intentResult = main.TRUE
- if remainingIntent:
- main.log.error( "There are still remaining intent" )
- intentResult = main.FALSE
- i = 8
-
- PingResult = main.TRUE
- """
- while i < 18:
- main.log.info(
- "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- if ping == main.TRUE:
- i = 19
- PingResult = main.TRUE
- elif ping == main.FALSE:
- i += 1
- PingResult = main.FALSE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
- # Note: If the ping result failed, that means the intents have been
- # withdrawn correctly.
- if PingResult == main.TRUE:
- main.log.report( "Host intents have not been withdrawn correctly" )
- # main.cleanup()
- # main.exit()
- if PingResult == main.FALSE:
- main.log.report( "Host intents have been withdrawn correctly" )
- """
- case8Result = intentResult
-
- if case8Result == main.TRUE:
- main.log.report( "Intent removal successful" )
- else:
- main.log.report( "Intent removal failed" )
-
- utilities.assertEquals( expect=main.TRUE, actual=case8Result,
- onpass="Intent removal test successful",
- onfail="Intent removal test failed" )
-
- def CASE9( self ):
- """
- This test case adds point intents. Make sure you run test case 8
- which is host intent removal before executing this test case.
- Else the host intent's flows will persist on switches and the pings
- would work even if there is some issue with the point intent's flows
- """
- main.log.report(
- "This testcase adds point intents and then does pingall" )
- main.log.report( "__________________________________" )
- main.log.info( "Adding point intents" )
- main.case(
- "Adding bidirectional point for mn hosts(h8-h18,h9-h19,h10-h20," +
- "h11-h21,h12-h22,h13-h23,h14-h24,h15-h25,h16-h26,h17-h27)" )
- main.step(
- "Add point-to-point intents for mininet hosts" +
- " h8 and h18 or ONOS hosts h8 and h12" )
- macsDict = {}
- for i in range( 1,29 ):
- macsDict[ 'h' + str( i ) ]= main.Mininet1.getMacAddress( host='h'+ str( i ) )
- print macsDict
- # main.step(var1)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- ingressDevice="of:0000000000003008/1",
- egressDevice="of:0000000000006018/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h8' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- ingressDevice="of:0000000000006018/1",
- egressDevice="of:0000000000003008/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h18' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var2 = "Add point intents for mn hosts h9&h19 or ONOS hosts h9&h13"
- main.step(var2)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003009/1",
- "of:0000000000006019/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h9' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006019/1",
- "of:0000000000003009/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h19' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var3 = "Add point intents for MN hosts h10&h20 or ONOS hosts hA&h14"
- main.step(var3)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003010/1",
- "of:0000000000006020/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h10' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006020/1",
- "of:0000000000003010/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h20' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var4 = "Add point intents for mininet hosts h11 and h21 or" +\
- " ONOS hosts hB and h15"
- main.case(var4)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003011/1",
- "of:0000000000006021/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h11' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006021/1",
- "of:0000000000003011/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h21' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var5 = "Add point intents for mininet hosts h12 and h22 " +\
- "ONOS hosts hC and h16"
- main.case(var5)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003012/1",
- "of:0000000000006022/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h12' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006022/1",
- "of:0000000000003012/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h22' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var6 = "Add point intents for mininet hosts h13 and h23 or" +\
- " ONOS hosts hD and h17"
- main.case(var6)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003013/1",
- "of:0000000000006023/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h13' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006023/1",
- "of:0000000000003013/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h23' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var7 = "Add point intents for mininet hosts h14 and h24 or" +\
- " ONOS hosts hE and h18"
- main.case(var7)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003014/1",
- "of:0000000000006024/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h14' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006024/1",
- "of:0000000000003014/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h24' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var8 = "Add point intents for mininet hosts h15 and h25 or" +\
- " ONOS hosts hF and h19"
- main.case(var8)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003015/1",
- "of:0000000000006025/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h15' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006025/1",
- "of:0000000000003015/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h25' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var9 = "Add intents for mininet hosts h16 and h26 or" +\
- " ONOS hosts h10 and h1A"
- main.case(var9)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003016/1",
- "of:0000000000006026/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h16' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006026/1",
- "of:0000000000003016/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h26' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var10 = "Add point intents for mininet hosts h17 and h27 or" +\
- " ONOS hosts h11 and h1B"
- main.case(var10)
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000003017/1",
- "of:0000000000006027/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h17' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOScli1.intents()
- main.log.info( "Point to point intent install successful" )
- #main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000000000006027/1",
- "of:0000000000003017/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h27' ))
-
- print(
- "_______________________________________________________" +
- "________________________________" )
-
- flowHandle = main.ONOScli1.flows()
- print "flowHandle = ", flowHandle
- main.log.info( "flows :" + flowHandle )
-
- count = 1
- i = 8
- PingResult = main.TRUE
- while i < 18:
- main.log.info(
- "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- if ping == main.FALSE and count < 5:
- count += 1
- # i = 8
- PingResult = main.FALSE
- main.log.report( "Ping between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- " failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.report( "All ping attempts between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "have failed" )
- i = 19
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "passed!" )
- i += 1
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
- if PingResult == main.FALSE:
- main.log.report(
- "Ping all test after Point intents" +
- " addition failed. Cleaning up" )
- # main.cleanup()
- # main.exit()
- if PingResult == main.TRUE:
- main.log.report(
- "Ping all test after Point intents addition successful" )
-
- case8Result = PingResult
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case8Result,
- onpass="Ping all test after Point intents addition successful",
- onfail="Ping all test after Point intents addition failed" )
-
- def CASE31( self ):
- """
- This test case adds point intent related to
- SDN-IP matching on ICMP ( ethertype=IPV4, ipProto=1 )
- """
- import json
-
- main.log.report(
- "This test case adds point intent " +
- "related to SDN-IP matching on ICMP" )
- main.case(
- "Adding bidirectional point intent related" +
- " to SDN-IP matching on ICMP" )
- main.step( "Adding bidirectional point intent" )
- # add-point-intent --ipSrc=10.0.0.8/32 --ipDst=10.0.0.18/32
- # --ethType=IPV4 --ipProto=1 of:0000000000003008/1
- # of:0000000000006018/1
-
- hostsJson = json.loads( main.ONOScli1.hosts() )
- for i in range( 8, 11 ):
- main.log.info(
- "Adding point intent between h" + str( i ) +
- " and h" + str( i + 10 ) )
- host1 = "00:00:00:00:00:" + \
- str( hex( i )[ 2: ] ).zfill( 2 ).upper()
- host2 = "00:00:00:00:00:" + \
- str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
- host1Id = main.ONOScli1.getHost( host1 )[ 'id' ]
- host2Id = main.ONOScli1.getHost( host2 )[ 'id' ]
- for host in hostsJson:
- if host[ 'id' ] == host1Id:
- ip1 = host[ 'ipAddresses' ][ 0 ]
- ip1 = str( ip1 + "/32" )
- device1 = host[ 'location' ][ 'elementId' ]
- device1 = str( device1 + "/1" )
- elif host[ 'id' ] == host2Id:
- ip2 = str( host[ 'ipAddresses' ][ 0 ] ) + "/32"
- device2 = host[ 'location' ][ 'elementId' ]
- device2 = str( device2 + "/1" )
-
- pIntentResult1 = main.ONOScli1.addPointIntent(
- ingressDevice=device1,
- egressDevice=device2,
- ipSrc=ip1,
- ipDst=ip2,
- ethType=main.params[ 'SDNIP' ][ 'ethType' ],
- ipProto=main.params[ 'SDNIP' ][ 'icmpProto' ], )
-
- getIntentResult = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( getIntentResult )
-
- pIntentResult2 = main.ONOScli1.addPointIntent(
- ingressDevice=device2,
- egressDevice=device1,
- ipSrc=ip2,
- ipDst=ip1,
- ethType=main.params[ 'SDNIP' ][ 'ethType' ],
- ipProto=main.params[ 'SDNIP' ][ 'icmpProto' ] )
-
- getIntentResult = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( getIntentResult )
- if ( pIntentResult1 and pIntentResult2 ) :
- # getIntentResult = main.ONOScli1.intents()
- # main.log.info( getIntentResult )
- main.log.info(
- "Point intent related to SDN-IP matching" +
- " on ICMP install successful" )
-
- time.sleep( 15 )
- getIntentResult = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "intents = " + getIntentResult )
- getFlowsResult = main.ONOScli1.flows()
- main.log.info( "flows = " + getFlowsResult )
-
- count = 1
- i = 8
- PingResult = main.TRUE
- while i < 11:
- main.log.info(
- "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- if ping == main.FALSE and count < 3:
- count += 1
- # i = 8
- PingResult = main.FALSE
- main.log.report( "Ping between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- " failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.report( "All ping attempts between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "have failed" )
- i = 19
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "passed!" )
- i += 1
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
- if PingResult == main.FALSE:
- main.log.report(
- "Ping test after Point intents related to" +
- " SDN-IP matching on ICMP failed." )
- # main.cleanup()
- # main.exit()
- if PingResult == main.TRUE:
- main.log.report(
- "Ping all test after Point intents related to" +
- " SDN-IP matching on ICMP successful" )
-
- case31Result = PingResult
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case31Result,
- onpass="Point intent related to SDN-IP " +
- "matching on ICMP and ping test successful",
- onfail="Point intent related to SDN-IP" +
- " matching on ICMP and ping test failed" )
-
- def CASE32( self ):
- """
- This test case adds point intent related to SDN-IP matching on TCP
- ( ethertype=IPV4, ipProto=6, DefaultPort for iperf=5001 )
- Note: Although BGP port is 179, we are using 5001 because iperf
- is used for verifying and iperf's default port is 5001
- """
- import json
-
- main.log.report(
- "This test case adds point intent" +
- " related to SDN-IP matching on TCP" )
- main.case(
- "Adding bidirectional point intent related" +
- " to SDN-IP matching on TCP" )
- main.step( "Adding bidirectional point intent" )
- """
- add-point-intent --ipSrc=10.0.0.8/32 --ipDst=10.0.0.18/32
- --ethType=IPV4 --ipProto=6 --tcpDst=5001 of:0000000000003008/1
- of:0000000000006018/1
-
- add-point-intent --ipSrc=10.0.0.18/32 --ipDst=10.0.0.8/32
- --ethType=IPV4 --ipProto=6 --tcpDst=5001 of:0000000000006018/1
- of:0000000000003008/1
-
- add-point-intent --ipSrc=10.0.0.8/32 --ipDst=10.0.0.18/32
- --ethType=IPV4 --ipProto=6 --tcpSrc=5001 of:0000000000003008/1
- of:0000000000006018/1
-
- add-point-intent --ipSrc=10.0.0.18/32 --ipDst=10.0.0.8/32
- --ethType=IPV4 --ipProto=6 --tcpSrc=5001 of:0000000000006018/1
- of:0000000000003008/1
-
- """
- hostsJson = json.loads( main.ONOScli1.hosts() )
- for i in range( 8, 9 ):
- main.log.info(
- "Adding point intent between h" + str( i ) +
- " and h" + str( i + 10 ) )
- host1 = "00:00:00:00:00:" + \
- str( hex( i )[ 2: ] ).zfill( 2 ).upper()
- host2 = "00:00:00:00:00:" + \
- str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
- host1Id = main.ONOScli1.getHost( host1 )[ 'id' ]
- host2Id = main.ONOScli1.getHost( host2 )[ 'id' ]
- for host in hostsJson:
- if host[ 'id' ] == host1Id:
- ip1 = host[ 'ipAddresses' ][ 0 ]
- ip1 = str( ip1 + "/32" )
- device1 = host[ 'location' ][ 'elementId' ]
- device1 = str( device1 + "/1" )
- elif host[ 'id' ] == host2Id:
- ip2 = str( host[ 'ipAddresses' ][ 0 ] ) + "/32"
- device2 = host[ 'location' ][ 'elementId' ]
- device2 = str( device2 + "/1" )
-
- pIntentResult1 = main.ONOScli1.addPointIntent(
- ingressDevice=device1,
- egressDevice=device2,
- ipSrc=ip1,
- ipDst=ip2,
- ethType=main.params[ 'SDNIP' ][ 'ethType' ],
- ipProto=main.params[ 'SDNIP' ][ 'tcpProto' ],
- tcpDst=main.params[ 'SDNIP' ][ 'dstPort' ] )
- pIntentResult2 = main.ONOScli1.addPointIntent(
- ingressDevice=device2,
- egressDevice=device1,
- ipSrc=ip2,
- ipDst=ip1,
- ethType=main.params[ 'SDNIP' ][ 'ethType' ],
- ipProto=main.params[ 'SDNIP' ][ 'tcpProto' ],
- tcpDst=main.params[ 'SDNIP' ][ 'dstPort' ] )
-
- pIntentResult3 = main.ONOScli1.addPointIntent(
- ingressDevice=device1,
- egressDevice=device2,
- ipSrc=ip1,
- ipDst=ip2,
- ethType=main.params[ 'SDNIP' ][ 'ethType' ],
- ipProto=main.params[ 'SDNIP' ][ 'tcpProto' ],
- tcpSrc=main.params[ 'SDNIP' ][ 'srcPort' ] )
- pIntentResult4 = main.ONOScli1.addPointIntent(
- ingressDevice=device2,
- egressDevice=device1,
- ipSrc=ip2,
- ipDst=ip1,
- ethType=main.params[ 'SDNIP' ][ 'ethType' ],
- ipProto=main.params[ 'SDNIP' ][ 'tcpProto' ],
- tcpSrc=main.params[ 'SDNIP' ][ 'srcPort' ] )
-
- getIntentResult = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( getIntentResult )
- pIntentResult = main.TRUE
- if getIntentResult:
- main.log.report(
- "Point intent related to SDN-IP matching" +
- " on TCP install successful" )
- else:
- main.log.report(
- "Point intent related to SDN-IP matching" +
- " on TCP install failed" )
- pIntentResult = main.FALSE
-
- iperfResult = main.Mininet1.iperf( 'h8', 'h18' )
- if iperfResult == main.TRUE:
- main.log.report( "iperf test successful" )
- else:
- main.log.report( "iperf test failed" )
-
- case32Result = pIntentResult and iperfResult
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case32Result,
- onpass="Ping all test after Point intents addition related " +
- "to SDN-IP on TCP match successful",
- onfail="Ping all test after Point intents addition related " +
- "to SDN-IP on TCP match failed" )
-
- def CASE33( self ):
- """
- This test case adds multipoint to singlepoint intent related to
- SDN-IP matching on destination ip and the action is to rewrite
- the mac address
- Here the mac address to be rewritten is the mac address of the
- egress device
- """
- import json
- import time
-
- main.log.report(
- "This test case adds multipoint to singlepoint intent related to" +
- " SDN-IP matching on destination ip and " +
- "rewrite mac address action" )
- main.case(
- "Adding multipoint to singlepoint intent related to SDN-IP" +
- " matching on destination ip" )
- main.step( "Adding bidirectional multipoint to singlepoint intent" )
- """
- add-multi-to-single-intent --ipDst=10.0.3.0/24
- --setEthDst=00:00:00:00:00:12 of:0000000000003008/1 0000000000003009/1
- of:0000000000006018/1
-
- add-multi-to-single-intent --ipDst=10.0.1.0/24
- --setEthDst=00:00:00:00:00:08 of:0000000000006018/1 0000000000003009/1
- of:0000000000003008/1
- """
- main.case(
- "Installing multipoint to single point " +
- "intent with rewrite mac address" )
- main.step( "Uninstalling proxy arp app" )
- # deactivating proxyarp app
- appInstallResult = main.ONOScli1.deactivateApp( "org.onosproject.proxyarp" )
- appCheck = main.ONOScli1.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOScli1.apps() )
- main.log.warn( main.ONOScli1.appIDs() )
- time.sleep( 30 )
- main.log.info( "onos-app-proxyarp deactivated" )
-
- main.step( "Changing ipaddress of hosts h8,h9 and h18" )
- main.Mininet1.changeIP(
- host='h8',
- intf='h8-eth0',
- newIP='10.0.1.1',
- newNetmask='255.255.255.0' )
- main.Mininet1.changeIP(
- host='h9',
- intf='h9-eth0',
- newIP='10.0.2.1',
- newNetmask='255.255.255.0' )
- main.Mininet1.changeIP(
- host='h10',
- intf='h10-eth0',
- newIP='10.0.3.1',
- newNetmask='255.255.255.0' )
-
- main.step( "Changing default gateway of hosts h8,h9 and h18" )
- main.Mininet1.changeDefaultGateway( host='h8', newGW='10.0.1.254' )
- main.Mininet1.changeDefaultGateway( host='h9', newGW='10.0.2.254' )
- main.Mininet1.changeDefaultGateway( host='h10', newGW='10.0.3.254' )
-
- main.step(
- "Assigning random mac address to the default gateways " +
- "since proxyarp app is uninstalled" )
- main.Mininet1.addStaticMACAddress(
- host='h8',
- GW='10.0.1.254',
- macaddr='00:00:00:00:11:11' )
- main.Mininet1.addStaticMACAddress(
- host='h9',
- GW='10.0.2.254',
- macaddr='00:00:00:00:22:22' )
- main.Mininet1.addStaticMACAddress(
- host='h10',
- GW='10.0.3.254',
- macaddr='00:00:00:00:33:33' )
-
- main.step( "Verify static gateway and MAC address assignment" )
- main.Mininet1.verifyStaticGWandMAC( host='h8' )
- main.Mininet1.verifyStaticGWandMAC( host='h9' )
- main.Mininet1.verifyStaticGWandMAC( host='h10' )
-
- ingressDevice1=main.params[ 'MULTIPOINT_INTENT' ][ 'device1' ]
- ingressDevice2=main.params[ 'MULTIPOINT_INTENT' ][ 'device2' ]
- ingressDeviceList = []
- ingressDeviceList.append( ingressDevice1 )
- ingressDeviceList.append( ingressDevice2 )
-
- main.step( "Adding multipoint to singlepoint intent" )
- pIntentResult1 = main.ONOScli1.addMultipointToSinglepointIntent(
- ingressDeviceList,
- egressDevice=main.params[ 'MULTIPOINT_INTENT' ][ 'device3' ],
- ipDst=main.params[ 'MULTIPOINT_INTENT' ][ 'ip1' ],
- setEthDst=main.params[ 'MULTIPOINT_INTENT' ][ 'mac1' ] )
-
- ingressDevice1=main.params[ 'MULTIPOINT_INTENT' ][ 'device3' ]
- ingressDevice2=main.params[ 'MULTIPOINT_INTENT' ][ 'device2' ]
- ingressDeviceList = [ingressDevice1, ingressDevice2]
-
- pIntentResult2 = main.ONOScli1.addMultipointToSinglepointIntent(
- ingressDeviceList,
- egressDevice=main.params[ 'MULTIPOINT_INTENT' ][ 'device1' ],
- ipDst=main.params[ 'MULTIPOINT_INTENT' ][ 'ip2' ],
- setEthDst=main.params[ 'MULTIPOINT_INTENT' ][ 'mac2' ] )
-
- pIntentResult = pIntentResult1 and pIntentResult2
- if pIntentResult == main.FALSE:
- main.log.info(
- "Multi point to single point intent " +
- "installation failed" )
- else:
- pIntentResult = main.TRUE
- getIntentResult = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "intents = " + getIntentResult )
-
- time.sleep( 10 )
- getFlowsResult = main.ONOScli1.flows( jsonFormat=False )
- main.log.info( "flows = " + getFlowsResult )
-
- count = 1
- i = 8
- PingResult = main.TRUE
-
- main.log.info( "\n\nh" + str( i ) + " is Pinging h" + str( i + 2 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 2 ) )
- if ping == main.FALSE and count < 3:
- count += 1
- PingResult = main.FALSE
- main.log.report( "Ping between h" +
- str( i ) +
- " and h" +
- str( i +
- 2 ) +
- " failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.report( "All ping attempts between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "have failed" )
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h" +
- str( i ) +
- " and h" +
- str( i +
- 2 ) +
- " passed!" )
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
-
- if PingResult == main.FALSE:
- main.log.report( "Ping test failed." )
- # main.cleanup()
- # main.exit()
- if PingResult == main.TRUE:
- main.log.report( "Ping all successful" )
-
- if pIntentResult == main.TRUE:
- main.log.info(
- "Multi point intent with rewrite mac " +
- "address installation and ping successful" )
-
- case33Result = pIntentResult and PingResult
- utilities.assertEquals(
- expect=main.TRUE,
- actual=case33Result,
- onpass="Ping all test after multipoint to single point" +
- " intent addition with rewrite mac address successful",
- onfail="Ping all test after multipoint to single point intent" +
- " addition with rewrite mac address failed" )
-
- def CASE20( self ):
- """
- Exit from mininet cli
- reinstall ONOS
- """
- import time
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS2Ip = main.params[ 'CTRL' ][ 'ip2' ]
- ONOS3Ip = main.params[ 'CTRL' ][ 'ip3' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- ONOS2Port = main.params[ 'CTRL' ][ 'port2' ]
- ONOS3Port = main.params[ 'CTRL' ][ 'port3' ]
-
- main.log.report( "This testcase exits the mininet cli and reinstalls" +
- "ONOS to switch over to Packet Optical topology" )
- main.log.report( "_____________________________________________" )
- main.case( "Disconnecting mininet and restarting ONOS" )
- main.step( "Disconnecting mininet and restarting ONOS" )
- mininetDisconnect = main.Mininet1.disconnect()
- print "mininetDisconnect = ", mininetDisconnect
-
- main.step( "Removing raft logs before a clen installation of ONOS" )
- main.ONOSbench.onosRemoveRaftLogs()
-
- main.step( "Applying cell variable to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- time.sleep( 5 )
- main.step( "Uninstalling ONOS package" )
- onos1UninstallResult = main.ONOSbench.onosUninstall( nodeIp = ONOS1Ip)
- onos2UninstallResult = main.ONOSbench.onosUninstall( nodeIp = ONOS2Ip)
- onos3UninstallResult = main.ONOSbench.onosUninstall( nodeIp = ONOS3Ip)
- onosUninstallResult = onos1UninstallResult and onos2UninstallResult \
- and onos3UninstallResult
- time.sleep( 15 )
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS1Ip )
- onos2InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS2Ip )
- onos3InstallResult = main.ONOSbench.onosInstall(
- options="-f",
- node=ONOS3Ip )
- onosInstallResult = onos1InstallResult and onos2InstallResult and\
- onos3InstallResult
- if onosInstallResult == main.TRUE:
- main.log.report( "Installing ONOS package successful" )
- else:
- main.log.report( "Installing ONOS package failed" )
-
- time.sleep( 10 )
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- onos2Isup = main.ONOSbench.isup( ONOS2Ip )
- onos3Isup = main.ONOSbench.isup( ONOS3Ip )
- onosIsup = onos1Isup and onos2Isup and onos3Isup
- if onosIsup == main.TRUE:
- main.log.report( "ONOS instances are up and ready" )
- else:
- main.log.report( "ONOS instances may not be up" )
-
- main.step( "Starting ONOS service" )
- time.sleep( 10 )
- startResult = main.TRUE
- # startResult = main.ONOSbench.onosStart( ONOS1Ip )
- startcli1 = main.ONOScli1.startOnosCli( ONOSIp=ONOS1Ip )
- startcli2 = main.ONOScli2.startOnosCli( ONOSIp=ONOS2Ip )
- startcli3 = main.ONOScli3.startOnosCli( ONOSIp=ONOS3Ip )
- startResult = startcli1 and startcli2 and startcli3
- if startResult == main.TRUE:
- main.log.report( "ONOS cli starts properly" )
- case20Result = mininetDisconnect and cellResult and verifyResult \
- and onosInstallResult and onosIsup and startResult
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case20Result,
- onpass= "Exiting functionality mininet topology and reinstalling" +
- " ONOS successful",
- onfail= "Exiting functionality mininet topology and reinstalling" +
- " ONOS failed" )
-
- def CASE21( self, main ):
- """
- On ONOS bench, run this command:
- sudo -E python ~/onos/tools/test/topos/opticalTest.py -OC1 <Ctrls>
- which spawns packet optical topology and copies the links
- json file to the onos instance.
- Note that in case of Packet Optical, the links are not learnt
- from the topology, instead the links are learnt
- from the json config file
- """
- main.log.report(
- "This testcase starts the packet layer topology and REST" )
- main.log.report( "_____________________________________________" )
- main.case( "Starting LINC-OE and other components" )
- main.step( "Starting LINC-OE and other components" )
- main.log.info( "Activate optical app" )
- appInstallResult = main.ONOScli1.activateApp( "org.onosproject.optical" )
- appCheck = main.ONOScli1.appToIDCheck()
- appCheck = appCheck and main.ONOScli2.appToIDCheck()
- appCheck = appCheck and main.ONOScli3.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( "Checking ONOS application unsuccesful" )
-
- ctrllerIP = []
- ctrllerIP.append( main.params[ 'CTRL' ][ 'ip1' ] )
- #ctrllerIP.append( main.params[ 'CTRL' ][ 'ip2' ] )
- #ctrllerIP.append( main.params[ 'CTRL' ][ 'ip3' ] )
- opticalMnScript = main.LincOE2.runOpticalMnScript( ctrllerIP = ctrllerIP )
- case21Result = opticalMnScript and appInstallResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case21Result,
- onpass="Packet optical topology spawned successsfully",
- onfail="Packet optical topology spawning failed" )
-
- def CASE22( self, main ):
- """
- Curretly we use, 10 optical switches(ROADM's) and
- 6 packet layer mininet switches each with one host.
- Therefore, the roadmCount variable = 10,
- packetLayerSWCount variable = 6, hostCount=6 and
- links=46.
- All this is hardcoded in the testcase. If the topology changes,
- these hardcoded values need to be changed
- """
- import time
- main.log.report(
- "This testcase compares the optical+packet topology against what" +
- " is expected" )
- main.case( "Topology comparision" )
- main.step( "Topology comparision" )
- devicesResult = main.ONOScli3.devices( jsonFormat=False )
- time.sleep( 15 )
- print "devices_result = ", devicesResult
- devicesLinewise = devicesResult.split( "\n" )
- roadmCount = 0
- packetLayerSWCount = 0
- for line in devicesLinewise:
- components = line.split( "," )
- availability = components[ 1 ].split( "=" )[ 1 ]
- type = components[ 3 ].split( "=" )[ 1 ]
- if availability == 'true' and type == 'ROADM':
- roadmCount += 1
- elif availability == 'true' and type == 'SWITCH':
- packetLayerSWCount += 1
- if roadmCount == 10:
- print "Number of Optical Switches = %d and is" % roadmCount +\
- " correctly detected"
- main.log.info(
- "Number of Optical Switches = " +
- str( roadmCount ) +
- " and is correctly detected" )
- opticalSWResult = main.TRUE
- else:
- print "Number of Optical Switches = %d and is wrong" % roadmCount
- main.log.info(
- "Number of Optical Switches = " +
- str( roadmCount ) +
- " and is wrong" )
- opticalSWResult = main.FALSE
-
- if packetLayerSWCount == 6:
- print "Number of Packet layer or mininet Switches = %d "\
- % packetLayerSWCount + "and is correctly detected"
- main.log.info(
- "Number of Packet layer or mininet Switches = " +
- str( packetLayerSWCount ) +
- " and is correctly detected" )
- packetSWResult = main.TRUE
- else:
- print "Number of Packet layer or mininet Switches = %d and"\
- % packetLayerSWCount + " is wrong"
- main.log.info(
- "Number of Packet layer or mininet Switches = " +
- str( packetLayerSWCount ) +
- " and is wrong" )
- packetSWResult = main.FALSE
- print "_________________________________"
-
- linksResult = main.ONOScli3.links( jsonFormat=False )
- print "links_result = ", linksResult
- print "_________________________________"
- linkActiveCount = linksResult.count("state=ACTIVE")
- main.log.info( "linkActiveCount = " + str( linkActiveCount ))
- if linkActiveCount == 46:
- linkActiveResult = main.TRUE
- main.log.info(
- "Number of links in ACTIVE state are correct")
- else:
- linkActiveResult = main.FALSE
- main.log.info(
- "Number of links in ACTIVE state are wrong")
-
- case22Result = opticalSWResult and packetSWResult and \
- linkActiveResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case22Result,
- onpass="Packet optical topology discovery successful",
- onfail="Packet optical topology discovery failed" )
-
- def CASE23( self, main ):
- import time
- """
- Add bidirectional point intents between 2 packet layer( mininet )
- devices and
- ping mininet hosts
- """
- main.log.report(
- "This testcase adds bidirectional point intents between 2 " +
- "packet layer( mininet ) devices and ping mininet hosts" )
- main.case( "Topology comparision" )
- main.step( "Adding point intents" )
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000ffffffff0001/1",
- "of:0000ffffffff0005/1" )
- if ptpIntentResult == main.TRUE:
- main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "Point to point intent install successful" )
-
- ptpIntentResult = main.ONOScli1.addPointIntent(
- "of:0000ffffffff0005/1",
- "of:0000ffffffff0001/1" )
- if ptpIntentResult == main.TRUE:
- main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "Point to point intent install successful" )
-
- time.sleep( 30 )
- #flowHandle = main.ONOScli1.flows()
- #main.log.info( "flows :" + flowHandle )
-
- # Sleep for 30 seconds to provide time for the intent state to change
- time.sleep( 60 )
- intentHandle = main.ONOScli1.intents( jsonFormat=False )
- main.log.info( "intents :" + intentHandle )
-
- PingResult = main.TRUE
- count = 1
- main.log.info( "\n\nh1 is Pinging h5" )
- ping = main.LincOE2.pingHostOptical( src="h1", target="h5" )
- # ping = main.LincOE2.pinghost()
- if ping == main.FALSE and count < 5:
- count += 1
- PingResult = main.FALSE
- main.log.info(
- "Ping between h1 and h5 failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.info( "All ping attempts between h1 and h5 have failed" )
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h1 and h5 passed!" )
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
-
- if PingResult == main.FALSE:
- main.log.report(
- "Point intents for packet optical have not ben installed" +
- " correctly. Cleaning up" )
- if PingResult == main.TRUE:
- main.log.report(
- "Point Intents for packet optical have been " +
- "installed correctly" )
-
- case23Result = PingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case23Result,
- onpass= "Point intents addition for packet optical and" +
- "Pingall Test successful",
- onfail= "Point intents addition for packet optical and" +
- "Pingall Test NOT successful" )
-
- def CASE24( self, main ):
- import time
- import json
- """
- LINC uses its own switch IDs. You can use the following
- command on the LINC console to find the mapping between
- DPIDs and LINC IDs.
- rp(application:get_all_key(linc)).
-
- Test Rerouting of Packet Optical by bringing a port down
- ( port 20 ) of a switch( switchID=1, or LincOE switchID =9 ),
- so that link
- ( between switch1 port20 - switch5 port50 ) is inactive
- and do a ping test. If rerouting is successful,
- ping should pass. also check the flows
- """
- main.log.report(
- "This testcase tests rerouting and pings mininet hosts" )
- main.case( "Test rerouting and pings mininet hosts" )
- main.step( "Attach to the Linc-OE session" )
- attachConsole = main.LincOE1.attachLincOESession()
- print "attachConsole = ", attachConsole
-
- main.step( "Bring a port down and verify the link state" )
- main.LincOE1.portDown( swId="9", ptId="20" )
- linksNonjson = main.ONOScli3.links( jsonFormat=False )
- main.log.info( "links = " + linksNonjson )
-
- linkInactiveCount = linksNonjson.count("state=INACTIVE")
- main.log.info( "linkInactiveCount = " + str( linkInactiveCount ))
- if linkInactiveCount == 2:
- main.log.info(
- "Number of links in INACTIVE state are correct")
- else:
- main.log.info(
- "Number of links in INACTIVE state are wrong")
-
- links = main.ONOScli3.links()
- main.log.info( "links = " + links )
-
- linksResult = json.loads( links )
- linksStateResult = main.FALSE
- for item in linksResult:
- if item[ 'src' ][ 'device' ] == "of:0000ffffffffff01" and item[
- 'src' ][ 'port' ] == "20":
- if item[ 'dst' ][ 'device' ] == "of:0000ffffffffff05" and item[
- 'dst' ][ 'port' ] == "50":
- linksState = item[ 'state' ]
- if linksState == "INACTIVE":
- main.log.info(
- "Links state is inactive as expected due to one" +
- " of the ports being down" )
- main.log.report(
- "Links state is inactive as expected due to one" +
- " of the ports being down" )
- linksStateResult = main.TRUE
- break
- else:
- main.log.info(
- "Links state is not inactive as expected" )
- main.log.report(
- "Links state is not inactive as expected" )
- linksStateResult = main.FALSE
-
- print "links_state_result = ", linksStateResult
- time.sleep( 10 )
- #flowHandle = main.ONOScli3.flows()
- #main.log.info( "flows :" + flowHandle )
-
- main.step( "Verify Rerouting by a ping test" )
- PingResult = main.TRUE
- count = 1
- main.log.info( "\n\nh1 is Pinging h5" )
- ping = main.LincOE2.pingHostOptical( src="h1", target="h5" )
- # ping = main.LincOE2.pinghost()
- if ping == main.FALSE and count < 5:
- count += 1
- PingResult = main.FALSE
- main.log.info(
- "Ping between h1 and h5 failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.info( "All ping attempts between h1 and h5 have failed" )
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h1 and h5 passed!" )
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
-
- if PingResult == main.TRUE:
- main.log.report( "Ping test successful " )
- if PingResult == main.FALSE:
- main.log.report( "Ping test failed" )
-
- case24Result = PingResult and linksStateResult
- utilities.assert_equals( expect=main.TRUE, actual=case24Result,
- onpass="Packet optical rerouting successful",
- onfail="Packet optical rerouting failed" )
diff --git a/TestON/tests/MultiProd13/MultiProd13.topo b/TestON/tests/MultiProd13/MultiProd13.topo
deleted file mode 100755
index 4b1ab12..0000000
--- a/TestON/tests/MultiProd13/MultiProd13.topo
+++ /dev/null
@@ -1,118 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOScli1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli1>
-
- <ONOScli2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli2>
-
- <ONOScli3>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli3>
-
- <ONOS1>
- <host>10.128.10.11</host>
- <user>sdn</user>
- <password>sdn</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.128.10.11</host>
- <user>sdn</user>
- <password>sdn</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.128.10.11</host>
- <user>sdn</user>
- <password>sdn</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
-
- <Mininet1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> --switch ovs,protocols=OpenFlow13 </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet1>
-
- <Mininet2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> --switch ovs,protocols=OpenFlow13 </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet2>
-
- <LincOE1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>LincOEDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </LincOE1>
-
- <LincOE2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </LincOE2>
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/MultiProd13/__init__.py b/TestON/tests/MultiProd13/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/MultiProd13/__init__.py
+++ /dev/null
diff --git a/TestON/tests/OnosCHO/OnosCHO.params b/TestON/tests/OnosCHO/OnosCHO.params
deleted file mode 100644
index 6240fdb..0000000
--- a/TestON/tests/OnosCHO/OnosCHO.params
+++ /dev/null
@@ -1,88 +0,0 @@
-<PARAMS>
- # 1,20,3,[40,5,60,70,80,10,90,71,81,10,93,10]*50,21,3,[41,5,61,72,82,10,91,73,83,10,94,10]*50,22,3,[42,5,62,10,92,10,95,10,98,10]*50
- # 1. Starts ONOS cluster with 5 nodes
- # 20. Starts Att Topology
- # 21. Starts Chordal Topology
- # 22. Starts Spine-Leaf Topology
- # 3. Checks the consistency of ONOS and Mininet's topologies
- # 4X. Reactive forwarding | host discovery
- # 5. ONOS Topology verification
- # 6X. host intents
- # 7X. Bring random links down( Unique for each topology)
- # 8X. Bring random links back up
- # 9X Point,Multi-single,Single-Multi Intents
-
- <testcases>1,20,3,[40,5,60,70,80,10,90,71,81,10]*50,21,3,[41,5,61,72,82,10,91,73,83,10]*50,22,3,[42,5,62,74,84,10,92,10]*50</testcases>
- <ENV>
- <cellName>choTest3</cellName>
- </ENV>
- <GIT>
- #autoPull 'on' or 'off'
- <autoPull>on</autoPull>
- <branch>master</branch>
- </GIT>
- <TOPO1>
- <topo>~/mininet/custom/topoAtt.py</topo>
- <numSwitches>25</numSwitches>
- <numHosts>25</numHosts>
- <numLinks>114</numLinks>
- <numPaths>1</numPaths>
- </TOPO1>
- <TOPO2>
- <topo>~/mininet/custom/topoChordal.py</topo>
- <numSwitches>25</numSwitches>
- <numHosts>25</numHosts>
- <numLinks>600</numLinks>
- <numPaths>1</numPaths>
- </TOPO2>
- <TOPO3>
- <topo>~/mininet/custom/topoSpine.py</topo>
- <numSwitches>78</numSwitches>
- <numHosts>68</numHosts>
- <numLinks>284</numLinks>
- <numPaths>1</numPaths>
- </TOPO3>
- <CTRL>
- <numCtrl>3</numCtrl>
- <ip1>10.128.40.41</ip1>
- <port1>6633</port1>
- <ip2>10.128.40.42</ip2>
- <port2>6633</port2>
- <ip3>10.128.40.43</ip3>
- <port3>6633</port3>
- </CTRL>
- <HOSTS>
- <startMAC>00:00:00:00:00:01</startMAC>
- <endMAC>00:00:00:00:00:19</endMAC>
- </HOSTS>
- <ATTCORELINKS>
- <toggleLinks>1</toggleLinks>
-
- <linkS3a>s3</linkS3a>
- <linkS3b>s1,s4,s7,s10,s16,s17,s18,s21,s22</linkS3b>
- #######s1,s4,s7,s10,s16,s17,s18,s21,s22########
-
- <linkS14a>s14</linkS14a>
- <linkS14b>s6,s9,s10,s11,s12,s13,s16,s17,s23</linkS14b>
- ########s6,s9,s10,s11,s12,s13,s16,s17,s18,s23########
-
- <linkS18a>s18</linkS18a>
- <linkS18b>s14,s16,s17,s19,s20,s21,s22,s23</linkS18b>
- #######s3,s14,s16,s17,s19,s20,s21,s22,s23########
- </ATTCORELINKS>
-
- <SPINECORELINKS>
- <linkS9>s9</linkS9>
- <linkS9top>s1,s3,s5,s7</linkS9top>
- <linkS9bot>s11,s12</linkS9bot>
- <linkS10>s10</linkS10>
- <linkS10top>s2,s4,s6,s8</linkS10top>
- <linkS10bot>s13,s14</linkS10bot>
- </SPINECORELINKS>
-
- <timers>
- <LinkDiscovery>10</LinkDiscovery>
- <SwitchDiscovery>10</SwitchDiscovery>
- </timers>
-
-</PARAMS>
diff --git a/TestON/tests/OnosCHO/OnosCHO.py b/TestON/tests/OnosCHO/OnosCHO.py
deleted file mode 100644
index 27aa450..0000000
--- a/TestON/tests/OnosCHO/OnosCHO.py
+++ /dev/null
@@ -1,2451 +0,0 @@
-
-import sys
-import os
-import re
-import time
-import json
-import itertools
-
-
-class OnosCHO:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- """
- Startup sequence:
- git pull
- mvn clean install
- onos-package
- cell <name>
- onos-verify-cell
- onos-install -f
- onos-wait-for-start
- """
- import time
-
- global intentState
- main.threadID = 0
- main.pingTimeout = 300
- main.numCtrls = main.params[ 'CTRL' ][ 'numCtrl' ]
- main.ONOS1_ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.ONOS2_ip = main.params[ 'CTRL' ][ 'ip2' ]
- main.ONOS3_ip = main.params[ 'CTRL' ][ 'ip3' ]
- #main.ONOS4_ip = main.params[ 'CTRL' ][ 'ip4' ]
- #main.ONOS5_ip = main.params[ 'CTRL' ][ 'ip5' ]
- main.ONOS1_port = main.params[ 'CTRL' ][ 'port1' ]
- main.ONOS2_port = main.params[ 'CTRL' ][ 'port2' ]
- main.ONOS3_port = main.params[ 'CTRL' ][ 'port3' ]
- #main.ONOS4_port = main.params[ 'CTRL' ][ 'port4' ]
- #main.ONOS5_port = main.params[ 'CTRL' ][ 'port5' ]
- cell_name = main.params[ 'ENV' ][ 'cellName' ]
- git_pull = main.params[ 'GIT' ][ 'autoPull' ]
- git_branch = main.params[ 'GIT' ][ 'branch' ]
- main.newTopo = ""
- main.CLIs = []
- main.nodes = []
- for i in range( 1, int(main.numCtrls) + 1 ):
- main.CLIs.append( getattr( main, 'ONOScli' + str( i ) ) )
- main.nodes.append( getattr( main, 'ONOS' + str( i ) ) )
-
- main.case( "Set up test environment" )
- main.log.report( "Set up test environment" )
- main.log.report( "_______________________" )
-
- main.step( "Git checkout and pull " + git_branch )
- if git_pull == 'on':
- checkout_result = main.ONOSbench.gitCheckout( git_branch )
- pull_result = main.ONOSbench.gitPull()
- cp_result = ( checkout_result and pull_result )
- else:
- checkout_result = main.TRUE
- pull_result = main.TRUE
- main.log.info( "Skipped git checkout and pull" )
- cp_result = ( checkout_result and pull_result )
- utilities.assert_equals( expect=main.TRUE, actual=cp_result,
- onpass="Test step PASS",
- onfail="Test step FAIL" )
-
- main.step( "mvn clean & install" )
- if git_pull == 'on':
- mvn_result = main.ONOSbench.cleanInstall()
- utilities.assert_equals( expect=main.TRUE, actual=mvn_result,
- onpass="Test step PASS",
- onfail="Test step FAIL" )
- else:
- mvn_result = main.TRUE
- main.log.info("Skipped mvn clean install as git pull is disabled in params file")
-
- main.ONOSbench.getVersion( report=True )
-
- main.step( "Apply Cell environment for ONOS" )
- cell_result = main.ONOSbench.setCell( cell_name )
- utilities.assert_equals( expect=main.TRUE, actual=cell_result,
- onpass="Test step PASS",
- onfail="Test step FAIL" )
-
- main.step( "Create ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
- utilities.assert_equals( expect=main.TRUE, actual=packageResult,
- onpass="Test step PASS",
- onfail="Test step FAIL" )
-
- main.step( "Uninstall ONOS package on all Nodes" )
- uninstallResult = main.TRUE
- for i in range( 1, int( main.numCtrls ) + 1 ):
- ONOS_ip = main.params[ 'CTRL' ][ 'ip' + str( i ) ]
- main.log.info( "Uninstalling package on ONOS Node IP: " + ONOS_ip )
- u_result = main.ONOSbench.onosUninstall( ONOS_ip )
- utilities.assert_equals( expect=main.TRUE, actual=u_result,
- onpass="Test step PASS",
- onfail="Test step FAIL" )
- uninstallResult = ( uninstallResult and u_result )
-
- #main.step( "Removing copy-cat logs from ONOS nodes" )
- #main.ONOSbench.onosRemoveRaftLogs()
-
- main.step( "Install ONOS package on all Nodes" )
- installResult = main.TRUE
- for i in range( 1, int( main.numCtrls ) + 1 ):
- ONOS_ip = main.params[ 'CTRL' ][ 'ip' + str( i ) ]
- main.log.info( "Intsalling package on ONOS Node IP: " + ONOS_ip )
- i_result = main.ONOSbench.onosInstall( node=ONOS_ip )
- utilities.assert_equals( expect=main.TRUE, actual=i_result,
- onpass="Test step PASS",
- onfail="Test step FAIL" )
- installResult = ( installResult and i_result )
-
- main.step( "Verify ONOS nodes UP status" )
- statusResult = main.TRUE
- for i in range( 1, int( main.numCtrls ) + 1 ):
- ONOS_ip = main.params[ 'CTRL' ][ 'ip' + str( i ) ]
- main.log.info( "ONOS Node " + ONOS_ip + " status:" )
- onos_status = main.ONOSbench.onosStatus( node=ONOS_ip )
- utilities.assert_equals( expect=main.TRUE, actual=onos_status,
- onpass="Test step PASS",
- onfail="Test step FAIL" )
- statusResult = ( statusResult and onos_status )
-
- main.step( "Start ONOS CLI on all nodes" )
- cliResult = main.TRUE
- karafTimeout = "3600000"
- # need to wait here for sometime. This will be removed once ONOS is
- # stable enough
- time.sleep( 25 )
- main.log.step(" Start ONOS cli using thread ")
- startCliResult = main.TRUE
- pool = []
- time1 = time.time()
- for i in range( int( main.numCtrls) ):
- t = main.Thread( target=main.CLIs[i].startOnosCli,
- threadID=main.threadID,
- name="startOnosCli",
- args=[ main.nodes[i].ip_address, karafTimeout ] )
- pool.append(t)
- t.start()
- main.threadID = main.threadID + 1
- for t in pool:
- t.join()
- startCliResult = startCliResult and t.result
- time2 = time.time()
-
- if not startCliResult:
- main.log.info("ONOS CLI did not start up properly")
- #main.cleanup()
- #main.exit()
- else:
- main.log.info("Successful CLI startup")
- startCliResult = main.TRUE
- case1Result = installResult and uninstallResult and statusResult and startCliResult
- time.sleep(30)
- main.log.info("Time for connecting to CLI: %2f seconds" %(time2-time1))
- utilities.assert_equals( expect=main.TRUE, actual=case1Result,
- onpass="Set up test environment PASS",
- onfail="Set up test environment FAIL" )
-
- def CASE20( self, main ):
- """
- This test script Loads a new Topology (Att) on CHO setup and balances all switches
- """
- import re
- import time
- import copy
-
- main.numMNswitches = int ( main.params[ 'TOPO1' ][ 'numSwitches' ] )
- main.numMNlinks = int ( main.params[ 'TOPO1' ][ 'numLinks' ] )
- main.numMNhosts = int ( main.params[ 'TOPO1' ][ 'numHosts' ] )
- main.pingTimeout = 300
- main.log.report(
- "Load Att topology and Balance all Mininet switches across controllers" )
- main.log.report(
- "________________________________________________________________________" )
- main.case(
- "Assign and Balance all Mininet switches across controllers" )
- main.step( "Stop any previous Mininet network topology" )
- cliResult = main.TRUE
- if main.newTopo == main.params['TOPO3']['topo']:
- stopStatus = main.Mininet1.stopNet( fileName = "topoSpine" )
-
- main.step( "Start Mininet with Att topology" )
- main.newTopo = main.params['TOPO1']['topo']
- startStatus = main.Mininet1.startNet(topoFile = main.newTopo)
- time.sleep(45)
- main.step( "Assign switches to controllers" )
- onosIps = []
- onosPort = []
- onosIps.append( ONOS1_ip )
- onosIps.append( ONOS2_ip )
- onosIps.append( ONOS3_ip )
- onosPort.append( ONOS1_port )
- onosPort.append( ONOS2_port )
- onosPort.append( ONOS3_port )
-
- for i in range( 1, ( main.numMNswitches + 1 ) ): # 1 to ( num of switches +1 )
- main.Mininet1.assignSwController(
- sw="s" + str( i ),
- count=int( main.numCtrls ),
- ip=onosIps,
- port=onosPort )
-
- switch_mastership = main.TRUE
- for i in range( 1, ( main.numMNswitches + 1 ) ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + main.ONOS1_ip, response ):
- switch_mastership = switch_mastership and main.TRUE
- else:
- switch_mastership = main.FALSE
-
- if switch_mastership == main.TRUE:
- main.log.report( "Controller assignment successfull" )
- else:
- main.log.report( "Controller assignment failed" )
-
- """topoFailed = main.FALSE
- checkCount = 0
- while(topoFailed == main.FALSE):
- topology_output = main.ONOScli1.topology()
- topology_result = main.ONOSbench.getTopology( topology_output )
- numOnosDevices = topology_result[ 'deviceCount' ]
- numOnosLinks = topology_result[ 'linkCount' ]
- if ( ( main.numMNswitches == int(numOnosDevices) ) and ( main.numMNlinks >= int(numOnosLinks) ) ):
- main.log.info("Att topology is now ready!")
- break
- else:
- main.log.info("Att topology is not ready yet!")
- checkCount = checkCount + 1
- time.sleep(2)
- if checkCount == 10:
- topoFailed = main.TRUE
- if topoFailed:
- main.log.info("Att topology failed to start correctly")
- """
- time.sleep(45)
- #Don't balance master for now..
- main.step( "Balance devices across controllers" )
- for i in range( int( main.numCtrls ) ):
- balanceResult = main.ONOScli1.balanceMasters()
- # giving some breathing time for ONOS to complete re-balance
- time.sleep( 5 )
- topology_output = main.ONOScli1.topology()
- topology_result = main.ONOSbench.getTopology( topology_output )
- case2Result = ( switch_mastership and startStatus )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case2Result,
- onpass="Starting new Att topology test PASS",
- onfail="Starting new Att topology test FAIL" )
-
- def CASE21( self, main ):
- """
- This test script Loads a new Topology (Chordal) on CHO setup and balances all switches
- """
- import re
- import time
- import copy
-
- main.newTopo = main.params['TOPO2']['topo']
- main.numMNswitches = int ( main.params[ 'TOPO2' ][ 'numSwitches' ] )
- main.numMNlinks = int ( main.params[ 'TOPO2' ][ 'numLinks' ] )
- main.numMNhosts = int ( main.params[ 'TOPO2' ][ 'numHosts' ] )
- main.pingTimeout = 300
- main.log.report(
- "Load Chordal topology and Balance all Mininet switches across controllers" )
- main.log.report(
- "________________________________________________________________________" )
- main.case(
- "Assign and Balance all Mininet switches across controllers" )
- main.step( "Stop any previous Mininet network topology" )
- stopStatus = main.Mininet1.stopNet(fileName = "topoAtt" )
- time.sleep(10)
- main.step( "Start Mininet with Chordal topology" )
- startStatus = main.Mininet1.startNet(topoFile = main.newTopo)
- time.sleep(15)
- main.step( "Assign switches to controllers" )
- onosIps = []
- onosPort = []
- onosIps.append( ONOS1_ip )
- onosIps.append( ONOS2_ip )
- onosIps.append( ONOS3_ip )
- onosPort.append( ONOS1_port )
- onosPort.append( ONOS2_port )
- onosPort.append( ONOS3_port )
-
- for i in range( 1, ( main.numMNswitches + 1 ) ): # 1 to ( num of switches +1 )
- main.Mininet1.assignSwController(
- sw="s" + str( i ),
- count=int( main.numCtrls ),
- ip=onosIps,
- port=onosPort )
-
- switch_mastership = main.TRUE
- for i in range( 1, ( main.numMNswitches + 1 ) ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + main.ONOS1_ip, response ):
- switch_mastership = switch_mastership and main.TRUE
- else:
- switch_mastership = main.FALSE
-
- if switch_mastership == main.TRUE:
- main.log.report( "Controller assignment successfull" )
- else:
- main.log.report( "Controller assignment failed" )
- time.sleep( 5 )
-
- main.step( "Balance devices across controllers" )
- for i in range( int( main.numCtrls ) ):
- balanceResult = main.ONOScli1.balanceMasters()
- # giving some breathing time for ONOS to complete re-balance
- time.sleep( 3 )
-
- case21Result = switch_mastership
- time.sleep(30)
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case21Result,
- onpass="Starting new Chordal topology test PASS",
- onfail="Starting new Chordal topology test FAIL" )
-
- def CASE22( self, main ):
- """
- This test script Loads a new Topology (Spine) on CHO setup and balances all switches
- """
- import re
- import time
- import copy
-
- main.newTopo = main.params['TOPO3']['topo']
- main.numMNswitches = int ( main.params[ 'TOPO3' ][ 'numSwitches' ] )
- main.numMNlinks = int ( main.params[ 'TOPO3' ][ 'numLinks' ] )
- main.numMNhosts = int ( main.params[ 'TOPO3' ][ 'numHosts' ] )
- main.pingTimeout = 600
-
- main.log.report(
- "Load Spine and Leaf topology and Balance all Mininet switches across controllers" )
- main.log.report(
- "________________________________________________________________________" )
- # need to wait here for sometime until ONOS bootup
- main.case(
- "Assign and Balance all Mininet switches across controllers" )
- main.step( "Stop any previous Mininet network topology" )
- stopStatus = main.Mininet1.stopNet(fileName = "topoChordal" )
- main.step( "Start Mininet with Spine topology" )
- startStatus = main.Mininet1.startNet(topoFile = main.newTopo)
- time.sleep(60)
- main.step( "Assign switches to controllers" )
- onosIps = []
- onosPort = []
- onosIps.append( ONOS1_ip )
- onosIps.append( ONOS2_ip )
- onosIps.append( ONOS3_ip )
- onosPort.append( ONOS1_port )
- onosPort.append( ONOS2_port )
- onosPort.append( ONOS3_port )
-
- for i in range( 1, ( main.numMNswitches + 1 ) ): # 1 to ( num of switches +1 )
- main.Mininet1.assignSwController(
- sw="s" + str( i ),
- count=int( main.numCtrls ),
- ip=onosIps,
- port=onosPort )
-
- switch_mastership = main.TRUE
- for i in range( 1, ( main.numMNswitches + 1 ) ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + main.ONOS1_ip, response ):
- switch_mastership = switch_mastership and main.TRUE
- else:
- switch_mastership = main.FALSE
-
- if switch_mastership == main.TRUE:
- main.log.report( "Controller assignment successfull" )
- else:
- main.log.report( "Controller assignment failed" )
- time.sleep( 5 )
-
- main.step( "Balance devices across controllers" )
- for i in range( int( main.numCtrls ) ):
- balanceResult = main.ONOScli1.balanceMasters()
- # giving some breathing time for ONOS to complete re-balance
- time.sleep( 3 )
-
- case22Result = switch_mastership
- time.sleep(60)
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case22Result,
- onpass="Starting new Spine topology test PASS",
- onfail="Starting new Spine topology test FAIL" )
-
- def CASE3( self, main ):
- """
- This Test case will be extended to collect and store more data related
- ONOS state.
- """
- import re
- import copy
- main.deviceDPIDs = []
- main.hostMACs = []
- main.deviceLinks = []
- main.deviceActiveLinksCount = []
- main.devicePortsEnabledCount = []
-
- main.log.report(
- "Collect and Store topology details from ONOS before running any Tests" )
- main.log.report(
- "____________________________________________________________________" )
- main.case( "Collect and Store Topology Details from ONOS" )
- main.step( "Collect and store current number of switches and links" )
- topology_output = main.ONOScli1.topology()
- topology_result = main.ONOSbench.getTopology( topology_output )
- numOnosDevices = topology_result[ 'devices' ]
- numOnosLinks = topology_result[ 'links' ]
- topoResult = main.TRUE
-
- if ( ( main.numMNswitches == int(numOnosDevices) ) and ( main.numMNlinks >= int(numOnosLinks) ) ):
- main.step( "Store Device DPIDs" )
- for i in range( 1, (main.numMNswitches+1) ):
- main.deviceDPIDs.append( "of:00000000000000" + format( i, '02x' ) )
- print "Device DPIDs in Store: \n", str( main.deviceDPIDs )
-
- main.step( "Store Host MACs" )
- for i in range( 1, ( main.numMNhosts + 1 ) ):
- main.hostMACs.append( "00:00:00:00:00:" + format( i, '02x' ) + "/-1" )
- print "Host MACs in Store: \n", str( main.hostMACs )
- main.MACsDict = {}
- print "Creating dictionary of DPID and HostMacs"
- for i in range(len(main.hostMACs)):
- main.MACsDict[main.deviceDPIDs[i]] = main.hostMACs[i].split('/')[0]
- print main.MACsDict
- main.step( "Collect and store all Devices Links" )
- linksResult = main.ONOScli1.links( jsonFormat=False )
- ansi_escape = re.compile( r'\x1b[^m]*m' )
- linksResult = ansi_escape.sub( '', linksResult )
- linksResult = linksResult.replace( " links", "" ).replace( "\r\r", "" )
- linksResult = linksResult.splitlines()
- main.deviceLinks = copy.copy( linksResult )
- print "Device Links Stored: \n", str( main.deviceLinks )
- # this will be asserted to check with the params provided count of
- # links
- print "Length of Links Store", len( main.deviceLinks )
-
- main.step( "Collect and store each Device ports enabled Count" )
- time1 = time.time()
- for i in xrange(1,(main.numMNswitches + 1), int( main.numCtrls ) ):
- pool = []
- for cli in main.CLIs:
- if i >= main.numMNswitches + 1:
- break
- dpid = "of:00000000000000" + format( i,'02x' )
- t = main.Thread(target = cli.getDevicePortsEnabledCount,threadID = main.threadID, name = "getDevicePortsEnabledCount",args = [dpid])
- t.start()
- pool.append(t)
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- portResult = thread.result
- #portCount = re.split( r'\t+', portResult )
- #portCount = portTemp[ 1 ].replace( "\r\r\n\x1b[32m", "" )
- main.devicePortsEnabledCount.append( portResult )
- print "Device Enabled Port Counts Stored: \n", str( main.devicePortsEnabledCount )
- time2 = time.time()
- main.log.info("Time for counting enabled ports of the switches: %2f seconds" %(time2-time1))
-
- main.step( "Collect and store each Device active links Count" )
- time1 = time.time()
-
- for i in xrange( 1,( main.numMNswitches + 1 ), int( main.numCtrls) ):
- pool = []
- for cli in main.CLIs:
- if i >= main.numMNswitches + 1:
- break
- dpid = "of:00000000000000" + format( i,'02x' )
- t = main.Thread( target = cli.getDeviceLinksActiveCount,
- threadID = main.threadID,
- name = "getDevicePortsEnabledCount",
- args = [dpid])
- t.start()
- pool.append(t)
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- linkCountResult = thread.result
- #linkCount = re.split( r'\t+', linkCountResult )
- #linkCount = linkCountTemp[ 1 ].replace( "\r\r\n\x1b[32m", "" )
- main.deviceActiveLinksCount.append( linkCountResult )
- print "Device Active Links Count Stored: \n", str( main.deviceActiveLinksCount )
- time2 = time.time()
- main.log.info("Time for counting all enabled links of the switches: %2f seconds" %(time2-time1))
-
- else:
- main.log.info("Devices (expected): %s, Links (expected): %s" %
- ( str( main.numMNswitches ), str( main.numMNlinks ) ) )
- main.log.info("Devices (actual): %s, Links (actual): %s" %
- ( numOnosDevices , numOnosLinks ) )
- main.log.info("Topology does not match, exiting CHO test...")
- topoResult = main.FALSE
- # It's better exit here from running the test
- main.cleanup()
- main.exit()
-
- # just returning TRUE for now as this one just collects data
- case3Result = topoResult
- utilities.assert_equals( expect=main.TRUE, actual=case3Result,
- onpass="Saving ONOS topology data test PASS",
- onfail="Saving ONOS topology data test FAIL" )
-
- def CASE40( self, main ):
- """
- Verify Reactive forwarding (Att Topology)
- """
- import re
- import copy
- import time
- main.log.report( "Verify Reactive forwarding (Att Topology)" )
- main.log.report( "______________________________________________" )
- main.case( "Enable Reactive forwarding and Verify ping all" )
- main.step( "Enable Reactive forwarding" )
- installResult = main.TRUE
- # Activate fwd app
- appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" )
- appCheck = main.TRUE
- pool = []
- for cli in main.CLIs:
- t = main.Thread( target=cli.appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- pool.append( t )
- t.start()
- for t in pool:
- t.join()
- appCheck = appCheck and t.result
- utilities.assert_equals( expect=main.TRUE, actual=appCheck,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
- if appCheck != main.TRUE:
- main.log.warn( main.CLIs[0].apps() )
- main.log.warn( main.CLIs[0].appIDs() )
-
- time.sleep( 10 )
-
- main.step( "Verify Pingall" )
- ping_result = main.FALSE
- time1 = time.time()
- ping_result = main.Mininet1.pingall( timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
-
- if ping_result == main.TRUE:
- main.log.report( "Pingall Test in Reactive mode successful" )
- else:
- main.log.report( "Pingall Test in Reactive mode failed" )
-
- main.step( "Disable Reactive forwarding" )
-
- main.log.info( "Uninstall reactive forwarding app" )
- appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
- pool = []
- for cli in main.CLIs:
- t = main.Thread( target=cli.appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- pool.append( t )
- t.start()
-
- for t in pool:
- t.join()
- appCheck = appCheck and t.result
- utilities.assert_equals( expect=main.TRUE, actual=appCheck,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
- if appCheck != main.TRUE:
- main.log.warn( main.CLIs[0].apps() )
- main.log.warn( main.CLIs[0].appIDs() )
-
- # Waiting for reative flows to be cleared.
- time.sleep( 30 )
- case40Result = installResult and uninstallResult and ping_result
- utilities.assert_equals( expect=main.TRUE, actual=case40Result,
- onpass="Reactive Mode Pingall test PASS",
- onfail="Reactive Mode Pingall test FAIL" )
-
- def CASE41( self, main ):
- """
- Verify Reactive forwarding (Chordal Topology)
- """
- import re
- import copy
- import time
- main.log.report( "Verify Reactive forwarding (Chordal Topology)" )
- main.log.report( "______________________________________________" )
- main.case( "Enable Reactive forwarding and Verify ping all" )
- main.step( "Enable Reactive forwarding" )
- installResult = main.TRUE
- # Activate fwd app
- appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" )
-
- appCheck = main.TRUE
- pool = []
- for cli in main.CLIs:
- t = main.Thread( target=cli.appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- pool.append( t )
- t.start()
- for t in pool:
- t.join()
- appCheck = appCheck and t.result
- utilities.assert_equals( expect=main.TRUE, actual=appCheck,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
- if appCheck != main.TRUE:
- main.log.warn( main.CLIs[0].apps() )
- main.log.warn( main.CLIs[0].appIDs() )
-
- time.sleep( 10 )
-
- main.step( "Verify Pingall" )
- ping_result = main.FALSE
- time1 = time.time()
- ping_result = main.Mininet1.pingall( timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
-
- if ping_result == main.TRUE:
- main.log.report( "Pingall Test in Reactive mode successful" )
- else:
- main.log.report( "Pingall Test in Reactive mode failed" )
-
- main.step( "Disable Reactive forwarding" )
-
- main.log.info( "Uninstall reactive forwarding app" )
- appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
- pool = []
- for cli in main.CLIs:
- t = main.Thread( target=cli.appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- pool.append( t )
- t.start()
-
- for t in pool:
- t.join()
- appCheck = appCheck and t.result
- utilities.assert_equals( expect=main.TRUE, actual=appCheck,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
- if appCheck != main.TRUE:
- main.log.warn( main.CLIs[0].apps() )
- main.log.warn( main.CLIs[0].appIDs() )
-
- # Waiting for reative flows to be cleared.
- time.sleep( 30 )
- case41Result = installResult and uninstallResult and ping_result
- utilities.assert_equals( expect=main.TRUE, actual=case41Result,
- onpass="Reactive Mode Pingall test PASS",
- onfail="Reactive Mode Pingall test FAIL" )
-
- def CASE42( self, main ):
- """
- Verify Reactive forwarding (Spine Topology)
- """
- import re
- import copy
- import time
- main.log.report( "Verify Reactive forwarding (Spine Topology)" )
- main.log.report( "______________________________________________" )
- main.case( "Enable Reactive forwarding and Verify ping all" )
- main.step( "Enable Reactive forwarding" )
- installResult = main.TRUE
- # Activate fwd app
- appResults = main.CLIs[0].activateApp( "org.onosproject.fwd" )
-
- appCheck = main.TRUE
- pool = []
- for cli in main.CLIs:
- t = main.Thread( target=cli.appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- pool.append( t )
- t.start()
- for t in pool:
- t.join()
- appCheck = appCheck and t.result
- utilities.assert_equals( expect=main.TRUE, actual=appCheck,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
- if appCheck != main.TRUE:
- main.log.warn( main.CLIs[0].apps() )
- main.log.warn( main.CLIs[0].appIDs() )
-
- time.sleep( 10 )
-
- main.step( "Verify Pingall" )
- ping_result = main.FALSE
- time1 = time.time()
- ping_result = main.Mininet1.pingall( timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
-
- if ping_result == main.TRUE:
- main.log.report( "Pingall Test in Reactive mode successful" )
- else:
- main.log.report( "Pingall Test in Reactive mode failed" )
-
- main.step( "Disable Reactive forwarding" )
-
- main.log.info( "Uninstall reactive forwarding app" )
- appResults = appResults and main.CLIs[0].deactivateApp( "org.onosproject.fwd" )
- pool = []
- for cli in main.CLIs:
- t = main.Thread( target=cli.appToIDCheck,
- name="appToIDCheck-" + str( i ),
- args=[] )
- pool.append( t )
- t.start()
-
- for t in pool:
- t.join()
- appCheck = appCheck and t.result
- utilities.assert_equals( expect=main.TRUE, actual=appCheck,
- onpass="App Ids seem to be correct",
- onfail="Something is wrong with app Ids" )
- if appCheck != main.TRUE:
- main.log.warn( main.CLIs[0].apps() )
- main.log.warn( main.CLIs[0].appIDs() )
-
- # Waiting for reative flows to be cleared.
- time.sleep( 30 )
- case42Result = installResult and uninstallResult and ping_result
- utilities.assert_equals( expect=main.TRUE, actual=case42Result,
- onpass="Reactive Mode Pingall test PASS",
- onfail="Reactive Mode Pingall test FAIL" )
-
- def CASE5( self, main ):
- """
- Compare current ONOS topology with reference data
- """
- import re
-
- devicesDPIDTemp = []
- hostMACsTemp = []
- deviceLinksTemp = []
- deviceActiveLinksCountTemp = []
- devicePortsEnabledCountTemp = []
-
- main.log.report(
- "Compare ONOS topology with reference data in Stores" )
- main.log.report( "__________________________________________________" )
- main.case( "Compare ONOS topology with reference data" )
-
- main.step( "Compare current Device ports enabled with reference" )
- time1 = time.time()
- for i in xrange( 1,(main.numMNswitches + 1), int( main.numCtrls ) ):
- pool = []
- for cli in main.CLIs:
- if i >= main.numMNswitches + 1:
- break
- dpid = "of:00000000000000" + format( i,'02x' )
- t = main.Thread(target = cli.getDevicePortsEnabledCount,
- threadID = main.threadID,
- name = "getDevicePortsEnabledCount",
- args = [dpid])
- t.start()
- pool.append(t)
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- portResult = thread.result
- #portTemp = re.split( r'\t+', portResult )
- #portCount = portTemp[ 1 ].replace( "\r\r\n\x1b[32m", "" )
- devicePortsEnabledCountTemp.append( portResult )
-
- time2 = time.time()
- main.log.info("Time for counting enabled ports of the switches: %2f seconds" %(time2-time1))
- main.log.info (
- "Device Enabled ports EXPECTED: %s" %
- str( main.devicePortsEnabledCount ) )
- main.log.info (
- "Device Enabled ports ACTUAL: %s" %
- str( devicePortsEnabledCountTemp ) )
-
- if ( cmp( main.devicePortsEnabledCount,
- devicePortsEnabledCountTemp ) == 0 ):
- stepResult1 = main.TRUE
- else:
- stepResult1 = main.FALSE
-
- main.step( "Compare Device active links with reference" )
- time1 = time.time()
- for i in xrange( 1, ( main.numMNswitches + 1) , int( main.numCtrls ) ):
- pool = []
- for cli in main.CLIs:
- if i >= main.numMNswitches + 1:
- break
- dpid = "of:00000000000000" + format( i,'02x' )
- t = main.Thread(target = cli.getDeviceLinksActiveCount,
- threadID = main.threadID,
- name = "getDeviceLinksActiveCount",
- args = [dpid])
- t.start()
- pool.append(t)
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- linkCountResult = thread.result
- #linkCountTemp = re.split( r'\t+', linkCountResult )
- #linkCount = linkCountTemp[ 1 ].replace( "\r\r\n\x1b[32m", "" )
- deviceActiveLinksCountTemp.append( linkCountResult )
-
- time2 = time.time()
- main.log.info("Time for counting all enabled links of the switches: %2f seconds" %(time2-time1))
- main.log.info (
- "Device Active links EXPECTED: %s" %
- str( main.deviceActiveLinksCount ) )
- main.log.info (
- "Device Active links ACTUAL: %s" % str( deviceActiveLinksCountTemp ) )
- if ( cmp( main.deviceActiveLinksCount, deviceActiveLinksCountTemp ) == 0 ):
- stepResult2 = main.TRUE
- else:
- stepResult2 = main.FALSE
-
- """
- place holder for comparing devices, hosts, paths and intents if required.
- Links and ports data would be incorrect with out devices anyways.
- """
- case5Result = ( stepResult1 and stepResult2 )
- utilities.assert_equals( expect=main.TRUE, actual=case5Result,
- onpass="Compare Topology test PASS",
- onfail="Compare Topology test FAIL" )
-
- def CASE60( self ):
- """
- Install 300 host intents and verify ping all (Att Topology)
- """
- main.log.report( "Add 300 host intents and verify pingall (Att Topology)" )
- main.log.report( "_______________________________________" )
- import itertools
- import time
- main.case( "Install 300 host intents" )
- main.step( "Add host Intents" )
- intentResult = main.TRUE
- hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
-
- intentIdList = []
- time1 = time.time()
- for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
- pool = []
- for cli in main.CLIs:
- if i >= len( hostCombos ):
- break
- t = main.Thread( target=cli.addHostIntent,
- threadID=main.threadID,
- name="addHostIntent",
- args=[hostCombos[i][0],hostCombos[i][1]])
- pool.append(t)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
-
- intentResult = main.TRUE
- intentsJson = main.ONOScli2.intents()
- getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
- intentsJson = intentsJson)
- print "len of intent ID", str(len(intentIdList))
- print "len of intent state results", str(len(getIntentStateResult))
- print getIntentStateResult
- # Takes awhile for all the onos to get the intents
- time.sleep( 30 )
- """intentState = main.TRUE
- for i in getIntentStateResult:
- if getIntentStateResult.get( 'state' ) != 'INSTALLED':
- """
-
-
- main.step( "Verify Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- case60Result = ( intentResult and pingResult )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case60Result,
- onpass="Install 300 Host Intents and Ping All test PASS",
- onfail="Install 300 Host Intents and Ping All test FAIL" )
-
- def CASE61( self ):
- """
- Install 600 host intents and verify ping all for Chordal Topology
- """
- main.log.report( "Add 600 host intents and verify pingall (Chordal Topo)" )
- main.log.report( "_______________________________________" )
- import itertools
-
- main.case( "Install 600 host intents" )
- main.step( "Add host Intents" )
- intentResult = main.TRUE
- hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
-
- intentIdList = []
- time1 = time.time()
-
- for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
- pool = []
- for cli in main.CLIs:
- if i >= len( hostCombos ):
- break
- t = main.Thread( target=cli.addHostIntent,
- threadID=main.threadID,
- name="addHostIntent",
- args=[hostCombos[i][0],hostCombos[i][1]])
- pool.append(t)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
- intentResult = main.TRUE
- intentsJson = main.ONOScli2.intents()
- getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
- intentsJson = intentsJson)
- print getIntentStateResult
-
- main.step( "Verify Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- case14Result = ( intentResult and pingResult )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case14Result,
- onpass="Install 300 Host Intents and Ping All test PASS",
- onfail="Install 300 Host Intents and Ping All test FAIL" )
-
- def CASE62( self ):
- """
- Install 2278 host intents and verify ping all for Spine Topology
- """
- main.log.report( "Add 2278 host intents and verify pingall (Spine Topo)" )
- main.log.report( "_______________________________________" )
- import itertools
-
- main.case( "Install 2278 host intents" )
- main.step( "Add host Intents" )
- intentResult = main.TRUE
- hostCombos = list( itertools.combinations( main.hostMACs, 2 ) )
- main.pingTimeout = 300
- intentIdList = []
- time1 = time.time()
- for i in xrange( 0, len( hostCombos ), int(main.numCtrls) ):
- pool = []
- for cli in main.CLIs:
- if i >= len( hostCombos ):
- break
- t = main.Thread( target=cli.addHostIntent,
- threadID=main.threadID,
- name="addHostIntent",
- args=[hostCombos[i][0],hostCombos[i][1]])
- pool.append(t)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding host intents: %2f seconds" %(time2-time1))
- intentResult = main.TRUE
- intentsJson = main.ONOScli2.intents()
- getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
- intentsJson = intentsJson)
- print getIntentStateResult
-
- main.step( "Verify Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- case15Result = ( intentResult and pingResult )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case15Result,
- onpass="Install 2278 Host Intents and Ping All test PASS",
- onfail="Install 2278 Host Intents and Ping All test FAIL" )
-
- def CASE70( self, main ):
- """
- Randomly bring some core links down and verify ping all ( Host Intents-Att Topo)
- """
- import random
- main.randomLink1 = []
- main.randomLink2 = []
- main.randomLink3 = []
- link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
- link1End2 = main.params[ 'ATTCORELINKS' ][ 'linkS3b' ].split( ',' )
- link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
- link2End2 = main.params[ 'ATTCORELINKS' ][ 'linkS14b' ].split( ',' )
- link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
- link3End2 = main.params[ 'ATTCORELINKS' ][ 'linkS18b' ].split( ',' )
- switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- main.log.report( "Randomly bring some core links down and verify ping all (Host Intents-Att Topo)" )
- main.log.report( "___________________________________________________________________________" )
- main.case( "Host intents - Randomly bring some core links down and verify ping all" )
- main.step( "Verify number of Switch links to toggle on each Core Switch are between 1 - 5" )
- if ( int( switchLinksToToggle ) ==
- 0 or int( switchLinksToToggle ) > 5 ):
- main.log.info( "Please check your PARAMS file. Valid range for number of switch links to toggle is between 1 to 5" )
- #main.cleanup()
- #main.exit()
- else:
- main.log.info( "User provided Core switch links range to toggle is correct, proceeding to run the test" )
-
- main.step( "Cut links on Core devices using user provided range" )
- main.randomLink1 = random.sample( link1End2, int( switchLinksToToggle ) )
- main.randomLink2 = random.sample( link2End2, int( switchLinksToToggle ) )
- main.randomLink3 = random.sample( link3End2, int( switchLinksToToggle ) )
- for i in range( int( switchLinksToToggle ) ):
- main.Mininet1.link(
- END1=link1End1,
- END2=main.randomLink1[ i ],
- OPTION="down" )
- time.sleep( link_sleep )
- main.Mininet1.link(
- END1=link2End1,
- END2=main.randomLink2[ i ],
- OPTION="down" )
- time.sleep( link_sleep )
- main.Mininet1.link(
- END1=link3End1,
- END2=main.randomLink3[ i ],
- OPTION="down" )
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli2.topology()
- linkDown = main.ONOSbench.checkStatus(
- topology_output, main.numMNswitches, str(
- int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkDown,
- onpass="Link Down discovered properly",
- onfail="Link down was not discovered in " +
- str( link_sleep ) +
- " seconds" )
-
- main.step( "Verify Ping across all hosts" )
- pingResultLinkDown = main.FALSE
- time1 = time.time()
- pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- caseResult70 = linkDown and pingResultLinkDown
- utilities.assert_equals( expect=main.TRUE, actual=caseResult70,
- onpass="Random Link cut Test PASS",
- onfail="Random Link cut Test FAIL" )
-
- def CASE80( self, main ):
- """
- Bring the core links up that are down and verify ping all ( Host Intents-Att Topo )
- """
- import random
- link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
- link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
- link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
- switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
-
- main.log.report(
- "Bring the core links up that are down and verify ping all (Host Intents-Att Topo" )
- main.log.report(
- "__________________________________________________________________" )
- main.case(
- "Host intents - Bring the core links up that are down and verify ping all" )
- main.step( "Bring randomly cut links on Core devices up" )
- for i in range( int( switchLinksToToggle ) ):
- main.Mininet1.link(
- END1=link1End1,
- END2=main.randomLink1[ i ],
- OPTION="up" )
- time.sleep( link_sleep )
- main.Mininet1.link(
- END1=link2End1,
- END2=main.randomLink2[ i ],
- OPTION="up" )
- time.sleep( link_sleep )
- main.Mininet1.link(
- END1=link3End1,
- END2=main.randomLink3[ i ],
- OPTION="up" )
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli2.topology()
- linkUp = main.ONOSbench.checkStatus(
- topology_output,
- main.numMNswitches,
- str( main.numMNlinks ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( link_sleep ) +
- " seconds" )
-
- main.step( "Verify Ping across all hosts" )
- pingResultLinkUp = main.FALSE
- time1 = time.time()
- pingResultLinkUp = main.Mininet1.pingall( timeout=main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- caseResult80 = linkUp and pingResultLinkUp
- utilities.assert_equals( expect=main.TRUE, actual=caseResult80,
- onpass="Link Up Test PASS",
- onfail="Link Up Test FAIL" )
-
- def CASE71( self, main ):
- """
- Randomly bring some core links down and verify ping all ( Point Intents-Att Topo)
- """
- import random
- main.randomLink1 = []
- main.randomLink2 = []
- main.randomLink3 = []
- link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
- link1End2 = main.params[ 'ATTCORELINKS' ][ 'linkS3b' ].split( ',' )
- link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
- link2End2 = main.params[ 'ATTCORELINKS' ][ 'linkS14b' ].split( ',' )
- link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
- link3End2 = main.params[ 'ATTCORELINKS' ][ 'linkS18b' ].split( ',' )
- switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- main.log.report( "Randomly bring some core links down and verify ping all (Point Intents-Att Topo)" )
- main.log.report( "___________________________________________________________________________" )
- main.case( "Point intents - Randomly bring some core links down and verify ping all" )
- main.step( "Verify number of Switch links to toggle on each Core Switch are between 1 - 5" )
- if ( int( switchLinksToToggle ) ==
- 0 or int( switchLinksToToggle ) > 5 ):
- main.log.info( "Please check your PARAMS file. Valid range for number of switch links to toggle is between 1 to 5" )
- #main.cleanup()
- #main.exit()
- else:
- main.log.info( "User provided Core switch links range to toggle is correct, proceeding to run the test" )
-
- main.step( "Cut links on Core devices using user provided range" )
- main.randomLink1 = random.sample( link1End2, int( switchLinksToToggle ) )
- main.randomLink2 = random.sample( link2End2, int( switchLinksToToggle ) )
- main.randomLink3 = random.sample( link3End2, int( switchLinksToToggle ) )
- for i in range( int( switchLinksToToggle ) ):
- main.Mininet1.link(
- END1=link1End1,
- END2=main.randomLink1[ i ],
- OPTION="down" )
- time.sleep( link_sleep )
- main.Mininet1.link(
- END1=link2End1,
- END2=main.randomLink2[ i ],
- OPTION="down" )
- time.sleep( link_sleep )
- main.Mininet1.link(
- END1=link3End1,
- END2=main.randomLink3[ i ],
- OPTION="down" )
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli2.topology()
- linkDown = main.ONOSbench.checkStatus(
- topology_output, main.numMNswitches, str(
- int( main.numMNlinks ) - int( switchLinksToToggle ) * 6 ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkDown,
- onpass="Link Down discovered properly",
- onfail="Link down was not discovered in " +
- str( link_sleep ) +
- " seconds" )
-
- main.step( "Verify Ping across all hosts" )
- pingResultLinkDown = main.FALSE
- time1 = time.time()
- pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- caseResult71 = linkDown and pingResultLinkDown
- utilities.assert_equals( expect=main.TRUE, actual=caseResult71,
- onpass="Random Link cut Test PASS",
- onfail="Random Link cut Test FAIL" )
-
- def CASE81( self, main ):
- """
- Bring the core links up that are down and verify ping all ( Point Intents-Att Topo )
- """
- import random
- link1End1 = main.params[ 'ATTCORELINKS' ][ 'linkS3a' ]
- link2End1 = main.params[ 'ATTCORELINKS' ][ 'linkS14a' ]
- link3End1 = main.params[ 'ATTCORELINKS' ][ 'linkS18a' ]
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
- switchLinksToToggle = main.params[ 'ATTCORELINKS' ][ 'toggleLinks' ]
-
- main.log.report(
- "Bring the core links up that are down and verify ping all ( Point Intents-Att Topo" )
- main.log.report(
- "__________________________________________________________________" )
- main.case(
- "Point intents - Bring the core links up that are down and verify ping all" )
- main.step( "Bring randomly cut links on Core devices up" )
- for i in range( int( switchLinksToToggle ) ):
- main.Mininet1.link(
- END1=link1End1,
- END2=main.randomLink1[ i ],
- OPTION="up" )
- time.sleep( link_sleep )
- main.Mininet1.link(
- END1=link2End1,
- END2=main.randomLink2[ i ],
- OPTION="up" )
- time.sleep( link_sleep )
- main.Mininet1.link(
- END1=link3End1,
- END2=main.randomLink3[ i ],
- OPTION="up" )
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli2.topology()
- linkUp = main.ONOSbench.checkStatus(
- topology_output,
- main.numMNswitches,
- str( main.numMNlinks ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( link_sleep ) +
- " seconds" )
-
- main.step( "Verify Ping across all hosts" )
- pingResultLinkUp = main.FALSE
- time1 = time.time()
- pingResultLinkUp = main.Mininet1.pingall(timeout = main.pingTimeout )
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- caseResult81 = linkUp and pingResultLinkUp
- utilities.assert_equals( expect=main.TRUE, actual=caseResult81,
- onpass="Link Up Test PASS",
- onfail="Link Up Test FAIL" )
-
- def CASE72( self, main ):
- """
- Randomly bring some links down and verify ping all ( Host Intents-Chordal Topo)
- """
- import random
- import itertools
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- main.log.report( "Randomly bring some core links down and verify ping all (Host Intents-Chordal Topo)" )
- main.log.report( "___________________________________________________________________________" )
- main.case( "Host intents - Randomly bring some core links down and verify ping all" )
- switches = []
- switchesComb = []
- for i in range( main.numMNswitches ):
- switches.append('s%d'%(i+1))
- switchesLinksComb = list(itertools.combinations(switches,2))
- main.randomLinks = random.sample(switchesLinksComb, 5 )
- print main.randomLinks
- main.step( "Cut links on random devices" )
-
- for switch in main.randomLinks:
- main.Mininet1.link(
- END1=switch[0],
- END2=switch[1],
- OPTION="down")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli2.topology()
- linkDown = main.ONOSbench.checkStatus(
- topology_output, main.numMNswitches, str(
- int( main.numMNlinks ) - 5 * 2 ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkDown,
- onpass="Link Down discovered properly",
- onfail="Link down was not discovered in " +
- str( link_sleep ) +
- " seconds" )
-
- main.step( "Verify Ping across all hosts" )
- pingResultLinkDown = main.FALSE
- time1 = time.time()
- pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- caseResult71 = pingResultLinkDown
- utilities.assert_equals( expect=main.TRUE, actual=caseResult71,
- onpass="Random Link cut Test PASS",
- onfail="Random Link cut Test FAIL" )
-
- def CASE82( self, main ):
- """
- Bring the core links up that are down and verify ping all ( Host Intents Chordal Topo )
- """
- import random
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- main.log.report(
- "Bring the core links up that are down and verify ping all (Host Intents-Chordal Topo" )
- main.log.report(
- "__________________________________________________________________" )
- main.case(
- "Host intents - Bring the core links up that are down and verify ping all" )
- main.step( "Bring randomly cut links on devices up" )
-
- for switch in main.randomLinks:
- main.Mininet1.link(
- END1=switch[0],
- END2=switch[1],
- OPTION="up")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli2.topology()
- linkUp = main.ONOSbench.checkStatus(
- topology_output,
- main.numMNswitches,
- str( main.numMNlinks ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( link_sleep ) +
- " seconds" )
-
- main.step( "Verify Ping across all hosts" )
- pingResultLinkUp = main.FALSE
- time1 = time.time()
- pingResultLinkUp = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- caseResult82 = linkUp and pingResultLinkUp
- utilities.assert_equals( expect=main.TRUE, actual=caseResult82,
- onpass="Link Up Test PASS",
- onfail="Link Up Test FAIL" )
-
- def CASE73( self, main ):
- """
- Randomly bring some links down and verify ping all ( Point Intents-Chordal Topo)
- """
- import random
- import itertools
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- main.log.report( "Randomly bring some core links down and verify ping all ( Point Intents-Chordal Topo)" )
- main.log.report( "___________________________________________________________________________" )
- main.case( "Point intents - Randomly bring some core links down and verify ping all" )
- switches = []
- switchesComb = []
- for i in range( main.numMNswitches ):
- switches.append('s%d'%(i+1))
- switchesLinksComb = list(itertools.combinations(switches,2))
- main.randomLinks = random.sample(switchesLinksComb, 5 )
- print main.randomLinks
- main.step( "Cut links on random devices" )
-
- for switch in main.randomLinks:
- main.Mininet1.link(
- END1=switch[0],
- END2=switch[1],
- OPTION="down")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli2.topology()
- linkDown = main.ONOSbench.checkStatus(
- topology_output, main.numMNswitches, str(
- int( main.numMNlinks ) - 5 * 2 ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkDown,
- onpass="Link Down discovered properly",
- onfail="Link down was not discovered in " +
- str( link_sleep ) +
- " seconds" )
-
- main.step( "Verify Ping across all hosts" )
- pingResultLinkDown = main.FALSE
- time1 = time.time()
- pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- caseResult73 = pingResultLinkDown
- utilities.assert_equals( expect=main.TRUE, actual=caseResult73,
- onpass="Random Link cut Test PASS",
- onfail="Random Link cut Test FAIL" )
-
- def CASE83( self, main ):
- """
- Bring the core links up that are down and verify ping all ( Point Intents Chordal Topo )
- """
- import random
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- main.log.report(
- "Bring the core links up that are down and verify ping all ( Point Intents-Chordal Topo" )
- main.log.report(
- "__________________________________________________________________" )
- main.case(
- "Point intents - Bring the core links up that are down and verify ping all" )
- main.step( "Bring randomly cut links on devices up" )
-
- for switch in main.randomLinks:
- main.Mininet1.link(
- END1=switch[0],
- END2=switch[1],
- OPTION="up")
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli2.topology()
- linkUp = main.ONOSbench.checkStatus(
- topology_output,
- main.numMNswitches,
- str( main.numMNlinks ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( link_sleep ) +
- " seconds" )
-
- main.step( "Verify Ping across all hosts" )
- pingResultLinkUp = main.FALSE
- time1 = time.time()
- pingResultLinkUp = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- caseResult83 = linkUp and pingResultLinkUp
- utilities.assert_equals( expect=main.TRUE, actual=caseResult83,
- onpass="Link Up Test PASS",
- onfail="Link Up Test FAIL" )
-
- def CASE74( self, main ):
- """
- Randomly bring some core links down and verify ping all ( Host Intents-Spine Topo)
- """
- import random
- main.randomLink1 = []
- main.randomLink2 = []
- main.randomLink3 = []
- main.randomLink4 = []
- link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ]
- link1End2top = main.params[ 'SPINECORELINKS' ][ 'linkS9top' ].split( ',' )
- link1End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS9bot' ].split( ',' )
- link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
- link2End2top = main.params[ 'SPINECORELINKS' ][ 'linkS10top' ].split( ',' )
- link2End2bot = main.params[ 'SPINECORELINKS' ][ 'linkS10bot' ].split( ',' )
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
- main.pingTimeout = 400
-
- main.log.report( "Bring some core links down and verify ping all (Host Intents-Spine Topo)" )
- main.log.report( "___________________________________________________________________________" )
-
- linkIndex = range(4)
- linkIndexS9 = random.sample(linkIndex,1)[0]
- linkIndex.remove(linkIndexS9)
- linkIndexS10 = random.sample(linkIndex,1)[0]
- main.randomLink1 = link1End2top[linkIndexS9]
- main.randomLink2 = link2End2top[linkIndexS10]
- main.randomLink3 = random.sample(link1End2bot,1)[0]
- main.randomLink4 = random.sample(link2End2bot,1)[0]
- # main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="down" )
- # main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="down" )
- main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="down" )
- time.sleep( link_sleep )
- main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="down" )
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli2.topology()
- linkDown = main.ONOSbench.checkStatus(
- topology_output, main.numMNswitches, str(
- int( main.numMNlinks ) - 8 ))
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkDown,
- onpass="Link Down discovered properly",
- onfail="Link down was not discovered in " +
- str( link_sleep ) +
- " seconds" )
-
- main.step( "Verify Ping across all hosts" )
- pingResultLinkDown = main.FALSE
- time1 = time.time()
- pingResultLinkDown = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkDown,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- caseResult74 = linkDown and pingResultLinkDown
- utilities.assert_equals( expect=main.TRUE, actual=caseResult74,
- onpass="Random Link cut Test PASS",
- onfail="Random Link cut Test FAIL" )
-
- def CASE84( self, main ):
- """
- Bring the core links up that are down and verify ping all ( Host Intents-Spine Topo )
- """
- import random
- link1End1 = main.params[ 'SPINECORELINKS' ][ 'linkS9' ]
- link2End1 = main.params[ 'SPINECORELINKS' ][ 'linkS10' ]
- link_sleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
- main.log.report(
- "Bring the core links up that are down and verify ping all (Host Intents-Spine Topo" )
- main.log.report(
- "__________________________________________________________________" )
- main.case(
- "Host intents - Bring the core links up that are down and verify ping all" )
-
- #main.Mininet1.link( END1=link1End1, END2=main.randomLink1, OPTION="up" )
- #main.Mininet1.link( END1=link2End1, END2=main.randomLink2, OPTION="up" )
- main.Mininet1.link( END1=link1End1, END2=main.randomLink3, OPTION="up" )
- time.sleep( link_sleep )
- main.Mininet1.link( END1=link2End1, END2=main.randomLink4, OPTION="up" )
- time.sleep( link_sleep )
-
- topology_output = main.ONOScli2.topology()
- linkUp = main.ONOSbench.checkStatus(
- topology_output,
- main.numMNswitches,
- str( main.numMNlinks ) )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=linkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( link_sleep ) +
- " seconds" )
-
- main.step( "Verify Ping across all hosts" )
- pingResultLinkUp = main.FALSE
- time1 = time.time()
- pingResultLinkUp = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResultLinkUp,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- caseResult84 = linkUp and pingResultLinkUp
- utilities.assert_equals( expect=main.TRUE, actual=caseResult84,
- onpass="Link Up Test PASS",
- onfail="Link Up Test FAIL" )
-
- def CASE90( self ):
- """
- Install 600 point intents and verify ping all (Att Topology)
- """
- main.log.report( "Add 600 point intents and verify pingall (Att Topology)" )
- main.log.report( "_______________________________________" )
- import itertools
- import time
- main.case( "Install 600 point intents" )
- main.step( "Add point Intents" )
- intentResult = main.TRUE
- deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
-
- intentIdList = []
- time1 = time.time()
- for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
- pool = []
- for cli in main.CLIs:
- if i >= len( deviceCombos ):
- break
- t = main.Thread( target=cli.addPointIntent,
- threadID=main.threadID,
- name="addPointIntent",
- args=[deviceCombos[i][0],deviceCombos[i][1],1,1,"IPV4",main.MACsDict.get(deviceCombos[i][0]),main.MACsDict.get(deviceCombos[i][1])])
- pool.append(t)
- #time.sleep(1)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
- intentResult = main.TRUE
- intentsJson = main.ONOScli2.intents()
- getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
- intentsJson = intentsJson)
- print getIntentStateResult
- # Takes awhile for all the onos to get the intents
- time.sleep(60)
- main.step( "Verify Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
- onpass="PING tALL PASS",
- onfail="PING ALL FAIL" )
-
- case90Result = ( intentResult and pingResult )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case90Result,
- onpass="Install 600 point Intents and Ping All test PASS",
- onfail="Install 600 point Intents and Ping All test FAIL" )
-
- def CASE91( self ):
- """
- Install 600 point intents and verify ping all (Chordal Topology)
- """
- main.log.report( "Add 600 point intents and verify pingall (Chordal Topology)" )
- main.log.report( "_______________________________________" )
- import itertools
- import time
- main.case( "Install 600 point intents" )
- main.step( "Add point Intents" )
- intentResult = main.TRUE
- deviceCombos = list( itertools.permutations( main.deviceDPIDs, 2 ) )
-
- intentIdList = []
- time1 = time.time()
- for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
- pool = []
- for cli in main.CLIs:
- if i >= len( deviceCombos ):
- break
- t = main.Thread( target=cli.addPointIntent,
- threadID=main.threadID,
- name="addPointIntent",
- args=[deviceCombos[i][0],deviceCombos[i][1],1,1,"IPV4","",main.MACsDict.get(deviceCombos[i][1])])
- pool.append(t)
- #time.sleep(1)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
- intentResult = main.TRUE
- intentsJson = main.ONOScli2.intents()
- getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
- intentsJson = intentsJson)
- print getIntentStateResult
- # Takes awhile for all the onos to get the intents
- time.sleep(30)
- main.step( "Verify Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- case91Result = ( intentResult and pingResult )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case91Result,
- onpass="Install 600 point Intents and Ping All test PASS",
- onfail="Install 600 point Intents and Ping All test FAIL" )
-
- def CASE92( self ):
- """
- Install 4556 point intents and verify ping all (Spine Topology)
- """
- main.log.report( "Add 4556 point intents and verify pingall (Spine Topology)" )
- main.log.report( "_______________________________________" )
- import itertools
- import time
- main.case( "Install 4556 point intents" )
- main.step( "Add point Intents" )
- intentResult = main.TRUE
- main.pingTimeout = 600
- for i in range(len(main.hostMACs)):
- main.MACsDict[main.deviceDPIDs[i+10]] = main.hostMACs[i].split('/')[0]
- print main.MACsDict
- deviceCombos = list( itertools.permutations( main.deviceDPIDs[10:], 2 ) )
- intentIdList = []
- time1 = time.time()
- for i in xrange( 0, len( deviceCombos ), int(main.numCtrls) ):
- pool = []
- for cli in main.CLIs:
- if i >= len( deviceCombos ):
- break
- t = main.Thread( target=cli.addPointIntent,
- threadID=main.threadID,
- name="addPointIntent",
- args=[deviceCombos[i][0],deviceCombos[i][1],1,1,"IPV4","",main.MACsDict.get(deviceCombos[i][1])])
- pool.append(t)
- #time.sleep(1)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
- intentResult = main.TRUE
- intentsJson = main.ONOScli2.intents()
- getIntentStateResult = main.ONOScli1.getIntentState(intentsId = intentIdList,
- intentsJson = intentsJson)
- #print getIntentStateResult
- # Takes awhile for all the onos to get the intents
- time.sleep(60)
- main.step( "Verify Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
- onpass="PING ALL PASS",
- onfail="PING ALL FAIL" )
-
- case92Result = ( intentResult and pingResult )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case92Result,
- onpass="Install 4556 point Intents and Ping All test PASS",
- onfail="Install 4556 point Intents and Ping All test FAIL" )
-
- def CASE93( self ):
- """
- Install multi-single point intents and verify Ping all works
- for att topology
- """
- import copy
- import time
- main.log.report( "Install multi-single point intents and verify Ping all" )
- main.log.report( "___________________________________________" )
- main.case( "Install multi-single point intents and Ping all" )
- deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
- portIngressList = ['1']*(len(deviceDPIDsCopy) - 1)
- intentIdList = []
- print "MACsDict", main.MACsDict
- time1 = time.time()
- for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
- pool = []
- for cli in main.CLIs:
- egressDevice = deviceDPIDsCopy[i]
- ingressDeviceList = copy.copy(deviceDPIDsCopy)
- ingressDeviceList.remove(egressDevice)
- if i >= len( deviceDPIDsCopy ):
- break
- t = main.Thread( target=cli.addMultipointToSinglepointIntent,
- threadID=main.threadID,
- name="addMultipointToSinglepointIntent",
- args =[ingressDeviceList,egressDevice,portIngressList,'1','IPV4','',main.MACsDict.get(egressDevice)])
- pool.append(t)
- #time.sleep(1)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
- time.sleep(30)
- print "getting all intents ID"
- intentIdTemp = main.ONOScli1.getAllIntentsId()
- print intentIdTemp
- print len(intentIdList)
- print intentIdList
- checkIntentStateResult = main.TRUE
- print "Checking intents state"
- checkIntentStateResult = main.ONOScli1.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
- checkIntentStateResult = main.ONOScli2.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
- checkIntentStateResult = main.ONOScli3.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
- checkIntentStateResult = main.ONOScli4.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
- checkIntentStateResult = main.ONOScli5.checkIntentState( intentsId = intentIdList ) and checkIntentStateResult
-
- if checkIntentStateResult:
- main.log.info( "All intents are installed correctly " )
-
- print "Checking flows state "
- checkFlowsState = main.ONOScli1.checkFlowsState()
- time.sleep(50)
- main.step( "Verify Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
- checkFlowsState = main.ONOScli1.checkFlowsState()
- case93Result = pingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case93Result,
- onpass="Install 25 multi to single point Intents and Ping All test PASS",
- onfail="Install 25 multi to single point Intents and Ping All test FAIL" )
-
- def CASE94( self ):
- """
- Install multi-single point intents and verify Ping all works
- for Chordal topology
- """
- import copy
- import time
- main.log.report( "Install multi-single point intents and verify Ping all" )
- main.log.report( "___________________________________________" )
- main.case( "Install multi-single point intents and Ping all" )
- deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
- portIngressList = ['1']*(len(deviceDPIDsCopy) - 1)
- intentIdList = []
- print "MACsDict", main.MACsDict
- time1 = time.time()
- for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
- pool = []
- for cli in main.CLIs:
- egressDevice = deviceDPIDsCopy[i]
- ingressDeviceList = copy.copy(deviceDPIDsCopy)
- ingressDeviceList.remove(egressDevice)
- if i >= len( deviceDPIDsCopy ):
- break
- t = main.Thread( target=cli.addMultipointToSinglepointIntent,
- threadID=main.threadID,
- name="addMultipointToSinglepointIntent",
- args =[ingressDeviceList,egressDevice,portIngressList,'1','IPV4','',main.MACsDict.get(egressDevice)])
- pool.append(t)
- #time.sleep(1)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
- time.sleep(5)
- main.step( "Verify Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
-
- case94Result = pingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case94Result,
- onpass="Install 25 multi to single point Intents and Ping All test PASS",
- onfail="Install 25 multi to single point Intents and Ping All test FAIL" )
-
- #def CASE95 multi-single point intent for Spine
-
- def CASE96( self ):
- """
- Install single-multi point intents and verify Ping all works
- for att topology
- """
- import copy
- main.log.report( "Install single-multi point intents and verify Ping all" )
- main.log.report( "___________________________________________" )
- main.case( "Install single-multi point intents and Ping all" )
- deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
- portEgressList = ['1']*(len(deviceDPIDsCopy) - 1)
- intentIdList = []
- print "MACsDict", main.MACsDict
- time1 = time.time()
- for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
- pool = []
- for cli in main.CLIs:
- ingressDevice = deviceDPIDsCopy[i]
- egressDeviceList = copy.copy(deviceDPIDsCopy)
- egressDeviceList.remove(ingressDevice)
- if i >= len( deviceDPIDsCopy ):
- break
- t = main.Thread( target=cli.addSinglepointToMultipointIntent,
- threadID=main.threadID,
- name="addSinglepointToMultipointIntent",
- args =[ingressDevice,egressDeviceList,'1',portEgressList,'IPV4',main.MACsDict.get(ingressDevice)])
- pool.append(t)
- #time.sleep(1)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
- time.sleep(5)
- main.step( "Verify Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
-
- case96Result = pingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case96Result,
- onpass="Install 25 single to multi point Intents and Ping All test PASS",
- onfail="Install 25 single to multi point Intents and Ping All test FAIL" )
-
- def CASE97( self ):
- """
- Install single-multi point intents and verify Ping all works
- for Chordal topology
- """
- import copy
- main.log.report( "Install single-multi point intents and verify Ping all" )
- main.log.report( "___________________________________________" )
- main.case( "Install single-multi point intents and Ping all" )
- deviceDPIDsCopy = copy.copy(main.deviceDPIDs)
- portEgressList = ['1']*(len(deviceDPIDsCopy) - 1)
- intentIdList = []
- print "MACsDict", main.MACsDict
- time1 = time.time()
- for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
- pool = []
- for cli in main.CLIs:
- ingressDevice = deviceDPIDsCopy[i]
- egressDeviceList = copy.copy(deviceDPIDsCopy)
- egressDeviceList.remove(ingressDevice)
- if i >= len( deviceDPIDsCopy ):
- break
- t = main.Thread( target=cli.addSinglepointToMultipointIntent,
- threadID=main.threadID,
- name="addSinglepointToMultipointIntent",
- args =[ingressDevice,egressDeviceList,'1',portEgressList,'IPV4',main.MACsDict.get(ingressDevice),''])
- pool.append(t)
- #time.sleep(1)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
- time.sleep(5)
- main.step( "Verify Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
-
- case97Result = pingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case97Result,
- onpass="Install 25 single to multi point Intents and Ping All test PASS",
- onfail="Install 25 single to multi point Intents and Ping All test FAIL" )
-
- def CASE98( self ):
- """
- Install single-multi point intents and verify Ping all works
- for Spine topology
- """
- import copy
- main.log.report( "Install single-multi point intents and verify Ping all" )
- main.log.report( "___________________________________________" )
- main.case( "Install single-multi point intents and Ping all" )
- deviceDPIDsCopy = copy.copy( main.deviceDPIDs )
- deviceDPIDsCopy = deviceDPIDsCopy[ 10: ]
- portEgressList = [ '1' ]*(len(deviceDPIDsCopy) - 1)
- intentIdList = []
- MACsDictCopy = {}
- for i in range( len( deviceDPIDsCopy ) ):
- MACsDictCopy[ deviceDPIDsCopy[ i ] ] = main.hostMACs[i].split( '/' )[ 0 ]
-
- print "deviceDPIDsCopy", deviceDPIDsCopy
- print ""
- print "MACsDictCopy", MACsDictCopy
- time1 = time.time()
- for i in xrange(0,len(deviceDPIDsCopy),int(main.numCtrls)):
- pool = []
- for cli in main.CLIs:
- if i >= len( deviceDPIDsCopy ):
- break
- ingressDevice = deviceDPIDsCopy[i]
- egressDeviceList = copy.copy(deviceDPIDsCopy)
- egressDeviceList.remove(ingressDevice)
- t = main.Thread( target=cli.addSinglepointToMultipointIntent,
- threadID=main.threadID,
- name="addSinglepointToMultipointIntent",
- args =[ingressDevice,egressDeviceList,'1',portEgressList,'IPV4',MACsDictCopy.get(ingressDevice),''])
- pool.append(t)
- #time.sleep(1)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- time2 = time.time()
- main.log.info("Time for adding point intents: %2f seconds" %(time2-time1))
- time.sleep(5)
- main.step( "Verify Ping across all hosts" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall(timeout=main.pingTimeout,shortCircuit=False,acceptableFailed=5)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
-
- case98Result = pingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case98Result,
- onpass="Install 25 single to multi point Intents and Ping All test PASS",
- onfail="Install 25 single to multi point Intents and Ping All test FAIL" )
-
- def CASE10( self ):
- import time
- """
- Remove all Intents
- """
- main.log.report( "Remove all intents that were installed previously" )
- main.log.report( "______________________________________________" )
- main.log.info( "Remove all intents" )
- main.case( "Removing intents" )
- main.step( "Obtain the intent id's first" )
- intentsList = main.ONOScli1.getAllIntentIds()
- ansi_escape = re.compile( r'\x1b[^m]*m' )
- intentsList = ansi_escape.sub( '', intentsList )
- intentsList = intentsList.replace(
- " onos:intents | grep id=",
- "" ).replace(
- "id=",
- "" ).replace(
- "\r\r",
- "" )
- intentsList = intentsList.splitlines()
- #intentsList = intentsList[ 1: ]
- intentIdList = []
- step1Result = main.TRUE
- moreIntents = main.TRUE
- removeIntentCount = 0
- intentsCount = len(intentsList)
- main.log.info ( "Current number of intents: " + str(intentsCount) )
- if ( len( intentsList ) > 1 ):
- results = main.TRUE
- main.log.info("Removing intent...")
- while moreIntents:
- #This is a work around for a major issue. We cycle through intents removal for up to 5 times.
- if removeIntentCount == 5:
- break
- removeIntentCount = removeIntentCount + 1
- intentsList1 = main.ONOScli1.getAllIntentIds()
- if len( intentsList1 ) == 0:
- break
- ansi_escape = re.compile( r'\x1b[^m]*m' )
- intentsList1 = ansi_escape.sub( '', intentsList1 )
- intentsList1 = intentsList1.replace(
- " onos:intents | grep id=",
- "" ).replace(
- " state=",
- "" ).replace(
- "\r\r",
- "" )
- intentsList1 = intentsList1.splitlines()
- #intentsList1 = intentsList1[ 1: ]
- main.log.info ( "Round %d intents to remove: " %(removeIntentCount) )
- print intentsList1
- intentIdList1 = []
- if ( len( intentsList1 ) > 0 ):
- moreIntents = main.TRUE
- for i in range( len( intentsList1 ) ):
- intentsTemp1 = intentsList1[ i ].split( ',' )
- intentIdList1.append( intentsTemp1[ 0 ].split('=')[1] )
- main.log.info ( "Leftover Intent IDs: " + str(intentIdList1) )
- main.log.info ( "Length of Leftover Intents list: " + str(len(intentIdList1)) )
- time1 = time.time()
- for i in xrange( 0, len( intentIdList1 ), int(main.numCtrls) ):
- pool = []
- for cli in main.CLIs:
- if i >= len( intentIdList1 ):
- break
- t = main.Thread( target=cli.removeIntent,
- threadID=main.threadID,
- name="removeIntent",
- args=[intentIdList1[i],'org.onosproject.cli',False,False])
- pool.append(t)
- t.start()
- i = i + 1
- main.threadID = main.threadID + 1
- for thread in pool:
- thread.join()
- intentIdList.append(thread.result)
- #time.sleep(2)
- time2 = time.time()
- main.log.info("Time for removing host intents: %2f seconds" %(time2-time1))
- time.sleep(10)
- main.log.info("Purging WITHDRAWN Intents")
- purgeResult = main.ONOScli2.purgeIntents()
- else:
- time.sleep(10)
- if len( main.ONOScli1.intents()):
- continue
- break
- time.sleep(10)
- else:
- print "Removed %d intents" %(intentsCount)
- step1Result = main.TRUE
- else:
- print "No Intent IDs found in Intents list: ", intentsList
- step1Result = main.FALSE
-
- print main.ONOScli1.intents()
- caseResult10 = step1Result
- utilities.assert_equals( expect=main.TRUE, actual=caseResult10,
- onpass="Intent removal test successful",
- onfail="Intent removal test failed" )
-
- def CASE12( self, main ):
- """
- Enable onos-app-ifwd, Verify Intent based Reactive forwarding through ping all and Disable it
- """
- import re
- import copy
- import time
-
- Thread = imp.load_source('Thread','/home/admin/ONLabTest/TestON/tests/OnosCHO/Thread.py')
- threadID = 0
-
- main.log.report( "Enable Intent based Reactive forwarding and Verify ping all" )
- main.log.report( "_____________________________________________________" )
- main.case( "Enable Intent based Reactive forwarding and Verify ping all" )
- main.step( "Enable intent based Reactive forwarding" )
- installResult = main.FALSE
- feature = "onos-app-ifwd"
-
- pool = []
- time1 = time.time()
- for cli,feature in main.CLIs:
- t = main.Thread(target=cli,threadID=threadID,
- name="featureInstall",args=[feature])
- pool.append(t)
- t.start()
- threadID = threadID + 1
-
- results = []
- for thread in pool:
- thread.join()
- results.append(thread.result)
- time2 = time.time()
-
- if( all(result == main.TRUE for result in results) == False):
- main.log.info("Did not install onos-app-ifwd feature properly")
- #main.cleanup()
- #main.exit()
- else:
- main.log.info("Successful feature:install onos-app-ifwd")
- installResult = main.TRUE
- main.log.info("Time for feature:install onos-app-ifwd: %2f seconds" %(time2-time1))
-
- main.step( "Verify Pingall" )
- ping_result = main.FALSE
- time1 = time.time()
- ping_result = main.Mininet1.pingall(timeout=600)
- time2 = time.time()
- timeDiff = round( ( time2 - time1 ), 2 )
- main.log.report(
- "Time taken for Ping All: " +
- str( timeDiff ) +
- " seconds" )
-
- if ping_result == main.TRUE:
- main.log.report( "Pingall Test in Reactive mode successful" )
- else:
- main.log.report( "Pingall Test in Reactive mode failed" )
-
- main.step( "Disable Intent based Reactive forwarding" )
- uninstallResult = main.FALSE
-
- pool = []
- time1 = time.time()
- for cli,feature in main.CLIs:
- t = main.Thread(target=cli,threadID=threadID,
- name="featureUninstall",args=[feature])
- pool.append(t)
- t.start()
- threadID = threadID + 1
-
- results = []
- for thread in pool:
- thread.join()
- results.append(thread.result)
- time2 = time.time()
-
- if( all(result == main.TRUE for result in results) == False):
- main.log.info("Did not uninstall onos-app-ifwd feature properly")
- uninstallResult = main.FALSE
- #main.cleanup()
- #main.exit()
- else:
- main.log.info("Successful feature:uninstall onos-app-ifwd")
- uninstallResult = main.TRUE
- main.log.info("Time for feature:uninstall onos-app-ifwd: %2f seconds" %(time2-time1))
-
- # Waiting for reative flows to be cleared.
- time.sleep( 10 )
-
- case11Result = installResult and ping_result and uninstallResult
- utilities.assert_equals( expect=main.TRUE, actual=case11Result,
- onpass="Intent based Reactive forwarding Pingall test PASS",
- onfail="Intent based Reactive forwarding Pingall test FAIL" )
-
- def CASE99(self):
- import time
- # WORK AROUND FOR ONOS-581. STOP ONOS BEFORE ASSIGNING CONTROLLERS AT MININET & START ONCE DONE
- main.step( "Stop ONOS on all Nodes" )
- stopResult = main.TRUE
- for i in range( 1, int( main.numCtrls ) + 1 ):
- ONOS_ip = main.params[ 'CTRL' ][ 'ip' + str( i ) ]
- main.log.info( "Stopping ONOS Node IP: " + ONOS_ip )
- sresult = main.ONOSbench.onosStop( ONOS_ip )
- utilities.assert_equals( expect=main.TRUE, actual=sresult,
- onpass="Test step PASS",
- onfail="Test step FAIL" )
- stopResult = ( stopResult and sresult )
-
- main.step( "Start ONOS on all Nodes" )
- startResult = main.TRUE
- for i in range( 1, int( main.numCtrls ) + 1 ):
- ONOS_ip = main.params[ 'CTRL' ][ 'ip' + str( i ) ]
- main.log.info( "Starting ONOS Node IP: " + ONOS_ip )
- sresult = main.ONOSbench.onosStart( ONOS_ip )
- utilities.assert_equals( expect=main.TRUE, actual=sresult,
- onpass="Test step PASS",
- onfail="Test step FAIL" )
- startResult = ( startResult and sresult )
-
- main.step( "Start ONOS CLI on all nodes" )
- cliResult = main.TRUE
- time.sleep( 30 )
- main.log.step(" Start ONOS cli using thread ")
- pool = []
- time1 = time.time()
- for i in range( int( main.numCtrls ) ):
- t = main.Thread(target=main.CLIs[i].startOnosCli,
- threadID=main.threadID,
- name="startOnosCli",
- args=[main.nodes[i].ip_address])
- pool.append(t)
- t.start()
- main.threadID = main.threadID + 1
- for t in pool:
- t.join()
- cliResult = cliResult and t.result
- time2 = time.time()
-
- if not cliResult:
- main.log.info("ONOS CLI did not start up properly")
- #main.cleanup()
- #main.exit()
- else:
- main.log.info("Successful CLI startup")
- main.log.info("Time for connecting to CLI: %2f seconds" %(time2-time1))
-
- case99Result = ( startResult and cliResult )
- time.sleep(30)
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case99Result,
- onpass="Starting new Chordal topology test PASS",
- onfail="Starting new Chordal topology test FAIL" )
-
-
-
-
-
diff --git a/TestON/tests/OnosCHO/OnosCHO.topo b/TestON/tests/OnosCHO/OnosCHO.topo
deleted file mode 100644
index 8205d2f..0000000
--- a/TestON/tests/OnosCHO/OnosCHO.topo
+++ /dev/null
@@ -1,99 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.128.40.40</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS>
- <home>~/ONOS</home>
- </COMPONENTS>
- </ONOSbench>
-
- <ONOScli1>
- <host>10.128.40.40</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli1>
-
- <ONOScli2>
- <host>10.128.40.40</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli2>
-
- <ONOScli3>
- <host>10.128.40.40</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli3>
-
- <ONOS1>
- <host>10.128.40.41</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.128.40.42</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.128.40.43</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
- <Mininet1>
- <host>10.128.40.50</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>12</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/att-mpls-topo.py </arg1>
- <arg2> --topo att </arg2>
- <arg3> --link tc --switch ovs,protocols=OpenFlow13 </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet1>
-
- <Mininet2>
- <host>10.128.40.50</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>13</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/att-mpls-topo.py </arg1>
- <arg2> --topo att </arg2>
- <arg3> --link tc --switch ovs,protocols=OpenFlow13 </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet2>
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/OnosCHO/__init__.py b/TestON/tests/OnosCHO/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/OnosCHO/__init__.py
+++ /dev/null
diff --git a/TestON/tests/PeeringRouterTest/PeeringRouterTest.params b/TestON/tests/PeeringRouterTest/PeeringRouterTest.params
deleted file mode 100755
index 0c4af63..0000000
--- a/TestON/tests/PeeringRouterTest/PeeringRouterTest.params
+++ /dev/null
@@ -1,26 +0,0 @@
-<PARAMS>
-
- <testcases>5,7,8,9,31,32</testcases>
-
- #Environment variables
- <ENV>
- <cellName>sdnip_single_instance</cellName>
- <home>/home/admin/ONLabTest/TestON/tests/PeeringRouterTest</home>
- </ENV>
-
- <CTRL>
- <ip1>127.0.0.1</ip1>
- <port1>6633</port1>
- </CTRL>
-
- <GIT>
- <autoPull>off</autoPull>
- <checkout>master</checkout>
- </GIT>
-
- <JSON>
- <prefix>prefix</prefix>
- <nextHop>nextHop</nextHop>
- </JSON>
-
-</PARAMS>
diff --git a/TestON/tests/PeeringRouterTest/PeeringRouterTest.py b/TestON/tests/PeeringRouterTest/PeeringRouterTest.py
deleted file mode 100755
index fec9365..0000000
--- a/TestON/tests/PeeringRouterTest/PeeringRouterTest.py
+++ /dev/null
@@ -1,2537 +0,0 @@
-# from cupshelpers.config import prefix
-
-# Testing the basic functionality of SDN-IP
-
-class PeeringRouterTest:
-
- def __init__( self ):
- self.default = ''
-
-
- def CASE6 ( self, main):
-
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- TESTCASE_ROOT_PATH = main.params[ 'ENV' ][ 'home' ]
- TESTCASE_MININET_ROOT_PATH = TESTCASE_ROOT_PATH + "/vlan/mininet"
- # Launch mininet topology for this case
- MININET_TOPO_FILE = TESTCASE_MININET_ROOT_PATH + "/PeeringRouterMininetVlan.py"
- main.step( "Launch mininet" )
- main.Mininet.handle.sendline("sudo python " + MININET_TOPO_FILE + " " + TESTCASE_MININET_ROOT_PATH)
- main.step("waiting 20 secs for all switches and quagga instances to comeup")
- time.sleep(20)
- main.step( "Test whether Mininet is started" )
-
- #============================= Ping Test ========================
- main.log.info("Start ping test")
-
- for m in range( 3, 6 ):
- for n in range( 1, 11 ):
- hostIp = str( m ) + ".0." + str( n ) + ".1"
- pingTestResults = main.Mininet.pingHost(SRC="as2host", TARGET=hostIp)
-
- if pingTestResults:
- main.log.info("Test succeeded")
- else:
- main.log.info("Test failed")
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
-
- def CASE4( self, main):
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- main.case("The test case is to help to setup the TestON environment \
- and test new drivers" )
- TESTCASE_ROOT_PATH = main.params[ 'ENV' ][ 'home' ]
- TESTCASE_MININET_ROOT_PATH = TESTCASE_ROOT_PATH + "/mininet"
- SDNIPJSONFILEPATH = TESTCASE_ROOT_PATH + "/sdnip.json"
- main.log.info("sdnip.json file path: "+ SDNIPJSONFILEPATH)
-
- # Copy the json files to config dir
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/addresses.json ~/onos/tools/package/config/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/sdnip.json ~/onos/tools/package/config/")
-
- # Launch mininet topology for this case
- MININET_TOPO_FILE = TESTCASE_MININET_ROOT_PATH + "/PeeringRouterMininet.py"
- main.step( "Launch mininet" )
- main.Mininet.handle.sendline("sudo python " + MININET_TOPO_FILE + " " + TESTCASE_MININET_ROOT_PATH)
- main.step("waiting 20 secs for all switches and quagga instances to comeup")
- time.sleep(20)
- main.step( "Test whether Mininet is started" )
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
-
- main.log.info( "Generate prefixes for host3" )
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host5" )
- prefixesHost5 = main.QuaggaCliHost5.generatePrefixes( 5, 10 )
- main.log.info( prefixesHost5 )
- for prefix in prefixesHost5:
- allRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- routeIntentsExpectedHost5 = \
- main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
- prefixesHost5, "192.168.60.1", "00:00:00:00:06:02",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4 + routeIntentsExpectedHost5
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f", node=ONOS1Ip )
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- main.step( "Start ONOS-cli" )
-
- main.ONOScli.startOnosCli( ONOS1Ip )
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing bgprouter feature" )
- main.ONOScli.featureInstall( "onos-app-bgprouter" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
-
- main.log.info( "Login Quagga CLI on host5" )
- main.QuaggaCliHost5.loginQuagga( "1.168.30.5" )
- main.log.info( "Enter configuration model of Quagga CLI on host5" )
- main.QuaggaCliHost5.enterConfig( 64521 )
- main.log.info( "Add routes to Quagga on host5" )
- main.QuaggaCliHost5.addRoutes( prefixesHost5, 1 )
-
- time.sleep( 30 )
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.QuaggaCliHost.pingTestAndCheckAllPass( "1.168.30.100" )
- main.log.info("Ping test result")
- if pingTestResults:
- main.log.info("Test succeeded")
- else:
- main.log.info("Test failed")
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
- main.QuaggaCliHost5.deleteRoutes( prefixesHost5, 1 )
-
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report( "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.QuaggaCliHost.pingTestAndCheckAllFail( "1.168.30.100" )
- main.log.info("Ping test result")
- if pingTestResults:
- main.log.info("Test succeeded")
- else:
- main.log.info("Test failed")
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="disconnect check PASS",
- onfail="disconnect check FAIL")
-
- main.ONOScli.logout()
- main.ONOSbench.onosStop(ONOS1Ip);
- main.Mininet.stopNet()
- time.sleep(10)
-
- def CASE5( self, main ):
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- main.case("The test case is to help to setup the TestON environment \
- and test new drivers" )
- TESTCASE_ROOT_PATH = main.params[ 'ENV' ][ 'home' ]
- TESTCASE_MININET_ROOT_PATH = TESTCASE_ROOT_PATH + "/vlan/mininet"
- SDNIPJSONFILEPATH = TESTCASE_ROOT_PATH + "/vlan/sdnip.json"
- main.log.info("sdnip.json file path: "+ SDNIPJSONFILEPATH)
-
- # Copy the json files to config dir
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/vlan/addresses.json ~/onos/tools/package/config/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/vlan/sdnip.json ~/onos/tools/package/config/")
-
- # Launch mininet topology for this case
- MININET_TOPO_FILE = TESTCASE_MININET_ROOT_PATH + "/PeeringRouterMininetVlan.py"
- main.step( "Launch mininet" )
- main.Mininet.handle.sendline("sudo python " + MININET_TOPO_FILE + " " + TESTCASE_MININET_ROOT_PATH)
- main.step("waiting 20 secs for all switches and quagga instances to comeup")
- time.sleep(20)
- main.step( "Test whether Mininet is started" )
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
-
- main.log.info( "Generate prefixes for host3" )
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host5" )
- prefixesHost5 = main.QuaggaCliHost5.generatePrefixes( 5, 10 )
- main.log.info( prefixesHost5 )
- for prefix in prefixesHost5:
- allRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- routeIntentsExpectedHost5 = \
- main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
- prefixesHost5, "192.168.60.1", "00:00:00:00:06:02",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4 + routeIntentsExpectedHost5
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- # Copy the cfg files to config dir
- main.log.info("Copying two cfg files to onos etc folder")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f", node=ONOS1Ip )
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- main.step( "Start ONOS-cli" )
-
- main.ONOScli.startOnosCli( ONOS1Ip )
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing bgprouter feature" )
- main.ONOScli.featureInstall( "onos-app-bgprouter" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
-
- main.log.info( "Login Quagga CLI on host5" )
- main.QuaggaCliHost5.loginQuagga( "1.168.30.5" )
- main.log.info( "Enter configuration model of Quagga CLI on host5" )
- main.QuaggaCliHost5.enterConfig( 64521 )
- main.log.info( "Add routes to Quagga on host5" )
- main.QuaggaCliHost5.addRoutes( prefixesHost5, 1 )
-
- time.sleep( 30 )
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- time.sleep(20)
-
- #============================= Ping Test ========================
- pingTestResults = main.TRUE
- sources = ["as2host", "as3host", "as6host"]
- targets = ["192.168.10.101", "192.168.20.101", "192.168.30.101", "192.168.60.101"]
- for source in sources:
- for target in targets:
- r = main.Mininet.pingHost(SRC=source, TARGET=target)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Router connectivity check PASS",
- onfail="Router connectivity check FAIL")
-
- pingTestResults = main.TRUE
- for m in range( 3, 6 ):
- for n in range( 1, 10 ):
- hostIp = str( m ) + ".0." + str( n ) + ".1"
- r = main.Mininet.pingHost(SRC="as2host", TARGET=hostIp)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- time.sleep(20)
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
- main.QuaggaCliHost5.deleteRoutes( prefixesHost5, 1 )
-
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report( "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
-
- time.sleep(10)
- #============================= Ping Test ========================
- pingTestResults = main.TRUE
- for m in range( 4, 6 ):
- for n in range( 1, 10 ):
- hostIp = str( m ) + ".0." + str( n ) + ".1"
- r = main.Mininet.pingHost(SRC="as2host", TARGET=hostIp)
- if r == main.TRUE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="disconnect check PASS",
- onfail="disconnect check FAIL")
-
-
- time.sleep(20);
-
- main.ONOScli.logout()
- main.log.info("ONOS cli logout")
- time.sleep(20);
- main.ONOSbench.onosStop(ONOS1Ip);
- main.log.info("onos stop")
- time.sleep(20);
- main.Mininet.stopNet()
- main.log.info("mininet stop")
- time.sleep(20)
-
-
- def CASE7( self, main ):
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- main.case("The test case is to help to setup the TestON environment \
- and test new drivers" )
- TESTCASE_ROOT_PATH = main.params[ 'ENV' ][ 'home' ]
- TESTCASE_MININET_ROOT_PATH = TESTCASE_ROOT_PATH + "/vlan/mininet"
- SDNIPJSONFILEPATH = TESTCASE_ROOT_PATH + "/vlan/sdnip.json"
- main.log.info("sdnip.json file path: "+ SDNIPJSONFILEPATH)
-
- # Copy the json files to config dir
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/vlan/addresses.json ~/onos/tools/package/config/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/vlan/sdnip.json ~/onos/tools/package/config/")
-
- # Launch mininet topology for this case
- MININET_TOPO_FILE = TESTCASE_MININET_ROOT_PATH + "/PeeringRouterMininetVlan.py"
- main.step( "Launch mininet" )
- main.Mininet.handle.sendline("sudo python " + MININET_TOPO_FILE + " " + TESTCASE_MININET_ROOT_PATH)
- main.step("waiting 20 secs for all switches and quagga instances to comeup")
- time.sleep(20)
- main.step( "Test whether Mininet is started" )
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
-
- main.log.info( "Generate prefixes for host3" )
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 3500 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 3500 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host5" )
- prefixesHost5 = main.QuaggaCliHost5.generatePrefixes( 5, 3500 )
- main.log.info( prefixesHost5 )
- for prefix in prefixesHost5:
- allRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- routeIntentsExpectedHost5 = \
- main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
- prefixesHost5, "192.168.60.1", "00:00:00:00:06:02",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4 + routeIntentsExpectedHost5
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- # Copy the cfg files to config dir
- main.log.info("Copying two cfg files to onos etc folder")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f", node=ONOS1Ip )
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- main.step( "Start ONOS-cli" )
-
- main.ONOScli.startOnosCli( ONOS1Ip )
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing bgprouter feature" )
- main.ONOScli.featureInstall( "onos-app-bgprouter" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- time.sleep(20)
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
-
- time.sleep(20)
-
- main.log.info( "Login Quagga CLI on host5" )
- main.QuaggaCliHost5.loginQuagga( "1.168.30.5" )
- main.log.info( "Enter configuration model of Quagga CLI on host5" )
- main.QuaggaCliHost5.enterConfig( 64521 )
- main.log.info( "Add routes to Quagga on host5" )
- main.QuaggaCliHost5.addRoutes( prefixesHost5, 1 )
-
- time.sleep(60)
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- time.sleep(20)
-
-
- #============================= Ping Test ========================
- pingTestResults = main.TRUE
- for m in range( 3, 6 ):
- for n in range( 1, 10 ):
- hostIp = str( m ) + ".0." + str( n ) + ".1"
- r = main.Mininet.pingHost(SRC="as2host", TARGET=hostIp)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- time.sleep(10)
-
- main.ONOScli.logout()
- main.log.info("ONOS cli logout")
- time.sleep(20);
- main.ONOSbench.onosStop(ONOS1Ip);
- main.log.info("onos stop")
- time.sleep(20);
- main.Mininet.stopNet()
- main.log.info("mininet stop")
- time.sleep(20)
-
- # Route flap test (Add a route and detele it very fast 20 times) in VLAN configuration
- def CASE8( self, main ):
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- main.case("The test case is to help to setup the TestON environment \
- and test new drivers" )
- TESTCASE_ROOT_PATH = main.params[ 'ENV' ][ 'home' ]
- TESTCASE_MININET_ROOT_PATH = TESTCASE_ROOT_PATH + "/vlan/mininet"
- SDNIPJSONFILEPATH = TESTCASE_ROOT_PATH + "/vlan/sdnip.json"
- main.log.info("sdnip.json file path: "+ SDNIPJSONFILEPATH)
-
- # Copy the json files to config dir
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/vlan/addresses.json ~/onos/tools/package/config/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/vlan/sdnip.json ~/onos/tools/package/config/")
-
- # Launch mininet topology for this case
- MININET_TOPO_FILE = TESTCASE_MININET_ROOT_PATH + "/PeeringRouterMininetVlan.py"
- main.step( "Launch mininet" )
- main.Mininet.handle.sendline("sudo python " + MININET_TOPO_FILE + " " + TESTCASE_MININET_ROOT_PATH)
- main.step("waiting 20 secs for all switches and quagga instances to comeup")
- time.sleep(20)
- main.step( "Test whether Mininet is started" )
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
-
- main.log.info( "Generate prefixes for host3" )
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 1 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host5" )
- prefixesHost5 = main.QuaggaCliHost5.generatePrefixes( 5, 1 )
- main.log.info( prefixesHost5 )
- for prefix in prefixesHost5:
- allRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- routeIntentsExpectedHost5 = \
- main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
- prefixesHost5, "192.168.60.1", "00:00:00:00:06:02",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost5
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- # Copy the cfg files to config dir
- main.log.info("Copying two cfg files to onos etc folder")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f", node=ONOS1Ip )
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- main.step( "Start ONOS-cli" )
-
- main.ONOScli.startOnosCli( ONOS1Ip )
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing bgprouter feature" )
- main.ONOScli.featureInstall( "onos-app-bgprouter" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
-
- main.log.info( "Login Quagga CLI on host5" )
- main.QuaggaCliHost5.loginQuagga( "1.168.30.5" )
- main.log.info( "Enter configuration model of Quagga CLI on host5" )
- main.QuaggaCliHost5.enterConfig( 64521 )
- main.log.info( "Add routes to Quagga on host5" )
- main.QuaggaCliHost5.addRoutes( prefixesHost5, 1 )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add and delete a route to Quagga on host3 20 times" )
- for i in range(0, 20):
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
- main.log.info("Add a route %s times", i)
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.log.info("Delete the route")
- time.sleep(0.1)
-
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
- main.log.info("Add the route finally and wait for 10 sec")
-
- #============================= Ping Test ========================
- for j in range(0, 30):
- r = main.Mininet.pingHost(SRC="as6host", TARGET="3.0.0.1")
-
- utilities.assert_equals(expect=main.TRUE,actual=r,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- #time.sleep(20)
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add and delete a route to Quagga on host3 20 times" )
- for i in range(0, 20):
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
- main.log.info("Add a route %s times", i)
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.log.info("Delete the route")
- time.sleep(0.1)
-
- main.QuaggaCliHost5.deleteRoutes( prefixesHost5, 1 )
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = []
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
-
- for j in range(0, 5):
- r = main.Mininet.pingHost(SRC="as6host", TARGET="3.0.0.1")
-
- utilities.assert_equals(expect=main.FALSE,actual=r,
- onpass="disconnectivity check PASS",
- onfail="disconnectivity check FAIL")
-
- main.ONOScli.logout()
- main.log.info("ONOS cli logout")
- time.sleep(20);
- main.ONOSbench.onosStop(ONOS1Ip);
- main.log.info("onos stop")
- time.sleep(20);
- main.Mininet.stopNet()
- main.log.info("mininet stop")
- time.sleep(20)
-
- # Route flap test (change the next-hop very fast 20 times) in VLAN configuration
- def CASE9( self, main):
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- main.case("The test case is to help to setup the TestON environment \
- and test new drivers" )
- TESTCASE_ROOT_PATH = main.params[ 'ENV' ][ 'home' ]
- TESTCASE_MININET_ROOT_PATH = TESTCASE_ROOT_PATH + "/vlan/routeconvergence/mininet"
- SDNIPJSONFILEPATH = TESTCASE_ROOT_PATH + "/vlan/sdnip.json"
- main.log.info("sdnip.json file path: "+ SDNIPJSONFILEPATH)
-
- # Copy the json files to config dir
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/vlan/addresses.json ~/onos/tools/package/config/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/vlan/sdnip.json ~/onos/tools/package/config/")
-
- # Launch mininet topology for this case
- MININET_TOPO_FILE = TESTCASE_MININET_ROOT_PATH + "/PeeringRouterConvergenceVlanMininet.py"
- main.step( "Launch mininet" )
- main.Mininet.handle.sendline("sudo python " + MININET_TOPO_FILE + " " + TESTCASE_MININET_ROOT_PATH)
- main.step("waiting 20 secs for all switches and quagga instances to comeup")
- time.sleep(20)
- main.step( "Test whether Mininet is started" )
- main.log.info( "Login Quagga CLI on host3" )
- result = main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- #if result is not main.TRUE:
- # main.log.report("Mininet is not started...Aborting")
- # main.Mininet.stopNet()
- # main.cleanup()
- # main.exit()
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
- main.log.info( "Generate prefixes for host3" )
-
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host5" )
- prefixesHost5 = main.QuaggaCliHost5.generatePrefixes( 5, 10 )
- main.log.info( prefixesHost5 )
- for prefix in prefixesHost5:
- allRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- routeIntentsExpectedHost5 = \
- main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
- prefixesHost5, "192.168.60.1", "00:00:00:00:06:02",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4 + routeIntentsExpectedHost5
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
- utilities.assert_equals(expect=main.TRUE,actual=verifyResult,onpass="Verify cell pass!",onfail="Verify cell failed...")
-
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- # Copy the cfg files to config dir
- main.log.info("Copying two cfg files to onos etc folder")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f", node=ONOS1Ip )
- if onos1InstallResult is not main.TRUE:
- main.log.report("ONOS is not installed...Aborting")
- main.Mininet.stopNet()
- main.cleanup()
- main.exit()
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if onos1Isup is not main.TRUE:
- main.log.report("ONOS1 didn't start!...Aborting" )
- main.Mininet.stopNet()
- main.ONOSbench.onosStop(ONOS1Ip);
- main.cleanup()
- main.exit()
-
- main.step( "Start ONOS-cli" )
-
- result = main.ONOScli.startOnosCli( ONOS1Ip )
- utilities.assert_equals(expect=main.TRUE,actual=result,onpass="ONOS CLI is up!",onfail="ONOS CLI is not up...")
- if result is not main.TRUE:
- main.log.report("ONOS1 didn't start!...Aborting" )
- main.Mininet.stopNet()
- main.ONOScli.logout()
- main.ONOSbench.onosStop(ONOS1Ip);
- main.cleanup()
- main.exit()
-
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing bgprouter feature" )
- main.ONOScli.featureInstall( "onos-app-bgprouter" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
-
- main.log.info( "Login Quagga CLI on host5" )
- main.QuaggaCliHost5.loginQuagga( "1.168.30.5" )
- main.log.info( "Enter configuration model of Quagga CLI on host5" )
- main.QuaggaCliHost5.enterConfig( 64521 )
- main.log.info( "Add routes to Quagga on host5" )
- main.QuaggaCliHost5.addRoutes( prefixesHost5, 1 )
-
- time.sleep( 30 )
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- #============= Flap the BGP session between QuaggaCliHost4 and ONOS ==================
- main.log.info( "Disabling bgp session and enable it 20 times very fast between QuaggaCliHost4 and 192.168.30.101:" )
- for i in range(0, 20):
- main.log.info("Disable it %s times", i)
- main.QuaggaCliHost4.disable_bgp_peer( "192.168.30.101", "64513")
- main.log.info("Enable it again")
- main.QuaggaCliHost4.enable_bgp_peer( "192.168.30.101", "64513" )
- time.sleep(0.1)
- main.log.info("Disable it finally")
- main.QuaggaCliHost4.disable_bgp_peer( "192.168.30.101", "64513")
-
- main.log.info( "Sleeping for 30 seconds for network to converge" )
- time.sleep(30)
- # get routes inside SDN-IP
- main.log.info( "Getting Routes from ONOS CLI" )
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- newAllRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- newAllRoutesStrActual = str( newAllRoutesActual ).replace( 'u', "" )
-
- # Expected routes with changed next hop
- newAllRoutesExpected = []
- for prefix in prefixesHost3:
- newAllRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- for prefix in prefixesHost4:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- for prefix in prefixesHost5:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- newAllRoutesStrExpected = str( sorted( newAllRoutesExpected ) )
- main.step( "Check routes installed after convergence-1" )
- main.log.info( "Routes expected:" )
- main.log.info( newAllRoutesStrExpected )
- main.log.info( "Routes got from ONOS CLI after convergence-1:" )
- main.log.info( newAllRoutesStrActual )
- utilities.assertEquals(
- expect=newAllRoutesStrExpected, actual=newAllRoutesStrActual,
- onpass="***Routes in SDN-IP are correct after convergence!***",
- onfail="***Routes in SDN-IP are wrong after convergence!***" )
- if( eq( newAllRoutesStrExpected, newAllRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after convergence are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after convergence are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.TRUE
- for m in range( 3, 6 ):
- for n in range( 1, 10 ):
- hostIp = str( m ) + ".0." + str( n ) + ".1"
- r = main.Mininet.pingHost(SRC="as2host", TARGET=hostIp)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- #============= Flap the BGP session between QuaggaCliHost4 and ONOS ==================
- main.log.info( "Disabling bgp session and enable it 20 times very fast between QuaggaCliHost4 and 192.168.30.101:" )
- for i in range(0, 20):
- main.log.info("Disable it %s times", i)
- main.QuaggaCliHost4.disable_bgp_peer( "192.168.30.101", "64513")
- main.log.info("Enable it again")
- main.QuaggaCliHost4.enable_bgp_peer( "192.168.30.101", "64513" )
- time.sleep(0.1)
-
- main.log.info( "Sleeping for 30 seconds for network to converge" )
- time.sleep(30)
-
- # get routes inside SDN-IP
- main.log.info( "Getting Routes from ONOS CLI" )
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- newAllRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- newAllRoutesStrActual = str( newAllRoutesActual ).replace( 'u', "" )
-
- # Expected routes with changed next hop
- newAllRoutesExpected = []
- for prefix in prefixesHost3:
- newAllRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- for prefix in prefixesHost4:
- newAllRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- for prefix in prefixesHost5:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- newAllRoutesStrExpected = str( sorted( newAllRoutesExpected ) )
- main.step( "Check routes installed after convergence-2" )
- main.log.info( "Routes expected:" )
- main.log.info( newAllRoutesStrExpected )
- main.log.info( "Routes got from ONOS CLI after convergence-2:" )
- main.log.info( newAllRoutesStrActual )
- utilities.assertEquals(
- expect=newAllRoutesStrExpected, actual=newAllRoutesStrActual,
- onpass="***Routes in SDN-IP are correct after convergence!***",
- onfail="***Routes in SDN-IP are wrong after convergence!***" )
- if( eq( newAllRoutesStrExpected, newAllRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after convergence are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after convergence are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.TRUE
- for m in range( 3, 6 ):
- for n in range( 1, 10 ):
- hostIp = str( m ) + ".0." + str( n ) + ".1"
- r = main.Mininet.pingHost(SRC="as2host", TARGET=hostIp)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- main.ONOScli.logout()
- main.log.info("ONOS cli logout")
- time.sleep(20);
- main.ONOSbench.onosStop(ONOS1Ip);
- main.log.info("onos stop")
- time.sleep(20);
- main.Mininet.stopNet()
- main.log.info("mininet stop")
- time.sleep(20)
-
- # Route convergence and connectivity test
- def CASE21( self, main):
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- main.case("The test case is to help to setup the TestON environment \
- and test new drivers" )
- TESTCASE_ROOT_PATH = main.params[ 'ENV' ][ 'home' ]
- TESTCASE_MININET_ROOT_PATH = TESTCASE_ROOT_PATH + "/routeconvergence/mininet"
- SDNIPJSONFILEPATH = TESTCASE_ROOT_PATH + "/sdnip.json"
- main.log.info("sdnip.json file path: "+ SDNIPJSONFILEPATH)
-
- # Copy the json files to config dir
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/addresses.json ~/onos/tools/package/config/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/sdnip.json ~/onos/tools/package/config/")
-
- # Launch mininet topology for this case
- MININET_TOPO_FILE = TESTCASE_MININET_ROOT_PATH + "/PeeringRouterConvergenceMininet.py"
- main.step( "Launch mininet" )
- main.Mininet.handle.sendline("sudo python " + MININET_TOPO_FILE + " " + TESTCASE_MININET_ROOT_PATH)
- main.step("waiting 20 secs for all switches and quagga instances to comeup")
- time.sleep(20)
- main.step( "Test whether Mininet is started" )
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
- main.log.info( "Generate prefixes for host3" )
-
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host5" )
- prefixesHost5 = main.QuaggaCliHost5.generatePrefixes( 5, 10 )
- main.log.info( prefixesHost5 )
- for prefix in prefixesHost5:
- allRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- routeIntentsExpectedHost5 = \
- main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
- prefixesHost5, "192.168.60.1", "00:00:00:00:06:02",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4 + routeIntentsExpectedHost5
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- # Copy the cfg files to config dir
- main.log.info("Copying two cfg files to onos etc folder")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f", node=ONOS1Ip )
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- main.step( "Start ONOS-cli" )
-
- main.ONOScli.startOnosCli( ONOS1Ip )
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing gbprouter feature" )
- main.ONOScli.featureInstall( "onos-app-bgprouter" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
-
- main.log.info( "Login Quagga CLI on host5" )
- main.QuaggaCliHost5.loginQuagga( "1.168.30.5" )
- main.log.info( "Enter configuration model of Quagga CLI on host5" )
- main.QuaggaCliHost5.enterConfig( 64521 )
- main.log.info( "Add routes to Quagga on host5" )
- main.QuaggaCliHost5.addRoutes( prefixesHost5, 1 )
-
- time.sleep( 30 )
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.QuaggaCliHost.pingTestAndCheckAllPass( "1.168.30.100" )
- main.log.info("Ping test result")
- if pingTestResults:
- main.log.info("Test succeeded")
- else:
- main.log.info("Test failed")
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- #============= Disconnect the BGP session between QuaggaCliHost4 and ONOS ==================
- main.log.info( "Disabling bgp session between QuaggaCliHost4 and 192.168.30.101:" )
- main.QuaggaCliHost4.disable_bgp_peer( "192.168.30.101", "64513" )
- main.log.info( "Sleeping for 150 seconds for network to converge" )
- time.sleep(150)
- # get routes inside SDN-IP
- main.log.info( "Getting Routes from ONOS CLI" )
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- newAllRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- newAllRoutesStrActual = str( newAllRoutesActual ).replace( 'u', "" )
-
- # Expected routes with changed next hop
- newAllRoutesExpected = []
- for prefix in prefixesHost3:
- newAllRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- for prefix in prefixesHost4:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- for prefix in prefixesHost5:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- newAllRoutesStrExpected = str( sorted( newAllRoutesExpected ) )
- main.step( "Check routes installed after convergence-1" )
- main.log.info( "Routes expected:" )
- main.log.info( newAllRoutesStrExpected )
- main.log.info( "Routes got from ONOS CLI after convergence-1:" )
- main.log.info( newAllRoutesStrActual )
- utilities.assertEquals(
- expect=newAllRoutesStrExpected, actual=newAllRoutesStrActual,
- onpass="***Routes in SDN-IP are correct after convergence!***",
- onfail="***Routes in SDN-IP are wrong after convergence!***" )
- if( eq( newAllRoutesStrExpected, newAllRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after convergence are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after convergence are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.QuaggaCliHost.pingTestAndCheckAllPass( "1.168.30.100" )
- main.log.info("Ping test result")
- if pingTestResults:
- main.log.info("Test succeeded")
- else:
- main.log.info("Test failed")
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- #============= Enabling the BGP session between QuaggaCliHost4 and ONOS ==================
- main.log.info( "Enabling bgp session between QuaggaCliHost4 and 192.168.30.101:" )
- main.QuaggaCliHost4.enable_bgp_peer( "192.168.30.101", "64513" )
- main.log.info( "Sleeping for 150 seconds for network to converge" )
- time.sleep(150)
- # get routes inside SDN-IP
- main.log.info( "Getting Routes from ONOS CLI" )
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- newAllRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- newAllRoutesStrActual = str( newAllRoutesActual ).replace( 'u', "" )
-
- # Expected routes with changed next hop
- newAllRoutesExpected = []
- for prefix in prefixesHost3:
- newAllRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- for prefix in prefixesHost4:
- newAllRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- for prefix in prefixesHost5:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- newAllRoutesStrExpected = str( sorted( newAllRoutesExpected ) )
- main.step( "Check routes installed after convergence-2" )
- main.log.info( "Routes expected:" )
- main.log.info( newAllRoutesStrExpected )
- main.log.info( "Routes got from ONOS CLI after convergence-2:" )
- main.log.info( newAllRoutesStrActual )
- utilities.assertEquals(
- expect=newAllRoutesStrExpected, actual=newAllRoutesStrActual,
- onpass="***Routes in SDN-IP are correct after convergence!***",
- onfail="***Routes in SDN-IP are wrong after convergence!***" )
- if( eq( newAllRoutesStrExpected, newAllRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after convergence are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after convergence are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.QuaggaCliHost.pingTestAndCheckAllPass( "1.168.30.100" )
- main.log.info("Ping test result")
- if pingTestResults:
- main.log.info("Test succeeded")
- else:
- main.log.info("Test failed")
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
- main.QuaggaCliHost5.deleteRoutes( prefixesHost5, 1 )
-
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report( "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.QuaggaCliHost.pingTestAndCheckAllFail( "1.168.30.100" )
- main.log.info("Ping test result")
- if pingTestResults:
- main.log.info("Test succeeded")
- else:
- main.log.info("Test failed")
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="disconnect check PASS",
- onfail="disconnect check FAIL")
-
- main.ONOScli.logout()
- main.ONOSbench.onosStop(ONOS1Ip);
- main.Mininet.stopNet()
- time.sleep(10)
-
- # Route convergence and connectivity test with Route Server
- def CASE22( self, main):
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- main.case("The test case is to help to setup the TestON environment \
- and test new drivers" )
- TESTCASE_ROOT_PATH = main.params[ 'ENV' ][ 'home' ]
- TESTCASE_MININET_ROOT_PATH = TESTCASE_ROOT_PATH + "/routeserver/mininet"
- SDNIPJSONFILEPATH = TESTCASE_ROOT_PATH + "/routeserver/sdnip.json"
- main.log.info("sdnip.json file path: "+ SDNIPJSONFILEPATH)
-
- # Copy the json files to config dir
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/routeserver/addresses.json ~/onos/tools/package/config/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/routeserver/sdnip.json ~/onos/tools/package/config/")
-
- # Launch mininet topology for this case
- MININET_TOPO_FILE = TESTCASE_MININET_ROOT_PATH + "/PeeringRouteServerMininet.py"
- main.step( "Launch mininet" )
- main.Mininet.handle.sendline("sudo python " + MININET_TOPO_FILE + " " + TESTCASE_MININET_ROOT_PATH)
- main.step("waiting 20 secs for all switches and quagga instances to comeup")
- time.sleep(20)
- main.step( "Test whether Mininet is started" )
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
- main.log.info( "Generate prefixes for host3" )
-
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host5" )
- prefixesHost5 = main.QuaggaCliHost5.generatePrefixes( 5, 10 )
- main.log.info( prefixesHost5 )
- for prefix in prefixesHost5:
- allRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- routeIntentsExpectedHost5 = \
- main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
- prefixesHost5, "192.168.60.1", "00:00:00:00:06:02",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4 + routeIntentsExpectedHost5
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- # Copy the cfg files to config dir
- main.log.info("Copying two cfg files to onos etc folder")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f", node=ONOS1Ip )
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- main.step( "Start ONOS-cli" )
-
- main.ONOScli.startOnosCli( ONOS1Ip )
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing gbprouter feature" )
- main.ONOScli.featureInstall( "onos-app-bgprouter" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
-
- main.log.info( "Login Quagga CLI on host5" )
- main.QuaggaCliHost5.loginQuagga( "1.168.30.5" )
- main.log.info( "Enter configuration model of Quagga CLI on host5" )
- main.QuaggaCliHost5.enterConfig( 64521 )
- main.log.info( "Add routes to Quagga on host5" )
- main.QuaggaCliHost5.addRoutes( prefixesHost5, 1 )
-
- time.sleep( 60 )
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.QuaggaCliHost.pingTestAndCheckAllPass( "1.168.30.100" )
- main.log.info("Ping test result")
- if pingTestResults:
- main.log.info("Test succeeded")
- else:
- main.log.info("Test failed")
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- #============= Disconnect the BGP session between QuaggaCliHost4 and ONOS ==================
- main.log.info( "Disabling bgp session between QuaggaCliHost4 and 192.168.30.101:" )
- main.QuaggaCliHost4.disable_bgp_peer( "192.168.30.101", "64513" )
- main.log.info( "Sleeping for 150 seconds for network to converge" )
- time.sleep(150)
- # get routes inside SDN-IP
- main.log.info( "Getting Routes from ONOS CLI" )
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- newAllRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- newAllRoutesStrActual = str( newAllRoutesActual ).replace( 'u', "" )
-
- # Expected routes with changed next hop
- newAllRoutesExpected = []
- for prefix in prefixesHost3:
- newAllRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- for prefix in prefixesHost4:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- for prefix in prefixesHost5:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- newAllRoutesStrExpected = str( sorted( newAllRoutesExpected ) )
- main.step( "Check routes installed after convergence-1" )
- main.log.info( "Routes expected:" )
- main.log.info( newAllRoutesStrExpected )
- main.log.info( "Routes got from ONOS CLI after convergence-1:" )
- main.log.info( newAllRoutesStrActual )
- utilities.assertEquals(
- expect=newAllRoutesStrExpected, actual=newAllRoutesStrActual,
- onpass="***Routes in SDN-IP are correct after convergence!***",
- onfail="***Routes in SDN-IP are wrong after convergence!***" )
- if( eq( newAllRoutesStrExpected, newAllRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after convergence are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after convergence are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.QuaggaCliHost.pingTestAndCheckAllPass( "1.168.30.100" )
- main.log.info("Ping test result")
- if pingTestResults:
- main.log.info("Test succeeded")
- else:
- main.log.info("Test failed")
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- #============= Enabling the BGP session between QuaggaCliHost4 and ONOS ==================
- main.log.info( "Enabling bgp session between QuaggaCliHost4 and 192.168.30.101:" )
- main.QuaggaCliHost4.enable_bgp_peer( "192.168.30.101", "64513" )
- main.log.info( "Sleeping for 150 seconds for network to converge" )
- time.sleep(150)
- # get routes inside SDN-IP
- main.log.info( "Getting Routes from ONOS CLI" )
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- newAllRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- newAllRoutesStrActual = str( newAllRoutesActual ).replace( 'u', "" )
-
- # Expected routes with changed next hop
- newAllRoutesExpected = []
- for prefix in prefixesHost3:
- newAllRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- for prefix in prefixesHost4:
- newAllRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- for prefix in prefixesHost5:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- newAllRoutesStrExpected = str( sorted( newAllRoutesExpected ) )
- main.step( "Check routes installed after convergence-2" )
- main.log.info( "Routes expected:" )
- main.log.info( newAllRoutesStrExpected )
- main.log.info( "Routes got from ONOS CLI after convergence-2:" )
- main.log.info( newAllRoutesStrActual )
- utilities.assertEquals(
- expect=newAllRoutesStrExpected, actual=newAllRoutesStrActual,
- onpass="***Routes in SDN-IP are correct after convergence!***",
- onfail="***Routes in SDN-IP are wrong after convergence!***" )
- if( eq( newAllRoutesStrExpected, newAllRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after convergence are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after convergence are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.QuaggaCliHost.pingTestAndCheckAllPass( "1.168.30.100" )
- main.log.info("Ping test result")
- if pingTestResults:
- main.log.info("Test succeeded")
- else:
- main.log.info("Test failed")
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
- main.QuaggaCliHost5.deleteRoutes( prefixesHost5, 1 )
-
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report( "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.QuaggaCliHost.pingTestAndCheckAllFail( "1.168.30.100" )
- main.log.info("Ping test result")
- if pingTestResults:
- main.log.info("Test succeeded")
- else:
- main.log.info("Test failed")
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="disconnect check PASS",
- onfail="disconnect check FAIL")
-
- main.ONOScli.logout()
- main.ONOSbench.onosStop(ONOS1Ip);
- main.Mininet.stopNet()
- time.sleep(10)
-
- # Route convergence and connectivity test in VLAN configuration
- def CASE31( self, main):
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- main.case("The test case is to help to setup the TestON environment \
- and test new drivers" )
- TESTCASE_ROOT_PATH = main.params[ 'ENV' ][ 'home' ]
- TESTCASE_MININET_ROOT_PATH = TESTCASE_ROOT_PATH + "/vlan/routeconvergence/mininet"
- SDNIPJSONFILEPATH = TESTCASE_ROOT_PATH + "/vlan/sdnip.json"
- main.log.info("sdnip.json file path: "+ SDNIPJSONFILEPATH)
-
- # Copy the json files to config dir
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/vlan/addresses.json ~/onos/tools/package/config/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/vlan/sdnip.json ~/onos/tools/package/config/")
-
- # Launch mininet topology for this case
- MININET_TOPO_FILE = TESTCASE_MININET_ROOT_PATH + "/PeeringRouterConvergenceVlanMininet.py"
- main.step( "Launch mininet" )
- main.Mininet.handle.sendline("sudo python " + MININET_TOPO_FILE + " " + TESTCASE_MININET_ROOT_PATH)
- main.step("waiting 20 secs for all switches and quagga instances to comeup")
- time.sleep(20)
- main.step( "Test whether Mininet is started" )
- main.log.info( "Login Quagga CLI on host3" )
- result = main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- #if result is not main.TRUE:
- # main.log.report("Mininet is not started...Aborting")
- # main.Mininet.stopNet()
- # main.cleanup()
- # main.exit()
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
- main.log.info( "Generate prefixes for host3" )
-
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host5" )
- prefixesHost5 = main.QuaggaCliHost5.generatePrefixes( 5, 10 )
- main.log.info( prefixesHost5 )
- for prefix in prefixesHost5:
- allRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- routeIntentsExpectedHost5 = \
- main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
- prefixesHost5, "192.168.60.1", "00:00:00:00:06:02",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4 + routeIntentsExpectedHost5
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
- utilities.assert_equals(expect=main.TRUE,actual=verifyResult,onpass="Verify cell pass!",onfail="Verify cell failed...")
-
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- # Copy the cfg files to config dir
- main.log.info("Copying two cfg files to onos etc folder")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f", node=ONOS1Ip )
- if onos1InstallResult is not main.TRUE:
- main.log.report("ONOS is not installed...Aborting")
- main.Mininet.stopNet()
- main.cleanup()
- main.exit()
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if onos1Isup is not main.TRUE:
- main.log.report("ONOS1 didn't start!...Aborting" )
- main.Mininet.stopNet()
- main.ONOSbench.onosStop(ONOS1Ip);
- main.cleanup()
- main.exit()
-
- main.step( "Start ONOS-cli" )
-
- result = main.ONOScli.startOnosCli( ONOS1Ip )
- utilities.assert_equals(expect=main.TRUE,actual=result,onpass="ONOS CLI is up!",onfail="ONOS CLI is not up...")
- if result is not main.TRUE:
- main.log.report("ONOS1 didn't start!...Aborting" )
- main.Mininet.stopNet()
- main.ONOScli.logout()
- main.ONOSbench.onosStop(ONOS1Ip);
- main.cleanup()
- main.exit()
-
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing bgprouter feature" )
- main.ONOScli.featureInstall( "onos-app-bgprouter" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
-
- main.log.info( "Login Quagga CLI on host5" )
- main.QuaggaCliHost5.loginQuagga( "1.168.30.5" )
- main.log.info( "Enter configuration model of Quagga CLI on host5" )
- main.QuaggaCliHost5.enterConfig( 64521 )
- main.log.info( "Add routes to Quagga on host5" )
- main.QuaggaCliHost5.addRoutes( prefixesHost5, 1 )
-
- time.sleep( 30 )
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.TRUE
- sources = ["as2host", "as3host", "as6host"]
- targets = ["192.168.10.101", "192.168.20.101", "192.168.30.101", "192.168.60.101"]
- for source in sources:
- for target in targets:
- r = main.Mininet.pingHost(SRC=source, TARGET=target)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Router connectivity check PASS",
- onfail="Router connectivity check FAIL")
-
- pingTestResults = main.TRUE
- for m in range( 3, 6 ):
- for n in range( 1, 10 ):
- hostIp = str( m ) + ".0." + str( n ) + ".1"
- r = main.Mininet.pingHost(SRC="as2host", TARGET=hostIp)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- time.sleep(20)
-
- #============= Disconnect the BGP session between QuaggaCliHost4 and ONOS ==================
- main.log.info( "Disabling bgp session between QuaggaCliHost4 and 192.168.30.101:" )
- main.QuaggaCliHost4.disable_bgp_peer( "192.168.30.101", "64513" )
- main.log.info( "Sleeping for 150 seconds for network to converge" )
- time.sleep(150)
- # get routes inside SDN-IP
- main.log.info( "Getting Routes from ONOS CLI" )
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- newAllRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- newAllRoutesStrActual = str( newAllRoutesActual ).replace( 'u', "" )
-
- # Expected routes with changed next hop
- newAllRoutesExpected = []
- for prefix in prefixesHost3:
- newAllRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- for prefix in prefixesHost4:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- for prefix in prefixesHost5:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- newAllRoutesStrExpected = str( sorted( newAllRoutesExpected ) )
- main.step( "Check routes installed after convergence-1" )
- main.log.info( "Routes expected:" )
- main.log.info( newAllRoutesStrExpected )
- main.log.info( "Routes got from ONOS CLI after convergence-1:" )
- main.log.info( newAllRoutesStrActual )
- utilities.assertEquals(
- expect=newAllRoutesStrExpected, actual=newAllRoutesStrActual,
- onpass="***Routes in SDN-IP are correct after convergence!***",
- onfail="***Routes in SDN-IP are wrong after convergence!***" )
- if( eq( newAllRoutesStrExpected, newAllRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after convergence are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after convergence are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.TRUE
- sources = ["as2host", "as3host", "as6host"]
- targets = ["192.168.10.101", "192.168.20.101", "192.168.30.101", "192.168.60.101"]
- for source in sources:
- for target in targets:
- r = main.Mininet.pingHost(SRC=source, TARGET=target)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Router connectivity check PASS",
- onfail="Router connectivity check FAIL")
-
- pingTestResults = main.TRUE
- for m in range( 3, 6 ):
- for n in range( 1, 10 ):
- hostIp = str( m ) + ".0." + str( n ) + ".1"
- r = main.Mininet.pingHost(SRC="as2host", TARGET=hostIp)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- time.sleep(20)
-
- #============= Enabling the BGP session between QuaggaCliHost4 and ONOS ==================
- main.log.info( "Enabling bgp session between QuaggaCliHost4 and 192.168.30.101:" )
- main.QuaggaCliHost4.enable_bgp_peer( "192.168.30.101", "64513" )
- main.log.info( "Sleeping for 150 seconds for network to converge" )
- time.sleep(150)
- # get routes inside SDN-IP
- main.log.info( "Getting Routes from ONOS CLI" )
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- newAllRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- newAllRoutesStrActual = str( newAllRoutesActual ).replace( 'u', "" )
-
- # Expected routes with changed next hop
- newAllRoutesExpected = []
- for prefix in prefixesHost3:
- newAllRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- for prefix in prefixesHost4:
- newAllRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- for prefix in prefixesHost5:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- newAllRoutesStrExpected = str( sorted( newAllRoutesExpected ) )
- main.step( "Check routes installed after convergence-2" )
- main.log.info( "Routes expected:" )
- main.log.info( newAllRoutesStrExpected )
- main.log.info( "Routes got from ONOS CLI after convergence-2:" )
- main.log.info( newAllRoutesStrActual )
- utilities.assertEquals(
- expect=newAllRoutesStrExpected, actual=newAllRoutesStrActual,
- onpass="***Routes in SDN-IP are correct after convergence!***",
- onfail="***Routes in SDN-IP are wrong after convergence!***" )
- if( eq( newAllRoutesStrExpected, newAllRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after convergence are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after convergence are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.QuaggaCliHost.pingTestAndCheckAllPass( "1.168.30.100" )
- main.log.info("Ping test result")
- if pingTestResults:
- main.log.info("Test succeeded")
- else:
- main.log.info("Test failed")
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
- main.QuaggaCliHost5.deleteRoutes( prefixesHost5, 1 )
-
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report( "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.TRUE
- for m in range( 4, 6 ):
- for n in range( 1, 10 ):
- hostIp = str( m ) + ".0." + str( n ) + ".1"
- r = main.Mininet.pingHost(SRC="as2host", TARGET=hostIp)
- if r == main.TRUE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="disconnect check PASS",
- onfail="disconnect check FAIL")
-
- time.sleep(20);
-
- main.ONOScli.logout()
- main.ONOSbench.onosStop(ONOS1Ip);
- main.Mininet.stopNet()
- time.sleep(10)
-
- # Route convergence and connectivity test with Route Server in VLAN tagged network
- def CASE32( self, main):
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- main.case("The test case is to help to setup the TestON environment \
- and test new drivers" )
- TESTCASE_ROOT_PATH = main.params[ 'ENV' ][ 'home' ]
- TESTCASE_MININET_ROOT_PATH = TESTCASE_ROOT_PATH + "/vlan/routeserver/mininet"
- SDNIPJSONFILEPATH = TESTCASE_ROOT_PATH + "/vlan/routeserver/sdnip.json"
- main.log.info("sdnip.json file path: "+ SDNIPJSONFILEPATH)
-
- # Copy the json files to config dir
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/vlan/routeserver/addresses.json ~/onos/tools/package/config/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/vlan/routeserver/sdnip.json ~/onos/tools/package/config/")
-
- # Launch mininet topology for this case
- MININET_TOPO_FILE = TESTCASE_MININET_ROOT_PATH + "/PeeringRouteServerVlanMininet.py"
- main.step( "Launch mininet" )
- main.Mininet.handle.sendline("sudo python " + MININET_TOPO_FILE + " " + TESTCASE_MININET_ROOT_PATH)
- main.step("waiting 20 secs for all switches and quagga instances to comeup")
- time.sleep(20)
- main.step( "Test whether Mininet is started" )
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
- main.log.info( "Generate prefixes for host3" )
-
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host5" )
- prefixesHost5 = main.QuaggaCliHost5.generatePrefixes( 5, 10 )
- main.log.info( prefixesHost5 )
- for prefix in prefixesHost5:
- allRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- routeIntentsExpectedHost5 = \
- main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
- prefixesHost5, "192.168.60.1", "00:00:00:00:06:02",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4 + routeIntentsExpectedHost5
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- # Copy the cfg files to config dir
- main.log.info("Copying two cfg files to onos etc folder")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.ONOSbench.handle.sendline("cp " + TESTCASE_ROOT_PATH + "/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg ~/onos/tools/package/etc/")
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f", node=ONOS1Ip )
-
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- main.step( "Start ONOS-cli" )
-
- main.ONOScli.startOnosCli( ONOS1Ip )
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing gbprouter feature" )
- main.ONOScli.featureInstall( "onos-app-bgprouter" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
-
- main.log.info( "Login Quagga CLI on host5" )
- main.QuaggaCliHost5.loginQuagga( "1.168.30.5" )
- main.log.info( "Enter configuration model of Quagga CLI on host5" )
- main.QuaggaCliHost5.enterConfig( 64521 )
- main.log.info( "Add routes to Quagga on host5" )
- main.QuaggaCliHost5.addRoutes( prefixesHost5, 1 )
-
- time.sleep( 60 )
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.TRUE
- sources = ["as2host", "as3host", "as6host"]
- targets = ["192.168.10.101", "192.168.20.101", "192.168.30.101", "192.168.60.101"]
- for source in sources:
- for target in targets:
- r = main.Mininet.pingHost(SRC=source, TARGET=target)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Router connectivity check PASS",
- onfail="Router connectivity check FAIL")
-
- pingTestResults = main.TRUE
- for m in range( 3, 6 ):
- for n in range( 1, 10 ):
- hostIp = str( m ) + ".0." + str( n ) + ".1"
- r = main.Mininet.pingHost(SRC="as2host", TARGET=hostIp)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- time.sleep(20)
-
- #============= Disconnect the BGP session between QuaggaCliHost4 and ONOS ==================
- main.log.info( "Disabling bgp session between QuaggaCliHost4 and 192.168.30.101:" )
- main.QuaggaCliHost4.disable_bgp_peer( "192.168.30.101", "64513" )
- main.log.info( "Sleeping for 150 seconds for network to converge" )
- time.sleep(150)
- # get routes inside SDN-IP
- main.log.info( "Getting Routes from ONOS CLI" )
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- newAllRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- newAllRoutesStrActual = str( newAllRoutesActual ).replace( 'u', "" )
-
- # Expected routes with changed next hop
- newAllRoutesExpected = []
- for prefix in prefixesHost3:
- newAllRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- for prefix in prefixesHost4:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- for prefix in prefixesHost5:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- newAllRoutesStrExpected = str( sorted( newAllRoutesExpected ) )
- main.step( "Check routes installed after convergence-1" )
- main.log.info( "Routes expected:" )
- main.log.info( newAllRoutesStrExpected )
- main.log.info( "Routes got from ONOS CLI after convergence-1:" )
- main.log.info( newAllRoutesStrActual )
- utilities.assertEquals(
- expect=newAllRoutesStrExpected, actual=newAllRoutesStrActual,
- onpass="***Routes in SDN-IP are correct after convergence!***",
- onfail="***Routes in SDN-IP are wrong after convergence!***" )
- if( eq( newAllRoutesStrExpected, newAllRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after convergence are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after convergence are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.TRUE
- sources = ["as2host", "as3host", "as6host"]
- targets = ["192.168.10.101", "192.168.20.101", "192.168.30.101", "192.168.60.101"]
- for source in sources:
- for target in targets:
- r = main.Mininet.pingHost(SRC=source, TARGET=target)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Router connectivity check PASS",
- onfail="Router connectivity check FAIL")
-
- pingTestResults = main.TRUE
- for m in range( 3, 6 ):
- for n in range( 1, 10 ):
- hostIp = str( m ) + ".0." + str( n ) + ".1"
- r = main.Mininet.pingHost(SRC="as2host", TARGET=hostIp)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- time.sleep(20)
-
- #============= Enabling the BGP session between QuaggaCliHost4 and ONOS ==================
- main.log.info( "Enabling bgp session between QuaggaCliHost4 and 192.168.30.101:" )
- main.QuaggaCliHost4.enable_bgp_peer( "192.168.30.101", "64513" )
- main.log.info( "Sleeping for 150 seconds for network to converge" )
- time.sleep(150)
- # get routes inside SDN-IP
- main.log.info( "Getting Routes from ONOS CLI" )
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- newAllRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- newAllRoutesStrActual = str( newAllRoutesActual ).replace( 'u', "" )
-
- # Expected routes with changed next hop
- newAllRoutesExpected = []
- for prefix in prefixesHost3:
- newAllRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- for prefix in prefixesHost4:
- newAllRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- for prefix in prefixesHost5:
- newAllRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- newAllRoutesStrExpected = str( sorted( newAllRoutesExpected ) )
- main.step( "Check routes installed after convergence-2" )
- main.log.info( "Routes expected:" )
- main.log.info( newAllRoutesStrExpected )
- main.log.info( "Routes got from ONOS CLI after convergence-2:" )
- main.log.info( newAllRoutesStrActual )
- utilities.assertEquals(
- expect=newAllRoutesStrExpected, actual=newAllRoutesStrActual,
- onpass="***Routes in SDN-IP are correct after convergence!***",
- onfail="***Routes in SDN-IP are wrong after convergence!***" )
- if( eq( newAllRoutesStrExpected, newAllRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after convergence are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after convergence are wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.TRUE
- sources = ["as2host", "as3host", "as6host"]
- targets = ["192.168.10.101", "192.168.20.101", "192.168.30.101", "192.168.60.101"]
- for source in sources:
- for target in targets:
- r = main.Mininet.pingHost(SRC=source, TARGET=target)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Router connectivity check PASS",
- onfail="Router connectivity check FAIL")
-
- pingTestResults = main.TRUE
- for m in range( 3, 6 ):
- for n in range( 1, 10 ):
- hostIp = str( m ) + ".0." + str( n ) + ".1"
- r = main.Mininet.pingHost(SRC="as2host", TARGET=hostIp)
- if r == main.FALSE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="Default connectivity check PASS",
- onfail="Default connectivity check FAIL")
-
- time.sleep(20)
-
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
- main.QuaggaCliHost5.deleteRoutes( prefixesHost5, 1 )
-
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report( "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
-
- #============================= Ping Test ========================
- pingTestResults = main.TRUE
- for m in range( 4, 6 ):
- for n in range( 1, 10 ):
- hostIp = str( m ) + ".0." + str( n ) + ".1"
- r = main.Mininet.pingHost(SRC="as2host", TARGET=hostIp)
- if r == main.TRUE:
- pingTestResults = main.FALSE
-
- utilities.assert_equals(expect=main.TRUE,actual=pingTestResults,
- onpass="disconnect check PASS",
- onfail="disconnect check FAIL")
- time.sleep(20)
-
- main.ONOScli.logout()
- main.ONOSbench.onosStop(ONOS1Ip);
- main.Mininet.stopNet()
- time.sleep(10)
-
diff --git a/TestON/tests/PeeringRouterTest/PeeringRouterTest.topo b/TestON/tests/PeeringRouterTest/PeeringRouterTest.topo
deleted file mode 100755
index a1e2c45..0000000
--- a/TestON/tests/PeeringRouterTest/PeeringRouterTest.topo
+++ /dev/null
@@ -1,82 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <Mininet>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </Mininet>
-
- <ONOSbench>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password></password>
- <type>OnosDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS>
- <home>~/onos</home>
- </COMPONENTS>
- </ONOSbench>
-
- <ONOScli>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password></password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS>
- <home>~/onos</home>
- </COMPONENTS>
- </ONOScli>
-
- <ONOS1>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password></password>
- <type>OnosDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS>
- <home>~/onos</home>
- </COMPONENTS>
- </ONOS1>
-
- <QuaggaCliHost3>
- <host>1.168.30.2</host>
- <user>admin</user>
- <password></password>
- <type>QuaggaCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost3>
- <QuaggaCliHost4>
- <host>1.168.30.3</host>
- <user>admin</user>
- <password></password>
- <type>QuaggaCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost4>
- <QuaggaCliHost5>
- <host>1.168.30.5</host>
- <user>admin</user>
- <password></password>
- <type>QuaggaCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost5>
- <QuaggaCliHost>
- <host>1.168.30.100</host>
- <user>admin</user>
- <password></password>
- <type>QuaggaCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost>
-
-
- </COMPONENT>
-</TOPOLOGY>
-
diff --git a/TestON/tests/PeeringRouterTest/README.md b/TestON/tests/PeeringRouterTest/README.md
deleted file mode 100644
index 002a0f1..0000000
--- a/TestON/tests/PeeringRouterTest/README.md
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-1) Install TestON framework from https://github.com/srikanthvavila/ONLabTest (Follow README instructions. Until forked repo is mrged back, use URL https://github.com/srikanthvavila/ONLabTest for cloning this repo. You can ignore Linc-OE and STS installation steps as we may not need them for now)
-
-2) Peering router testcases are under ~/TestON/tests/PeeringRouterTest folder:
-a) CASE4 - Basic Route advertisement and connectivity in untagged network
-b) CASE5 - Basic Route advertisement and connectivity in tagged network
-c) CASE7 - Scale test with 25k routes
-d) CASE8 - Flap a route 20 times with 100 msec interval
-e) CASE9 - Flap a next-hop 20 times with 100 msec interval
-f) CASE21 - Route convergence due to bgp peering session flapping in untagged network
-g) CASE22 - Basic Route advertisement and connectivity in untagged network with Route server
-h) CASE31 - Route convergence due to bgp peering session flapping in tagged network
-i) CASE32 - Basic Route advertisement and connectivity in tagged network with Route server
-
-3) Before running the testcases, ensure quagga is installed on the machine:
-a) "sudo apt-get install quagga"
-b) "Create a folder for /usr/local/var/run/quagga"
-c) "chmod 777" to quagga folder
-
-4) Test environment assumes the TestON, ONOS and Mininet all are running in the same VM. These testcases are not verified with the components running in separate VMs.
-
-5) Before running testcases, edit the following files and make necessary changes:
-a) ~/TestON/tests/PeeringRouterTest/PeeringRouterTest.params --> Edit "cellname", "test home folder" and "controller IP" fields
-b) ~/TestON/tests/PeeringRouterTest/PeeringRouterTest.topo --> Edit "host", "user", "password", "home" fields under "ONOSbench", "ONOSCli" and "ONOS1". Similalry edit "user" field under "QuaggaCliHost<>" (You can use the same user name as your mininet VM)
-d) ~/TestON/drivers/common/cli/onosclidriver.py --> Change the line "self.handle.expect( "ONOS_CELL=" + str( cellname ) )" to "self.handle.expect( "ONOS_CELL" )"
-
-6) Ensure the ONOS cell file has the following lines populated:
-OCI=127.0.0.1
-OC1=127.0.0.1
-OC2=127.0.0.1
-OCN=127.0.0.1
-ONOS_FEATURES=webconsole,onos-api,onos-core-trivial,onos-cli,onos-openflow,onos-gui,onos-rest,onos-app-config,onos-app-proxyarp
-ONOS_USER=<user>
-ONOS_GROUP=<user>
-ONOS_NIC=127.0.0.*
-
-7) Ensure KARAF_ROOT is set to "/opt/onos/apache-karaf-3.0.2"
-
-8) Ensure JAVA_HOME is unset before sourcing ~/onos/tools/dev/bash_profile
-
-9) Ensure "onos-package" operation is done before executing the test cases
-
-10) Update the testcases to be run in ~/TestON/tests/PeeringRouterTest/PeeringRouterTest.params and execute "./cly.py run PeeringRouterTest" from ~/TestON/bin folder.
diff --git a/TestON/tests/PeeringRouterTest/__init__.py b/TestON/tests/PeeringRouterTest/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/PeeringRouterTest/__init__.py
+++ /dev/null
diff --git a/TestON/tests/PeeringRouterTest/addresses.json b/TestON/tests/PeeringRouterTest/addresses.json
deleted file mode 100644
index 8831f8d..0000000
--- a/TestON/tests/PeeringRouterTest/addresses.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "addresses" : [
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "1",
- "ips" : ["192.168.10.101/24"],
- "mac" : "00:00:00:00:00:01"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "2",
- "ips" : ["192.168.20.101/24"],
- "mac" : "00:00:00:00:00:01"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "3",
- "ips" : ["192.168.30.101/24"],
- "mac" : "00:00:00:00:00:01"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "4",
- "ips" : ["192.168.60.101/24"],
- "mac" : "00:00:00:00:00:01"
- }
-
- ]
-}
diff --git a/TestON/tests/PeeringRouterTest/mininet/PeeringRouterMininet.py b/TestON/tests/PeeringRouterTest/mininet/PeeringRouterMininet.py
deleted file mode 100755
index 6991916..0000000
--- a/TestON/tests/PeeringRouterTest/mininet/PeeringRouterMininet.py
+++ /dev/null
@@ -1,337 +0,0 @@
-#!/usr/bin/python
-
-"""
-Start up the SDN-IP demo topology
-"""
-
-"""
-AS1 = 64513, (SDN AS)
-AS2 = 64514, reachable by 192.168.10.1, 192.168.20.1
-AS3 = 64516, reachable by 192.168.30.1
-AS4 = 64517, reachable by 192.168.40.1
-AS6 = 64520, reachable by 192.168.60.2, (route server 192.168.60.1)
-"""
-
-from mininet.net import Mininet
-from mininet.node import Controller, RemoteController
-from mininet.log import setLogLevel, info
-from mininet.cli import CLI
-from mininet.topo import Topo
-from mininet.util import quietRun
-from mininet.moduledeps import pathCheck
-
-import os.path
-import time
-import sys
-from subprocess import Popen, STDOUT, PIPE
-
-QUAGGA_DIR = '/usr/lib/quagga'
-#QUAGGA_DIR = '/usr/local/sbin'
-QUAGGA_RUN_DIR = '/usr/local/var/run/quagga'
-
-QUAGGA_CONFIG_FILE_DIR = '/home/tutorial1/ONLabTest/TestON/tests/PeeringRouterTest/mininet'
-
-class SDNIpModifiedTopo( Topo ):
- "SDN Ip Modified Topology"
-
- def __init__( self, *args, **kwargs ):
- global numHost101
- global numHost200
- numHost101 = 101
- numHost200 = 200
- Topo.__init__( self, *args, **kwargs )
- sw1 = self.addSwitch('sw1', dpid='0000000000000001')
- sw2 = self.addSwitch('sw2', dpid='0000000000000002')
- #sw3 = self.addSwitch('sw3', dpid='00000000000000a3')
- #sw4 = self.addSwitch('sw4', dpid='00000000000000a4')
- #sw5 = self.addSwitch('sw5', dpid='00000000000000a5')
- #sw6 = self.addSwitch('sw6', dpid='00000000000000a6')
- #add a switch for 3 quagga hosts
- swTestOn = self.addSwitch('swTestOn', dpid='0000000000000102')
- #Note this switch isn't part of the SDN topology
- #We'll use the ovs-controller to turn this into a learning switch
- as6sw = self.addSwitch('as6sw', dpid='00000000000000a7')
-
- host1 = self.addHost( 'host1' )
- root1 = self.addHost( 'root1', inNamespace=False , ip='0')
- rootTestOn = self.addHost( 'rootTestOn', inNamespace=False, ip='0' )
-
- #AS2 host
- host3 = self.addHost( 'host3' )
- as2host = self.addHost( 'as2host' )
- #AS3 host
- host4 = self.addHost( 'host4' )
- as3host = self.addHost( 'as3host' )
- #AS6 host
- host5 = self.addHost( 'host5' )
- as6host = self.addHost( 'as6host' )
-
- self.addLink( host1, sw2 )
- #Links to the multihomed AS
- self.addLink( host3, sw1 )
- self.addLink( host3, sw1 )
- self.addLink( as2host, host3 )
- #Single links to the remaining two ASes
- self.addLink( host4, sw1 )
- self.addLink( as3host, host4 )
-
- #AS3-AS4 link
- #self.addLink( host4, host5)
- #Add new AS6 to its bridge
- self.addLink( host5, as6sw )
- self.addLink( as6host, host5 )
- #test the host behind the router(behind the router server)
-# for i in range(1, 10):
- # host = self.addHost('as6host%d' % i)
- # self.addLink(host, as6router)
-
- ## Internal Connection To Hosts ##
- self.addLink( root1, host1 )
-
- # self.addLink( sw1, sw2 )
- # self.addLink( sw1, sw3 )
- # self.addLink( sw2, sw4 )
- # self.addLink( sw3, sw4 )
- # self.addLink( sw3, sw5 )
- # self.addLink( sw4, sw6 )
- # self.addLink( sw5, sw6 )
- self.addLink( as6sw, sw1 )
-
-
- self.addLink(swTestOn, rootTestOn)
- #self.addLink(swTestOn, host1)
- self.addLink(swTestOn, host3)
- self.addLink(swTestOn, host4)
- self.addLink(swTestOn, host5)
- self.addLink(swTestOn, as2host)
-
-
- #self.addLink(rootTestOn, host4)
-
-def startsshd( host ):
- "Start sshd on host"
- info( '*** Starting sshd\n' )
- name, intf, ip = host.name, host.defaultIntf(), host.IP()
- banner = '/tmp/%s.banner' % name
- host.cmd( 'echo "Welcome to %s at %s" > %s' % ( name, ip, banner ) )
- host.cmd( '/usr/sbin/sshd -o "Banner %s"' % banner, '-o "UseDNS no"' )
- info( '***', host.name, 'is running sshd on', intf, 'at', ip, '\n' )
-
-def startsshds ( hosts ):
- for h in hosts:
- startsshd( h )
-
-def stopsshd( ):
- "Stop *all* sshd processes with a custom banner"
- info( '*** Shutting down stale sshd/Banner processes ',
- quietRun( "pkill -9 -f Banner" ), '\n' )
-
-def startquagga( host, num, config_file ):
- info( '*** Starting Quagga on %s\n' % host )
- zebra_cmd = 'sudo %s/zebra -d -f %s/zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid' % (QUAGGA_DIR, QUAGGA_CONFIG_FILE_DIR, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
- quagga_cmd = 'sudo %s/bgpd -d -f %s -z %s/zserv%s.api -i %s/bgpd%s.pid' % (QUAGGA_DIR, config_file, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
-
- print zebra_cmd
- print quagga_cmd
-
- host.cmd( zebra_cmd )
- host.cmd( quagga_cmd )
-
-def startquaggahost5( host, num ):
- info( '*** Starting Quagga on %s\n' % host )
- zebra_cmd = 'sudo %s/zebra -d -f %s/zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid' % (QUAGGA_DIR, QUAGGA_CONFIG_FILE_DIR, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
- quagga_cmd = 'sudo %s/bgpd -d -f ./as4quaggas/quagga%s.conf -z %s/zserv%s.api -i %s/bgpd%s.pid' % (QUAGGA_DIR, num, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
-
- host.cmd( zebra_cmd )
- host.cmd( quagga_cmd )
-
-
-def stopquagga( ):
- quietRun( 'sudo pkill -9 -f bgpd' )
- quietRun( 'sudo pkill -9 -f zebra' )
-
-def sdn1net():
- topo = SDNIpModifiedTopo()
- info( '*** Creating network\n' )
- net = Mininet( topo=topo, controller=RemoteController )
- net = Mininet( topo=topo, controller=RemoteController )
-
- host1, host3, host4, host5 = net.get( 'host1', 'host3', 'host4', 'host5' )
-
- #host100.setIP('1.168.30.' + str(i), 24, str(host100) + "-eth2")
-
- #host500.setMAC('00:00:00:00:04:%d' % (i-101), 'host%d-eth0' %(i))
- #add IP prefixes
- #for j in range(0,121):
- #host100.cmd('sudo ip addr add %s.0.40.%s/24 dev host%s-eth0' %(i,j,i))
-
- ## Adding 2nd, 3rd and 4th interface to host1 connected to sw1 (for another BGP peering)
- #sw1 = net.get('sw1')
- host1.setMAC('00:00:00:00:00:01', 'host1-eth0')
- host1.cmd('ip addr add 192.168.20.101/24 dev host1-eth0')
- host1.cmd('ip addr add 192.168.30.101/24 dev host1-eth0')
- #host1.cmd('ip addr add 192.168.40.101/24 dev host1-eth0')
- host1.cmd('ip addr add 192.168.60.101/24 dev host1-eth0')
-
- # Net has to be start after adding the above link
- net.start()
-
- # Set up as6sw as a learning switch as quickly as possible so it
- # hopefully doesn't connect to the actual controller
- # TODO figure out how to change controller before starting switch
- as6sw = net.get('as6sw')
- as6sw.cmd('ovs-vsctl set-controller as6sw none')
- as6sw.cmd('ovs-vsctl set-fail-mode as6sw standalone')
-
-
- sw1 = net.get('sw1')
- sw1.cmd('ovs-vsctl set-controller sw1 tcp:127.0.0.1:6633')
-# sw2.cmd('ovs-vsctl set-controller sw2 tcp:127.0.0.1:6633')
-# sw3.cmd('ovs-vsctl set-controller sw3 tcp:127.0.0.1:6633')
-# sw4.cmd('ovs-vsctl set-controller sw4 tcp:127.0.0.1:6633')
-# sw5.cmd('ovs-vsctl set-controller sw5 tcp:127.0.0.1:6633')
-# sw6.cmd('ovs-vsctl set-controller sw6 tcp:127.0.0.1:6633')
-
-
- swTestOn = net.get('swTestOn')
- swTestOn.cmd('ovs-vsctl set-controller swTestOn none')
- swTestOn.cmd('ovs-vsctl set-fail-mode swTestOn standalone')
-
- host1.defaultIntf().setIP('192.168.10.101/24')
- # Run BGPd
- #host1.cmd('%s -d -f %s' % (BGPD, BGPD_CONF))
- #host1.cmd('/sbin/route add default gw 192.168.10.254 dev %s-eth0' % (host1.name))
-
- # Configure new host interfaces
- #host2.defaultIntf().setIP('172.16.10.2/24')
- #host2.defaultIntf().setMAC('00:00:00:00:01:02')
- #host2.cmd('/sbin/route add default gw 172.16.10.254 dev %s-eth0' % (host2.name))
-
- # Set up AS2
- host3.setIP('192.168.10.1', 24, 'host3-eth0')
- #host3.cmd('sudo ip addr add 172.16.20.1/24 dev host3-eth0')
- host3.setIP('192.168.20.1', 24, 'host3-eth1')
- host3.setMAC('00:00:00:00:02:01', 'host3-eth0')
- host3.setMAC('00:00:00:00:02:02', 'host3-eth1')
- #host3.setIP('172.16.20.254', 24, 'host3-eth2')
- host3.setIP('3.0.0.254', 8, 'host3-eth2')
- host3.cmd('sysctl net.ipv4.conf.all.forwarding=1')
-
- host3.setIP('1.168.30.2', 24, 'host3-eth3')
- host3.cmd('sysctl net.ipv4.conf.all.arp_ignore=1')
- host3.cmd('sysctl net.ipv4.conf.all.arp_announce=1')
- as2host = net.get('as2host')
- #as2host.defaultIntf().setIP('172.16.20.1/24')
- for i in range(0, 20):
- as2host.cmd('sudo ip addr add 3.0.%d.1/24 dev as2host-eth0' %i)
- as2host.setIP('1.168.30.100', 24, 'as2host-eth1')
-
- as2host.cmd('ip route add default via 3.0.0.254')
-
- # Set up AS3
- host4.setIP('192.168.30.1', 24, 'host4-eth0')
- host4.setMAC('00:00:00:00:03:01', 'host4-eth0')
- host4.setIP('4.0.0.254', 8, 'host4-eth1')
- host4.setMAC('00:00:00:00:03:99', 'host4-eth1')
- host4.cmd('sysctl net.ipv4.conf.all.forwarding=1')
- as3host = net.get('as3host')
- for i in range(0, 20):
- as3host.cmd('sudo ip addr add 4.0.%d.1/24 dev as3host-eth0' %i)
- as3host.cmd('ip route add default via 4.0.0.254')
-
- #root space
- host4.setIP('1.168.30.3', 24, 'host4-eth2')
- host4.setMAC('00:00:00:00:03:03', 'host4-eth2')
-
- # Set up AS4
- #as4host = net.get('as4host')
- #as4host.defaultIntf().setIP('172.16.40.1/24')
- #as4host.cmd('ip route add default via 172.16.40.254')
-
- # setup interface address for 100 quagga hosts
- time.sleep(10)
- #for i in range(numHost101, numHost200 + 1):
- #host100 = net.get('host' + str(i))
- #host100.cmd(str(i)+'.0.1.254', 24, 'host'+str(i)+'-eth1')
- #as4host100 = net.get('as4host%s' %(i))
- #as4host100.defaultIntf().setIP(str(i) + '.0.0.1/24')
- #as4host100.cmd('ip route add default via ' + str(i) + '.0.0.254')
- #for j in range(0, 100):
- #as4host100.cmd('sudo ip addr add %d.0.%d.1/24 dev %s-eth0' %(i, j, as4host100))
-
- # Set up AS6 - This has a router and a route server
- #as6rs, host5 = net.get('as6rs', 'host5')
- host5 = net.get('host5')
- #as6rs.setIP('192.168.60.1', 24, 'as6rs-eth0')
- #as6rs.setMAC('00:00:00:00:06:01', 'as6rs-eth0')
- host5.setIP('192.168.60.2', 24, 'host5-eth0')
- host5.setMAC('00:00:00:00:06:02', 'host5-eth0')
- #as6router.setIP('172.16.60.254', 24, 'as6router-eth1')
- host5.setIP('5.0.0.254', 8, 'host5-eth1')
- host5.cmd('sysctl net.ipv4.conf.all.forwarding=1')
- host5.setIP('1.168.30.5', 24, 'host5-eth2')
- host5.setMAC('00:00:00:00:06:05', 'host5-eth2')
-
- as6host = net.get('as6host')
- #as6host.defaultIntf().setIP('5.0.0.1/24')
- for i in range(0, 10):
- as6host.cmd('sudo ip addr add 5.0.%d.1/24 dev as6host-eth0' %i)
- as6host.cmd('ip route add default via 5.0.0.254')
-
- # test the host in the as6
- #for i in range(1, 10):
- # baseip = (i-1)*4
- # host = net.get('as6host%d' % i)
- # host.defaultIntf().setIP('172.16.70.%d/24' % (baseip+1))
- # host.cmd('ip route add default via 172.16.70.%d' % (baseip+2))
- # as6router.setIP('172.16.70.%d' % (baseip+2), 30, 'as6router-eth%d' % (i+1))
-
- # Start Quagga on border routers
- startquagga(host3, 1, QUAGGA_CONFIG_FILE_DIR + '/quagga1.conf')
- startquagga(host4, 2, QUAGGA_CONFIG_FILE_DIR + '/quagga2.conf')
- #for i in range(numHost101, numHost200 + 1):
- #host100=net.get('host%d' % (i))
- #startquaggahost5(host100, i)
-
- #startquagga(as6rs, 4, 'quagga-as6-rs.conf')
- startquagga(host5, 5, QUAGGA_CONFIG_FILE_DIR + '/quagga-as6.conf')
-
- #root1, root2, rootTestOn = net.get( 'root1', 'root2', 'rootTestOn' )
- root1, rootTestOn = net.get( 'root1', 'rootTestOn' )
- host1.intf('host1-eth1').setIP('1.1.1.1/24')
- root1.intf('root1-eth0').setIP('1.1.1.2/24')
- #host2.intf('host2-eth1').setIP('1.1.2.1/24')
- #root2.intf('root2-eth0').setIP('1.1.2.2/24')
-
- #rootTestOn.cmd('ip addr add 1.168.30.102/24 dev rootTestOn-eth0')
- rootTestOn.cmd('ip addr add 1.168.30.99/24 dev rootTestOn-eth0')
-
- stopsshd()
-
- startquagga(host1, 100, QUAGGA_CONFIG_FILE_DIR + '/quagga-sdn-modified.conf')
- hosts = [ host1, host3, host4, host5, as2host ];
- #sshdHosts = sshdHosts + hosts
- startsshds( hosts )
- #
- onos1 = '127.0.0.1'
- forwarding1 = '%s:2000:%s:2000' % ('1.1.1.2', onos1)
- root1.cmd( 'ssh -nNT -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -l sdn -L %s %s & ' % (forwarding1, onos1) )
-
- # Forward 2605 to root namespace for easier access to SDN domain BGPd
- # If root can ssh to itself without a password this should work
- root1.cmd('ssh -N -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -L 2605:1.1.1.1:2605 1.1.1.1 &')
- #time.sleep(3000000000)
- CLI( net )
-
- # Close the ssh port forwarding
- #quietRun('sudo pkill -f 1.1.1.1')
-
- stopsshd()
- stopquagga()
- net.stop()
-
-if __name__ == '__main__':
- setLogLevel( 'debug' )
- if len(sys.argv) > 1:
- QUAGGA_CONFIG_FILE_DIR = sys.argv[1]
- sdn1net()
diff --git a/TestON/tests/PeeringRouterTest/mininet/quagga-as6-rs.conf b/TestON/tests/PeeringRouterTest/mininet/quagga-as6-rs.conf
deleted file mode 100644
index 1eac0dd..0000000
--- a/TestON/tests/PeeringRouterTest/mininet/quagga-as6-rs.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64520
- bgp router-id 192.168.60.1
- neighbor 192.168.60.101 remote-as 64513
- neighbor 192.168.60.101 route-server-client
- neighbor 192.168.60.2 remote-as 64521
- neighbor 192.168.60.2 route-server-client
-! network 172.16.60.0/24
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/mininet/quagga-as6.conf b/TestON/tests/PeeringRouterTest/mininet/quagga-as6.conf
deleted file mode 100644
index 434f983..0000000
--- a/TestON/tests/PeeringRouterTest/mininet/quagga-as6.conf
+++ /dev/null
@@ -1,39 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64521
- bgp router-id 192.168.60.2
- neighbor 192.168.60.101 remote-as 64513
-! neighbor 192.168.60.1 remote-as 64520
-! neighbor 192.168.60.3 remote-as 64520
-! network 172.16.60.0/24
-! network 172.16.70.4/30
- ! network 172.16.70.8/30
- ! network 172.16.70.12/30
- ! network 172.16.70.16/30
- ! network 172.16.70.20/30
- ! network 172.16.70.24/30
- ! network 172.16.70.28/30
- ! network 172.16.70.32/30
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/mininet/quagga-sdn-modified.conf b/TestON/tests/PeeringRouterTest/mininet/quagga-sdn-modified.conf
deleted file mode 100644
index d334c2a..0000000
--- a/TestON/tests/PeeringRouterTest/mininet/quagga-sdn-modified.conf
+++ /dev/null
@@ -1,49 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-route-map AS65000 permit 1
- set as-path prepend 65000
-!
-router bgp 64513
- bgp router-id 192.168.10.101
- timers bgp 1 3
- !timers bgp 3 9
- neighbor 192.168.10.1 remote-as 64514
- neighbor 192.168.10.1 ebgp-multihop
- neighbor 192.168.10.1 timers connect 5
- neighbor 192.168.20.1 remote-as 64514
- neighbor 192.168.20.1 ebgp-multihop
- neighbor 192.168.20.1 timers connect 5
- neighbor 192.168.20.1 route-map AS65000 in
- neighbor 192.168.30.1 remote-as 64516
- neighbor 192.168.30.1 ebgp-multihop
- neighbor 192.168.30.1 timers connect 5
- neighbor 192.168.60.2 remote-as 64521
- neighbor 192.168.60.2 ebgp-multihop
- neighbor 192.168.60.2 timers connect 5
- neighbor 1.1.1.2 remote-as 64513
- neighbor 1.1.1.2 port 2000
- neighbor 1.1.1.2 timers connect 5
-
-
-
- network 172.16.10.0/24
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/mininet/quagga-sdn.conf b/TestON/tests/PeeringRouterTest/mininet/quagga-sdn.conf
deleted file mode 100644
index 77392a6..0000000
--- a/TestON/tests/PeeringRouterTest/mininet/quagga-sdn.conf
+++ /dev/null
@@ -1,349 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-route-map AS65000 permit 1
- set as-path prepend 65000
-!
-router bgp 64513
- bgp router-id 192.168.10.101
- timers bgp 1 3
- !timers bgp 3 9
- neighbor 192.168.10.1 remote-as 64514
- neighbor 192.168.10.1 ebgp-multihop
- neighbor 192.168.10.1 timers connect 5
- neighbor 192.168.20.1 remote-as 64514
- neighbor 192.168.20.1 ebgp-multihop
- neighbor 192.168.20.1 timers connect 5
- neighbor 192.168.20.1 route-map AS65000 in
- neighbor 192.168.30.1 remote-as 64516
- neighbor 192.168.30.1 ebgp-multihop
- neighbor 192.168.30.1 timers connect 5
- neighbor 192.168.60.1 remote-as 64520
- neighbor 192.168.60.1 ebgp-multihop
- neighbor 192.168.60.1 timers connect 5
- neighbor 1.1.1.2 remote-as 64513
- neighbor 1.1.1.2 port 2000
- neighbor 1.1.1.2 timers connect 5
-
-
-neighbor 192.168.40.1 remote-as 65001
-neighbor 192.168.40.1 ebgp-multihop
-neighbor 192.168.40.1 timers connect 10
-neighbor 192.168.40.2 remote-as 65002
-neighbor 192.168.40.2 ebgp-multihop
-neighbor 192.168.40.2 timers connect 10
-neighbor 192.168.40.3 remote-as 65003
-neighbor 192.168.40.3 ebgp-multihop
-neighbor 192.168.40.3 timers connect 10
-neighbor 192.168.40.4 remote-as 65004
-neighbor 192.168.40.4 ebgp-multihop
-neighbor 192.168.40.4 timers connect 10
-neighbor 192.168.40.5 remote-as 65005
-neighbor 192.168.40.5 ebgp-multihop
-neighbor 192.168.40.5 timers connect 10
-neighbor 192.168.40.6 remote-as 65006
-neighbor 192.168.40.6 ebgp-multihop
-neighbor 192.168.40.6 timers connect 10
-neighbor 192.168.40.7 remote-as 65007
-neighbor 192.168.40.7 ebgp-multihop
-neighbor 192.168.40.7 timers connect 10
-neighbor 192.168.40.8 remote-as 65008
-neighbor 192.168.40.8 ebgp-multihop
-neighbor 192.168.40.8 timers connect 10
-neighbor 192.168.40.9 remote-as 65009
-neighbor 192.168.40.9 ebgp-multihop
-neighbor 192.168.40.9 timers connect 10
-neighbor 192.168.40.10 remote-as 65010
-neighbor 192.168.40.10 ebgp-multihop
-neighbor 192.168.40.10 timers connect 10
-neighbor 192.168.40.11 remote-as 65011
-neighbor 192.168.40.11 ebgp-multihop
-neighbor 192.168.40.11 timers connect 10
-neighbor 192.168.40.12 remote-as 65012
-neighbor 192.168.40.12 ebgp-multihop
-neighbor 192.168.40.12 timers connect 10
-neighbor 192.168.40.13 remote-as 65013
-neighbor 192.168.40.13 ebgp-multihop
-neighbor 192.168.40.13 timers connect 10
-neighbor 192.168.40.14 remote-as 65014
-neighbor 192.168.40.14 ebgp-multihop
-neighbor 192.168.40.14 timers connect 10
-neighbor 192.168.40.15 remote-as 65015
-neighbor 192.168.40.15 ebgp-multihop
-neighbor 192.168.40.15 timers connect 10
-neighbor 192.168.40.16 remote-as 65016
-neighbor 192.168.40.16 ebgp-multihop
-neighbor 192.168.40.16 timers connect 10
-neighbor 192.168.40.17 remote-as 65017
-neighbor 192.168.40.17 ebgp-multihop
-neighbor 192.168.40.17 timers connect 10
-neighbor 192.168.40.18 remote-as 65018
-neighbor 192.168.40.18 ebgp-multihop
-neighbor 192.168.40.18 timers connect 10
-neighbor 192.168.40.19 remote-as 65019
-neighbor 192.168.40.19 ebgp-multihop
-neighbor 192.168.40.19 timers connect 10
-neighbor 192.168.40.20 remote-as 65020
-neighbor 192.168.40.20 ebgp-multihop
-neighbor 192.168.40.20 timers connect 10
-neighbor 192.168.40.21 remote-as 65021
-neighbor 192.168.40.21 ebgp-multihop
-neighbor 192.168.40.21 timers connect 10
-neighbor 192.168.40.22 remote-as 65022
-neighbor 192.168.40.22 ebgp-multihop
-neighbor 192.168.40.22 timers connect 10
-neighbor 192.168.40.23 remote-as 65023
-neighbor 192.168.40.23 ebgp-multihop
-neighbor 192.168.40.23 timers connect 10
-neighbor 192.168.40.24 remote-as 65024
-neighbor 192.168.40.24 ebgp-multihop
-neighbor 192.168.40.24 timers connect 10
-neighbor 192.168.40.25 remote-as 65025
-neighbor 192.168.40.25 ebgp-multihop
-neighbor 192.168.40.25 timers connect 10
-neighbor 192.168.40.26 remote-as 65026
-neighbor 192.168.40.26 ebgp-multihop
-neighbor 192.168.40.26 timers connect 10
-neighbor 192.168.40.27 remote-as 65027
-neighbor 192.168.40.27 ebgp-multihop
-neighbor 192.168.40.27 timers connect 10
-neighbor 192.168.40.28 remote-as 65028
-neighbor 192.168.40.28 ebgp-multihop
-neighbor 192.168.40.28 timers connect 10
-neighbor 192.168.40.29 remote-as 65029
-neighbor 192.168.40.29 ebgp-multihop
-neighbor 192.168.40.29 timers connect 10
-neighbor 192.168.40.30 remote-as 65030
-neighbor 192.168.40.30 ebgp-multihop
-neighbor 192.168.40.30 timers connect 10
-neighbor 192.168.40.31 remote-as 65031
-neighbor 192.168.40.31 ebgp-multihop
-neighbor 192.168.40.31 timers connect 10
-neighbor 192.168.40.32 remote-as 65032
-neighbor 192.168.40.32 ebgp-multihop
-neighbor 192.168.40.32 timers connect 10
-neighbor 192.168.40.33 remote-as 65033
-neighbor 192.168.40.33 ebgp-multihop
-neighbor 192.168.40.33 timers connect 10
-neighbor 192.168.40.34 remote-as 65034
-neighbor 192.168.40.34 ebgp-multihop
-neighbor 192.168.40.34 timers connect 10
-neighbor 192.168.40.35 remote-as 65035
-neighbor 192.168.40.35 ebgp-multihop
-neighbor 192.168.40.35 timers connect 10
-neighbor 192.168.40.36 remote-as 65036
-neighbor 192.168.40.36 ebgp-multihop
-neighbor 192.168.40.36 timers connect 10
-neighbor 192.168.40.37 remote-as 65037
-neighbor 192.168.40.37 ebgp-multihop
-neighbor 192.168.40.37 timers connect 10
-neighbor 192.168.40.38 remote-as 65038
-neighbor 192.168.40.38 ebgp-multihop
-neighbor 192.168.40.38 timers connect 10
-neighbor 192.168.40.39 remote-as 65039
-neighbor 192.168.40.39 ebgp-multihop
-neighbor 192.168.40.39 timers connect 10
-neighbor 192.168.40.40 remote-as 65040
-neighbor 192.168.40.40 ebgp-multihop
-neighbor 192.168.40.40 timers connect 10
-neighbor 192.168.40.41 remote-as 65041
-neighbor 192.168.40.41 ebgp-multihop
-neighbor 192.168.40.41 timers connect 10
-neighbor 192.168.40.42 remote-as 65042
-neighbor 192.168.40.42 ebgp-multihop
-neighbor 192.168.40.42 timers connect 10
-neighbor 192.168.40.43 remote-as 65043
-neighbor 192.168.40.43 ebgp-multihop
-neighbor 192.168.40.43 timers connect 10
-neighbor 192.168.40.44 remote-as 65044
-neighbor 192.168.40.44 ebgp-multihop
-neighbor 192.168.40.44 timers connect 10
-neighbor 192.168.40.45 remote-as 65045
-neighbor 192.168.40.45 ebgp-multihop
-neighbor 192.168.40.45 timers connect 10
-neighbor 192.168.40.46 remote-as 65046
-neighbor 192.168.40.46 ebgp-multihop
-neighbor 192.168.40.46 timers connect 10
-neighbor 192.168.40.47 remote-as 65047
-neighbor 192.168.40.47 ebgp-multihop
-neighbor 192.168.40.47 timers connect 10
-neighbor 192.168.40.48 remote-as 65048
-neighbor 192.168.40.48 ebgp-multihop
-neighbor 192.168.40.48 timers connect 10
-neighbor 192.168.40.49 remote-as 65049
-neighbor 192.168.40.49 ebgp-multihop
-neighbor 192.168.40.49 timers connect 10
-neighbor 192.168.40.50 remote-as 65050
-neighbor 192.168.40.50 ebgp-multihop
-neighbor 192.168.40.50 timers connect 10
-neighbor 192.168.40.51 remote-as 65051
-neighbor 192.168.40.51 ebgp-multihop
-neighbor 192.168.40.51 timers connect 10
-neighbor 192.168.40.52 remote-as 65052
-neighbor 192.168.40.52 ebgp-multihop
-neighbor 192.168.40.52 timers connect 10
-neighbor 192.168.40.53 remote-as 65053
-neighbor 192.168.40.53 ebgp-multihop
-neighbor 192.168.40.53 timers connect 10
-neighbor 192.168.40.54 remote-as 65054
-neighbor 192.168.40.54 ebgp-multihop
-neighbor 192.168.40.54 timers connect 10
-neighbor 192.168.40.55 remote-as 65055
-neighbor 192.168.40.55 ebgp-multihop
-neighbor 192.168.40.55 timers connect 10
-neighbor 192.168.40.56 remote-as 65056
-neighbor 192.168.40.56 ebgp-multihop
-neighbor 192.168.40.56 timers connect 10
-neighbor 192.168.40.57 remote-as 65057
-neighbor 192.168.40.57 ebgp-multihop
-neighbor 192.168.40.57 timers connect 10
-neighbor 192.168.40.58 remote-as 65058
-neighbor 192.168.40.58 ebgp-multihop
-neighbor 192.168.40.58 timers connect 10
-neighbor 192.168.40.59 remote-as 65059
-neighbor 192.168.40.59 ebgp-multihop
-neighbor 192.168.40.59 timers connect 10
-neighbor 192.168.40.60 remote-as 65060
-neighbor 192.168.40.60 ebgp-multihop
-neighbor 192.168.40.60 timers connect 10
-neighbor 192.168.40.61 remote-as 65061
-neighbor 192.168.40.61 ebgp-multihop
-neighbor 192.168.40.61 timers connect 10
-neighbor 192.168.40.62 remote-as 65062
-neighbor 192.168.40.62 ebgp-multihop
-neighbor 192.168.40.62 timers connect 10
-neighbor 192.168.40.63 remote-as 65063
-neighbor 192.168.40.63 ebgp-multihop
-neighbor 192.168.40.63 timers connect 10
-neighbor 192.168.40.64 remote-as 65064
-neighbor 192.168.40.64 ebgp-multihop
-neighbor 192.168.40.64 timers connect 10
-neighbor 192.168.40.65 remote-as 65065
-neighbor 192.168.40.65 ebgp-multihop
-neighbor 192.168.40.65 timers connect 10
-neighbor 192.168.40.66 remote-as 65066
-neighbor 192.168.40.66 ebgp-multihop
-neighbor 192.168.40.66 timers connect 10
-neighbor 192.168.40.67 remote-as 65067
-neighbor 192.168.40.67 ebgp-multihop
-neighbor 192.168.40.67 timers connect 10
-neighbor 192.168.40.68 remote-as 65068
-neighbor 192.168.40.68 ebgp-multihop
-neighbor 192.168.40.68 timers connect 10
-neighbor 192.168.40.69 remote-as 65069
-neighbor 192.168.40.69 ebgp-multihop
-neighbor 192.168.40.69 timers connect 10
-neighbor 192.168.40.70 remote-as 65070
-neighbor 192.168.40.70 ebgp-multihop
-neighbor 192.168.40.70 timers connect 10
-neighbor 192.168.40.71 remote-as 65071
-neighbor 192.168.40.71 ebgp-multihop
-neighbor 192.168.40.71 timers connect 10
-neighbor 192.168.40.72 remote-as 65072
-neighbor 192.168.40.72 ebgp-multihop
-neighbor 192.168.40.72 timers connect 10
-neighbor 192.168.40.73 remote-as 65073
-neighbor 192.168.40.73 ebgp-multihop
-neighbor 192.168.40.73 timers connect 10
-neighbor 192.168.40.74 remote-as 65074
-neighbor 192.168.40.74 ebgp-multihop
-neighbor 192.168.40.74 timers connect 10
-neighbor 192.168.40.75 remote-as 65075
-neighbor 192.168.40.75 ebgp-multihop
-neighbor 192.168.40.75 timers connect 10
-neighbor 192.168.40.76 remote-as 65076
-neighbor 192.168.40.76 ebgp-multihop
-neighbor 192.168.40.76 timers connect 10
-neighbor 192.168.40.77 remote-as 65077
-neighbor 192.168.40.77 ebgp-multihop
-neighbor 192.168.40.77 timers connect 10
-neighbor 192.168.40.78 remote-as 65078
-neighbor 192.168.40.78 ebgp-multihop
-neighbor 192.168.40.78 timers connect 10
-neighbor 192.168.40.79 remote-as 65079
-neighbor 192.168.40.79 ebgp-multihop
-neighbor 192.168.40.79 timers connect 10
-neighbor 192.168.40.80 remote-as 65080
-neighbor 192.168.40.80 ebgp-multihop
-neighbor 192.168.40.80 timers connect 10
-neighbor 192.168.40.81 remote-as 65081
-neighbor 192.168.40.81 ebgp-multihop
-neighbor 192.168.40.81 timers connect 10
-neighbor 192.168.40.82 remote-as 65082
-neighbor 192.168.40.82 ebgp-multihop
-neighbor 192.168.40.82 timers connect 10
-neighbor 192.168.40.83 remote-as 65083
-neighbor 192.168.40.83 ebgp-multihop
-neighbor 192.168.40.83 timers connect 10
-neighbor 192.168.40.84 remote-as 65084
-neighbor 192.168.40.84 ebgp-multihop
-neighbor 192.168.40.84 timers connect 10
-neighbor 192.168.40.85 remote-as 65085
-neighbor 192.168.40.85 ebgp-multihop
-neighbor 192.168.40.85 timers connect 10
-neighbor 192.168.40.86 remote-as 65086
-neighbor 192.168.40.86 ebgp-multihop
-neighbor 192.168.40.86 timers connect 10
-neighbor 192.168.40.87 remote-as 65087
-neighbor 192.168.40.87 ebgp-multihop
-neighbor 192.168.40.87 timers connect 10
-neighbor 192.168.40.88 remote-as 65088
-neighbor 192.168.40.88 ebgp-multihop
-neighbor 192.168.40.88 timers connect 10
-neighbor 192.168.40.89 remote-as 65089
-neighbor 192.168.40.89 ebgp-multihop
-neighbor 192.168.40.89 timers connect 10
-neighbor 192.168.40.90 remote-as 65090
-neighbor 192.168.40.90 ebgp-multihop
-neighbor 192.168.40.90 timers connect 10
-neighbor 192.168.40.91 remote-as 65091
-neighbor 192.168.40.91 ebgp-multihop
-neighbor 192.168.40.91 timers connect 10
-neighbor 192.168.40.92 remote-as 65092
-neighbor 192.168.40.92 ebgp-multihop
-neighbor 192.168.40.92 timers connect 10
-neighbor 192.168.40.93 remote-as 65093
-neighbor 192.168.40.93 ebgp-multihop
-neighbor 192.168.40.93 timers connect 10
-neighbor 192.168.40.94 remote-as 65094
-neighbor 192.168.40.94 ebgp-multihop
-neighbor 192.168.40.94 timers connect 10
-neighbor 192.168.40.95 remote-as 65095
-neighbor 192.168.40.95 ebgp-multihop
-neighbor 192.168.40.95 timers connect 10
-neighbor 192.168.40.96 remote-as 65096
-neighbor 192.168.40.96 ebgp-multihop
-neighbor 192.168.40.96 timers connect 10
-neighbor 192.168.40.97 remote-as 65097
-neighbor 192.168.40.97 ebgp-multihop
-neighbor 192.168.40.97 timers connect 10
-neighbor 192.168.40.98 remote-as 65098
-neighbor 192.168.40.98 ebgp-multihop
-neighbor 192.168.40.98 timers connect 10
-neighbor 192.168.40.99 remote-as 65099
-neighbor 192.168.40.99 ebgp-multihop
-neighbor 192.168.40.99 timers connect 10
-neighbor 192.168.40.100 remote-as 65100
-neighbor 192.168.40.100 ebgp-multihop
-neighbor 192.168.40.100 timers connect 10
-
- network 172.16.10.0/24
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/mininet/quagga1.conf b/TestON/tests/PeeringRouterTest/mininet/quagga1.conf
deleted file mode 100644
index 264f85e..0000000
--- a/TestON/tests/PeeringRouterTest/mininet/quagga1.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-!
-! Zebra configuration saved from vty
-! 2014/11/25 11:22:24
-!
-hostname bgpd
-password hello
-log stdout
-!
-router bgp 64514
- bgp router-id 192.168.10.1
-! network 3.0.0.0/24
-! network 3.0.1.0/24
-! network 3.0.2.0/24
-! network 3.0.3.0/24
-! network 3.0.4.0/24
-! network 3.0.5.0/24
-! network 3.0.6.0/24
-! network 3.0.7.0/24
-! network 3.0.8.0/24
-! network 3.0.9.0/24
- neighbor 192.168.20.101 remote-as 64513
- neighbor 192.168.20.101 route-map PREPEND2 in
- neighbor 192.168.20.101 route-map PREPEND2 out
-!
-route-map PREPEND1 permit 1
- set as-path prepend 64514
-!
-route-map PREPEND2 permit 2
- set as-path prepend 64514 64514
-!
-line vty
-!
diff --git a/TestON/tests/PeeringRouterTest/mininet/quagga2.conf b/TestON/tests/PeeringRouterTest/mininet/quagga2.conf
deleted file mode 100644
index 20ca9e4..0000000
--- a/TestON/tests/PeeringRouterTest/mininet/quagga2.conf
+++ /dev/null
@@ -1,31 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64516
- bgp router-id 192.168.30.1
-! timers bgp 1 3
- neighbor 192.168.30.101 remote-as 64513
-! neighbor 192.168.50.2 remote-as 65001
-! network 172.16.30.0/24
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/mininet/zebra.conf b/TestON/tests/PeeringRouterTest/mininet/zebra.conf
deleted file mode 100644
index 0f8e3a2..0000000
--- a/TestON/tests/PeeringRouterTest/mininet/zebra.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-! -*- zebra -*-
-!
-! zebra sample configuration file
-!
-! $Id: zebra.conf.sample,v 1.1 2002/12/13 20:15:30 paul Exp $
-!
-hostname zebra
-password hello
-enable password 0fw0rk
-log stdout
-!
-! Interfaces description.
-!
-!interface lo
-! description test of desc.
-!
-!interface sit0
-! multicast
-
-!
-! Static default route sample.
-!
-!ip route 0.0.0.0/0 203.181.89.241
-!
-
-!log file /usr/local/var/log/quagga/zebra.log
diff --git a/TestON/tests/PeeringRouterTest/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg b/TestON/tests/PeeringRouterTest/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg
deleted file mode 100644
index 5feaf1d..0000000
--- a/TestON/tests/PeeringRouterTest/org.onosproject.openflow.controller.impl.OpenFlowControllerImpl.cfg
+++ /dev/null
@@ -1 +0,0 @@
-corsaDpid = 00:00:00:00:00:00:00:01
diff --git a/TestON/tests/PeeringRouterTest/org.onosproject.provider.lldp.impl.LLDPLinkProvider.cfg b/TestON/tests/PeeringRouterTest/org.onosproject.provider.lldp.impl.LLDPLinkProvider.cfg
deleted file mode 100644
index 65c7bf3..0000000
--- a/TestON/tests/PeeringRouterTest/org.onosproject.provider.lldp.impl.LLDPLinkProvider.cfg
+++ /dev/null
@@ -1,19 +0,0 @@
-# Sample configuration for link discovery
-# Note that this file location is required for packaging onos and launching it in another localtion.
-# If you are launching onos locally, this configuration file would be placed at: $(KARAF_ROOT)/etc
-
-#
-# Disable Link Dicovery Permanently (Note: changing this property at runtime will have NO effect)
-#
-disableLinkDiscovery = true
-
-#
-# Enable Broadcast Discovery Protocol
-#
-#useBDDP = false
-
-#
-# Disable LLDP's recieved from specific devices
-# Details of the devices are in the file configured below
-#
-#lldpSuppression =
diff --git a/TestON/tests/PeeringRouterTest/routeconvergence/mininet/PeeringRouterConvergenceMininet.py b/TestON/tests/PeeringRouterTest/routeconvergence/mininet/PeeringRouterConvergenceMininet.py
deleted file mode 100755
index 13c66ac..0000000
--- a/TestON/tests/PeeringRouterTest/routeconvergence/mininet/PeeringRouterConvergenceMininet.py
+++ /dev/null
@@ -1,346 +0,0 @@
-#!/usr/bin/python
-
-"""
-Start up the SDN-IP demo topology
-"""
-
-"""
-AS1 = 64513, (SDN AS)
-AS2 = 64514, reachable by 192.168.10.1, 192.168.20.1
-AS3 = 64516, reachable by 192.168.30.1
-AS4 = 64517, reachable by 192.168.40.1
-AS6 = 64520, reachable by 192.168.60.2, (route server 192.168.60.1)
-"""
-
-from mininet.net import Mininet
-from mininet.node import Controller, RemoteController
-from mininet.log import setLogLevel, info
-from mininet.cli import CLI
-from mininet.topo import Topo
-from mininet.util import quietRun
-from mininet.moduledeps import pathCheck
-
-import os.path
-import time
-import sys
-from subprocess import Popen, STDOUT, PIPE
-
-QUAGGA_DIR = '/usr/lib/quagga'
-#QUAGGA_DIR = '/usr/local/sbin'
-QUAGGA_RUN_DIR = '/usr/local/var/run/quagga'
-
-QUAGGA_CONFIG_FILE_DIR = '/home/tutorial1/ONLabTest/TestON/tests/PeeringRouterTest/mininet'
-
-class SDNIpModifiedTopo( Topo ):
- "SDN Ip Modified Topology"
-
- def __init__( self, *args, **kwargs ):
- global numHost101
- global numHost200
- numHost101 = 101
- numHost200 = 200
- Topo.__init__( self, *args, **kwargs )
- sw1 = self.addSwitch('sw1', dpid='0000000000000001')
- sw2 = self.addSwitch('sw2', dpid='0000000000000002')
- #sw3 = self.addSwitch('sw3', dpid='00000000000000a3')
- #sw4 = self.addSwitch('sw4', dpid='00000000000000a4')
- #sw5 = self.addSwitch('sw5', dpid='00000000000000a5')
- #sw6 = self.addSwitch('sw6', dpid='00000000000000a6')
- #add a switch for 3 quagga hosts
- swTestOn = self.addSwitch('swTestOn', dpid='0000000000000102')
- #Note this switch isn't part of the SDN topology
- #We'll use the ovs-controller to turn this into a learning switch
- as6sw = self.addSwitch('as6sw', dpid='00000000000000a7')
-
- host1 = self.addHost( 'host1' )
- root1 = self.addHost( 'root1', inNamespace=False , ip='0')
- rootTestOn = self.addHost( 'rootTestOn', inNamespace=False, ip='0' )
-
- #AS2 host
- host3 = self.addHost( 'host3' )
- as2host = self.addHost( 'as2host' )
- #AS3 host
- host4 = self.addHost( 'host4' )
- as3host = self.addHost( 'as3host' )
- #AS6 host
- host5 = self.addHost( 'host5' )
- as6host = self.addHost( 'as6host' )
-
- self.addLink( host1, sw2 )
- #Links to the multihomed AS
- self.addLink( host3, sw1 )
- self.addLink( host3, sw1 )
- self.addLink( as2host, host3 )
- #Single links to the remaining two ASes
- self.addLink( host4, sw1 )
- self.addLink( as3host, host4 )
-
- #AS3-AS4 link
- #self.addLink( host4, host5)
- #Add new AS6 to its bridge
- self.addLink( host5, as6sw )
- self.addLink( as6host, host5 )
-
- #Backup link from router5 to router4
- self.addLink( host4, host5)
-
- #test the host behind the router(behind the router server)
-# for i in range(1, 10):
- # host = self.addHost('as6host%d' % i)
- # self.addLink(host, as6router)
-
- ## Internal Connection To Hosts ##
- self.addLink( root1, host1 )
-
- # self.addLink( sw1, sw2 )
- # self.addLink( sw1, sw3 )
- # self.addLink( sw2, sw4 )
- # self.addLink( sw3, sw4 )
- # self.addLink( sw3, sw5 )
- # self.addLink( sw4, sw6 )
- # self.addLink( sw5, sw6 )
- self.addLink( as6sw, sw1 )
-
-
- self.addLink(swTestOn, rootTestOn)
- #self.addLink(swTestOn, host1)
- self.addLink(swTestOn, host3)
- self.addLink(swTestOn, host4)
- self.addLink(swTestOn, host5)
- self.addLink(swTestOn, as2host)
-
-
- #self.addLink(rootTestOn, host4)
-
-def startsshd( host ):
- "Start sshd on host"
- info( '*** Starting sshd\n' )
- name, intf, ip = host.name, host.defaultIntf(), host.IP()
- banner = '/tmp/%s.banner' % name
- host.cmd( 'echo "Welcome to %s at %s" > %s' % ( name, ip, banner ) )
- host.cmd( '/usr/sbin/sshd -o "Banner %s"' % banner, '-o "UseDNS no"' )
- info( '***', host.name, 'is running sshd on', intf, 'at', ip, '\n' )
-
-def startsshds ( hosts ):
- for h in hosts:
- startsshd( h )
-
-def stopsshd( ):
- "Stop *all* sshd processes with a custom banner"
- info( '*** Shutting down stale sshd/Banner processes ',
- quietRun( "pkill -9 -f Banner" ), '\n' )
-
-def startquagga( host, num, config_file ):
- info( '*** Starting Quagga on %s\n' % host )
- zebra_cmd = 'sudo %s/zebra -d -f %s/zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid' % (QUAGGA_DIR, QUAGGA_CONFIG_FILE_DIR, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
- quagga_cmd = 'sudo %s/bgpd -d -f %s -z %s/zserv%s.api -i %s/bgpd%s.pid' % (QUAGGA_DIR, config_file, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
-
- print zebra_cmd
- print quagga_cmd
-
- host.cmd( zebra_cmd )
- host.cmd( quagga_cmd )
-
-def startquaggahost5( host, num ):
- info( '*** Starting Quagga on %s\n' % host )
- zebra_cmd = 'sudo %s/zebra -d -f %s/zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid' % (QUAGGA_DIR, QUAGGA_CONFIG_FILE_DIR, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
- quagga_cmd = 'sudo %s/bgpd -d -f ./as4quaggas/quagga%s.conf -z %s/zserv%s.api -i %s/bgpd%s.pid' % (QUAGGA_DIR, num, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
-
- host.cmd( zebra_cmd )
- host.cmd( quagga_cmd )
-
-
-def stopquagga( ):
- quietRun( 'sudo pkill -9 -f bgpd' )
- quietRun( 'sudo pkill -9 -f zebra' )
-
-def sdn1net():
- topo = SDNIpModifiedTopo()
- info( '*** Creating network\n' )
- net = Mininet( topo=topo, controller=RemoteController )
- net = Mininet( topo=topo, controller=RemoteController )
-
- host1, host3, host4, host5 = net.get( 'host1', 'host3', 'host4', 'host5' )
-
- #host100.setIP('1.168.30.' + str(i), 24, str(host100) + "-eth2")
-
- #host500.setMAC('00:00:00:00:04:%d' % (i-101), 'host%d-eth0' %(i))
- #add IP prefixes
- #for j in range(0,121):
- #host100.cmd('sudo ip addr add %s.0.40.%s/24 dev host%s-eth0' %(i,j,i))
-
- ## Adding 2nd, 3rd and 4th interface to host1 connected to sw1 (for another BGP peering)
- #sw1 = net.get('sw1')
- host1.setMAC('00:00:00:00:00:01', 'host1-eth0')
- host1.cmd('ip addr add 192.168.20.101/24 dev host1-eth0')
- host1.cmd('ip addr add 192.168.30.101/24 dev host1-eth0')
- #host1.cmd('ip addr add 192.168.40.101/24 dev host1-eth0')
- host1.cmd('ip addr add 192.168.60.101/24 dev host1-eth0')
-
- # Net has to be start after adding the above link
- net.start()
-
- # Set up as6sw as a learning switch as quickly as possible so it
- # hopefully doesn't connect to the actual controller
- # TODO figure out how to change controller before starting switch
- as6sw = net.get('as6sw')
- as6sw.cmd('ovs-vsctl set-controller as6sw none')
- as6sw.cmd('ovs-vsctl set-fail-mode as6sw standalone')
-
-
- sw1 = net.get('sw1')
- sw1.cmd('ovs-vsctl set-controller sw1 tcp:127.0.0.1:6633')
-# sw2.cmd('ovs-vsctl set-controller sw2 tcp:127.0.0.1:6633')
-# sw3.cmd('ovs-vsctl set-controller sw3 tcp:127.0.0.1:6633')
-# sw4.cmd('ovs-vsctl set-controller sw4 tcp:127.0.0.1:6633')
-# sw5.cmd('ovs-vsctl set-controller sw5 tcp:127.0.0.1:6633')
-# sw6.cmd('ovs-vsctl set-controller sw6 tcp:127.0.0.1:6633')
-
-
- swTestOn = net.get('swTestOn')
- swTestOn.cmd('ovs-vsctl set-controller swTestOn none')
- swTestOn.cmd('ovs-vsctl set-fail-mode swTestOn standalone')
-
- host1.defaultIntf().setIP('192.168.10.101/24')
- # Run BGPd
- #host1.cmd('%s -d -f %s' % (BGPD, BGPD_CONF))
- #host1.cmd('/sbin/route add default gw 192.168.10.254 dev %s-eth0' % (host1.name))
-
- # Configure new host interfaces
- #host2.defaultIntf().setIP('172.16.10.2/24')
- #host2.defaultIntf().setMAC('00:00:00:00:01:02')
- #host2.cmd('/sbin/route add default gw 172.16.10.254 dev %s-eth0' % (host2.name))
-
- # Set up AS2
- host3.setIP('192.168.10.1', 24, 'host3-eth0')
- #host3.cmd('sudo ip addr add 172.16.20.1/24 dev host3-eth0')
- host3.setIP('192.168.20.1', 24, 'host3-eth1')
- host3.setMAC('00:00:00:00:02:01', 'host3-eth0')
- host3.setMAC('00:00:00:00:02:02', 'host3-eth1')
- #host3.setIP('172.16.20.254', 24, 'host3-eth2')
- host3.setIP('3.0.0.254', 8, 'host3-eth2')
- host3.cmd('sysctl net.ipv4.conf.all.forwarding=1')
-
- host3.setIP('1.168.30.2', 24, 'host3-eth3')
- host3.cmd('sysctl net.ipv4.conf.all.arp_ignore=1')
- host3.cmd('sysctl net.ipv4.conf.all.arp_announce=1')
- as2host = net.get('as2host')
- #as2host.defaultIntf().setIP('172.16.20.1/24')
- for i in range(0, 20):
- as2host.cmd('sudo ip addr add 3.0.%d.1/24 dev as2host-eth0' %i)
- as2host.setIP('1.168.30.100', 24, 'as2host-eth1')
-
- as2host.cmd('ip route add default via 3.0.0.254')
-
- # Set up AS3
- host4.setIP('192.168.30.1', 24, 'host4-eth0')
- host4.setMAC('00:00:00:00:03:01', 'host4-eth0')
- host4.setIP('4.0.0.254', 8, 'host4-eth1')
- host4.setMAC('00:00:00:00:03:99', 'host4-eth1')
- host4.cmd('sysctl net.ipv4.conf.all.forwarding=1')
- as3host = net.get('as3host')
- for i in range(0, 20):
- as3host.cmd('sudo ip addr add 4.0.%d.1/24 dev as3host-eth0' %i)
- as3host.cmd('ip route add default via 4.0.0.254')
-
- host4.setIP('10.0.0.4', 24, 'host4-eth2')
- host4.setMAC('00:00:00:00:03:33', 'host4-eth2')
-
- #root space
- host4.setIP('1.168.30.3', 24, 'host4-eth3')
- host4.setMAC('00:00:00:00:03:03', 'host4-eth3')
-
- # Set up AS4
- #as4host = net.get('as4host')
- #as4host.defaultIntf().setIP('172.16.40.1/24')
- #as4host.cmd('ip route add default via 172.16.40.254')
-
- # setup interface address for 100 quagga hosts
- time.sleep(10)
- #for i in range(numHost101, numHost200 + 1):
- #host100 = net.get('host' + str(i))
- #host100.cmd(str(i)+'.0.1.254', 24, 'host'+str(i)+'-eth1')
- #as4host100 = net.get('as4host%s' %(i))
- #as4host100.defaultIntf().setIP(str(i) + '.0.0.1/24')
- #as4host100.cmd('ip route add default via ' + str(i) + '.0.0.254')
- #for j in range(0, 100):
- #as4host100.cmd('sudo ip addr add %d.0.%d.1/24 dev %s-eth0' %(i, j, as4host100))
-
- # Set up AS6 - This has a router and a route server
- #as6rs, host5 = net.get('as6rs', 'host5')
- host5 = net.get('host5')
- #as6rs.setIP('192.168.60.1', 24, 'as6rs-eth0')
- #as6rs.setMAC('00:00:00:00:06:01', 'as6rs-eth0')
- host5.setIP('192.168.60.2', 24, 'host5-eth0')
- host5.setMAC('00:00:00:00:06:02', 'host5-eth0')
- #as6router.setIP('172.16.60.254', 24, 'as6router-eth1')
- host5.setIP('5.0.0.254', 8, 'host5-eth1')
- host5.cmd('sysctl net.ipv4.conf.all.forwarding=1')
- host5.setIP('10.0.0.5', 24, 'host5-eth2')
- host5.setMAC('00:00:00:00:06:66', 'host5-eth2')
- host5.setIP('1.168.30.5', 24, 'host5-eth3')
- host5.setMAC('00:00:00:00:06:05', 'host5-eth3')
-
- as6host = net.get('as6host')
- #as6host.defaultIntf().setIP('5.0.0.1/24')
- for i in range(0, 10):
- as6host.cmd('sudo ip addr add 5.0.%d.1/24 dev as6host-eth0' %i)
- as6host.cmd('ip route add default via 5.0.0.254')
-
- # test the host in the as6
- #for i in range(1, 10):
- # baseip = (i-1)*4
- # host = net.get('as6host%d' % i)
- # host.defaultIntf().setIP('172.16.70.%d/24' % (baseip+1))
- # host.cmd('ip route add default via 172.16.70.%d' % (baseip+2))
- # as6router.setIP('172.16.70.%d' % (baseip+2), 30, 'as6router-eth%d' % (i+1))
-
- # Start Quagga on border routers
- startquagga(host3, 1, QUAGGA_CONFIG_FILE_DIR + '/quagga1.conf')
- startquagga(host4, 2, QUAGGA_CONFIG_FILE_DIR + '/quagga2.conf')
- #for i in range(numHost101, numHost200 + 1):
- #host100=net.get('host%d' % (i))
- #startquaggahost5(host100, i)
-
- #startquagga(as6rs, 4, 'quagga-as6-rs.conf')
- startquagga(host5, 5, QUAGGA_CONFIG_FILE_DIR + '/quagga-as6.conf')
-
- #root1, root2, rootTestOn = net.get( 'root1', 'root2', 'rootTestOn' )
- root1, rootTestOn = net.get( 'root1', 'rootTestOn' )
- host1.intf('host1-eth1').setIP('1.1.1.1/24')
- root1.intf('root1-eth0').setIP('1.1.1.2/24')
- #host2.intf('host2-eth1').setIP('1.1.2.1/24')
- #root2.intf('root2-eth0').setIP('1.1.2.2/24')
-
- #rootTestOn.cmd('ip addr add 1.168.30.102/24 dev rootTestOn-eth0')
- rootTestOn.cmd('ip addr add 1.168.30.99/24 dev rootTestOn-eth0')
-
- stopsshd()
-
- startquagga(host1, 100, QUAGGA_CONFIG_FILE_DIR + '/quagga-sdn-modified.conf')
- hosts = [ host1, host3, host4, host5, as2host ];
- #sshdHosts = sshdHosts + hosts
- startsshds( hosts )
- #
- onos1 = '127.0.0.1'
- forwarding1 = '%s:2000:%s:2000' % ('1.1.1.2', onos1)
- root1.cmd( 'ssh -nNT -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -l sdn -L %s %s & ' % (forwarding1, onos1) )
-
- # Forward 2605 to root namespace for easier access to SDN domain BGPd
- # If root can ssh to itself without a password this should work
- root1.cmd('ssh -N -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -L 2605:1.1.1.1:2605 1.1.1.1 &')
- #time.sleep(3000000000)
- CLI( net )
-
- # Close the ssh port forwarding
- #quietRun('sudo pkill -f 1.1.1.1')
-
- stopsshd()
- stopquagga()
- net.stop()
-
-if __name__ == '__main__':
- setLogLevel( 'debug' )
- if len(sys.argv) > 1:
- QUAGGA_CONFIG_FILE_DIR = sys.argv[1]
- sdn1net()
diff --git a/TestON/tests/PeeringRouterTest/routeconvergence/mininet/quagga-as6.conf b/TestON/tests/PeeringRouterTest/routeconvergence/mininet/quagga-as6.conf
deleted file mode 100644
index 5e7028d..0000000
--- a/TestON/tests/PeeringRouterTest/routeconvergence/mininet/quagga-as6.conf
+++ /dev/null
@@ -1,39 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64521
- bgp router-id 192.168.60.2
- neighbor 192.168.60.101 remote-as 64513
- neighbor 10.0.0.4 remote-as 64516
-! neighbor 192.168.60.3 remote-as 64520
-! network 172.16.60.0/24
-! network 172.16.70.4/30
- ! network 172.16.70.8/30
- ! network 172.16.70.12/30
- ! network 172.16.70.16/30
- ! network 172.16.70.20/30
- ! network 172.16.70.24/30
- ! network 172.16.70.28/30
- ! network 172.16.70.32/30
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/routeconvergence/mininet/quagga-sdn-modified.conf b/TestON/tests/PeeringRouterTest/routeconvergence/mininet/quagga-sdn-modified.conf
deleted file mode 100644
index d334c2a..0000000
--- a/TestON/tests/PeeringRouterTest/routeconvergence/mininet/quagga-sdn-modified.conf
+++ /dev/null
@@ -1,49 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-route-map AS65000 permit 1
- set as-path prepend 65000
-!
-router bgp 64513
- bgp router-id 192.168.10.101
- timers bgp 1 3
- !timers bgp 3 9
- neighbor 192.168.10.1 remote-as 64514
- neighbor 192.168.10.1 ebgp-multihop
- neighbor 192.168.10.1 timers connect 5
- neighbor 192.168.20.1 remote-as 64514
- neighbor 192.168.20.1 ebgp-multihop
- neighbor 192.168.20.1 timers connect 5
- neighbor 192.168.20.1 route-map AS65000 in
- neighbor 192.168.30.1 remote-as 64516
- neighbor 192.168.30.1 ebgp-multihop
- neighbor 192.168.30.1 timers connect 5
- neighbor 192.168.60.2 remote-as 64521
- neighbor 192.168.60.2 ebgp-multihop
- neighbor 192.168.60.2 timers connect 5
- neighbor 1.1.1.2 remote-as 64513
- neighbor 1.1.1.2 port 2000
- neighbor 1.1.1.2 timers connect 5
-
-
-
- network 172.16.10.0/24
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/routeconvergence/mininet/quagga1.conf b/TestON/tests/PeeringRouterTest/routeconvergence/mininet/quagga1.conf
deleted file mode 100644
index 264f85e..0000000
--- a/TestON/tests/PeeringRouterTest/routeconvergence/mininet/quagga1.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-!
-! Zebra configuration saved from vty
-! 2014/11/25 11:22:24
-!
-hostname bgpd
-password hello
-log stdout
-!
-router bgp 64514
- bgp router-id 192.168.10.1
-! network 3.0.0.0/24
-! network 3.0.1.0/24
-! network 3.0.2.0/24
-! network 3.0.3.0/24
-! network 3.0.4.0/24
-! network 3.0.5.0/24
-! network 3.0.6.0/24
-! network 3.0.7.0/24
-! network 3.0.8.0/24
-! network 3.0.9.0/24
- neighbor 192.168.20.101 remote-as 64513
- neighbor 192.168.20.101 route-map PREPEND2 in
- neighbor 192.168.20.101 route-map PREPEND2 out
-!
-route-map PREPEND1 permit 1
- set as-path prepend 64514
-!
-route-map PREPEND2 permit 2
- set as-path prepend 64514 64514
-!
-line vty
-!
diff --git a/TestON/tests/PeeringRouterTest/routeconvergence/mininet/quagga2.conf b/TestON/tests/PeeringRouterTest/routeconvergence/mininet/quagga2.conf
deleted file mode 100644
index 14c7d67..0000000
--- a/TestON/tests/PeeringRouterTest/routeconvergence/mininet/quagga2.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64516
- bgp router-id 192.168.30.1
-! timers bgp 1 3
- neighbor 192.168.30.101 remote-as 64513
- neighbor 10.0.0.5 remote-as 64521
-! neighbor 192.168.50.2 remote-as 65001
-! network 172.16.30.0/24
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/routeconvergence/mininet/zebra.conf b/TestON/tests/PeeringRouterTest/routeconvergence/mininet/zebra.conf
deleted file mode 100644
index 0f8e3a2..0000000
--- a/TestON/tests/PeeringRouterTest/routeconvergence/mininet/zebra.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-! -*- zebra -*-
-!
-! zebra sample configuration file
-!
-! $Id: zebra.conf.sample,v 1.1 2002/12/13 20:15:30 paul Exp $
-!
-hostname zebra
-password hello
-enable password 0fw0rk
-log stdout
-!
-! Interfaces description.
-!
-!interface lo
-! description test of desc.
-!
-!interface sit0
-! multicast
-
-!
-! Static default route sample.
-!
-!ip route 0.0.0.0/0 203.181.89.241
-!
-
-!log file /usr/local/var/log/quagga/zebra.log
diff --git a/TestON/tests/PeeringRouterTest/routeserver/addresses.json b/TestON/tests/PeeringRouterTest/routeserver/addresses.json
deleted file mode 100644
index ee83480..0000000
--- a/TestON/tests/PeeringRouterTest/routeserver/addresses.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "addresses" : [
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "1",
- "ips" : ["192.168.10.101/24"],
- "mac" : "00:00:00:00:00:01"
-
- },
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "2",
- "ips" : ["192.168.20.101/24"],
- "mac" : "00:00:00:00:00:01"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "3",
- "ips" : ["192.168.30.101/24"],
- "mac" : "00:00:00:00:00:01"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "4",
- "ips" : ["192.168.60.101/24"],
- "mac" : "00:00:00:00:00:01"
- }
-
- ]
-}
diff --git a/TestON/tests/PeeringRouterTest/routeserver/mininet/PeeringRouteServerMininet.py b/TestON/tests/PeeringRouterTest/routeserver/mininet/PeeringRouteServerMininet.py
deleted file mode 100755
index 0c8cb08..0000000
--- a/TestON/tests/PeeringRouterTest/routeserver/mininet/PeeringRouteServerMininet.py
+++ /dev/null
@@ -1,352 +0,0 @@
-#!/usr/bin/python
-
-"""
-Start up the SDN-IP demo topology
-"""
-
-"""
-AS1 = 64513, (SDN AS)
-AS2 = 64514, reachable by 192.168.10.1, 192.168.20.1
-AS3 = 64516, reachable by 192.168.30.1
-AS4 = 64517, reachable by 192.168.40.1
-AS6 = 64520, reachable by 192.168.60.2, (route server 192.168.60.1)
-"""
-
-from mininet.net import Mininet
-from mininet.node import Controller, RemoteController
-from mininet.log import setLogLevel, info
-from mininet.cli import CLI
-from mininet.topo import Topo
-from mininet.util import quietRun
-from mininet.moduledeps import pathCheck
-
-import os.path
-import time
-import sys
-from subprocess import Popen, STDOUT, PIPE
-
-QUAGGA_DIR = '/usr/lib/quagga'
-#QUAGGA_DIR = '/usr/local/sbin'
-QUAGGA_RUN_DIR = '/usr/local/var/run/quagga'
-
-QUAGGA_CONFIG_FILE_DIR = '/home/tutorial1/ONLabTest/TestON/tests/PeeringRouterTest/mininet'
-
-class SDNIpModifiedTopo( Topo ):
- "SDN Ip Modified Topology"
-
- def __init__( self, *args, **kwargs ):
- global numHost101
- global numHost200
- numHost101 = 101
- numHost200 = 200
- Topo.__init__( self, *args, **kwargs )
- sw1 = self.addSwitch('sw1', dpid='0000000000000001')
- sw2 = self.addSwitch('sw2', dpid='0000000000000002')
- #sw3 = self.addSwitch('sw3', dpid='00000000000000a3')
- #sw4 = self.addSwitch('sw4', dpid='00000000000000a4')
- #sw5 = self.addSwitch('sw5', dpid='00000000000000a5')
- #sw6 = self.addSwitch('sw6', dpid='00000000000000a6')
- #add a switch for 3 quagga hosts
- swTestOn = self.addSwitch('swTestOn', dpid='0000000000000102')
- #Note this switch isn't part of the SDN topology
- #We'll use the ovs-controller to turn this into a learning switch
- as6sw = self.addSwitch('as6sw', dpid='00000000000000a7')
-
- host1 = self.addHost( 'host1' )
- root1 = self.addHost( 'root1', inNamespace=False , ip='0')
- rootTestOn = self.addHost( 'rootTestOn', inNamespace=False, ip='0' )
-
- #AS2 host
- host3 = self.addHost( 'host3' )
- as2host = self.addHost( 'as2host' )
- #AS3 host
- host4 = self.addHost( 'host4' )
- as3host = self.addHost( 'as3host' )
- #AS6 host
- as6rs = self.addHost( 'as6rs' )
- host5 = self.addHost( 'host5' )
- as6host = self.addHost( 'as6host' )
-
- self.addLink( host1, sw2 )
- #Links to the multihomed AS
- self.addLink( host3, sw1 )
- self.addLink( host3, sw1 )
- self.addLink( as2host, host3 )
- #Single links to the remaining two ASes
- self.addLink( host4, sw1 )
- self.addLink( as3host, host4 )
-
- #AS3-AS4 link
- #self.addLink( host4, host5)
- #Add new AS6 to its bridge
- self.addLink( as6rs, as6sw )
- self.addLink( host5, as6sw )
- self.addLink( as6host, host5 )
-
- #Backup link from router5 to router4
- self.addLink( host4, host5)
-
- #test the host behind the router(behind the router server)
-# for i in range(1, 10):
- # host = self.addHost('as6host%d' % i)
- # self.addLink(host, as6router)
-
- ## Internal Connection To Hosts ##
- self.addLink( root1, host1 )
-
- # self.addLink( sw1, sw2 )
- # self.addLink( sw1, sw3 )
- # self.addLink( sw2, sw4 )
- # self.addLink( sw3, sw4 )
- # self.addLink( sw3, sw5 )
- # self.addLink( sw4, sw6 )
- # self.addLink( sw5, sw6 )
- self.addLink( as6sw, sw1 )
-
-
- self.addLink(swTestOn, rootTestOn)
- #self.addLink(swTestOn, host1)
- self.addLink(swTestOn, host3)
- self.addLink(swTestOn, host4)
- self.addLink(swTestOn, host5)
- self.addLink(swTestOn, as2host)
- self.addLink(swTestOn, as6rs)
-
-
- #self.addLink(rootTestOn, host4)
-
-def startsshd( host ):
- "Start sshd on host"
- info( '*** Starting sshd\n' )
- name, intf, ip = host.name, host.defaultIntf(), host.IP()
- banner = '/tmp/%s.banner' % name
- host.cmd( 'echo "Welcome to %s at %s" > %s' % ( name, ip, banner ) )
- host.cmd( '/usr/sbin/sshd -o "Banner %s"' % banner, '-o "UseDNS no"' )
- info( '***', host.name, 'is running sshd on', intf, 'at', ip, '\n' )
-
-def startsshds ( hosts ):
- for h in hosts:
- startsshd( h )
-
-def stopsshd( ):
- "Stop *all* sshd processes with a custom banner"
- info( '*** Shutting down stale sshd/Banner processes ',
- quietRun( "pkill -9 -f Banner" ), '\n' )
-
-def startquagga( host, num, config_file ):
- info( '*** Starting Quagga on %s\n' % host )
- zebra_cmd = 'sudo %s/zebra -d -f %s/zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid' % (QUAGGA_DIR, QUAGGA_CONFIG_FILE_DIR, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
- quagga_cmd = 'sudo %s/bgpd -d -f %s -z %s/zserv%s.api -i %s/bgpd%s.pid' % (QUAGGA_DIR, config_file, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
-
- print zebra_cmd
- print quagga_cmd
-
- host.cmd( zebra_cmd )
- host.cmd( quagga_cmd )
-
-def startquaggahost5( host, num ):
- info( '*** Starting Quagga on %s\n' % host )
- zebra_cmd = 'sudo %s/zebra -d -f %s/zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid' % (QUAGGA_DIR, QUAGGA_CONFIG_FILE_DIR, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
- quagga_cmd = 'sudo %s/bgpd -d -f ./as4quaggas/quagga%s.conf -z %s/zserv%s.api -i %s/bgpd%s.pid' % (QUAGGA_DIR, num, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
-
- host.cmd( zebra_cmd )
- host.cmd( quagga_cmd )
-
-
-def stopquagga( ):
- quietRun( 'sudo pkill -9 -f bgpd' )
- quietRun( 'sudo pkill -9 -f zebra' )
-
-def sdn1net():
- topo = SDNIpModifiedTopo()
- info( '*** Creating network\n' )
- net = Mininet( topo=topo, controller=RemoteController )
- net = Mininet( topo=topo, controller=RemoteController )
-
- host1, host3, host4, host5 = net.get( 'host1', 'host3', 'host4', 'host5' )
-
- #host100.setIP('1.168.30.' + str(i), 24, str(host100) + "-eth2")
-
- #host500.setMAC('00:00:00:00:04:%d' % (i-101), 'host%d-eth0' %(i))
- #add IP prefixes
- #for j in range(0,121):
- #host100.cmd('sudo ip addr add %s.0.40.%s/24 dev host%s-eth0' %(i,j,i))
-
- ## Adding 2nd, 3rd and 4th interface to host1 connected to sw1 (for another BGP peering)
- #sw1 = net.get('sw1')
- host1.setMAC('00:00:00:00:00:01', 'host1-eth0')
- host1.cmd('ip addr add 192.168.20.101/24 dev host1-eth0')
- host1.cmd('ip addr add 192.168.30.101/24 dev host1-eth0')
- #host1.cmd('ip addr add 192.168.40.101/24 dev host1-eth0')
- host1.cmd('ip addr add 192.168.60.101/24 dev host1-eth0')
-
- # Net has to be start after adding the above link
- net.start()
-
- # Set up as6sw as a learning switch as quickly as possible so it
- # hopefully doesn't connect to the actual controller
- # TODO figure out how to change controller before starting switch
- as6sw = net.get('as6sw')
- as6sw.cmd('ovs-vsctl set-controller as6sw none')
- as6sw.cmd('ovs-vsctl set-fail-mode as6sw standalone')
-
-
- sw1 = net.get('sw1')
- sw1.cmd('ovs-vsctl set-controller sw1 tcp:127.0.0.1:6633')
-# sw2.cmd('ovs-vsctl set-controller sw2 tcp:127.0.0.1:6633')
-# sw3.cmd('ovs-vsctl set-controller sw3 tcp:127.0.0.1:6633')
-# sw4.cmd('ovs-vsctl set-controller sw4 tcp:127.0.0.1:6633')
-# sw5.cmd('ovs-vsctl set-controller sw5 tcp:127.0.0.1:6633')
-# sw6.cmd('ovs-vsctl set-controller sw6 tcp:127.0.0.1:6633')
-
-
- swTestOn = net.get('swTestOn')
- swTestOn.cmd('ovs-vsctl set-controller swTestOn none')
- swTestOn.cmd('ovs-vsctl set-fail-mode swTestOn standalone')
-
- host1.defaultIntf().setIP('192.168.10.101/24')
- # Run BGPd
- #host1.cmd('%s -d -f %s' % (BGPD, BGPD_CONF))
- #host1.cmd('/sbin/route add default gw 192.168.10.254 dev %s-eth0' % (host1.name))
-
- # Configure new host interfaces
- #host2.defaultIntf().setIP('172.16.10.2/24')
- #host2.defaultIntf().setMAC('00:00:00:00:01:02')
- #host2.cmd('/sbin/route add default gw 172.16.10.254 dev %s-eth0' % (host2.name))
-
- # Set up AS2
- host3.setIP('192.168.10.1', 24, 'host3-eth0')
- #host3.cmd('sudo ip addr add 172.16.20.1/24 dev host3-eth0')
- host3.setIP('192.168.20.1', 24, 'host3-eth1')
- host3.setMAC('00:00:00:00:02:01', 'host3-eth0')
- host3.setMAC('00:00:00:00:02:02', 'host3-eth1')
- #host3.setIP('172.16.20.254', 24, 'host3-eth2')
- host3.setIP('3.0.0.254', 8, 'host3-eth2')
- host3.cmd('sysctl net.ipv4.conf.all.forwarding=1')
-
- host3.setIP('1.168.30.2', 24, 'host3-eth3')
- host3.cmd('sysctl net.ipv4.conf.all.arp_ignore=1')
- host3.cmd('sysctl net.ipv4.conf.all.arp_announce=1')
- as2host = net.get('as2host')
- #as2host.defaultIntf().setIP('172.16.20.1/24')
- for i in range(0, 20):
- as2host.cmd('sudo ip addr add 3.0.%d.1/24 dev as2host-eth0' %i)
- as2host.setIP('1.168.30.100', 24, 'as2host-eth1')
-
- as2host.cmd('ip route add default via 3.0.0.254')
-
- # Set up AS3
- host4.setIP('192.168.30.1', 24, 'host4-eth0')
- host4.setMAC('00:00:00:00:03:01', 'host4-eth0')
- host4.setIP('4.0.0.254', 8, 'host4-eth1')
- host4.setMAC('00:00:00:00:03:99', 'host4-eth1')
- host4.cmd('sysctl net.ipv4.conf.all.forwarding=1')
- as3host = net.get('as3host')
- for i in range(0, 20):
- as3host.cmd('sudo ip addr add 4.0.%d.1/24 dev as3host-eth0' %i)
- as3host.cmd('ip route add default via 4.0.0.254')
-
- host4.setIP('10.0.0.4', 24, 'host4-eth2')
- host4.setMAC('00:00:00:00:03:33', 'host4-eth2')
-
- #root space
- host4.setIP('1.168.30.3', 24, 'host4-eth3')
- host4.setMAC('00:00:00:00:03:03', 'host4-eth3')
-
- # Set up AS4
- #as4host = net.get('as4host')
- #as4host.defaultIntf().setIP('172.16.40.1/24')
- #as4host.cmd('ip route add default via 172.16.40.254')
-
- # setup interface address for 100 quagga hosts
- #time.sleep(10)
- #for i in range(numHost101, numHost200 + 1):
- #host100 = net.get('host' + str(i))
- #host100.cmd(str(i)+'.0.1.254', 24, 'host'+str(i)+'-eth1')
- #as4host100 = net.get('as4host%s' %(i))
- #as4host100.defaultIntf().setIP(str(i) + '.0.0.1/24')
- #as4host100.cmd('ip route add default via ' + str(i) + '.0.0.254')
- #for j in range(0, 100):
- #as4host100.cmd('sudo ip addr add %d.0.%d.1/24 dev %s-eth0' %(i, j, as4host100))
-
- # Set up AS6 - This has a router and a route server
- as6rs, host5 = net.get('as6rs', 'host5')
-
- as6rs.setIP('192.168.60.1', 24, 'as6rs-eth0')
- as6rs.setMAC('00:00:00:06:06:01', 'as6rs-eth0')
- as6rs.setIP('1.168.30.6', 24, 'as6rs-eth1')
- as6rs.setMAC('00:00:00:06:06:06', 'as6rs-eth1')
-
- host5.setIP('192.168.60.2', 24, 'host5-eth0')
- host5.setMAC('00:00:00:00:06:02', 'host5-eth0')
- #as6router.setIP('172.16.60.254', 24, 'as6router-eth1')
- host5.setIP('5.0.0.254', 8, 'host5-eth1')
- host5.cmd('sysctl net.ipv4.conf.all.forwarding=1')
- host5.setIP('10.0.0.5', 24, 'host5-eth2')
- host5.setMAC('00:00:00:00:06:66', 'host5-eth2')
- host5.setIP('1.168.30.5', 24, 'host5-eth3')
- host5.setMAC('00:00:00:00:06:05', 'host5-eth3')
-
- as6host = net.get('as6host')
- #as6host.defaultIntf().setIP('5.0.0.1/24')
- for i in range(0, 10):
- as6host.cmd('sudo ip addr add 5.0.%d.1/24 dev as6host-eth0' %i)
- as6host.cmd('ip route add default via 5.0.0.254')
-
- # test the host in the as6
- #for i in range(1, 10):
- # baseip = (i-1)*4
- # host = net.get('as6host%d' % i)
- # host.defaultIntf().setIP('172.16.70.%d/24' % (baseip+1))
- # host.cmd('ip route add default via 172.16.70.%d' % (baseip+2))
- # as6router.setIP('172.16.70.%d' % (baseip+2), 30, 'as6router-eth%d' % (i+1))
-
- # Start Quagga on border routers
- startquagga(host3, 1, QUAGGA_CONFIG_FILE_DIR + '/quagga1.conf')
- startquagga(host4, 2, QUAGGA_CONFIG_FILE_DIR + '/quagga2.conf')
- #for i in range(numHost101, numHost200 + 1):
- #host100=net.get('host%d' % (i))
- #startquaggahost5(host100, i)
-
- startquagga(as6rs, 4, QUAGGA_CONFIG_FILE_DIR + '/quagga-as6-rs.conf')
- startquagga(host5, 5, QUAGGA_CONFIG_FILE_DIR + '/quagga-as6.conf')
-
- #root1, root2, rootTestOn = net.get( 'root1', 'root2', 'rootTestOn' )
- root1, rootTestOn = net.get( 'root1', 'rootTestOn' )
- host1.intf('host1-eth1').setIP('1.1.1.1/24')
- root1.intf('root1-eth0').setIP('1.1.1.2/24')
- #host2.intf('host2-eth1').setIP('1.1.2.1/24')
- #root2.intf('root2-eth0').setIP('1.1.2.2/24')
-
- #rootTestOn.cmd('ip addr add 1.168.30.102/24 dev rootTestOn-eth0')
- rootTestOn.cmd('ip addr add 1.168.30.99/24 dev rootTestOn-eth0')
-
- stopsshd()
-
- startquagga(host1, 100, QUAGGA_CONFIG_FILE_DIR + '/quagga-sdn-modified.conf')
- hosts = [ host1, host3, host4, host5, as2host, as6rs ];
- #sshdHosts = sshdHosts + hosts
- startsshds( hosts )
- #
- onos1 = '127.0.0.1'
- forwarding1 = '%s:2000:%s:2000' % ('1.1.1.2', onos1)
- root1.cmd( 'ssh -nNT -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -l sdn -L %s %s & ' % (forwarding1, onos1) )
-
- # Forward 2605 to root namespace for easier access to SDN domain BGPd
- # If root can ssh to itself without a password this should work
- root1.cmd('ssh -N -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -L 2605:1.1.1.1:2605 1.1.1.1 &')
- #time.sleep(3000000000)
- CLI( net )
-
- # Close the ssh port forwarding
- #quietRun('sudo pkill -f 1.1.1.1')
-
- stopsshd()
- stopquagga()
- net.stop()
-
-if __name__ == '__main__':
- setLogLevel( 'debug' )
- if len(sys.argv) > 1:
- QUAGGA_CONFIG_FILE_DIR = sys.argv[1]
- sdn1net()
diff --git a/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga-as6-rs.conf b/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga-as6-rs.conf
deleted file mode 100644
index 1eac0dd..0000000
--- a/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga-as6-rs.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64520
- bgp router-id 192.168.60.1
- neighbor 192.168.60.101 remote-as 64513
- neighbor 192.168.60.101 route-server-client
- neighbor 192.168.60.2 remote-as 64521
- neighbor 192.168.60.2 route-server-client
-! network 172.16.60.0/24
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga-as6.conf b/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga-as6.conf
deleted file mode 100644
index 19cc140..0000000
--- a/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga-as6.conf
+++ /dev/null
@@ -1,39 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64521
- bgp router-id 192.168.60.2
- neighbor 192.168.60.1 remote-as 64520
- neighbor 10.0.0.4 remote-as 64516
-! neighbor 192.168.60.3 remote-as 64520
-! network 172.16.60.0/24
-! network 172.16.70.4/30
- ! network 172.16.70.8/30
- ! network 172.16.70.12/30
- ! network 172.16.70.16/30
- ! network 172.16.70.20/30
- ! network 172.16.70.24/30
- ! network 172.16.70.28/30
- ! network 172.16.70.32/30
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga-sdn-modified.conf b/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga-sdn-modified.conf
deleted file mode 100644
index bf37a60..0000000
--- a/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga-sdn-modified.conf
+++ /dev/null
@@ -1,49 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-route-map AS65000 permit 1
- set as-path prepend 65000
-!
-router bgp 64513
- bgp router-id 192.168.10.101
- timers bgp 1 3
- !timers bgp 3 9
- neighbor 192.168.10.1 remote-as 64514
- neighbor 192.168.10.1 ebgp-multihop
- neighbor 192.168.10.1 timers connect 5
- neighbor 192.168.20.1 remote-as 64514
- neighbor 192.168.20.1 ebgp-multihop
- neighbor 192.168.20.1 timers connect 5
- neighbor 192.168.20.1 route-map AS65000 in
- neighbor 192.168.30.1 remote-as 64516
- neighbor 192.168.30.1 ebgp-multihop
- neighbor 192.168.30.1 timers connect 5
- neighbor 192.168.60.1 remote-as 64520
- neighbor 192.168.60.1 ebgp-multihop
- neighbor 192.168.60.1 timers connect 5
- neighbor 1.1.1.2 remote-as 64513
- neighbor 1.1.1.2 port 2000
- neighbor 1.1.1.2 timers connect 5
-
-
-
- network 172.16.10.0/24
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga1.conf b/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga1.conf
deleted file mode 100644
index 264f85e..0000000
--- a/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga1.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-!
-! Zebra configuration saved from vty
-! 2014/11/25 11:22:24
-!
-hostname bgpd
-password hello
-log stdout
-!
-router bgp 64514
- bgp router-id 192.168.10.1
-! network 3.0.0.0/24
-! network 3.0.1.0/24
-! network 3.0.2.0/24
-! network 3.0.3.0/24
-! network 3.0.4.0/24
-! network 3.0.5.0/24
-! network 3.0.6.0/24
-! network 3.0.7.0/24
-! network 3.0.8.0/24
-! network 3.0.9.0/24
- neighbor 192.168.20.101 remote-as 64513
- neighbor 192.168.20.101 route-map PREPEND2 in
- neighbor 192.168.20.101 route-map PREPEND2 out
-!
-route-map PREPEND1 permit 1
- set as-path prepend 64514
-!
-route-map PREPEND2 permit 2
- set as-path prepend 64514 64514
-!
-line vty
-!
diff --git a/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga2.conf b/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga2.conf
deleted file mode 100644
index 14c7d67..0000000
--- a/TestON/tests/PeeringRouterTest/routeserver/mininet/quagga2.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64516
- bgp router-id 192.168.30.1
-! timers bgp 1 3
- neighbor 192.168.30.101 remote-as 64513
- neighbor 10.0.0.5 remote-as 64521
-! neighbor 192.168.50.2 remote-as 65001
-! network 172.16.30.0/24
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/routeserver/mininet/zebra.conf b/TestON/tests/PeeringRouterTest/routeserver/mininet/zebra.conf
deleted file mode 100644
index 0f8e3a2..0000000
--- a/TestON/tests/PeeringRouterTest/routeserver/mininet/zebra.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-! -*- zebra -*-
-!
-! zebra sample configuration file
-!
-! $Id: zebra.conf.sample,v 1.1 2002/12/13 20:15:30 paul Exp $
-!
-hostname zebra
-password hello
-enable password 0fw0rk
-log stdout
-!
-! Interfaces description.
-!
-!interface lo
-! description test of desc.
-!
-!interface sit0
-! multicast
-
-!
-! Static default route sample.
-!
-!ip route 0.0.0.0/0 203.181.89.241
-!
-
-!log file /usr/local/var/log/quagga/zebra.log
diff --git a/TestON/tests/PeeringRouterTest/routeserver/sdnip.json b/TestON/tests/PeeringRouterTest/routeserver/sdnip.json
deleted file mode 100644
index 1f0a80a..0000000
--- a/TestON/tests/PeeringRouterTest/routeserver/sdnip.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
-
- "bgpPeers" : [
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "1",
- "ipAddress" : "192.168.10.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "2",
- "ipAddress" : "192.168.20.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "3",
- "ipAddress" : "192.168.30.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "4",
- "ipAddress" : "192.168.60.1"
- }
-
- ],
- "bgpSpeakers" : [
- {
- "name" : "bgpSpeaker1",
- "attachmentDpid" : "00:00:00:00:00:00:00:02",
- "attachmentPort" : "1",
- "macAddress" : "00:00:00:00:00:01",
- "interfaceAddresses" : [
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "1",
- "ipAddress" : "192.168.10.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "2",
- "ipAddress" : "192.168.20.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "3",
- "ipAddress" : "192.168.30.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "4",
- "ipAddress" : "192.168.60.101"
- }
-
- ]
-
- }
-
- ]
-}
diff --git a/TestON/tests/PeeringRouterTest/sdnip.json b/TestON/tests/PeeringRouterTest/sdnip.json
deleted file mode 100644
index 5b61d05..0000000
--- a/TestON/tests/PeeringRouterTest/sdnip.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
-
- "bgpPeers" : [
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "1",
- "ipAddress" : "192.168.10.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "2",
- "ipAddress" : "192.168.20.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "3",
- "ipAddress" : "192.168.30.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "4",
- "ipAddress" : "192.168.60.2"
- }
-
- ],
- "bgpSpeakers" : [
- {
- "name" : "bgpSpeaker1",
- "attachmentDpid" : "00:00:00:00:00:00:00:02",
- "attachmentPort" : "1",
- "macAddress" : "00:00:00:00:00:02",
- "interfaceAddresses" : [
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "1",
- "ipAddress" : "192.168.10.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "2",
- "ipAddress" : "192.168.20.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "3",
- "ipAddress" : "192.168.30.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "4",
- "ipAddress" : "192.168.60.101"
- }
-
- ]
-
- }
-
- ]
-}
diff --git a/TestON/tests/PeeringRouterTest/vlan/addresses.json b/TestON/tests/PeeringRouterTest/vlan/addresses.json
deleted file mode 100644
index f800c1f..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/addresses.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "addresses" : [
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "1",
- "ips" : ["192.168.10.101/24"],
- "mac" : "00:00:00:00:00:01",
- "vlan" : "10"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "2",
- "ips" : ["192.168.20.101/24"],
- "mac" : "00:00:00:00:00:01",
- "vlan" : "20"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "3",
- "ips" : ["192.168.30.101/24"],
- "mac" : "00:00:00:00:00:01",
- "vlan" : "30"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "4",
- "ips" : ["192.168.60.101/24"],
- "mac" : "00:00:00:00:00:01",
- "vlan" : "60"
- }
-
- ]
-}
diff --git a/TestON/tests/PeeringRouterTest/vlan/mininet/PeeringRouterMininetVlan.py b/TestON/tests/PeeringRouterTest/vlan/mininet/PeeringRouterMininetVlan.py
deleted file mode 100755
index 9cbfc6d..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/mininet/PeeringRouterMininetVlan.py
+++ /dev/null
@@ -1,376 +0,0 @@
-#!/usr/bin/python
-
-"""
-Start up the SDN-IP demo topology
-"""
-
-"""
-AS1 = 64513, (SDN AS)
-AS2 = 64514, reachable by 192.168.10.1, 192.168.20.1
-AS3 = 64516, reachable by 192.168.30.1
-AS4 = 64517, reachable by 192.168.40.1
-AS6 = 64520, reachable by 192.168.60.2, (route server 192.168.60.1)
-"""
-
-from mininet.node import Host
-from mininet.net import Mininet
-from mininet.node import Controller, RemoteController
-from mininet.log import setLogLevel, info
-from mininet.cli import CLI
-from mininet.topo import Topo
-from mininet.util import quietRun
-from mininet.moduledeps import pathCheck
-
-import os.path
-import time
-import sys
-from subprocess import Popen, STDOUT, PIPE
-
-QUAGGA_DIR = '/usr/lib/quagga'
-#QUAGGA_DIR = '/usr/local/sbin'
-QUAGGA_RUN_DIR = '/usr/local/var/run/quagga'
-
-QUAGGA_CONFIG_FILE_DIR = '/home/admin/ONLabTest/TestON/tests/PeeringRouterTest/mininet'
-
-class VLANHost( Host ):
- "Host connected to VLAN interface"
-
- def config( self, vlan=10, intf2 = '', ip2 = 0, vlan2 = 0, **params):
- """Configure VLANHost according to (optional) parameters:
- vlan: VLAN ID for default interface"""
-
- r = super( VLANHost, self ).config( **params )
-
- intf = params['inf']
- # remove IP from default, "physical" interface
- self.cmd( 'ifconfig %s inet 0' % intf )
- # create VLAN interface
- self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- # assign the host's IP to the VLAN interface
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
- # update the intf name and host's intf map
- newName = '%s.%d' % ( intf, vlan )
- # update the (Mininet) interface to refer to VLAN interface name
- defaultIntf = self.defaultIntf()
- defaultIntf.name = newName
- # add VLAN interface to host's name to intf map
- self.nameToIntf[ newName ] = defaultIntf
-
- return r
-
-class SDNIpModifiedTopo( Topo ):
- "SDN Ip Modified Topology"
-
- def __init__( self, *args, **kwargs ):
- global numHost101
- global numHost200
- numHost101 = 101
- numHost200 = 200
- Topo.__init__( self, *args, **kwargs )
- sw1 = self.addSwitch('sw1', dpid='0000000000000001')
- sw2 = self.addSwitch('sw2', dpid='0000000000000002')
- #add a switch for 3 quagga hosts
- swTestOn = self.addSwitch('swTestOn', dpid='0000000000000102')
- #Note this switch isn't part of the SDN topology
- #We'll use the ovs-controller to turn this into a learning switch
- as6sw = self.addSwitch('as6sw', dpid='00000000000000a7')
-
- host1 = self.addHost( 'host1' )
- root1 = self.addHost( 'root1', inNamespace=False , ip='0')
- rootTestOn = self.addHost( 'rootTestOn', inNamespace=False, ip='0' )
-
- #AS2 host
- host3 = self.addHost( 'host3', cls=VLANHost, vlan=10, inf="host3-eth0", ip="192.168.10.1")
-
- as2host = self.addHost( 'as2host' )
- #AS3 host
- host4 = self.addHost( 'host4', cls=VLANHost, vlan=30, inf="host4-eth0", ip="192.168.30.1" )
- as3host = self.addHost( 'as3host' )
- #AS6 host
- host5 = self.addHost( 'host5', cls=VLANHost, vlan=60, inf="host5-eth0", ip="192.168.60.2" )
- as6host = self.addHost( 'as6host' )
-
- self.addLink( host1, sw2 )
- #Links to the multihomed AS
- self.addLink( host3, sw1 )
- self.addLink( host3, sw1 )
- self.addLink( as2host, host3 )
- #Single links to the remaining two ASes
- self.addLink( host4, sw1 )
- self.addLink( as3host, host4 )
-
- #AS3-AS4 link
- #self.addLink( host4, host5)
- #Add new AS6 to its bridge
- self.addLink( host5, as6sw )
- self.addLink( as6host, host5 )
- #test the host behind the router(behind the router server)
-# for i in range(1, 10):
- # host = self.addHost('as6host%d' % i)
- # self.addLink(host, as6router)
-
- ## Internal Connection To Hosts ##
- self.addLink( root1, host1 )
-
- # self.addLink( sw1, sw2 )
- # self.addLink( sw1, sw3 )
- # self.addLink( sw2, sw4 )
- # self.addLink( sw3, sw4 )
- # self.addLink( sw3, sw5 )
- # self.addLink( sw4, sw6 )
- # self.addLink( sw5, sw6 )
- self.addLink( as6sw, sw1 )
-
-
- self.addLink(swTestOn, rootTestOn)
- #self.addLink(swTestOn, host1)
- self.addLink(swTestOn, host3)
- self.addLink(swTestOn, host4)
- self.addLink(swTestOn, host5)
- self.addLink(swTestOn, as2host)
-
-
- #self.addLink(rootTestOn, host4)
-
-def startsshd( host ):
- "Start sshd on host"
- info( '*** Starting sshd\n' )
- name, intf, ip = host.name, host.defaultIntf(), host.IP()
- banner = '/tmp/%s.banner' % name
- host.cmd( 'echo "Welcome to %s at %s" > %s' % ( name, ip, banner ) )
- host.cmd( '/usr/sbin/sshd -o "Banner %s"' % banner, '-o "UseDNS no"' )
- info( '***', host.name, 'is running sshd on', intf, 'at', ip, '\n' )
-
-def startsshds ( hosts ):
- for h in hosts:
- startsshd( h )
-
-def stopsshd( ):
- "Stop *all* sshd processes with a custom banner"
- info( '*** Shutting down stale sshd/Banner processes ',
- quietRun( "pkill -9 -f Banner" ), '\n' )
-
-def startquagga( host, num, config_file ):
- info( '*** Starting Quagga on %s\n' % host )
- zebra_cmd = 'sudo %s/zebra -d -f %s/zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid' % (QUAGGA_DIR, QUAGGA_CONFIG_FILE_DIR, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
- quagga_cmd = 'sudo %s/bgpd -d -f %s -z %s/zserv%s.api -i %s/bgpd%s.pid' % (QUAGGA_DIR, config_file, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
-
- print zebra_cmd
- print quagga_cmd
-
- host.cmd( zebra_cmd )
- host.cmd( quagga_cmd )
-
-def startquaggahost5( host, num ):
- info( '*** Starting Quagga on %s\n' % host )
- zebra_cmd = 'sudo %s/zebra -d -f %s/zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid' % (QUAGGA_DIR, QUAGGA_CONFIG_FILE_DIR, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
- quagga_cmd = 'sudo %s/bgpd -d -f ./as4quaggas/quagga%s.conf -z %s/zserv%s.api -i %s/bgpd%s.pid' % (QUAGGA_DIR, num, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
-
- host.cmd( zebra_cmd )
- host.cmd( quagga_cmd )
-
-
-def stopquagga( ):
- quietRun( 'sudo pkill -9 -f bgpd' )
- quietRun( 'sudo pkill -9 -f zebra' )
-
-def sdn1net():
- topo = SDNIpModifiedTopo()
- info( '*** Creating network\n' )
- net = Mininet( topo=topo, controller=RemoteController )
- net = Mininet( topo=topo, controller=RemoteController )
-
- host1, host3, host4, host5 = net.get( 'host1', 'host3', 'host4', 'host5' )
-
- #host100.setIP('1.168.30.' + str(i), 24, str(host100) + "-eth2")
-
- #host500.setMAC('00:00:00:00:04:%d' % (i-101), 'host%d-eth0' %(i))
- #add IP prefixes
- #for j in range(0,121):
- #host100.cmd('sudo ip addr add %s.0.40.%s/24 dev host%s-eth0' %(i,j,i))
-
- ## Adding 2nd, 3rd and 4th interface to host1 connected to sw1 (for another BGP peering)
- #sw1 = net.get('sw1')
- host1.setMAC('00:00:00:00:00:01', 'host1-eth0')
- #host1.cmd('ip addr add 192.168.20.101/24 dev host1-eth0')
- #host1.cmd('ip addr add 192.168.30.101/24 dev host1-eth0')
- #host1.cmd('ip addr add 192.168.60.101/24 dev host1-eth0')
-
- # Net has to be start after adding the above link
- net.start()
-
- # Set up as6sw as a learning switch as quickly as possible so it
- # hopefully doesn't connect to the actual controller
- # TODO figure out how to change controller before starting switch
- as6sw = net.get('as6sw')
- as6sw.cmd('ovs-vsctl set-controller as6sw none')
- as6sw.cmd('ovs-vsctl set-fail-mode as6sw standalone')
-
- as6sw.cmd( 'sudo ovs-vsctl set port as6sw-eth1 trunk=60')
- as6sw.cmd( 'sudo ovs-vsctl set port as6sw-eth2 trunk=60')
-
-
- sw1 = net.get('sw1')
- sw1.cmd('ovs-vsctl set-controller sw1 tcp:127.0.0.1:6633')
-
- swTestOn = net.get('swTestOn')
- swTestOn.cmd('ovs-vsctl set-controller swTestOn none')
- swTestOn.cmd('ovs-vsctl set-fail-mode swTestOn standalone')
-
- #host1.defaultIntf().setIP('192.168.10.101/24')
-
- host1.cmd( 'ifconfig host1-eth0 inet 0')
- host1.cmd( 'vconfig add host1-eth0 10')
- host1.cmd( 'ifconfig host1-eth0.10 inet 192.168.10.101')
-
- host1.cmd( 'vconfig add host1-eth0 20')
- host1.cmd( 'ifconfig host1-eth0.20 inet 192.168.20.101')
-
- host1.cmd( 'vconfig add host1-eth0 30')
- host1.cmd( 'ifconfig host1-eth0.30 inet 192.168.30.101')
-
- host1.cmd( 'vconfig add host1-eth0 60')
- host1.cmd( 'ifconfig host1-eth0.60 inet 192.168.60.101')
-
- # Run BGPd
- #host1.cmd('%s -d -f %s' % (BGPD, BGPD_CONF))
- #host1.cmd('/sbin/route add default gw 192.168.10.254 dev %s-eth0' % (host1.name))
-
- # Configure new host interfaces
- #host2.defaultIntf().setIP('172.16.10.2/24')
- #host2.defaultIntf().setMAC('00:00:00:00:01:02')
- #host2.cmd('/sbin/route add default gw 172.16.10.254 dev %s-eth0' % (host2.name))
-
- # Set up AS2
- # add additional VLAN interface
- host3.cmd( 'ifconfig host3-eth1 inet 0')
- host3.cmd( 'vconfig add host3-eth1 20')
- host3.cmd( 'ifconfig host3-eth1.20 inet 192.168.20.1')
- # change the interface for the sencond connection to sw1 to vlan interface
- newName = "host3-eth1.20"
- secondIntf = host3.intf("host3-eth1")
- secondIntf.name = newName
- host3.nameToIntf[ newName ] = secondIntf
-
- host3.setMAC('00:00:00:00:02:01', 'host3-eth0.10')
- host3.setMAC('00:00:00:00:02:02', 'host3-eth1.20')
-
- #host3.setIP('172.16.20.254', 24, 'host3-eth2')
- host3.setIP('3.0.0.254', 8, 'host3-eth2')
- host3.cmd('sysctl net.ipv4.conf.all.forwarding=1')
-
- host3.setIP('1.168.30.2', 24, 'host3-eth3')
- host3.cmd('sysctl net.ipv4.conf.all.arp_ignore=1')
- host3.cmd('sysctl net.ipv4.conf.all.arp_announce=1')
- host3.cmd('ip route add default via 192.168.10.101')
- as2host = net.get('as2host')
- #as2host.defaultIntf().setIP('172.16.20.1/24')
- for i in range(0, 20):
- as2host.cmd('sudo ip addr add 3.0.%d.1/24 dev as2host-eth0' %i)
- as2host.setIP('1.168.30.100', 24, 'as2host-eth1')
-
- as2host.cmd('ip route add default via 3.0.0.254')
-
- # Set up AS3
- host4.setMAC('00:00:00:00:03:01', 'host4-eth0.30')
- host4.setIP('4.0.0.254', 8, 'host4-eth1')
- host4.setMAC('00:00:00:00:03:99', 'host4-eth1')
- host4.cmd('sysctl net.ipv4.conf.all.forwarding=1')
- host4.cmd('ip route add default via 192.168.30.101')
- as3host = net.get('as3host')
- for i in range(0, 20):
- as3host.cmd('sudo ip addr add 4.0.%d.1/24 dev as3host-eth0' %i)
- as3host.cmd('ip route add default via 4.0.0.254')
-
- #root space
- host4.setIP('1.168.30.3', 24, 'host4-eth2')
- host4.setMAC('00:00:00:00:03:03', 'host4-eth2')
-
- # Set up AS4
- #as4host = net.get('as4host')
- #as4host.defaultIntf().setIP('172.16.40.1/24')
- #as4host.cmd('ip route add default via 172.16.40.254')
-
- # setup interface address for 100 quagga hosts
- time.sleep(10)
- #for i in range(numHost101, numHost200 + 1):
- #host100 = net.get('host' + str(i))
- #host100.cmd(str(i)+'.0.1.254', 24, 'host'+str(i)+'-eth1')
- #as4host100 = net.get('as4host%s' %(i))
- #as4host100.defaultIntf().setIP(str(i) + '.0.0.1/24')
- #as4host100.cmd('ip route add default via ' + str(i) + '.0.0.254')
- #for j in range(0, 100):
- #as4host100.cmd('sudo ip addr add %d.0.%d.1/24 dev %s-eth0' %(i, j, as4host100))
-
- # Set up AS6 - This has a router and a route server
- host5 = net.get('host5')
- host5.setMAC('00:00:00:00:06:02', 'host5-eth0.60')
- #as6router.setIP('172.16.60.254', 24, 'as6router-eth1')
- host5.setIP('5.0.0.254', 8, 'host5-eth1')
- host5.cmd('sysctl net.ipv4.conf.all.forwarding=1')
- host5.setIP('1.168.30.5', 24, 'host5-eth2')
- host5.setMAC('00:00:00:00:06:05', 'host5-eth2')
- host5.cmd('ip route add default via 192.168.60.101')
- as6host = net.get('as6host')
- #as6host.defaultIntf().setIP('5.0.0.1/24')
- for i in range(0, 10):
- as6host.cmd('sudo ip addr add 5.0.%d.1/24 dev as6host-eth0' %i)
- as6host.cmd('ip route add default via 5.0.0.254')
-
- # test the host in the as6
- #for i in range(1, 10):
- # baseip = (i-1)*4
- # host = net.get('as6host%d' % i)
- # host.defaultIntf().setIP('172.16.70.%d/24' % (baseip+1))
- # host.cmd('ip route add default via 172.16.70.%d' % (baseip+2))
- # as6router.setIP('172.16.70.%d' % (baseip+2), 30, 'as6router-eth%d' % (i+1))
-
- # Start Quagga on border routers
- startquagga(host3, 1, QUAGGA_CONFIG_FILE_DIR + '/quagga1.conf')
- startquagga(host4, 2, QUAGGA_CONFIG_FILE_DIR + '/quagga2.conf')
- #for i in range(numHost101, numHost200 + 1):
- #host100=net.get('host%d' % (i))
- #startquaggahost5(host100, i)
-
- #startquagga(as6rs, 4, 'quagga-as6-rs.conf')
- startquagga(host5, 5, QUAGGA_CONFIG_FILE_DIR + '/quagga-as6.conf')
-
- #root1, root2, rootTestOn = net.get( 'root1', 'root2', 'rootTestOn' )
- root1, rootTestOn = net.get( 'root1', 'rootTestOn' )
- host1.intf('host1-eth1').setIP('1.1.1.1/24')
- root1.intf('root1-eth0').setIP('1.1.1.2/24')
- #host2.intf('host2-eth1').setIP('1.1.2.1/24')
- #root2.intf('root2-eth0').setIP('1.1.2.2/24')
-
- #rootTestOn.cmd('ip addr add 1.168.30.102/24 dev rootTestOn-eth0')
- rootTestOn.cmd('ip addr add 1.168.30.99/24 dev rootTestOn-eth0')
-
- stopsshd()
-
- startquagga(host1, 100, QUAGGA_CONFIG_FILE_DIR + '/quagga-sdn-modified.conf')
- hosts = [ host1, host3, host4, host5, as2host ];
- #sshdHosts = sshdHosts + hosts
- startsshds( hosts )
- #
- onos1 = '127.0.0.1'
- forwarding1 = '%s:2000:%s:2000' % ('1.1.1.2', onos1)
- root1.cmd( 'ssh -nNT -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -l sdn -L %s %s & ' % (forwarding1, onos1) )
-
- # Forward 2605 to root namespace for easier access to SDN domain BGPd
- # If root can ssh to itself without a password this should work
- root1.cmd('ssh -N -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -L 2605:1.1.1.1:2605 1.1.1.1 &')
- #time.sleep(3000000000)
- CLI( net )
-
- # Close the ssh port forwarding
- #quietRun('sudo pkill -f 1.1.1.1')
-
- stopsshd()
- stopquagga()
- net.stop()
-
-if __name__ == '__main__':
- setLogLevel( 'debug' )
- if len(sys.argv) > 1:
- QUAGGA_CONFIG_FILE_DIR = sys.argv[1]
- sdn1net()
diff --git a/TestON/tests/PeeringRouterTest/vlan/mininet/quagga-as6-rs.conf b/TestON/tests/PeeringRouterTest/vlan/mininet/quagga-as6-rs.conf
deleted file mode 100644
index 1eac0dd..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/mininet/quagga-as6-rs.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64520
- bgp router-id 192.168.60.1
- neighbor 192.168.60.101 remote-as 64513
- neighbor 192.168.60.101 route-server-client
- neighbor 192.168.60.2 remote-as 64521
- neighbor 192.168.60.2 route-server-client
-! network 172.16.60.0/24
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/vlan/mininet/quagga-as6.conf b/TestON/tests/PeeringRouterTest/vlan/mininet/quagga-as6.conf
deleted file mode 100644
index 434f983..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/mininet/quagga-as6.conf
+++ /dev/null
@@ -1,39 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64521
- bgp router-id 192.168.60.2
- neighbor 192.168.60.101 remote-as 64513
-! neighbor 192.168.60.1 remote-as 64520
-! neighbor 192.168.60.3 remote-as 64520
-! network 172.16.60.0/24
-! network 172.16.70.4/30
- ! network 172.16.70.8/30
- ! network 172.16.70.12/30
- ! network 172.16.70.16/30
- ! network 172.16.70.20/30
- ! network 172.16.70.24/30
- ! network 172.16.70.28/30
- ! network 172.16.70.32/30
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/vlan/mininet/quagga-sdn-modified.conf b/TestON/tests/PeeringRouterTest/vlan/mininet/quagga-sdn-modified.conf
deleted file mode 100644
index d334c2a..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/mininet/quagga-sdn-modified.conf
+++ /dev/null
@@ -1,49 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-route-map AS65000 permit 1
- set as-path prepend 65000
-!
-router bgp 64513
- bgp router-id 192.168.10.101
- timers bgp 1 3
- !timers bgp 3 9
- neighbor 192.168.10.1 remote-as 64514
- neighbor 192.168.10.1 ebgp-multihop
- neighbor 192.168.10.1 timers connect 5
- neighbor 192.168.20.1 remote-as 64514
- neighbor 192.168.20.1 ebgp-multihop
- neighbor 192.168.20.1 timers connect 5
- neighbor 192.168.20.1 route-map AS65000 in
- neighbor 192.168.30.1 remote-as 64516
- neighbor 192.168.30.1 ebgp-multihop
- neighbor 192.168.30.1 timers connect 5
- neighbor 192.168.60.2 remote-as 64521
- neighbor 192.168.60.2 ebgp-multihop
- neighbor 192.168.60.2 timers connect 5
- neighbor 1.1.1.2 remote-as 64513
- neighbor 1.1.1.2 port 2000
- neighbor 1.1.1.2 timers connect 5
-
-
-
- network 172.16.10.0/24
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/vlan/mininet/quagga-sdn.conf b/TestON/tests/PeeringRouterTest/vlan/mininet/quagga-sdn.conf
deleted file mode 100644
index 77392a6..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/mininet/quagga-sdn.conf
+++ /dev/null
@@ -1,349 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-route-map AS65000 permit 1
- set as-path prepend 65000
-!
-router bgp 64513
- bgp router-id 192.168.10.101
- timers bgp 1 3
- !timers bgp 3 9
- neighbor 192.168.10.1 remote-as 64514
- neighbor 192.168.10.1 ebgp-multihop
- neighbor 192.168.10.1 timers connect 5
- neighbor 192.168.20.1 remote-as 64514
- neighbor 192.168.20.1 ebgp-multihop
- neighbor 192.168.20.1 timers connect 5
- neighbor 192.168.20.1 route-map AS65000 in
- neighbor 192.168.30.1 remote-as 64516
- neighbor 192.168.30.1 ebgp-multihop
- neighbor 192.168.30.1 timers connect 5
- neighbor 192.168.60.1 remote-as 64520
- neighbor 192.168.60.1 ebgp-multihop
- neighbor 192.168.60.1 timers connect 5
- neighbor 1.1.1.2 remote-as 64513
- neighbor 1.1.1.2 port 2000
- neighbor 1.1.1.2 timers connect 5
-
-
-neighbor 192.168.40.1 remote-as 65001
-neighbor 192.168.40.1 ebgp-multihop
-neighbor 192.168.40.1 timers connect 10
-neighbor 192.168.40.2 remote-as 65002
-neighbor 192.168.40.2 ebgp-multihop
-neighbor 192.168.40.2 timers connect 10
-neighbor 192.168.40.3 remote-as 65003
-neighbor 192.168.40.3 ebgp-multihop
-neighbor 192.168.40.3 timers connect 10
-neighbor 192.168.40.4 remote-as 65004
-neighbor 192.168.40.4 ebgp-multihop
-neighbor 192.168.40.4 timers connect 10
-neighbor 192.168.40.5 remote-as 65005
-neighbor 192.168.40.5 ebgp-multihop
-neighbor 192.168.40.5 timers connect 10
-neighbor 192.168.40.6 remote-as 65006
-neighbor 192.168.40.6 ebgp-multihop
-neighbor 192.168.40.6 timers connect 10
-neighbor 192.168.40.7 remote-as 65007
-neighbor 192.168.40.7 ebgp-multihop
-neighbor 192.168.40.7 timers connect 10
-neighbor 192.168.40.8 remote-as 65008
-neighbor 192.168.40.8 ebgp-multihop
-neighbor 192.168.40.8 timers connect 10
-neighbor 192.168.40.9 remote-as 65009
-neighbor 192.168.40.9 ebgp-multihop
-neighbor 192.168.40.9 timers connect 10
-neighbor 192.168.40.10 remote-as 65010
-neighbor 192.168.40.10 ebgp-multihop
-neighbor 192.168.40.10 timers connect 10
-neighbor 192.168.40.11 remote-as 65011
-neighbor 192.168.40.11 ebgp-multihop
-neighbor 192.168.40.11 timers connect 10
-neighbor 192.168.40.12 remote-as 65012
-neighbor 192.168.40.12 ebgp-multihop
-neighbor 192.168.40.12 timers connect 10
-neighbor 192.168.40.13 remote-as 65013
-neighbor 192.168.40.13 ebgp-multihop
-neighbor 192.168.40.13 timers connect 10
-neighbor 192.168.40.14 remote-as 65014
-neighbor 192.168.40.14 ebgp-multihop
-neighbor 192.168.40.14 timers connect 10
-neighbor 192.168.40.15 remote-as 65015
-neighbor 192.168.40.15 ebgp-multihop
-neighbor 192.168.40.15 timers connect 10
-neighbor 192.168.40.16 remote-as 65016
-neighbor 192.168.40.16 ebgp-multihop
-neighbor 192.168.40.16 timers connect 10
-neighbor 192.168.40.17 remote-as 65017
-neighbor 192.168.40.17 ebgp-multihop
-neighbor 192.168.40.17 timers connect 10
-neighbor 192.168.40.18 remote-as 65018
-neighbor 192.168.40.18 ebgp-multihop
-neighbor 192.168.40.18 timers connect 10
-neighbor 192.168.40.19 remote-as 65019
-neighbor 192.168.40.19 ebgp-multihop
-neighbor 192.168.40.19 timers connect 10
-neighbor 192.168.40.20 remote-as 65020
-neighbor 192.168.40.20 ebgp-multihop
-neighbor 192.168.40.20 timers connect 10
-neighbor 192.168.40.21 remote-as 65021
-neighbor 192.168.40.21 ebgp-multihop
-neighbor 192.168.40.21 timers connect 10
-neighbor 192.168.40.22 remote-as 65022
-neighbor 192.168.40.22 ebgp-multihop
-neighbor 192.168.40.22 timers connect 10
-neighbor 192.168.40.23 remote-as 65023
-neighbor 192.168.40.23 ebgp-multihop
-neighbor 192.168.40.23 timers connect 10
-neighbor 192.168.40.24 remote-as 65024
-neighbor 192.168.40.24 ebgp-multihop
-neighbor 192.168.40.24 timers connect 10
-neighbor 192.168.40.25 remote-as 65025
-neighbor 192.168.40.25 ebgp-multihop
-neighbor 192.168.40.25 timers connect 10
-neighbor 192.168.40.26 remote-as 65026
-neighbor 192.168.40.26 ebgp-multihop
-neighbor 192.168.40.26 timers connect 10
-neighbor 192.168.40.27 remote-as 65027
-neighbor 192.168.40.27 ebgp-multihop
-neighbor 192.168.40.27 timers connect 10
-neighbor 192.168.40.28 remote-as 65028
-neighbor 192.168.40.28 ebgp-multihop
-neighbor 192.168.40.28 timers connect 10
-neighbor 192.168.40.29 remote-as 65029
-neighbor 192.168.40.29 ebgp-multihop
-neighbor 192.168.40.29 timers connect 10
-neighbor 192.168.40.30 remote-as 65030
-neighbor 192.168.40.30 ebgp-multihop
-neighbor 192.168.40.30 timers connect 10
-neighbor 192.168.40.31 remote-as 65031
-neighbor 192.168.40.31 ebgp-multihop
-neighbor 192.168.40.31 timers connect 10
-neighbor 192.168.40.32 remote-as 65032
-neighbor 192.168.40.32 ebgp-multihop
-neighbor 192.168.40.32 timers connect 10
-neighbor 192.168.40.33 remote-as 65033
-neighbor 192.168.40.33 ebgp-multihop
-neighbor 192.168.40.33 timers connect 10
-neighbor 192.168.40.34 remote-as 65034
-neighbor 192.168.40.34 ebgp-multihop
-neighbor 192.168.40.34 timers connect 10
-neighbor 192.168.40.35 remote-as 65035
-neighbor 192.168.40.35 ebgp-multihop
-neighbor 192.168.40.35 timers connect 10
-neighbor 192.168.40.36 remote-as 65036
-neighbor 192.168.40.36 ebgp-multihop
-neighbor 192.168.40.36 timers connect 10
-neighbor 192.168.40.37 remote-as 65037
-neighbor 192.168.40.37 ebgp-multihop
-neighbor 192.168.40.37 timers connect 10
-neighbor 192.168.40.38 remote-as 65038
-neighbor 192.168.40.38 ebgp-multihop
-neighbor 192.168.40.38 timers connect 10
-neighbor 192.168.40.39 remote-as 65039
-neighbor 192.168.40.39 ebgp-multihop
-neighbor 192.168.40.39 timers connect 10
-neighbor 192.168.40.40 remote-as 65040
-neighbor 192.168.40.40 ebgp-multihop
-neighbor 192.168.40.40 timers connect 10
-neighbor 192.168.40.41 remote-as 65041
-neighbor 192.168.40.41 ebgp-multihop
-neighbor 192.168.40.41 timers connect 10
-neighbor 192.168.40.42 remote-as 65042
-neighbor 192.168.40.42 ebgp-multihop
-neighbor 192.168.40.42 timers connect 10
-neighbor 192.168.40.43 remote-as 65043
-neighbor 192.168.40.43 ebgp-multihop
-neighbor 192.168.40.43 timers connect 10
-neighbor 192.168.40.44 remote-as 65044
-neighbor 192.168.40.44 ebgp-multihop
-neighbor 192.168.40.44 timers connect 10
-neighbor 192.168.40.45 remote-as 65045
-neighbor 192.168.40.45 ebgp-multihop
-neighbor 192.168.40.45 timers connect 10
-neighbor 192.168.40.46 remote-as 65046
-neighbor 192.168.40.46 ebgp-multihop
-neighbor 192.168.40.46 timers connect 10
-neighbor 192.168.40.47 remote-as 65047
-neighbor 192.168.40.47 ebgp-multihop
-neighbor 192.168.40.47 timers connect 10
-neighbor 192.168.40.48 remote-as 65048
-neighbor 192.168.40.48 ebgp-multihop
-neighbor 192.168.40.48 timers connect 10
-neighbor 192.168.40.49 remote-as 65049
-neighbor 192.168.40.49 ebgp-multihop
-neighbor 192.168.40.49 timers connect 10
-neighbor 192.168.40.50 remote-as 65050
-neighbor 192.168.40.50 ebgp-multihop
-neighbor 192.168.40.50 timers connect 10
-neighbor 192.168.40.51 remote-as 65051
-neighbor 192.168.40.51 ebgp-multihop
-neighbor 192.168.40.51 timers connect 10
-neighbor 192.168.40.52 remote-as 65052
-neighbor 192.168.40.52 ebgp-multihop
-neighbor 192.168.40.52 timers connect 10
-neighbor 192.168.40.53 remote-as 65053
-neighbor 192.168.40.53 ebgp-multihop
-neighbor 192.168.40.53 timers connect 10
-neighbor 192.168.40.54 remote-as 65054
-neighbor 192.168.40.54 ebgp-multihop
-neighbor 192.168.40.54 timers connect 10
-neighbor 192.168.40.55 remote-as 65055
-neighbor 192.168.40.55 ebgp-multihop
-neighbor 192.168.40.55 timers connect 10
-neighbor 192.168.40.56 remote-as 65056
-neighbor 192.168.40.56 ebgp-multihop
-neighbor 192.168.40.56 timers connect 10
-neighbor 192.168.40.57 remote-as 65057
-neighbor 192.168.40.57 ebgp-multihop
-neighbor 192.168.40.57 timers connect 10
-neighbor 192.168.40.58 remote-as 65058
-neighbor 192.168.40.58 ebgp-multihop
-neighbor 192.168.40.58 timers connect 10
-neighbor 192.168.40.59 remote-as 65059
-neighbor 192.168.40.59 ebgp-multihop
-neighbor 192.168.40.59 timers connect 10
-neighbor 192.168.40.60 remote-as 65060
-neighbor 192.168.40.60 ebgp-multihop
-neighbor 192.168.40.60 timers connect 10
-neighbor 192.168.40.61 remote-as 65061
-neighbor 192.168.40.61 ebgp-multihop
-neighbor 192.168.40.61 timers connect 10
-neighbor 192.168.40.62 remote-as 65062
-neighbor 192.168.40.62 ebgp-multihop
-neighbor 192.168.40.62 timers connect 10
-neighbor 192.168.40.63 remote-as 65063
-neighbor 192.168.40.63 ebgp-multihop
-neighbor 192.168.40.63 timers connect 10
-neighbor 192.168.40.64 remote-as 65064
-neighbor 192.168.40.64 ebgp-multihop
-neighbor 192.168.40.64 timers connect 10
-neighbor 192.168.40.65 remote-as 65065
-neighbor 192.168.40.65 ebgp-multihop
-neighbor 192.168.40.65 timers connect 10
-neighbor 192.168.40.66 remote-as 65066
-neighbor 192.168.40.66 ebgp-multihop
-neighbor 192.168.40.66 timers connect 10
-neighbor 192.168.40.67 remote-as 65067
-neighbor 192.168.40.67 ebgp-multihop
-neighbor 192.168.40.67 timers connect 10
-neighbor 192.168.40.68 remote-as 65068
-neighbor 192.168.40.68 ebgp-multihop
-neighbor 192.168.40.68 timers connect 10
-neighbor 192.168.40.69 remote-as 65069
-neighbor 192.168.40.69 ebgp-multihop
-neighbor 192.168.40.69 timers connect 10
-neighbor 192.168.40.70 remote-as 65070
-neighbor 192.168.40.70 ebgp-multihop
-neighbor 192.168.40.70 timers connect 10
-neighbor 192.168.40.71 remote-as 65071
-neighbor 192.168.40.71 ebgp-multihop
-neighbor 192.168.40.71 timers connect 10
-neighbor 192.168.40.72 remote-as 65072
-neighbor 192.168.40.72 ebgp-multihop
-neighbor 192.168.40.72 timers connect 10
-neighbor 192.168.40.73 remote-as 65073
-neighbor 192.168.40.73 ebgp-multihop
-neighbor 192.168.40.73 timers connect 10
-neighbor 192.168.40.74 remote-as 65074
-neighbor 192.168.40.74 ebgp-multihop
-neighbor 192.168.40.74 timers connect 10
-neighbor 192.168.40.75 remote-as 65075
-neighbor 192.168.40.75 ebgp-multihop
-neighbor 192.168.40.75 timers connect 10
-neighbor 192.168.40.76 remote-as 65076
-neighbor 192.168.40.76 ebgp-multihop
-neighbor 192.168.40.76 timers connect 10
-neighbor 192.168.40.77 remote-as 65077
-neighbor 192.168.40.77 ebgp-multihop
-neighbor 192.168.40.77 timers connect 10
-neighbor 192.168.40.78 remote-as 65078
-neighbor 192.168.40.78 ebgp-multihop
-neighbor 192.168.40.78 timers connect 10
-neighbor 192.168.40.79 remote-as 65079
-neighbor 192.168.40.79 ebgp-multihop
-neighbor 192.168.40.79 timers connect 10
-neighbor 192.168.40.80 remote-as 65080
-neighbor 192.168.40.80 ebgp-multihop
-neighbor 192.168.40.80 timers connect 10
-neighbor 192.168.40.81 remote-as 65081
-neighbor 192.168.40.81 ebgp-multihop
-neighbor 192.168.40.81 timers connect 10
-neighbor 192.168.40.82 remote-as 65082
-neighbor 192.168.40.82 ebgp-multihop
-neighbor 192.168.40.82 timers connect 10
-neighbor 192.168.40.83 remote-as 65083
-neighbor 192.168.40.83 ebgp-multihop
-neighbor 192.168.40.83 timers connect 10
-neighbor 192.168.40.84 remote-as 65084
-neighbor 192.168.40.84 ebgp-multihop
-neighbor 192.168.40.84 timers connect 10
-neighbor 192.168.40.85 remote-as 65085
-neighbor 192.168.40.85 ebgp-multihop
-neighbor 192.168.40.85 timers connect 10
-neighbor 192.168.40.86 remote-as 65086
-neighbor 192.168.40.86 ebgp-multihop
-neighbor 192.168.40.86 timers connect 10
-neighbor 192.168.40.87 remote-as 65087
-neighbor 192.168.40.87 ebgp-multihop
-neighbor 192.168.40.87 timers connect 10
-neighbor 192.168.40.88 remote-as 65088
-neighbor 192.168.40.88 ebgp-multihop
-neighbor 192.168.40.88 timers connect 10
-neighbor 192.168.40.89 remote-as 65089
-neighbor 192.168.40.89 ebgp-multihop
-neighbor 192.168.40.89 timers connect 10
-neighbor 192.168.40.90 remote-as 65090
-neighbor 192.168.40.90 ebgp-multihop
-neighbor 192.168.40.90 timers connect 10
-neighbor 192.168.40.91 remote-as 65091
-neighbor 192.168.40.91 ebgp-multihop
-neighbor 192.168.40.91 timers connect 10
-neighbor 192.168.40.92 remote-as 65092
-neighbor 192.168.40.92 ebgp-multihop
-neighbor 192.168.40.92 timers connect 10
-neighbor 192.168.40.93 remote-as 65093
-neighbor 192.168.40.93 ebgp-multihop
-neighbor 192.168.40.93 timers connect 10
-neighbor 192.168.40.94 remote-as 65094
-neighbor 192.168.40.94 ebgp-multihop
-neighbor 192.168.40.94 timers connect 10
-neighbor 192.168.40.95 remote-as 65095
-neighbor 192.168.40.95 ebgp-multihop
-neighbor 192.168.40.95 timers connect 10
-neighbor 192.168.40.96 remote-as 65096
-neighbor 192.168.40.96 ebgp-multihop
-neighbor 192.168.40.96 timers connect 10
-neighbor 192.168.40.97 remote-as 65097
-neighbor 192.168.40.97 ebgp-multihop
-neighbor 192.168.40.97 timers connect 10
-neighbor 192.168.40.98 remote-as 65098
-neighbor 192.168.40.98 ebgp-multihop
-neighbor 192.168.40.98 timers connect 10
-neighbor 192.168.40.99 remote-as 65099
-neighbor 192.168.40.99 ebgp-multihop
-neighbor 192.168.40.99 timers connect 10
-neighbor 192.168.40.100 remote-as 65100
-neighbor 192.168.40.100 ebgp-multihop
-neighbor 192.168.40.100 timers connect 10
-
- network 172.16.10.0/24
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/vlan/mininet/quagga1.conf b/TestON/tests/PeeringRouterTest/vlan/mininet/quagga1.conf
deleted file mode 100644
index 264f85e..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/mininet/quagga1.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-!
-! Zebra configuration saved from vty
-! 2014/11/25 11:22:24
-!
-hostname bgpd
-password hello
-log stdout
-!
-router bgp 64514
- bgp router-id 192.168.10.1
-! network 3.0.0.0/24
-! network 3.0.1.0/24
-! network 3.0.2.0/24
-! network 3.0.3.0/24
-! network 3.0.4.0/24
-! network 3.0.5.0/24
-! network 3.0.6.0/24
-! network 3.0.7.0/24
-! network 3.0.8.0/24
-! network 3.0.9.0/24
- neighbor 192.168.20.101 remote-as 64513
- neighbor 192.168.20.101 route-map PREPEND2 in
- neighbor 192.168.20.101 route-map PREPEND2 out
-!
-route-map PREPEND1 permit 1
- set as-path prepend 64514
-!
-route-map PREPEND2 permit 2
- set as-path prepend 64514 64514
-!
-line vty
-!
diff --git a/TestON/tests/PeeringRouterTest/vlan/mininet/quagga2.conf b/TestON/tests/PeeringRouterTest/vlan/mininet/quagga2.conf
deleted file mode 100644
index 20ca9e4..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/mininet/quagga2.conf
+++ /dev/null
@@ -1,31 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64516
- bgp router-id 192.168.30.1
-! timers bgp 1 3
- neighbor 192.168.30.101 remote-as 64513
-! neighbor 192.168.50.2 remote-as 65001
-! network 172.16.30.0/24
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/vlan/mininet/zebra.conf b/TestON/tests/PeeringRouterTest/vlan/mininet/zebra.conf
deleted file mode 100644
index 0f8e3a2..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/mininet/zebra.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-! -*- zebra -*-
-!
-! zebra sample configuration file
-!
-! $Id: zebra.conf.sample,v 1.1 2002/12/13 20:15:30 paul Exp $
-!
-hostname zebra
-password hello
-enable password 0fw0rk
-log stdout
-!
-! Interfaces description.
-!
-!interface lo
-! description test of desc.
-!
-!interface sit0
-! multicast
-
-!
-! Static default route sample.
-!
-!ip route 0.0.0.0/0 203.181.89.241
-!
-
-!log file /usr/local/var/log/quagga/zebra.log
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/PeeringRouterConvergenceVlanMininet.py b/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/PeeringRouterConvergenceVlanMininet.py
deleted file mode 100755
index 983d666..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/PeeringRouterConvergenceVlanMininet.py
+++ /dev/null
@@ -1,381 +0,0 @@
-#!/usr/bin/python
-
-"""
-Start up the SDN-IP demo topology
-"""
-
-"""
-AS1 = 64513, (SDN AS)
-AS2 = 64514, reachable by 192.168.10.1, 192.168.20.1
-AS3 = 64516, reachable by 192.168.30.1
-AS4 = 64517, reachable by 192.168.40.1
-AS6 = 64520, reachable by 192.168.60.2, (route server 192.168.60.1)
-"""
-
-from mininet.node import Host
-from mininet.net import Mininet
-from mininet.node import Controller, RemoteController
-from mininet.log import setLogLevel, info
-from mininet.cli import CLI
-from mininet.topo import Topo
-from mininet.util import quietRun
-from mininet.moduledeps import pathCheck
-
-import os.path
-import time
-import sys
-from subprocess import Popen, STDOUT, PIPE
-
-QUAGGA_DIR = '/usr/lib/quagga'
-#QUAGGA_DIR = '/usr/local/sbin'
-QUAGGA_RUN_DIR = '/usr/local/var/run/quagga'
-
-QUAGGA_CONFIG_FILE_DIR = '/home/tutorial1/ONLabTest/TestON/tests/PeeringRouterTest/mininet'
-
-class VLANHost( Host ):
- "Host connected to VLAN interface"
-
- def config( self, vlan=10, intf2 = '', ip2 = 0, vlan2 = 0, **params):
- """Configure VLANHost according to (optional) parameters:
- vlan: VLAN ID for default interface"""
-
- r = super( VLANHost, self ).config( **params )
-
- intf = params['inf']
- # remove IP from default, "physical" interface
- self.cmd( 'ifconfig %s inet 0' % intf )
- # create VLAN interface
- self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- # assign the host's IP to the VLAN interface
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
- # update the intf name and host's intf map
- newName = '%s.%d' % ( intf, vlan )
- # update the (Mininet) interface to refer to VLAN interface name
- defaultIntf = self.defaultIntf()
- defaultIntf.name = newName
- # add VLAN interface to host's name to intf map
- self.nameToIntf[ newName ] = defaultIntf
-
- return r
-
-class SDNIpModifiedTopo( Topo ):
- "SDN Ip Modified Topology"
-
- def __init__( self, *args, **kwargs ):
- global numHost101
- global numHost200
- numHost101 = 101
- numHost200 = 200
- Topo.__init__( self, *args, **kwargs )
- sw1 = self.addSwitch('sw1', dpid='0000000000000001')
- sw2 = self.addSwitch('sw2', dpid='0000000000000002')
- #add a switch for 3 quagga hosts
- swTestOn = self.addSwitch('swTestOn', dpid='0000000000000102')
- #Note this switch isn't part of the SDN topology
- #We'll use the ovs-controller to turn this into a learning switch
- as6sw = self.addSwitch('as6sw', dpid='00000000000000a7')
-
- host1 = self.addHost( 'host1' )
- root1 = self.addHost( 'root1', inNamespace=False , ip='0')
- rootTestOn = self.addHost( 'rootTestOn', inNamespace=False, ip='0' )
-
- #AS2 host
- host3 = self.addHost( 'host3', cls=VLANHost, vlan=10, inf="host3-eth0", ip="192.168.10.1")
-
- as2host = self.addHost( 'as2host' )
- #AS3 host
- host4 = self.addHost( 'host4', cls=VLANHost, vlan=30, inf="host4-eth0", ip="192.168.30.1" )
- as3host = self.addHost( 'as3host' )
- #AS6 host
- host5 = self.addHost( 'host5', cls=VLANHost, vlan=60, inf="host5-eth0", ip="192.168.60.2" )
- as6host = self.addHost( 'as6host' )
-
- self.addLink( host1, sw2 )
- #Links to the multihomed AS
- self.addLink( host3, sw1 )
- self.addLink( host3, sw1 )
- self.addLink( as2host, host3 )
- #Single links to the remaining two ASes
- self.addLink( host4, sw1 )
- self.addLink( as3host, host4 )
-
- #AS3-AS4 link
- #self.addLink( host4, host5)
- #Add new AS6 to its bridge
- self.addLink( host5, as6sw )
- self.addLink( as6host, host5 )
- #Backup link from router5 to router4
- self.addLink( host4, host5)
- #test the host behind the router(behind the router server)
-# for i in range(1, 10):
- # host = self.addHost('as6host%d' % i)
- # self.addLink(host, as6router)
-
- ## Internal Connection To Hosts ##
- self.addLink( root1, host1 )
-
- # self.addLink( sw1, sw2 )
- # self.addLink( sw1, sw3 )
- # self.addLink( sw2, sw4 )
- # self.addLink( sw3, sw4 )
- # self.addLink( sw3, sw5 )
- # self.addLink( sw4, sw6 )
- # self.addLink( sw5, sw6 )
- self.addLink( as6sw, sw1 )
-
-
- self.addLink(swTestOn, rootTestOn)
- #self.addLink(swTestOn, host1)
- self.addLink(swTestOn, host3)
- self.addLink(swTestOn, host4)
- self.addLink(swTestOn, host5)
- self.addLink(swTestOn, as2host)
-
-
- #self.addLink(rootTestOn, host4)
-
-def startsshd( host ):
- "Start sshd on host"
- info( '*** Starting sshd\n' )
- name, intf, ip = host.name, host.defaultIntf(), host.IP()
- banner = '/tmp/%s.banner' % name
- host.cmd( 'echo "Welcome to %s at %s" > %s' % ( name, ip, banner ) )
- host.cmd( '/usr/sbin/sshd -o "Banner %s"' % banner, '-o "UseDNS no"' )
- info( '***', host.name, 'is running sshd on', intf, 'at', ip, '\n' )
-
-def startsshds ( hosts ):
- for h in hosts:
- startsshd( h )
-
-def stopsshd( ):
- "Stop *all* sshd processes with a custom banner"
- info( '*** Shutting down stale sshd/Banner processes ',
- quietRun( "pkill -9 -f Banner" ), '\n' )
-
-def startquagga( host, num, config_file ):
- info( '*** Starting Quagga on %s\n' % host )
- zebra_cmd = 'sudo %s/zebra -d -f %s/zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid' % (QUAGGA_DIR, QUAGGA_CONFIG_FILE_DIR, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
- quagga_cmd = 'sudo %s/bgpd -d -f %s -z %s/zserv%s.api -i %s/bgpd%s.pid' % (QUAGGA_DIR, config_file, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
-
- print zebra_cmd
- print quagga_cmd
-
- host.cmd( zebra_cmd )
- host.cmd( quagga_cmd )
-
-def startquaggahost5( host, num ):
- info( '*** Starting Quagga on %s\n' % host )
- zebra_cmd = 'sudo %s/zebra -d -f %s/zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid' % (QUAGGA_DIR, QUAGGA_CONFIG_FILE_DIR, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
- quagga_cmd = 'sudo %s/bgpd -d -f ./as4quaggas/quagga%s.conf -z %s/zserv%s.api -i %s/bgpd%s.pid' % (QUAGGA_DIR, num, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
-
- host.cmd( zebra_cmd )
- host.cmd( quagga_cmd )
-
-
-def stopquagga( ):
- quietRun( 'sudo pkill -9 -f bgpd' )
- quietRun( 'sudo pkill -9 -f zebra' )
-
-def sdn1net():
- topo = SDNIpModifiedTopo()
- info( '*** Creating network\n' )
- net = Mininet( topo=topo, controller=RemoteController )
- net = Mininet( topo=topo, controller=RemoteController )
-
- host1, host3, host4, host5 = net.get( 'host1', 'host3', 'host4', 'host5' )
-
- #host100.setIP('1.168.30.' + str(i), 24, str(host100) + "-eth2")
-
- #host500.setMAC('00:00:00:00:04:%d' % (i-101), 'host%d-eth0' %(i))
- #add IP prefixes
- #for j in range(0,121):
- #host100.cmd('sudo ip addr add %s.0.40.%s/24 dev host%s-eth0' %(i,j,i))
-
- ## Adding 2nd, 3rd and 4th interface to host1 connected to sw1 (for another BGP peering)
- #sw1 = net.get('sw1')
- host1.setMAC('00:00:00:00:00:01', 'host1-eth0')
- #host1.cmd('ip addr add 192.168.20.101/24 dev host1-eth0')
- #host1.cmd('ip addr add 192.168.30.101/24 dev host1-eth0')
- #host1.cmd('ip addr add 192.168.60.101/24 dev host1-eth0')
-
- # Net has to be start after adding the above link
- net.start()
-
- # Set up as6sw as a learning switch as quickly as possible so it
- # hopefully doesn't connect to the actual controller
- # TODO figure out how to change controller before starting switch
- as6sw = net.get('as6sw')
- as6sw.cmd('ovs-vsctl set-controller as6sw none')
- as6sw.cmd('ovs-vsctl set-fail-mode as6sw standalone')
-
- as6sw.cmd( 'sudo ovs-vsctl set port as6sw-eth1 trunk=60')
- as6sw.cmd( 'sudo ovs-vsctl set port as6sw-eth2 trunk=60')
-
-
- sw1 = net.get('sw1')
- sw1.cmd('ovs-vsctl set-controller sw1 tcp:127.0.0.1:6633')
-
- swTestOn = net.get('swTestOn')
- swTestOn.cmd('ovs-vsctl set-controller swTestOn none')
- swTestOn.cmd('ovs-vsctl set-fail-mode swTestOn standalone')
-
- #host1.defaultIntf().setIP('192.168.10.101/24')
-
- host1.cmd( 'ifconfig host1-eth0 inet 0')
- host1.cmd( 'vconfig add host1-eth0 10')
- host1.cmd( 'ifconfig host1-eth0.10 inet 192.168.10.101')
-
- host1.cmd( 'vconfig add host1-eth0 20')
- host1.cmd( 'ifconfig host1-eth0.20 inet 192.168.20.101')
-
- host1.cmd( 'vconfig add host1-eth0 30')
- host1.cmd( 'ifconfig host1-eth0.30 inet 192.168.30.101')
-
- host1.cmd( 'vconfig add host1-eth0 60')
- host1.cmd( 'ifconfig host1-eth0.60 inet 192.168.60.101')
-
- # Run BGPd
- #host1.cmd('%s -d -f %s' % (BGPD, BGPD_CONF))
- #host1.cmd('/sbin/route add default gw 192.168.10.254 dev %s-eth0' % (host1.name))
-
- # Configure new host interfaces
- #host2.defaultIntf().setIP('172.16.10.2/24')
- #host2.defaultIntf().setMAC('00:00:00:00:01:02')
- #host2.cmd('/sbin/route add default gw 172.16.10.254 dev %s-eth0' % (host2.name))
-
- # Set up AS2
- # add additional VLAN interface
- host3.cmd( 'ifconfig host3-eth1 inet 0')
- host3.cmd( 'vconfig add host3-eth1 20')
- host3.cmd( 'ifconfig host3-eth1.20 inet 192.168.20.1')
- # change the interface for the sencond connection to sw1 to vlan interface
- newName = "host3-eth1.20"
- secondIntf = host3.intf("host3-eth1")
- secondIntf.name = newName
- host3.nameToIntf[ newName ] = secondIntf
-
- host3.setMAC('00:00:00:00:02:01', 'host3-eth0.10')
- host3.setMAC('00:00:00:00:02:02', 'host3-eth1.20')
-
- #host3.setIP('172.16.20.254', 24, 'host3-eth2')
- host3.setIP('3.0.0.254', 8, 'host3-eth2')
- host3.cmd('sysctl net.ipv4.conf.all.forwarding=1')
-
- host3.setIP('1.168.30.2', 24, 'host3-eth3')
- host3.cmd('sysctl net.ipv4.conf.all.arp_ignore=1')
- host3.cmd('sysctl net.ipv4.conf.all.arp_announce=1')
- as2host = net.get('as2host')
- #as2host.defaultIntf().setIP('172.16.20.1/24')
- for i in range(0, 20):
- as2host.cmd('sudo ip addr add 3.0.%d.1/24 dev as2host-eth0' %i)
- as2host.setIP('1.168.30.100', 24, 'as2host-eth1')
-
- as2host.cmd('ip route add default via 3.0.0.254')
-
- # Set up AS3
- host4.setMAC('00:00:00:00:03:01', 'host4-eth0.30')
- host4.setIP('4.0.0.254', 8, 'host4-eth1')
- host4.setMAC('00:00:00:00:03:99', 'host4-eth1')
- host4.cmd('sysctl net.ipv4.conf.all.forwarding=1')
- as3host = net.get('as3host')
- for i in range(0, 20):
- as3host.cmd('sudo ip addr add 4.0.%d.1/24 dev as3host-eth0' %i)
- as3host.cmd('ip route add default via 4.0.0.254')
-
- host4.setIP('10.0.0.4', 24, 'host4-eth2')
- host4.setMAC('00:00:00:00:03:33', 'host4-eth2')
-
- #root space
- host4.setIP('1.168.30.3', 24, 'host4-eth3')
- host4.setMAC('00:00:00:00:03:03', 'host4-eth3')
-
- # Set up AS4
- #as4host = net.get('as4host')
- #as4host.defaultIntf().setIP('172.16.40.1/24')
- #as4host.cmd('ip route add default via 172.16.40.254')
-
- # setup interface address for 100 quagga hosts
- time.sleep(10)
- #for i in range(numHost101, numHost200 + 1):
- #host100 = net.get('host' + str(i))
- #host100.cmd(str(i)+'.0.1.254', 24, 'host'+str(i)+'-eth1')
- #as4host100 = net.get('as4host%s' %(i))
- #as4host100.defaultIntf().setIP(str(i) + '.0.0.1/24')
- #as4host100.cmd('ip route add default via ' + str(i) + '.0.0.254')
- #for j in range(0, 100):
- #as4host100.cmd('sudo ip addr add %d.0.%d.1/24 dev %s-eth0' %(i, j, as4host100))
-
- # Set up AS6 - This has a router and a route server
- host5 = net.get('host5')
- host5.setMAC('00:00:00:00:06:02', 'host5-eth0.60')
- #as6router.setIP('172.16.60.254', 24, 'as6router-eth1')
- host5.setIP('5.0.0.254', 8, 'host5-eth1')
- host5.cmd('sysctl net.ipv4.conf.all.forwarding=1')
- host5.setIP('10.0.0.5', 24, 'host5-eth2')
- host5.setMAC('00:00:00:00:06:66', 'host5-eth2')
- host5.setIP('1.168.30.5', 24, 'host5-eth3')
- host5.setMAC('00:00:00:00:06:05', 'host5-eth3')
-
- as6host = net.get('as6host')
- #as6host.defaultIntf().setIP('5.0.0.1/24')
- for i in range(0, 10):
- as6host.cmd('sudo ip addr add 5.0.%d.1/24 dev as6host-eth0' %i)
- as6host.cmd('ip route add default via 5.0.0.254')
-
- # test the host in the as6
- #for i in range(1, 10):
- # baseip = (i-1)*4
- # host = net.get('as6host%d' % i)
- # host.defaultIntf().setIP('172.16.70.%d/24' % (baseip+1))
- # host.cmd('ip route add default via 172.16.70.%d' % (baseip+2))
- # as6router.setIP('172.16.70.%d' % (baseip+2), 30, 'as6router-eth%d' % (i+1))
-
- # Start Quagga on border routers
- startquagga(host3, 1, QUAGGA_CONFIG_FILE_DIR + '/quagga1.conf')
- startquagga(host4, 2, QUAGGA_CONFIG_FILE_DIR + '/quagga2.conf')
- #for i in range(numHost101, numHost200 + 1):
- #host100=net.get('host%d' % (i))
- #startquaggahost5(host100, i)
-
- #startquagga(as6rs, 4, 'quagga-as6-rs.conf')
- startquagga(host5, 5, QUAGGA_CONFIG_FILE_DIR + '/quagga-as6.conf')
-
- #root1, root2, rootTestOn = net.get( 'root1', 'root2', 'rootTestOn' )
- root1, rootTestOn = net.get( 'root1', 'rootTestOn' )
- host1.intf('host1-eth1').setIP('1.1.1.1/24')
- root1.intf('root1-eth0').setIP('1.1.1.2/24')
- #host2.intf('host2-eth1').setIP('1.1.2.1/24')
- #root2.intf('root2-eth0').setIP('1.1.2.2/24')
-
- #rootTestOn.cmd('ip addr add 1.168.30.102/24 dev rootTestOn-eth0')
- rootTestOn.cmd('ip addr add 1.168.30.99/24 dev rootTestOn-eth0')
-
- stopsshd()
-
- startquagga(host1, 100, QUAGGA_CONFIG_FILE_DIR + '/quagga-sdn-modified.conf')
- hosts = [ host1, host3, host4, host5, as2host ];
- #sshdHosts = sshdHosts + hosts
- startsshds( hosts )
- #
- onos1 = '127.0.0.1'
- forwarding1 = '%s:2000:%s:2000' % ('1.1.1.2', onos1)
- root1.cmd( 'ssh -nNT -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -l sdn -L %s %s & ' % (forwarding1, onos1) )
-
- # Forward 2605 to root namespace for easier access to SDN domain BGPd
- # If root can ssh to itself without a password this should work
- root1.cmd('ssh -N -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -L 2605:1.1.1.1:2605 1.1.1.1 &')
- #time.sleep(3000000000)
- CLI( net )
-
- # Close the ssh port forwarding
- #quietRun('sudo pkill -f 1.1.1.1')
-
- stopsshd()
- stopquagga()
- net.stop()
-
-if __name__ == '__main__':
- setLogLevel( 'debug' )
- if len(sys.argv) > 1:
- QUAGGA_CONFIG_FILE_DIR = sys.argv[1]
- sdn1net()
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/quagga-as6.conf b/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/quagga-as6.conf
deleted file mode 100644
index 5e7028d..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/quagga-as6.conf
+++ /dev/null
@@ -1,39 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64521
- bgp router-id 192.168.60.2
- neighbor 192.168.60.101 remote-as 64513
- neighbor 10.0.0.4 remote-as 64516
-! neighbor 192.168.60.3 remote-as 64520
-! network 172.16.60.0/24
-! network 172.16.70.4/30
- ! network 172.16.70.8/30
- ! network 172.16.70.12/30
- ! network 172.16.70.16/30
- ! network 172.16.70.20/30
- ! network 172.16.70.24/30
- ! network 172.16.70.28/30
- ! network 172.16.70.32/30
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/quagga-sdn-modified.conf b/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/quagga-sdn-modified.conf
deleted file mode 100644
index d334c2a..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/quagga-sdn-modified.conf
+++ /dev/null
@@ -1,49 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-route-map AS65000 permit 1
- set as-path prepend 65000
-!
-router bgp 64513
- bgp router-id 192.168.10.101
- timers bgp 1 3
- !timers bgp 3 9
- neighbor 192.168.10.1 remote-as 64514
- neighbor 192.168.10.1 ebgp-multihop
- neighbor 192.168.10.1 timers connect 5
- neighbor 192.168.20.1 remote-as 64514
- neighbor 192.168.20.1 ebgp-multihop
- neighbor 192.168.20.1 timers connect 5
- neighbor 192.168.20.1 route-map AS65000 in
- neighbor 192.168.30.1 remote-as 64516
- neighbor 192.168.30.1 ebgp-multihop
- neighbor 192.168.30.1 timers connect 5
- neighbor 192.168.60.2 remote-as 64521
- neighbor 192.168.60.2 ebgp-multihop
- neighbor 192.168.60.2 timers connect 5
- neighbor 1.1.1.2 remote-as 64513
- neighbor 1.1.1.2 port 2000
- neighbor 1.1.1.2 timers connect 5
-
-
-
- network 172.16.10.0/24
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/quagga1.conf b/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/quagga1.conf
deleted file mode 100644
index 264f85e..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/quagga1.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-!
-! Zebra configuration saved from vty
-! 2014/11/25 11:22:24
-!
-hostname bgpd
-password hello
-log stdout
-!
-router bgp 64514
- bgp router-id 192.168.10.1
-! network 3.0.0.0/24
-! network 3.0.1.0/24
-! network 3.0.2.0/24
-! network 3.0.3.0/24
-! network 3.0.4.0/24
-! network 3.0.5.0/24
-! network 3.0.6.0/24
-! network 3.0.7.0/24
-! network 3.0.8.0/24
-! network 3.0.9.0/24
- neighbor 192.168.20.101 remote-as 64513
- neighbor 192.168.20.101 route-map PREPEND2 in
- neighbor 192.168.20.101 route-map PREPEND2 out
-!
-route-map PREPEND1 permit 1
- set as-path prepend 64514
-!
-route-map PREPEND2 permit 2
- set as-path prepend 64514 64514
-!
-line vty
-!
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/quagga2.conf b/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/quagga2.conf
deleted file mode 100644
index 14c7d67..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/quagga2.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64516
- bgp router-id 192.168.30.1
-! timers bgp 1 3
- neighbor 192.168.30.101 remote-as 64513
- neighbor 10.0.0.5 remote-as 64521
-! neighbor 192.168.50.2 remote-as 65001
-! network 172.16.30.0/24
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/zebra.conf b/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/zebra.conf
deleted file mode 100644
index 0f8e3a2..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeconvergence/mininet/zebra.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-! -*- zebra -*-
-!
-! zebra sample configuration file
-!
-! $Id: zebra.conf.sample,v 1.1 2002/12/13 20:15:30 paul Exp $
-!
-hostname zebra
-password hello
-enable password 0fw0rk
-log stdout
-!
-! Interfaces description.
-!
-!interface lo
-! description test of desc.
-!
-!interface sit0
-! multicast
-
-!
-! Static default route sample.
-!
-!ip route 0.0.0.0/0 203.181.89.241
-!
-
-!log file /usr/local/var/log/quagga/zebra.log
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeserver/addresses.json b/TestON/tests/PeeringRouterTest/vlan/routeserver/addresses.json
deleted file mode 100644
index f800c1f..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeserver/addresses.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "addresses" : [
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "1",
- "ips" : ["192.168.10.101/24"],
- "mac" : "00:00:00:00:00:01",
- "vlan" : "10"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "2",
- "ips" : ["192.168.20.101/24"],
- "mac" : "00:00:00:00:00:01",
- "vlan" : "20"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "3",
- "ips" : ["192.168.30.101/24"],
- "mac" : "00:00:00:00:00:01",
- "vlan" : "30"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:01",
- "port" : "4",
- "ips" : ["192.168.60.101/24"],
- "mac" : "00:00:00:00:00:01",
- "vlan" : "60"
- }
-
- ]
-}
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/PeeringRouteServerVlanMininet.py b/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/PeeringRouteServerVlanMininet.py
deleted file mode 100755
index 3ba30cd..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/PeeringRouteServerVlanMininet.py
+++ /dev/null
@@ -1,389 +0,0 @@
-#!/usr/bin/python
-
-"""
-Start up the SDN-IP demo topology
-"""
-
-"""
-AS1 = 64513, (SDN AS)
-AS2 = 64514, reachable by 192.168.10.1, 192.168.20.1
-AS3 = 64516, reachable by 192.168.30.1
-AS4 = 64517, reachable by 192.168.40.1
-AS6 = 64520, reachable by 192.168.60.2, (route server 192.168.60.1)
-"""
-
-from mininet.node import Host
-from mininet.net import Mininet
-from mininet.node import Controller, RemoteController
-from mininet.log import setLogLevel, info
-from mininet.cli import CLI
-from mininet.topo import Topo
-from mininet.util import quietRun
-from mininet.moduledeps import pathCheck
-
-import os.path
-import time
-import sys
-from subprocess import Popen, STDOUT, PIPE
-
-QUAGGA_DIR = '/usr/lib/quagga'
-#QUAGGA_DIR = '/usr/local/sbin'
-QUAGGA_RUN_DIR = '/usr/local/var/run/quagga'
-
-QUAGGA_CONFIG_FILE_DIR = '/home/tutorial1/ONLabTest/TestON/tests/PeeringRouterTest/mininet'
-
-class VLANHost( Host ):
- "Host connected to VLAN interface"
-
- def config( self, vlan=10, intf2 = '', ip2 = 0, vlan2 = 0, **params):
- """Configure VLANHost according to (optional) parameters:
- vlan: VLAN ID for default interface"""
-
- r = super( VLANHost, self ).config( **params )
-
- intf = params['inf']
- # remove IP from default, "physical" interface
- self.cmd( 'ifconfig %s inet 0' % intf )
- # create VLAN interface
- self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- # assign the host's IP to the VLAN interface
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
- # update the intf name and host's intf map
- newName = '%s.%d' % ( intf, vlan )
- # update the (Mininet) interface to refer to VLAN interface name
- defaultIntf = self.defaultIntf()
- defaultIntf.name = newName
- # add VLAN interface to host's name to intf map
- self.nameToIntf[ newName ] = defaultIntf
-
- return r
-
-class SDNIpModifiedTopo( Topo ):
- "SDN Ip Modified Topology"
-
- def __init__( self, *args, **kwargs ):
- global numHost101
- global numHost200
- numHost101 = 101
- numHost200 = 200
- Topo.__init__( self, *args, **kwargs )
- sw1 = self.addSwitch('sw1', dpid='0000000000000001')
- sw2 = self.addSwitch('sw2', dpid='0000000000000002')
- #add a switch for 3 quagga hosts
- swTestOn = self.addSwitch('swTestOn', dpid='0000000000000102')
- #Note this switch isn't part of the SDN topology
- #We'll use the ovs-controller to turn this into a learning switch
- as6sw = self.addSwitch('as6sw', dpid='00000000000000a7')
-
- host1 = self.addHost( 'host1' )
- root1 = self.addHost( 'root1', inNamespace=False , ip='0')
- rootTestOn = self.addHost( 'rootTestOn', inNamespace=False, ip='0' )
-
- #AS2 host
- host3 = self.addHost( 'host3', cls=VLANHost, vlan=10, inf="host3-eth0", ip="192.168.10.1")
-
- as2host = self.addHost( 'as2host' )
- #AS3 host
- host4 = self.addHost( 'host4', cls=VLANHost, vlan=30, inf="host4-eth0", ip="192.168.30.1" )
- as3host = self.addHost( 'as3host' )
- #AS6 host
- as6rs = self.addHost( 'as6rs', cls=VLANHost, vlan=60, inf="as6rs-eth0", ip="192.168.60.1" )
- host5 = self.addHost( 'host5', cls=VLANHost, vlan=60, inf="host5-eth0", ip="192.168.60.2" )
- as6host = self.addHost( 'as6host' )
-
- self.addLink( host1, sw2 )
- #Links to the multihomed AS
- self.addLink( host3, sw1 )
- self.addLink( host3, sw1 )
- self.addLink( as2host, host3 )
- #Single links to the remaining two ASes
- self.addLink( host4, sw1 )
- self.addLink( as3host, host4 )
-
- #AS3-AS4 link
- #self.addLink( host4, host5)
- #Add new AS6 to its bridge
- self.addLink( as6rs, as6sw )
- self.addLink( host5, as6sw )
- self.addLink( as6host, host5 )
- #Backup link from router5 to router4
- self.addLink( host4, host5)
- #test the host behind the router(behind the router server)
-# for i in range(1, 10):
- # host = self.addHost('as6host%d' % i)
- # self.addLink(host, as6router)
-
- ## Internal Connection To Hosts ##
- self.addLink( root1, host1 )
-
- # self.addLink( sw1, sw2 )
- # self.addLink( sw1, sw3 )
- # self.addLink( sw2, sw4 )
- # self.addLink( sw3, sw4 )
- # self.addLink( sw3, sw5 )
- # self.addLink( sw4, sw6 )
- # self.addLink( sw5, sw6 )
- self.addLink( as6sw, sw1 )
-
-
- self.addLink(swTestOn, rootTestOn)
- #self.addLink(swTestOn, host1)
- self.addLink(swTestOn, host3)
- self.addLink(swTestOn, host4)
- self.addLink(swTestOn, host5)
- self.addLink(swTestOn, as2host)
- self.addLink(swTestOn, as6rs)
-
-
- #self.addLink(rootTestOn, host4)
-
-def startsshd( host ):
- "Start sshd on host"
- info( '*** Starting sshd\n' )
- name, intf, ip = host.name, host.defaultIntf(), host.IP()
- banner = '/tmp/%s.banner' % name
- host.cmd( 'echo "Welcome to %s at %s" > %s' % ( name, ip, banner ) )
- host.cmd( '/usr/sbin/sshd -o "Banner %s"' % banner, '-o "UseDNS no"' )
- info( '***', host.name, 'is running sshd on', intf, 'at', ip, '\n' )
-
-def startsshds ( hosts ):
- for h in hosts:
- startsshd( h )
-
-def stopsshd( ):
- "Stop *all* sshd processes with a custom banner"
- info( '*** Shutting down stale sshd/Banner processes ',
- quietRun( "pkill -9 -f Banner" ), '\n' )
-
-def startquagga( host, num, config_file ):
- info( '*** Starting Quagga on %s\n' % host )
- zebra_cmd = 'sudo %s/zebra -d -f %s/zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid' % (QUAGGA_DIR, QUAGGA_CONFIG_FILE_DIR, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
- quagga_cmd = 'sudo %s/bgpd -d -f %s -z %s/zserv%s.api -i %s/bgpd%s.pid' % (QUAGGA_DIR, config_file, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
-
- print zebra_cmd
- print quagga_cmd
-
- host.cmd( zebra_cmd )
- host.cmd( quagga_cmd )
-
-def startquaggahost5( host, num ):
- info( '*** Starting Quagga on %s\n' % host )
- zebra_cmd = 'sudo %s/zebra -d -f %s/zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid' % (QUAGGA_DIR, QUAGGA_CONFIG_FILE_DIR, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
- quagga_cmd = 'sudo %s/bgpd -d -f ./as4quaggas/quagga%s.conf -z %s/zserv%s.api -i %s/bgpd%s.pid' % (QUAGGA_DIR, num, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
-
- host.cmd( zebra_cmd )
- host.cmd( quagga_cmd )
-
-
-def stopquagga( ):
- quietRun( 'sudo pkill -9 -f bgpd' )
- quietRun( 'sudo pkill -9 -f zebra' )
-
-def sdn1net():
- topo = SDNIpModifiedTopo()
- info( '*** Creating network\n' )
- net = Mininet( topo=topo, controller=RemoteController )
- net = Mininet( topo=topo, controller=RemoteController )
-
- host1, host3, host4, host5 = net.get( 'host1', 'host3', 'host4', 'host5' )
-
- #host100.setIP('1.168.30.' + str(i), 24, str(host100) + "-eth2")
-
- #host500.setMAC('00:00:00:00:04:%d' % (i-101), 'host%d-eth0' %(i))
- #add IP prefixes
- #for j in range(0,121):
- #host100.cmd('sudo ip addr add %s.0.40.%s/24 dev host%s-eth0' %(i,j,i))
-
- ## Adding 2nd, 3rd and 4th interface to host1 connected to sw1 (for another BGP peering)
- #sw1 = net.get('sw1')
- host1.setMAC('00:00:00:00:00:01', 'host1-eth0')
- #host1.cmd('ip addr add 192.168.20.101/24 dev host1-eth0')
- #host1.cmd('ip addr add 192.168.30.101/24 dev host1-eth0')
- #host1.cmd('ip addr add 192.168.60.101/24 dev host1-eth0')
-
- # Net has to be start after adding the above link
- net.start()
-
- # Set up as6sw as a learning switch as quickly as possible so it
- # hopefully doesn't connect to the actual controller
- # TODO figure out how to change controller before starting switch
- as6sw = net.get('as6sw')
- as6sw.cmd('ovs-vsctl set-controller as6sw none')
- as6sw.cmd('ovs-vsctl set-fail-mode as6sw standalone')
-
- as6sw.cmd( 'sudo ovs-vsctl set port as6sw-eth1 trunk=60')
- as6sw.cmd( 'sudo ovs-vsctl set port as6sw-eth2 trunk=60')
-
-
- sw1 = net.get('sw1')
- sw1.cmd('ovs-vsctl set-controller sw1 tcp:127.0.0.1:6633')
-
- swTestOn = net.get('swTestOn')
- swTestOn.cmd('ovs-vsctl set-controller swTestOn none')
- swTestOn.cmd('ovs-vsctl set-fail-mode swTestOn standalone')
-
- #host1.defaultIntf().setIP('192.168.10.101/24')
-
- host1.cmd( 'ifconfig host1-eth0 inet 0')
- host1.cmd( 'vconfig add host1-eth0 10')
- host1.cmd( 'ifconfig host1-eth0.10 inet 192.168.10.101')
-
- host1.cmd( 'vconfig add host1-eth0 20')
- host1.cmd( 'ifconfig host1-eth0.20 inet 192.168.20.101')
-
- host1.cmd( 'vconfig add host1-eth0 30')
- host1.cmd( 'ifconfig host1-eth0.30 inet 192.168.30.101')
-
- host1.cmd( 'vconfig add host1-eth0 60')
- host1.cmd( 'ifconfig host1-eth0.60 inet 192.168.60.101')
-
- # Run BGPd
- #host1.cmd('%s -d -f %s' % (BGPD, BGPD_CONF))
- #host1.cmd('/sbin/route add default gw 192.168.10.254 dev %s-eth0' % (host1.name))
-
- # Configure new host interfaces
- #host2.defaultIntf().setIP('172.16.10.2/24')
- #host2.defaultIntf().setMAC('00:00:00:00:01:02')
- #host2.cmd('/sbin/route add default gw 172.16.10.254 dev %s-eth0' % (host2.name))
-
- # Set up AS2
- # add additional VLAN interface
- host3.cmd( 'ifconfig host3-eth1 inet 0')
- host3.cmd( 'vconfig add host3-eth1 20')
- host3.cmd( 'ifconfig host3-eth1.20 inet 192.168.20.1')
- # change the interface for the sencond connection to sw1 to vlan interface
- newName = "host3-eth1.20"
- secondIntf = host3.intf("host3-eth1")
- secondIntf.name = newName
- host3.nameToIntf[ newName ] = secondIntf
-
- host3.setMAC('00:00:00:00:02:01', 'host3-eth0.10')
- host3.setMAC('00:00:00:00:02:02', 'host3-eth1.20')
-
- #host3.setIP('172.16.20.254', 24, 'host3-eth2')
- host3.setIP('3.0.0.254', 8, 'host3-eth2')
- host3.cmd('sysctl net.ipv4.conf.all.forwarding=1')
-
- host3.setIP('1.168.30.2', 24, 'host3-eth3')
- host3.cmd('sysctl net.ipv4.conf.all.arp_ignore=1')
- host3.cmd('sysctl net.ipv4.conf.all.arp_announce=1')
- as2host = net.get('as2host')
- #as2host.defaultIntf().setIP('172.16.20.1/24')
- for i in range(0, 20):
- as2host.cmd('sudo ip addr add 3.0.%d.1/24 dev as2host-eth0' %i)
- as2host.setIP('1.168.30.100', 24, 'as2host-eth1')
-
- as2host.cmd('ip route add default via 3.0.0.254')
-
- # Set up AS3
- host4.setMAC('00:00:00:00:03:01', 'host4-eth0.30')
- host4.setIP('4.0.0.254', 8, 'host4-eth1')
- host4.setMAC('00:00:00:00:03:99', 'host4-eth1')
- host4.cmd('sysctl net.ipv4.conf.all.forwarding=1')
- as3host = net.get('as3host')
- for i in range(0, 20):
- as3host.cmd('sudo ip addr add 4.0.%d.1/24 dev as3host-eth0' %i)
- as3host.cmd('ip route add default via 4.0.0.254')
-
- host4.setIP('10.0.0.4', 24, 'host4-eth2')
- host4.setMAC('00:00:00:00:03:33', 'host4-eth2')
-
- #root space
- host4.setIP('1.168.30.3', 24, 'host4-eth3')
- host4.setMAC('00:00:00:00:03:03', 'host4-eth3')
-
- # Set up AS4
- #as4host = net.get('as4host')
- #as4host.defaultIntf().setIP('172.16.40.1/24')
- #as4host.cmd('ip route add default via 172.16.40.254')
-
- # setup interface address for 100 quagga hosts
- time.sleep(10)
- #for i in range(numHost101, numHost200 + 1):
- #host100 = net.get('host' + str(i))
- #host100.cmd(str(i)+'.0.1.254', 24, 'host'+str(i)+'-eth1')
- #as4host100 = net.get('as4host%s' %(i))
- #as4host100.defaultIntf().setIP(str(i) + '.0.0.1/24')
- #as4host100.cmd('ip route add default via ' + str(i) + '.0.0.254')
- #for j in range(0, 100):
- #as4host100.cmd('sudo ip addr add %d.0.%d.1/24 dev %s-eth0' %(i, j, as4host100))
-
- # Set up AS6 - This has a router and a route server
- as6rs, host5 = net.get('as6rs', 'host5')
-
- as6rs.setMAC('00:00:00:06:06:01', 'as6rs-eth0')
- as6rs.setIP('1.168.30.6', 24, 'as6rs-eth1')
- as6rs.setMAC('00:00:00:06:06:06', 'as6rs-eth1')
-
- host5.setMAC('00:00:00:00:06:02', 'host5-eth0.60')
- #as6router.setIP('172.16.60.254', 24, 'as6router-eth1')
- host5.setIP('5.0.0.254', 8, 'host5-eth1')
- host5.cmd('sysctl net.ipv4.conf.all.forwarding=1')
- host5.setIP('10.0.0.5', 24, 'host5-eth2')
- host5.setMAC('00:00:00:00:06:66', 'host5-eth2')
- host5.setIP('1.168.30.5', 24, 'host5-eth3')
- host5.setMAC('00:00:00:00:06:05', 'host5-eth3')
-
- as6host = net.get('as6host')
- #as6host.defaultIntf().setIP('5.0.0.1/24')
- for i in range(0, 10):
- as6host.cmd('sudo ip addr add 5.0.%d.1/24 dev as6host-eth0' %i)
- as6host.cmd('ip route add default via 5.0.0.254')
-
- # test the host in the as6
- #for i in range(1, 10):
- # baseip = (i-1)*4
- # host = net.get('as6host%d' % i)
- # host.defaultIntf().setIP('172.16.70.%d/24' % (baseip+1))
- # host.cmd('ip route add default via 172.16.70.%d' % (baseip+2))
- # as6router.setIP('172.16.70.%d' % (baseip+2), 30, 'as6router-eth%d' % (i+1))
-
- # Start Quagga on border routers
- startquagga(host3, 1, QUAGGA_CONFIG_FILE_DIR + '/quagga1.conf')
- startquagga(host4, 2, QUAGGA_CONFIG_FILE_DIR + '/quagga2.conf')
- #for i in range(numHost101, numHost200 + 1):
- #host100=net.get('host%d' % (i))
- #startquaggahost5(host100, i)
-
- startquagga(as6rs, 4, QUAGGA_CONFIG_FILE_DIR + '/quagga-as6-rs.conf')
- startquagga(host5, 5, QUAGGA_CONFIG_FILE_DIR + '/quagga-as6.conf')
-
- #root1, root2, rootTestOn = net.get( 'root1', 'root2', 'rootTestOn' )
- root1, rootTestOn = net.get( 'root1', 'rootTestOn' )
- host1.intf('host1-eth1').setIP('1.1.1.1/24')
- root1.intf('root1-eth0').setIP('1.1.1.2/24')
- #host2.intf('host2-eth1').setIP('1.1.2.1/24')
- #root2.intf('root2-eth0').setIP('1.1.2.2/24')
-
- #rootTestOn.cmd('ip addr add 1.168.30.102/24 dev rootTestOn-eth0')
- rootTestOn.cmd('ip addr add 1.168.30.99/24 dev rootTestOn-eth0')
-
- stopsshd()
-
- startquagga(host1, 100, QUAGGA_CONFIG_FILE_DIR + '/quagga-sdn-modified.conf')
- hosts = [ host1, host3, host4, host5, as2host, as6rs ];
- #sshdHosts = sshdHosts + hosts
- startsshds( hosts )
- #
- onos1 = '127.0.0.1'
- forwarding1 = '%s:2000:%s:2000' % ('1.1.1.2', onos1)
- root1.cmd( 'ssh -nNT -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -l sdn -L %s %s & ' % (forwarding1, onos1) )
-
- # Forward 2605 to root namespace for easier access to SDN domain BGPd
- # If root can ssh to itself without a password this should work
- root1.cmd('ssh -N -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -L 2605:1.1.1.1:2605 1.1.1.1 &')
- #time.sleep(3000000000)
- CLI( net )
-
- # Close the ssh port forwarding
- #quietRun('sudo pkill -f 1.1.1.1')
-
- stopsshd()
- stopquagga()
- net.stop()
-
-if __name__ == '__main__':
- setLogLevel( 'debug' )
- if len(sys.argv) > 1:
- QUAGGA_CONFIG_FILE_DIR = sys.argv[1]
- sdn1net()
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga-as6-rs.conf b/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga-as6-rs.conf
deleted file mode 100644
index 1eac0dd..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga-as6-rs.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64520
- bgp router-id 192.168.60.1
- neighbor 192.168.60.101 remote-as 64513
- neighbor 192.168.60.101 route-server-client
- neighbor 192.168.60.2 remote-as 64521
- neighbor 192.168.60.2 route-server-client
-! network 172.16.60.0/24
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga-as6.conf b/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga-as6.conf
deleted file mode 100644
index 19cc140..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga-as6.conf
+++ /dev/null
@@ -1,39 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64521
- bgp router-id 192.168.60.2
- neighbor 192.168.60.1 remote-as 64520
- neighbor 10.0.0.4 remote-as 64516
-! neighbor 192.168.60.3 remote-as 64520
-! network 172.16.60.0/24
-! network 172.16.70.4/30
- ! network 172.16.70.8/30
- ! network 172.16.70.12/30
- ! network 172.16.70.16/30
- ! network 172.16.70.20/30
- ! network 172.16.70.24/30
- ! network 172.16.70.28/30
- ! network 172.16.70.32/30
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga-sdn-modified.conf b/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga-sdn-modified.conf
deleted file mode 100644
index bf37a60..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga-sdn-modified.conf
+++ /dev/null
@@ -1,49 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-route-map AS65000 permit 1
- set as-path prepend 65000
-!
-router bgp 64513
- bgp router-id 192.168.10.101
- timers bgp 1 3
- !timers bgp 3 9
- neighbor 192.168.10.1 remote-as 64514
- neighbor 192.168.10.1 ebgp-multihop
- neighbor 192.168.10.1 timers connect 5
- neighbor 192.168.20.1 remote-as 64514
- neighbor 192.168.20.1 ebgp-multihop
- neighbor 192.168.20.1 timers connect 5
- neighbor 192.168.20.1 route-map AS65000 in
- neighbor 192.168.30.1 remote-as 64516
- neighbor 192.168.30.1 ebgp-multihop
- neighbor 192.168.30.1 timers connect 5
- neighbor 192.168.60.1 remote-as 64520
- neighbor 192.168.60.1 ebgp-multihop
- neighbor 192.168.60.1 timers connect 5
- neighbor 1.1.1.2 remote-as 64513
- neighbor 1.1.1.2 port 2000
- neighbor 1.1.1.2 timers connect 5
-
-
-
- network 172.16.10.0/24
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga1.conf b/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga1.conf
deleted file mode 100644
index 264f85e..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga1.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-!
-! Zebra configuration saved from vty
-! 2014/11/25 11:22:24
-!
-hostname bgpd
-password hello
-log stdout
-!
-router bgp 64514
- bgp router-id 192.168.10.1
-! network 3.0.0.0/24
-! network 3.0.1.0/24
-! network 3.0.2.0/24
-! network 3.0.3.0/24
-! network 3.0.4.0/24
-! network 3.0.5.0/24
-! network 3.0.6.0/24
-! network 3.0.7.0/24
-! network 3.0.8.0/24
-! network 3.0.9.0/24
- neighbor 192.168.20.101 remote-as 64513
- neighbor 192.168.20.101 route-map PREPEND2 in
- neighbor 192.168.20.101 route-map PREPEND2 out
-!
-route-map PREPEND1 permit 1
- set as-path prepend 64514
-!
-route-map PREPEND2 permit 2
- set as-path prepend 64514 64514
-!
-line vty
-!
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga2.conf b/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga2.conf
deleted file mode 100644
index 14c7d67..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/quagga2.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64516
- bgp router-id 192.168.30.1
-! timers bgp 1 3
- neighbor 192.168.30.101 remote-as 64513
- neighbor 10.0.0.5 remote-as 64521
-! neighbor 192.168.50.2 remote-as 65001
-! network 172.16.30.0/24
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/zebra.conf b/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/zebra.conf
deleted file mode 100644
index 0f8e3a2..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeserver/mininet/zebra.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-! -*- zebra -*-
-!
-! zebra sample configuration file
-!
-! $Id: zebra.conf.sample,v 1.1 2002/12/13 20:15:30 paul Exp $
-!
-hostname zebra
-password hello
-enable password 0fw0rk
-log stdout
-!
-! Interfaces description.
-!
-!interface lo
-! description test of desc.
-!
-!interface sit0
-! multicast
-
-!
-! Static default route sample.
-!
-!ip route 0.0.0.0/0 203.181.89.241
-!
-
-!log file /usr/local/var/log/quagga/zebra.log
diff --git a/TestON/tests/PeeringRouterTest/vlan/routeserver/sdnip.json b/TestON/tests/PeeringRouterTest/vlan/routeserver/sdnip.json
deleted file mode 100644
index f3117c6..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/routeserver/sdnip.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
-
- "bgpPeers" : [
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "1",
- "ipAddress" : "192.168.10.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "2",
- "ipAddress" : "192.168.20.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "3",
- "ipAddress" : "192.168.30.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "4",
- "ipAddress" : "192.168.60.1"
- }
-
- ],
- "bgpSpeakers" : [
- {
- "name" : "bgpSpeaker1",
- "attachmentDpid" : "00:00:00:00:00:00:00:02",
- "attachmentPort" : "1",
- "macAddress" : "00:00:00:00:00:02",
- "interfaceAddresses" : [
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "1",
- "ipAddress" : "192.168.10.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "2",
- "ipAddress" : "192.168.20.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "3",
- "ipAddress" : "192.168.30.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "4",
- "ipAddress" : "192.168.60.101"
- }
-
- ]
-
- }
-
- ]
-}
diff --git a/TestON/tests/PeeringRouterTest/vlan/sdnip.json b/TestON/tests/PeeringRouterTest/vlan/sdnip.json
deleted file mode 100644
index 5b61d05..0000000
--- a/TestON/tests/PeeringRouterTest/vlan/sdnip.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
-
- "bgpPeers" : [
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "1",
- "ipAddress" : "192.168.10.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "2",
- "ipAddress" : "192.168.20.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "3",
- "ipAddress" : "192.168.30.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:01",
- "attachmentPort" : "4",
- "ipAddress" : "192.168.60.2"
- }
-
- ],
- "bgpSpeakers" : [
- {
- "name" : "bgpSpeaker1",
- "attachmentDpid" : "00:00:00:00:00:00:00:02",
- "attachmentPort" : "1",
- "macAddress" : "00:00:00:00:00:02",
- "interfaceAddresses" : [
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "1",
- "ipAddress" : "192.168.10.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "2",
- "ipAddress" : "192.168.20.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "3",
- "ipAddress" : "192.168.30.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:01",
- "interfacePort" : "4",
- "ipAddress" : "192.168.60.101"
- }
-
- ]
-
- }
-
- ]
-}
diff --git a/TestON/tests/PingallExample/PingallExample.params b/TestON/tests/PingallExample/PingallExample.params
deleted file mode 100644
index 1e4cfc1..0000000
--- a/TestON/tests/PingallExample/PingallExample.params
+++ /dev/null
@@ -1,12 +0,0 @@
-<PARAMS>
- <testcases>1,2,3</testcases>
- <ENV>
- <cellName>SingleHA</cellName>
- </ENV>
- <Git>xe</Git>
-
- <CTRL>
- <ip1>10.128.30.11</ip1>
- <port1>6633</port1>
- </CTRL>
-</PARAMS>
diff --git a/TestON/tests/PingallExample/PingallExample.py b/TestON/tests/PingallExample/PingallExample.py
deleted file mode 100644
index 914f48e..0000000
--- a/TestON/tests/PingallExample/PingallExample.py
+++ /dev/null
@@ -1,171 +0,0 @@
-"""
-Description: This test is an example of a simple single node ONOS test
-
-List of test cases:
-CASE1: Compile ONOS and push it to the test machine
-CASE2: Assign mastership to controller
-CASE3: Pingall
-"""
-class PingallExample:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- """
- CASE1 is to compile ONOS and push it to the test machines
-
- Startup sequence:
- git pull
- mvn clean install
- onos-package
- cell <name>
- onos-verify-cell
- onos-install -f
- onos-wait-for-start
- """
- desc = "ONOS Single node cluster restart HA test - initialization"
- main.log.report( desc )
- main.case( "Setting up test environment" )
-
- # load some vairables from the params file
- PULLCODE = False
- if main.params[ 'Git' ] == 'True':
- PULLCODE = True
- cellName = main.params[ 'ENV' ][ 'cellName' ]
-
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-
- main.step( "Applying cell variable to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- cleanInstallResult = main.TRUE
- gitPullResult = main.TRUE
-
- main.step( "Compiling the latest version of ONOS" )
- if PULLCODE:
- main.step( "Git checkout and pull master" )
- main.ONOSbench.gitCheckout( "master" )
- gitPullResult = main.ONOSbench.gitPull()
-
- main.step( "Using mvn clean & install" )
- cleanInstallResult = main.TRUE
- if gitPullResult == main.TRUE:
- cleanInstallResult = main.ONOSbench.cleanInstall()
- else:
- main.log.warn( "Did not pull new code so skipping mvn " +
- "clean install" )
- main.ONOSbench.getVersion( report=True )
-
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
- node=ONOS1Ip )
-
- main.step( "Checking if ONOS is up yet" )
- for i in range( 2 ):
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if onos1Isup:
- break
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- # TODO: if it becomes an issue, we can retry this step a few times
-
- cliResult = main.ONOScli1.startOnosCli( ONOS1Ip )
-
- case1Result = ( cleanInstallResult and packageResult and
- cellResult and verifyResult and
- onos1InstallResult and
- onos1Isup and cliResult )
-
- utilities.assert_equals( expect=main.TRUE, actual=case1Result,
- onpass="Test startup successful",
- onfail="Test startup NOT successful" )
-
- if case1Result == main.FALSE:
- main.cleanup()
- main.exit()
-
- # Starting the mininet using the old way
- main.step( "Starting Mininet ..." )
- netIsUp = main.Mininet1.startNet()
- if netIsUp:
- main.log.info("Mininet CLI is up")
- else:
- main.log.info("Mininet CLI is down")
-
- def CASE2( self, main ):
- """
- Assign mastership to controller
- """
- import re
-
- main.log.report( "Assigning switches to controller" )
- main.case( "Assigning Controller" )
- main.step( "Assign switches to controller" )
-
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
-
- for i in range( 1, 14 ):
- main.Mininet1.assignSwController(
- sw="s" + str( i ),
- ip=ONOS1Ip,
- port=ONOS1Port )
-
- mastershipCheck = main.TRUE
- for i in range( 1, 14 ):
- response = main.Mininet1.getSwController( "s" + str( i ) )
- try:
- main.log.info( str( response ) )
- except Exception:
- main.log.info( repr( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- mastershipCheck = mastershipCheck and main.TRUE
- else:
- mastershipCheck = main.FALSE
- if mastershipCheck == main.TRUE:
- main.log.report( "Switch mastership assigned correctly" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=mastershipCheck,
- onpass="Switch mastership assigned correctly",
- onfail="Switches not assigned correctly to controllers" )
-
- def CASE3( self, main ):
- """
- Install forwarding app, Pingall and unistall the app
- """
- import time
-
- main.log.report( "Run Pingall" )
- main.case( "Run Pingall" )
-
- # install onos-app-fwd
- main.step( "Activate reactive forwarding app" )
- main.ONOScli1.activateApp( "org.onosproject.fwd" )
-
- # REACTIVE FWD test
- main.step( "Run the pingall command in Mininet" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall()
- time2 = time.time()
- main.log.info( "Time for pingall: %2f seconds" % ( time2 - time1 ) )
-
- # uninstall onos-app-fwd
- main.step( "Deactivate reactive forwarding app" )
- main.ONOScli1.deactivateApp( "org.onosproject.fwd" )
-
- utilities.assert_equals( expect=main.TRUE, actual=pingResult,
- onpass="All hosts are reachable",
- onfail="Some pings failed" )
diff --git a/TestON/tests/PingallExample/PingallExample.topo b/TestON/tests/PingallExample/PingallExample.topo
deleted file mode 100644
index 3eda540..0000000
--- a/TestON/tests/PingallExample/PingallExample.topo
+++ /dev/null
@@ -1,47 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password></password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOScli1>
- <host>10.128.30.10</host>
- <user>admin</user>
- <password></password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli1>
-
- <ONOS1>
- <host>10.128.30.11</host>
- <user>admin</user>
- <password></password>
- <type>OnosDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <Mininet1>
- <host>10.128.30.9</host>
- <user>admin</user>
- <password></password>
- <type>MininetCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --topo=tree,3,3 </arg1>
- <arg2> </arg2>
- <arg3> </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet1>
-
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/ProdFunc/ProdFunc.params b/TestON/tests/ProdFunc/ProdFunc.params
deleted file mode 100755
index c8e125b..0000000
--- a/TestON/tests/ProdFunc/ProdFunc.params
+++ /dev/null
@@ -1,43 +0,0 @@
-<PARAMS>
- #1,4,10,5,6,7,8,9,8,11,8,20,21,22,10,23,24
- <testcases>1,4,10,5,6,7,8,9,8,11,8,2,20,21,22,10,23,24</testcases>
- #Environment variables
- <ENV>
- <cellName>driver_test</cellName>
- </ENV>
- <GIT>
- <pull>True</pull>
- </GIT>
- <CTRL>
- <ip1>10.128.20.11</ip1>
- <port1>6633</port1>
- </CTRL>
-
- <PING>
- <source1>h8</source1>
- <source2>h9</source2>
- <source3>h10</source3>
- <source4>h11</source4>
- <source5>h12</source5>
- <source6>h13</source6>
- <source7>h14</source7>
- <source8>h15</source8>
- <source9>h16</source9>
- <source10>h17</source10>
- <target1>10.0.0.18</target1>
- <target2>10.0.0.19</target2>
- <target3>10.0.0.20</target3>
- <target4>10.0.0.21</target4>
- <target5>10.0.0.22</target5>
- <target6>10.0.0.23</target6>
- <target7>10.0.0.24</target7>
- <target8>10.0.0.25</target8>
- <target9>10.0.0.26</target9>
- <target10>10.0.0.27</target10>
- </PING>
-
- <timers>
- <LinkDiscovery>5</LinkDiscovery>
- <SwitchDiscovery>15</SwitchDiscovery>
- </timers>
-</PARAMS>
diff --git a/TestON/tests/ProdFunc/ProdFunc.py b/TestON/tests/ProdFunc/ProdFunc.py
deleted file mode 100644
index 5673173..0000000
--- a/TestON/tests/ProdFunc/ProdFunc.py
+++ /dev/null
@@ -1,1751 +0,0 @@
-
-# Testing the basic functionality of ONOS Next
-# For sanity and driver functionality excercises only.
-
-import time
-# import sys
-# import os
-# import re
-import json
-
-time.sleep( 1 )
-
-
-class ProdFunc:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- import time
- """
- Startup sequence:
- cell <name>
- onos-verify-cell
- onos-remove-raft-log
- git pull
- mvn clean install
- onos-package
- onos-install -f
- onos-wait-for-start
- """
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- gitPull = main.params[ 'GIT' ][ 'pull' ]
-
- main.case( "Setting up test environment" )
- main.log.report(
- "This testcase is testing setting up test environment" )
- main.log.report( "__________________________________" )
-
- main.step( "Applying cell variable to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- main.step( "Git checkout and get version" )
- main.ONOSbench.gitCheckout( "master" )
- if gitPull == 'True':
- gitPullResult = main.ONOSbench.gitPull()
- if gitPullResult == 1:
- main.step( "Using mvn clean & install" )
- main.ONOSbench.cleanInstall()
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
- elif gitPullResult == 0:
- main.log.report(
- "Git Pull Failed, look into logs for detailed reason" )
- main.cleanup()
- main.exit()
- main.log.info( "git_pull_result = " + str( gitPullResult ))
- else:
- main.log.info( "Skipping git pull" )
- main.ONOSbench.getVersion( report=True )
- packageResult = main.TRUE
-
- main.step( "Uninstalling ONOS package" )
- onosInstallResult = main.ONOSbench.onosUninstall( ONOS1Ip )
- if onosInstallResult == main.TRUE:
- main.log.report( "Uninstalling ONOS package successful" )
- else:
- main.log.report( "Uninstalling ONOS package failed" )
-
- time.sleep( 20 )
- main.step( "Installing ONOS package" )
- onosInstallResult = main.ONOSbench.onosInstall( ONOS1Ip )
- print onosInstallResult
- if onosInstallResult == main.TRUE:
- main.log.report( "Installing ONOS package successful" )
- else:
- main.log.report( "Installing ONOS package failed" )
-
- time.sleep( 20 )
- onos1Isup = main.ONOSbench.isup()
- if onos1Isup == main.TRUE:
- main.log.report( "ONOS instance is up and ready" )
- else:
- main.log.report( "ONOS instance may not be up" )
-
- startResult = main.TRUE
- #main.step( "Starting ONOS service" )
- #startResult = main.ONOSbench.onosStart( ONOS1Ip )
-
- main.ONOS2.startOnosCli( ONOS1Ip )
- main.step( "Starting Mininet CLI..." )
-
- # Starting the mininet using the old way
- main.step( "Starting Mininet ..." )
- netIsUp = main.Mininet1.startNet()
- if netIsUp:
- main.log.info("Mininet CLI is up")
-
- case1Result = ( packageResult and
- cellResult and verifyResult
- and onosInstallResult and
- onos1Isup and startResult )
- utilities.assert_equals( expect=main.TRUE, actual=case1Result,
- onpass="Test startup successful",
- onfail="Test startup NOT successful" )
-
- def CASE2( self, main ):
- """
- Switch Down
- """
- # NOTE: You should probably run a topology check after this
- import time
-
- main.case( "Switch down discovery" )
- main.log.report( "This testcase is testing a switch down discovery" )
- main.log.report( "__________________________________" )
-
- switchSleep = int( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
-
- description = "Killing a switch to ensure it is discovered correctly"
- main.log.report( description )
- main.case( description )
-
- # TODO: Make this switch parameterizable
- main.step( "Kill s28 " )
- main.log.report( "Deleting s28" )
- # FIXME: use new dynamic topo functions
- main.Mininet1.delSwitch( "s28" )
- main.log.info(
- "Waiting " +
- str( switchSleep ) +
- " seconds for switch down to be discovered" )
- time.sleep( switchSleep )
- # Peek at the deleted switch
- device = main.ONOS2.getDevice( dpid="0028" )
- print "device = ", device
- if device[ u'available' ] == 'False':
- case2Result = main.FALSE
- else:
- case2Result = main.TRUE
- utilities.assert_equals( expect=main.TRUE, actual=case2Result,
- onpass="Switch down discovery successful",
- onfail="Switch down discovery failed" )
-
- def CASE101( self, main ):
- """
- Cleanup sequence:
- onos-service <nodeIp> stop
- onos-uninstall
-
- TODO: Define rest of cleanup
-
- """
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-
- main.case( "Cleaning up test environment" )
-
- main.step( "Testing ONOS kill function" )
- killResult = main.ONOSbench.onosKill( ONOS1Ip )
-
- main.step( "Stopping ONOS service" )
- stopResult = main.ONOSbench.onosStop( ONOS1Ip )
-
- main.step( "Uninstalling ONOS service" )
- uninstallResult = main.ONOSbench.onosUninstall()
-
- case11Result = killResult and stopResult and uninstallResult
- utilities.assert_equals( expect=main.TRUE, actual=case11Result,
- onpass="Cleanup successful",
- onfail="Cleanup failed" )
-
- def CASE3( self, main ):
- """
- Test 'onos' command and its functionality in driver
- """
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-
- main.case( "Testing 'onos' command" )
-
- main.step( "Sending command 'onos -w <onos-ip> system:name'" )
- cmdstr1 = "system:name"
- cmdResult1 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr1 )
- main.log.info( "onos command returned: " + cmdResult1 )
-
- main.step( "Sending command 'onos -w <onos-ip> onos:topology'" )
- cmdstr2 = "onos:topology"
- cmdResult2 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr2 )
- main.log.info( "onos command returned: " + cmdResult2 )
-
- def CASE20( self ):
- """
- Exit from mininet cli
- reinstall ONOS
- """
- import time
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-
- main.log.report( "This testcase exits the mininet cli and reinstalls" +
- "ONOS to switch over to Packet Optical topology" )
- main.log.report( "_____________________________________________" )
- main.case( "Disconnecting mininet and restarting ONOS" )
-
- main.step( "Disconnecting mininet and restarting ONOS" )
- step1Result = main.TRUE
- mininetDisconnect = main.Mininet1.disconnect()
- print "mininetDisconnect = ", mininetDisconnect
- step1Result = mininetDisconnect
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Mininet disconnect successfully",
- onfail="Mininet failed to disconnect")
- """
- main.step( "Removing raft logs before a clean installation of ONOS" )
- step2Result = main.TRUE
- removeRaftLogsResult = main.ONOSbench.onosRemoveRaftLogs()
- step2Result = removeRaftLogsResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Raft logs removed successfully",
- onfail="Failed to remove raft logs")
- """
- main.step( "Applying cell variable to environment" )
- step3Result = main.TRUE
- setCellResult = main.ONOSbench.setCell( cellName )
- verifyCellResult = main.ONOSbench.verifyCell()
- step3Result = setCellResult and verifyCellResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step3Result,
- onpass="Cell applied successfully",
- onfail="Failed to apply cell")
-
- main.step( "Uninstalling ONOS package" )
- step4Result = main.TRUE
- ONOSip1 = main.params[ 'CTRL' ][ 'ip1' ]
- onosUninstallResult = main.ONOSbench.onosUninstall( nodeIp = ONOSip1)
- step4Result = onosUninstallResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step4Result,
- onpass="Successfully uninstalled ONOS",
- onfail="Failed to uninstall ONOS")
-
- time.sleep( 5 )
- main.step( "Installing ONOS package" )
- step5Result = main.TRUE
- onosInstallResult = main.ONOSbench.onosInstall( node = ONOSip1 )
- step5Result = onosInstallResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step5Result,
- onpass="Successfully installed ONOS",
- onfail="Failed to install ONOS")
-
- onos1Isup = main.ONOSbench.isup()
- if onos1Isup == main.TRUE:
- main.log.report( "ONOS instance is up and ready" )
- else:
- main.log.report( "ONOS instance may not be up" )
-
- main.step( "Starting ONOS service" )
- step6Result = main.TRUE
- startResult = main.ONOSbench.onosStart( ONOS1Ip )
- step6Result = startResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step6Result,
- onpass="Successfully started ONOS",
- onfail="Failed to start ONOS")
-
- main.step( "Starting ONOS cli" )
- step7Result = main.TRUE
- cliResult = main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
- step7Result = cliResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step7Result,
- onpass="Successfully started ONOS cli",
- onfail="Failed to start ONOS cli")
-
- def CASE21( self, main ):
- """
- On ONOS bench, run this command:
- sudo -E python ~/onos/tools/test/topos/opticalTest.py -OC1
- which spawns packet optical topology and copies the links
- json file to the onos instance.
- Note that in case of Packet Optical, the links are not learnt
- from the topology, instead the links are learnt
- from the json config file
- """
- import time
- main.log.report(
- "This testcase starts the packet layer topology and REST" )
- main.log.report( "_____________________________________________" )
- main.case( "Starting LINC-OE and other components" )
-
- main.step( "Activate optical app" )
- step1Result = main.TRUE
- activateOpticalResult = main.ONOS2.activateApp( "org.onosproject.optical" )
- step1Result = activateOpticalResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully activated optical app",
- onfail="Failed to activate optical app")
-
- appCheck = main.ONOS2.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOS2.apps() )
- main.log.warn( main.ONOS2.appIDs() )
-
- main.step( "Starting mininet and LINC-OE" )
- step2Result = main.TRUE
- time.sleep( 10 )
- opticalMnScript = main.LincOE2.runOpticalMnScript(ctrllerIP = main.params[ 'CTRL' ][ 'ip1' ])
- step2Result = opticalMnScript
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Started the topology successfully ",
- onfail="Failed to start the topology")
-
- def CASE22( self, main ):
- """
- Curretly we use, 10 optical switches(ROADM's) and
- 6 packet layer mininet switches each with one host.
- Therefore, the roadmCount variable = 10,
- packetLayerSWCount variable = 6, hostCount=6 and
- links=46.
- All this is hardcoded in the testcase. If the topology changes,
- these hardcoded values need to be changed
- """
- import time
- main.log.report(
- "This testcase compares the optical+packet topology against what" +
- " is expected" )
- main.case( "Topology comparision" )
-
- main.step( "Starts new ONOS cli" )
- step1Result = main.TRUE
- cliResult = main.ONOS3.startOnosCli( ONOSIp=main.params[ 'CTRL' ]\
- [ 'ip1' ] )
- step1Result = cliResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully starts a new cli",
- onfail="Failed to start new cli" )
-
- main.step( "Compare topology" )
- step2Result = main.TRUE
- devicesResult = main.ONOS3.devices( jsonFormat=False )
- print "devices_result :\n", devicesResult
- devicesLinewise = devicesResult.split( "\n" )
- roadmCount = 0
- packetLayerSWCount = 0
- for line in devicesLinewise:
- components = line.split( "," )
- availability = components[ 1 ].split( "=" )[ 1 ]
- type = components[ 3 ].split( "=" )[ 1 ]
- if availability == 'true' and type == 'ROADM':
- roadmCount += 1
- elif availability == 'true' and type == 'SWITCH':
- packetLayerSWCount += 1
- if roadmCount == 10:
- print "Number of Optical Switches = %d and is" % roadmCount +\
- " correctly detected"
- main.log.info(
- "Number of Optical Switches = " +
- str( roadmCount ) +
- " and is correctly detected" )
- opticalSWResult = main.TRUE
- else:
- print "Number of Optical Switches = %d and is wrong" % roadmCount
- main.log.info(
- "Number of Optical Switches = " +
- str( roadmCount ) +
- " and is wrong" )
- opticalSWResult = main.FALSE
- if packetLayerSWCount == 6:
- print "Number of Packet layer or mininet Switches = %d "\
- % packetLayerSWCount + "and is correctly detected"
- main.log.info(
- "Number of Packet layer or mininet Switches = " +
- str( packetLayerSWCount ) +
- " and is correctly detected" )
- packetSWResult = main.TRUE
- else:
- print "Number of Packet layer or mininet Switches = %d and"\
- % packetLayerSWCount + " is wrong"
- main.log.info(
- "Number of Packet layer or mininet Switches = " +
- str( packetLayerSWCount ) +
- " and is wrong" )
- packetSWResult = main.FALSE
- # sleeps for sometime so the state of the switches will be active
- time.sleep( 30 )
- print "_________________________________"
- linksResult = main.ONOS3.links( jsonFormat=False )
- print "links_result = ", linksResult
- print "_________________________________"
- linkActiveCount = linksResult.count("state=ACTIVE")
- main.log.info( "linkActiveCount = " + str( linkActiveCount ))
- if linkActiveCount == 46:
- linkActiveResult = main.TRUE
- main.log.info(
- "Number of links in ACTIVE state are correct")
- else:
- linkActiveResult = main.FALSE
- main.log.info(
- "Number of links in ACTIVE state are wrong")
- step2Result = opticalSWResult and packetSWResult and \
- linkActiveResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Successfully loaded packet optical topology",
- onfail="Failed to load packet optical topology" )
-
- def CASE23( self, main ):
- import time
- """
- Add bidirectional point intents between 2 packet layer( mininet )
- devices and
- ping mininet hosts
- """
- main.log.report(
- "This testcase adds bidirectional point intents between 2 " +
- "packet layer( mininet ) devices and ping mininet hosts" )
- main.case( "Install point intents between 2 packet layer device and " +
- "ping the hosts" )
-
- main.step( "Adding point intents" )
- checkFlowResult = main.TRUE
- step1Result = main.TRUE
- main.pIntentsId = []
- pIntent1 = main.ONOS3.addPointIntent(
- "of:0000ffffffff0001/1",
- "of:0000ffffffff0005/1" )
- pIntent2 = main.ONOS3.addPointIntent(
- "of:0000ffffffff0005/1",
- "of:0000ffffffff0001/1" )
- main.pIntentsId.append( pIntent1 )
- main.pIntentsId.append( pIntent2 )
- time.sleep( 10 )
- main.log.info( "Checking intents state")
- checkStateResult = main.ONOS3.checkIntentState(
- intentsId = main.pIntentsId )
- time.sleep( 10 )
- main.log.info( "Checking flows state")
- checkFlowResult = main.ONOS3.checkFlowsState()
- # Sleep for 30 seconds to provide time for the intent state to change
- time.sleep( 10 )
- main.log.info( "Checking intents state one more time")
- checkStateResult = main.ONOS3.checkIntentState(
- intentsId = main.pIntentsId )
- step1Result = checkStateResult and checkFlowResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully added point intents",
- onfail="Failed to add point intents")
-
- main.step( "Ping h1 and h5" )
- step2Result = main.TRUE
- main.log.info( "\n\nh1 is Pinging h5" )
- pingResult = main.LincOE2.pingHostOptical( src="h1", target="h5" )
- step2Result = pingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Successfully pinged h1 and h5",
- onfail="Failed to ping between h1 and h5")
-
- def CASE24( self, main ):
- import time
- import json
- """
- LINC uses its own switch IDs. You can use the following
- command on the LINC console to find the mapping between
- DPIDs and LINC IDs.
- rp(application:get_all_key(linc)).
-
- Test Rerouting of Packet Optical by bringing a port down
- ( port 20 ) of a switch( switchID=1, or LincOE switchID =9 ),
- so that link
- ( between switch1 port20 - switch5 port50 ) is inactive
- and do a ping test. If rerouting is successful,
- ping should pass. also check the flows
- """
- main.log.report(
- "This testcase tests rerouting and pings mininet hosts" )
- main.case( "Test rerouting and pings mininet hosts" )
-
- main.step( "Attach to the Linc-OE session" )
- step1Result = main.TRUE
- attachConsole = main.LincOE1.attachLincOESession()
- step1Result = attachConsole
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully attached Linc-OE session",
- onfail="Failed to attached Linc-OE session")
-
- main.step( "Bring a port down and verify the link state" )
- step2Result = main.TRUE
- main.LincOE1.portDown( swId="9", ptId="20" )
- linksNonjson = main.ONOS3.links( jsonFormat=False )
- main.log.info( "links = " + linksNonjson )
- linkInactiveCount = linksNonjson.count( "state=INACTIVE" )
- main.log.info( "linkInactiveCount = " + str( linkInactiveCount ))
- if linkInactiveCount == 2:
- main.log.info(
- "Number of links in INACTIVE state are correct")
- else:
- main.log.info(
- "Number of links in INACTIVE state are wrong")
- links = main.ONOS3.links()
- main.log.info( "links = " + links )
- linksResult = json.loads( links )
- linksStateResult = main.FALSE
- for item in linksResult:
- if item[ 'src' ][ 'device' ] == "of:0000ffffffffff01" and item[
- 'src' ][ 'port' ] == "20":
- if item[ 'dst' ][ 'device' ] == "of:0000ffffffffff05" and item[
- 'dst' ][ 'port' ] == "50":
- linksState = item[ 'state' ]
- if linksState == "INACTIVE":
- main.log.info(
- "Links state is inactive as expected due to one" +
- " of the ports being down" )
- main.log.report(
- "Links state is inactive as expected due to one" +
- " of the ports being down" )
- linksStateResult = main.TRUE
- break
- else:
- main.log.info(
- "Links state is not inactive as expected" )
- main.log.report(
- "Links state is not inactive as expected" )
- linksStateResult = main.FALSE
- time.sleep( 10 )
- checkFlowsState = main.ONOS3.checkFlowsState()
- step2Result = linksStateResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Successfuly brought down a link",
- onfail="Failed to bring down a link")
-
- main.step( "Verify Rerouting by a ping test" )
- step3Result = main.TRUE
- main.log.info( "\n\nh1 is Pinging h5" )
- pingResult = main.LincOE2.pingHostOptical( src="h1", target="h5" )
- step3Result = pingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step3Result,
- onpass="Successfully pinged h1 and h5",
- onfail="Failed to ping between h1 and h5")
-
- main.step( "Bring the downed port up and verify the link state" )
- step4Result = main.TRUE
- main.LincOE1.portUp( swId="9", ptId="20" )
- linksNonjson = main.ONOS3.links( jsonFormat=False )
- main.log.info( "links = " + linksNonjson )
- linkInactiveCount = linksNonjson.count( "state=INACTIVE" )
- main.log.info( "linkInactiveCount = " + str( linkInactiveCount ))
- if linkInactiveCount == 0:
- main.log.info(
- "Number of links in INACTIVE state are correct")
- else:
- main.log.info(
- "Number of links in INACTIVE state are wrong")
- step4Result = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step4Result,
- onpass="Successfully brought the port up",
- onfail="Failed to bring the port up")
- """
- main.step( "Removing host intents" )
- step5Result = main.TRUE
- removeResult = main.TRUE
- # Check remaining intents
- intentsJson = json.loads( main.ONOS3.intents() )
- main.ONOS3.removeIntent( intentId=intent1, purge=True )
- main.ONOS3.removeIntent( intentId=intent2, purge=True )
- for intents in intentsJson:
- main.ONOS3.removeIntent( intentId=intents.get( 'id' ),
- app='org.onosproject.optical',
- purge=True )
- print json.loads( main.ONOS3.intents() )
- if len( json.loads( main.ONOS3.intents() ) ):
- removeResult = main.FALSE
- step5Result = removeResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step5Result,
- onpass="Successfully removed host intents",
- onfail="Failed to remove host intents" )
- """
- def CASE10( self ):
- main.log.report(
- "This testcase uninstalls the reactive forwarding app" )
- main.log.report( "__________________________________" )
- main.case( "Uninstalling reactive forwarding app" )
- main.step( "Uninstalling reactive forwarding app" )
- step1Result = main.TRUE
- # Unistall onos-app-fwd app to disable reactive forwarding
- main.log.info( "deactivate reactive forwarding app" )
- appUninstallResult = main.ONOS2.deactivateApp( "org.onosproject.fwd" )
- appCheck = main.ONOS2.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOS2.apps() )
- main.log.warn( main.ONOS2.appIDs() )
- step1Result = appUninstallResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully deactivate reactive forwarding app",
- onfail="Failed to deactivate reactive forwarding app")
- # After reactive forwarding is disabled, the reactive flows on
- # switches timeout in 10-15s
- # So sleep for 15s
- time.sleep( 15 )
- flows = main.ONOS2.flows()
- main.log.info( flows )
-
- def CASE25( self ):
- """
- Add host intents between 2 packet layer host
- """
- import time
- import json
- main.log.report( "Adding host intents between 2 optical layer host" )
- main.case( "Test add host intents between optical layer host" )
-
- main.step( "Discover host using arping" )
- step1Result = main.TRUE
- main.hostMACs = []
- main.hostId = []
- #Listing host MAC addresses
- for i in range( 1 , 7 ):
- main.hostMACs.append( "00:00:00:00:00:" +
- str( hex( i )[ 2: ] ).zfill( 2 ).upper() )
- for macs in main.hostMACs:
- main.hostId.append( macs + "/-1" )
- host1 = main.hostId[ 0 ]
- host2 = main.hostId[ 1 ]
- # Use arping to discover the hosts
- main.LincOE2.arping( host = "h1" )
- main.LincOE2.arping( host = "h2" )
- time.sleep( 5 )
- hostsDict = main.ONOS3.hosts()
- if not len( hostsDict ):
- step1Result = main.FALSE
- # Adding host intent
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Hosts discovered",
- onfail="Failed to discover hosts")
-
- main.step( "Adding host intents to h1 and h2" )
- step2Result = main.TRUE
- intentsId = []
- intent1 = main.ONOS3.addHostIntent( hostIdOne = host1,
- hostIdTwo = host2 )
- intentsId.append( intent1 )
- time.sleep( 5 )
- intent2 = main.ONOS3.addHostIntent( hostIdOne = host2,
- hostIdTwo = host1 )
- intentsId.append( intent2 )
- # Checking intents state before pinging
- main.log.info( "Checking intents state" )
- time.sleep( 15 )
- intentResult = main.ONOS3.checkIntentState( intentsId = intentsId )
- #check intent state again if intents are not in installed state
- if not intentResult:
- intentResult = main.ONOS3.checkIntentState( intentsId = intentsId )
- step2Result = intentResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step2Result,
- onpass="All intents are in INSTALLED state ",
- onfail="Some of the intents are not in " +
- "INSTALLED state " )
-
- # pinging h1 to h2 and then ping h2 to h1
- main.step( "Pinging h1 and h2" )
- step3Result = main.TRUE
- pingResult = main.TRUE
- pingResult = main.LincOE2.pingHostOptical( src="h1", target="h2" )
- pingResult = pingResult and main.LincOE2.pingHostOptical( src="h2",
- target="h1" )
- step3Result = pingResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step3Result,
- onpass="Pinged successfully between h1 and h2",
- onfail="Pinged failed between h1 and h2" )
- # Removed all added host intents
- main.step( "Removing host intents" )
- step4Result = main.TRUE
- removeResult = main.TRUE
- # Check remaining intents
- intentsJson = json.loads( main.ONOS3.intents() )
- main.ONOS3.removeIntent( intentId=intent1, purge=True )
- main.ONOS3.removeIntent( intentId=intent2, purge=True )
- for intents in intentsJson:
- main.ONOS3.removeIntent( intentId=intents.get( 'id' ),
- app='org.onosproject.optical',
- purge=True )
- print json.loads( main.ONOS3.intents() )
- if len( json.loads( main.ONOS3.intents() ) ):
- removeResult = main.FALSE
- step4Result = removeResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step4Result,
- onpass="Successfully removed host intents",
- onfail="Failed to remove host intents" )
-
- def CASE4( self, main ):
- import re
- import time
- main.log.report( "This testcase is testing the assignment of" +
- " all the switches to all the controllers and" +
- " discovering the hosts in reactive mode" )
- main.log.report( "__________________________________" )
-
- main.case( "Pingall Test" )
- main.step( "Assigning switches to controllers" )
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- for i in range( 1, 29 ):
- if i == 1:
- main.Mininet1.assignSwController(
- sw=str( i ),
- ip1=ONOS1Ip,
- port1=ONOS1Port )
- elif i >= 2 and i < 5:
- main.Mininet1.assignSwController(
- sw=str( i ),
- ip1=ONOS1Ip,
- port1=ONOS1Port )
- elif i >= 5 and i < 8:
- main.Mininet1.assignSwController(
- sw=str( i ),
- ip1=ONOS1Ip,
- port1=ONOS1Port )
- elif i >= 8 and i < 18:
- main.Mininet1.assignSwController(
- sw=str( i ),
- ip1=ONOS1Ip,
- port1=ONOS1Port )
- elif i >= 18 and i < 28:
- main.Mininet1.assignSwController(
- sw=str( i ),
- ip1=ONOS1Ip,
- port1=ONOS1Port )
- else:
- main.Mininet1.assignSwController(
- sw=str( i ),
- ip1=ONOS1Ip,
- port1=ONOS1Port )
- SwitchMastership = main.TRUE
- for i in range( 1, 29 ):
- if i == 1:
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- SwitchMastership = SwitchMastership and main.TRUE
- else:
- SwitchMastership = main.FALSE
- elif i >= 2 and i < 5:
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- SwitchMastership = SwitchMastership and main.TRUE
- else:
- SwitchMastership = main.FALSE
- elif i >= 5 and i < 8:
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- SwitchMastership = SwitchMastership and main.TRUE
- else:
- SwitchMastership = main.FALSE
- elif i >= 8 and i < 18:
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- SwitchMastership = SwitchMastership and main.TRUE
- else:
- SwitchMastership = main.FALSE
- elif i >= 18 and i < 28:
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- SwitchMastership = SwitchMastership and main.TRUE
- else:
- SwitchMastership = main.FALSE
- else:
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is" + str( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- SwitchMastership = SwitchMastership and main.TRUE
- else:
- SwitchMastership = main.FALSE
-
- if SwitchMastership == main.TRUE:
- main.log.report( "Controller assignmnet successful" )
- else:
- main.log.report( "Controller assignmnet failed" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=SwitchMastership,
- onpass="MasterControllers assigned correctly" )
- """
- for i in range ( 1,29 ):
- main.Mininet1.assignSwController( sw=str( i ),count=5,
- ip1=ONOS1Ip,port1=ONOS1Port,
- ip2=ONOS2Ip,port2=ONOS2Port,
- ip3=ONOS3Ip,port3=ONOS3Port,
- ip4=ONOS4Ip,port4=ONOS4Port,
- ip5=ONOS5Ip,port5=ONOS5Port )
- """
- # REACTIVE FWD test
- main.log.info( "Activate fwd app" )
- appInstallResult = main.ONOS2.activateApp( "org.onosproject.fwd" )
- appCheck = main.ONOS2.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOS2.apps() )
- main.log.warn( main.ONOS2.appIDs() )
- time.sleep( 10 )
-
- main.step( "Get list of hosts from Mininet" )
- hostList = main.Mininet1.getHosts().keys()
- main.log.info( hostList )
-
- main.step( "Get host list in ONOS format" )
- hostOnosList = main.ONOS2.getHostsId( hostList )
- main.log.info( hostOnosList )
- # time.sleep( 5 )
-
- main.step( "Pingall" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall()
- time2 = time.time()
- print "Time for pingall: %2f seconds" % ( time2 - time1 )
-
- # Start onos cli again because u might have dropped out of
- # onos prompt to the shell prompt
- # if there was no activity
- main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
-
- case4Result = SwitchMastership and pingResult
- if pingResult == main.TRUE:
- main.log.report( "Pingall Test in reactive mode to" +
- " discover the hosts successful" )
- else:
- main.log.report( "Pingall Test in reactive mode to" +
- " discover the hosts failed" )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case4Result,
- onpass="Controller assignment and Pingall Test successful",
- onfail="Controller assignment and Pingall Test NOT successful" )
-
- def CASE11( self ):
- # NOTE: This testcase require reactive forwarding mode enabled
- # NOTE: in the beginning and then uninstall it before adding
- # NOTE: point intents. Again the app is installed so that
- # NOTE: testcase 10 can be ran successively
- import time
- main.log.report(
- "This testcase moves a host from one switch to another to add" +
- "point intents between them and then perform ping" )
- main.log.report( "__________________________________" )
- main.log.info( "Moving host from one switch to another" )
- main.case( "Moving host from a device and attach it to another device" )
- main.step( "Moving host h9 from device s9 and attach it to s8" )
- main.Mininet1.moveHost(host = 'h9', oldSw = 's9', newSw = 's8')
-
- main.log.info( "Activate fwd app" )
- appInstallResult = main.ONOS2.activateApp( "org.onosproject.fwd" )
- appCheck = main.ONOS2.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOS2.apps() )
- main.log.warn( main.ONOS2.appIDs() )
-
- time.sleep(25) #Time delay to have all the flows ready
- main.step( "Pingall" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( timeout=120,
- shortCircuit=True,
- acceptableFailed=20 )
- time2 = time.time()
- print "Time for pingall: %2f seconds" % ( time2 - time1 )
-
- hosts = main.ONOS2.hosts( jsonFormat = False )
- main.log.info( hosts )
-
- main.log.info( "deactivate reactive forwarding app" )
- appUninstallResult = main.ONOS2.deactivateApp( "org.onosproject.fwd" )
- appCheck = main.ONOS2.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOS2.apps() )
- main.log.warn( main.ONOS2.appIDs() )
-
- main.step( "Add point intents between hosts on the same device")
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003008/1",
- "of:0000000000003008/3",
- ethType='IPV4',
- ethSrc='00:00:00:00:00:08',
- ethDst='00:00:00:00:00:09' )
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003008/3",
- "of:0000000000003008/1",
- ethType='IPV4',
- ethSrc='00:00:00:00:00:09',
- ethDst='00:00:00:00:00:08' )
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- main.case( "Ping hosts on the same devices" )
- ping = main.Mininet1.pingHost( src = 'h8', target = 'h9' )
-
- '''
- main.case( "Installing reactive forwarding app" )
- # Install onos-app-fwd app to enable reactive forwarding
- appUninstallResult = main.ONOS2.featureInstall( "onos-app-fwd" )
- main.log.info( "onos-app-fwd installed" )
- '''
-
- if ping == main.FALSE:
- main.log.report(
- "Point intents for hosts on same devices haven't" +
- " been installed correctly. Cleaning up" )
- if ping == main.TRUE:
- main.log.report(
- "Point intents for hosts on same devices" +
- "installed correctly. Cleaning up" )
-
- case11Result = ping
- utilities.assert_equals(
- expect = main.TRUE,
- actual = case11Result,
- onpass = "Point intents for hosts on same devices" +
- "Ping Test successful",
- onfail = "Point intents for hosts on same devices" +
- "Ping Test NOT successful" )
-
- def CASE12( self ):
- """
- Verify the default flows on each switch in proactive mode
- """
- main.log.report( "This testcase is verifying num of default" +
- " flows on each switch" )
- main.log.report( "__________________________________" )
- main.case( "Verify num of default flows on each switch" )
- main.step( "Obtaining the device id's and flowrule count on them" )
-
- case12Result = main.TRUE
- idList = main.ONOS2.getAllDevicesId()
- for id in idList:
- count = main.ONOS2.FlowAddedCount( id )
- main.log.info("count = " +count)
- if int(count) != 3:
- case12Result = main.FALSE
- break
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case12Result,
- onpass = "Expected default num of flows exist",
- onfail = "Expected default num of flows do not exist")
-
- def CASE6( self ):
- import time
- main.log.report( "This testcase is testing the addition of" +
- " host intents and then does pingall" )
- main.log.report( "__________________________________" )
- main.case( "Obtaining host id's" )
- main.step( "Get hosts" )
- hosts = main.ONOS2.hosts()
- main.log.info( hosts )
-
- main.step( "Get all devices id" )
- devicesIdList = main.ONOS2.getAllDevicesId()
- main.log.info( devicesIdList )
-
- # ONOS displays the hosts in hex format unlike mininet which does
- # in decimal format
- # So take care while adding intents
- """
- main.step( "Add host-to-host intents for mininet hosts h8 and h18 or
- ONOS hosts h8 and h12" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:08/-1", "00:00:00:00:00:12/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:09/-1", "00:00:00:00:00:13/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:0A/-1", "00:00:00:00:00:14/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:0B/-1", "00:00:00:00:00:15/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:0C/-1", "00:00:00:00:00:16/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:0D/-1", "00:00:00:00:00:17/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:0E/-1", "00:00:00:00:00:18/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:0F/-1", "00:00:00:00:00:19/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:10/-1", "00:00:00:00:00:1A/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:11/-1", "00:00:00:00:00:1B/-1" )
- print "______________________________________________________"
- """
- intentsId = []
- for i in range( 8, 18 ):
- main.log.info(
- "Adding host intent between h" + str( i ) +
- " and h" + str( i + 10 ) )
- host1 = "00:00:00:00:00:" + \
- str( hex( i )[ 2: ] ).zfill( 2 ).upper()
- host2 = "00:00:00:00:00:" + \
- str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
- # NOTE: get host can return None
- if host1:
- host1Id = main.ONOS2.getHost( host1 )[ 'id' ]
- if host2:
- host2Id = main.ONOS2.getHost( host2 )[ 'id' ]
- if host1Id and host2Id:
- intentsId.append( main.ONOS2.addHostIntent( host1Id, host2Id ) )
-
- checkIntentResult = main.ONOS2.checkIntentState( intentsId )
- time.sleep( 10 )
- hIntents = main.ONOS2.intents( jsonFormat=False )
- main.log.info( "intents:" + hIntents )
- flows = main.ONOS2.flows()
- main.log.info( "flows:" + flows )
-
- count = 1
- i = 8
- PingResult = main.TRUE
- # while i<10:
- while i < 18:
- main.log.info(
- "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- if ping == main.FALSE and count < 5:
- count += 1
- # i = 8
- PingResult = main.FALSE
- main.log.report( "Ping between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- " failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.report( "All ping attempts between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "have failed" )
- i = 19
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "passed!" )
- i += 1
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
- if PingResult == main.FALSE:
- main.log.report(
- "Ping all test after Host intent addition failed.Cleaning up" )
- # main.cleanup()
- # main.exit()
- if PingResult == main.TRUE:
- main.log.report(
- "Ping all test after Host intent addition successful" )
-
- checkIntentResult = main.ONOS2.checkIntentState( intentsId )
-
- case6Result = PingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case6Result,
- onpass="Pingall Test after Host intents addition successful",
- onfail="Pingall Test after Host intents addition failed" )
-
- def CASE5( self, main ):
- """
- Check ONOS topology matches with mininet
- """
- import json
- main.log.report( "This testcase is testing if all ONOS nodes" +
- " are in topology sync with mininet" )
- main.log.report( "__________________________________" )
- main.case( "Comparing Mininet topology with the topology of ONOS" )
- main.step( "Start continuous pings" )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source1' ],
- target=main.params[ 'PING' ][ 'target1' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source2' ],
- target=main.params[ 'PING' ][ 'target2' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source3' ],
- target=main.params[ 'PING' ][ 'target3' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source4' ],
- target=main.params[ 'PING' ][ 'target4' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source5' ],
- target=main.params[ 'PING' ][ 'target5' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source6' ],
- target=main.params[ 'PING' ][ 'target6' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source7' ],
- target=main.params[ 'PING' ][ 'target7' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source8' ],
- target=main.params[ 'PING' ][ 'target8' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source9' ],
- target=main.params[ 'PING' ][ 'target9' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source10' ],
- target=main.params[ 'PING' ][ 'target10' ],
- pingTime=500 )
-
- TopologyCheck = main.TRUE
- main.step( "Compare ONOS Topology to MN Topology" )
- devicesJson = main.ONOS2.devices()
- linksJson = main.ONOS2.links()
- portsJson = main.ONOS2.ports()
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
-
- result1 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devicesJson ), json.loads( portsJson ) )
- result2 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( linksJson ) )
-
- result = result1 and result2
-
- print "***********************"
- if result == main.TRUE:
- main.log.report( "ONOS" + " Topology matches MN Topology" )
- else:
- main.log.report( "ONOS" + " Topology does not match MN Topology" )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=result,
- onpass="ONOS" +
- " Topology matches MN Topology",
- onfail="ONOS" +
- " Topology does not match MN Topology" )
-
- TopologyCheck = TopologyCheck and result
- utilities.assert_equals(
- expect=main.TRUE,
- actual=TopologyCheck,
- onpass="Topology checks passed",
- onfail="Topology checks failed" )
-
- def CASE7( self, main ):
- """
- Link discovery test case. Checks if ONOS can discover a link
- down or up properly.
- """
-
- linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- main.log.report( "This testscase is killing a link to ensure that" +
- " link discovery is consistent" )
- main.log.report( "__________________________________" )
- main.log.report( "Killing a link to ensure that link discovery" +
- " is consistent" )
- main.case( "Killing a link to Ensure that Link Discovery" +
- "is Working Properly" )
- """
- main.step( "Start continuous pings" )
-
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source1' ],
- target=main.params[ 'PING' ][ 'target1' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source2' ],
- target=main.params[ 'PING' ][ 'target2' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source3' ],
- target=main.params[ 'PING' ][ 'target3' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source4' ],
- target=main.params[ 'PING' ][ 'target4' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source5' ],
- target=main.params[ 'PING' ][ 'target5' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source6' ],
- target=main.params[ 'PING' ][ 'target6' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source7' ],
- target=main.params[ 'PING' ][ 'target7' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source8' ],
- target=main.params[ 'PING' ][ 'target8' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source9' ],
- target=main.params[ 'PING' ][ 'target9' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source10' ],
- target=main.params[ 'PING' ][ 'target10' ],
- pingTime=500 )
- """
- main.step( "Determine the current number of switches and links" )
- topologyOutput = main.ONOS2.topology()
- topologyResult = main.ONOS1.getTopology( topologyOutput )
- activeSwitches = topologyResult[ 'devices' ]
- links = topologyResult[ 'links' ]
- print "activeSwitches = ", type( activeSwitches )
- print "links = ", type( links )
- main.log.info(
- "Currently there are %s switches and %s links" %
- ( str( activeSwitches ), str( links ) ) )
-
- main.step( "Kill Link between s3 and s28" )
- main.Mininet1.link( END1="s3", END2="s28", OPTION="down" )
- time.sleep( linkSleep )
- topologyOutput = main.ONOS2.topology()
- LinkDown = main.ONOS1.checkStatus(
- topologyOutput, activeSwitches, str(
- int( links ) - 2 ) )
- if LinkDown == main.TRUE:
- main.log.report( "Link Down discovered properly" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=LinkDown,
- onpass="Link Down discovered properly",
- onfail="Link down was not discovered in " +
- str( linkSleep ) +
- " seconds" )
-
- # Check ping result here..add code for it
-
- main.step( "Bring link between s3 and s28 back up" )
- LinkUp = main.Mininet1.link( END1="s3", END2="s28", OPTION="up" )
- time.sleep( linkSleep )
- topologyOutput = main.ONOS2.topology()
- LinkUp = main.ONOS1.checkStatus(
- topologyOutput,
- activeSwitches,
- str( links ) )
- if LinkUp == main.TRUE:
- main.log.report( "Link up discovered properly" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=LinkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( linkSleep ) +
- " seconds" )
-
- # NOTE Check ping result here..add code for it
-
- main.step( "Compare ONOS Topology to MN Topology" )
-
- devicesJson = main.ONOS2.devices()
- linksJson = main.ONOS2.links()
- portsJson = main.ONOS2.ports()
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
-
- result1 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devicesJson ), json.loads( portsJson ) )
- result2 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( linksJson ) )
-
- result = result1 and result2
- print "***********************"
-
- if result == main.TRUE:
- main.log.report( "ONOS" + " Topology matches MN Topology" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=result,
- onpass="ONOS" +
- " Topology matches MN Topology",
- onfail="ONOS" +
- " Topology does not match MN Topology" )
-
- TopologyCheck = TopologyCheck and result
- utilities.assert_equals(
- expect=main.TRUE,
- actual=TopologyCheck,
- onpass="Topology checks passed",
- onfail="Topology checks failed" )
-
- result = LinkDown and LinkUp and TopologyCheck
- utilities.assert_equals( expect=main.TRUE, actual=result,
- onpass="Link failure is discovered correctly",
- onfail="Link Discovery failed" )
-
- def CASE8( self ):
- """
- Intent removal
- """
- main.log.report( "This testcase removes any previously added intents" +
- " before adding any new set of intents" )
- main.log.report( "__________________________________" )
- main.log.info( "intent removal" )
- main.case( "Removing installed intents" )
- main.step( "Obtain the intent id's" )
- currentIntents = main.ONOS2.intents( jsonFormat=False )
- main.log.info( "intent_result = " + currentIntents )
- intentLinewise = currentIntents.split( "\n" )
-
- intentList = [line for line in intentLinewise \
- if line.startswith( "id=")]
- intentids = [line.split( "," )[ 0 ].split( "=" )[ 1 ] for line in \
- intentList]
- for id in intentids:
- print "id = ", id
-
- main.step(
- "Iterate through the intentids list and remove each intent" )
- for id in intentids:
- main.ONOS2.removeIntent( intentId=id ,purge=True)
-
- remainingIntents = main.ONOS2.intents( jsonFormat=False )
- main.log.info( "intent_result = " + remainingIntents )
- if remainingIntents:
- main.log.info( "There are still remaining intents " )
- intentResult = main.FALSE
- else:
- intentResult = main.TRUE
-
- intentList = [line for line in remainingIntents.split( "\n" ) \
- if line.startswith( "id=")]
- intentState = [line.split( "," )[ 1 ].split( "=" )[ 1 ] for line in \
- intentList]
- for state in intentState:
- print state
-
- case8Result = main.TRUE
- for state in intentState:
- if state != 'WITHDRAWN':
- case8Result = main.FALSE
- break
-
- PingResult = main.TRUE
- """
- if case8Result == main.TRUE:
- i = 8
- while i < 18:
- main.log.info(
- "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- if ping == main.TRUE:
- i = 19
- PingResult = PingResult and main.TRUE
- elif ping == main.FALSE:
- i += 1
- PingResult = PingResult and main.FALSE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
-
- # Note: If the ping result failed, that means the intents have been
- # withdrawn correctly.
- if PingResult == main.TRUE:
- main.log.report( "Installed intents have not been withdrawn correctly" )
- # main.cleanup()
- # main.exit()
- if PingResult == main.FALSE:
- main.log.report( "Installed intents have been withdrawn correctly" )
- """
-
- if case8Result:
- main.log.report( "Intent removal successful" )
- else:
- main.log.report( "Intent removal failed" )
-
- utilities.assert_equals( expect=main.TRUE, actual=case8Result,
- onpass="Intent removal test passed",
- onfail="Intent removal test failed" )
-
- def CASE9( self ):
- """
- Testing Point intents
- """
- main.log.report(
- "This test case adds point intents and then does pingall" )
- main.log.report( "__________________________________" )
- main.log.info( "Adding point intents" )
- main.case(
- "Adding bidirectional point for mn hosts" +
- "( h8-h18, h9-h19, h10-h20, h11-h21, h12-h22, " +
- "h13-h23, h14-h24, h15-h25, h16-h26, h17-h27 )" )
- macsDict = {}
- for i in range( 1,29 ):
- macsDict[ 'h' + str( i ) ]= main.Mininet1.getMacAddress( host='h'+ str( i ) )
- print macsDict
- main.step( "Add point intents for mn hosts h8 and h18 or" +
- "ONOS hosts h8 and h12" )
- # main.step(var1)
- ptpIntentResult = main.ONOS2.addPointIntent(
- ingressDevice="of:0000000000003008/1",
- egressDevice="of:0000000000006018/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h8' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- ingressDevice="of:0000000000006018/1",
- egressDevice="of:0000000000003008/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h18' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var2 = "Add point intents for mn hosts h9&h19 or ONOS hosts h9&h13"
- main.step(var2)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003009/1",
- "of:0000000000006019/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h9' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006019/1",
- "of:0000000000003009/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h19' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var3 = "Add point intents for MN hosts h10&h20 or ONOS hosts hA&h14"
- main.step(var3)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003010/1",
- "of:0000000000006020/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h10' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006020/1",
- "of:0000000000003010/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h20' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var4 = "Add point intents for mininet hosts h11 and h21 or" +\
- " ONOS hosts hB and h15"
- main.case(var4)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003011/1",
- "of:0000000000006021/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h11' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006021/1",
- "of:0000000000003011/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h21' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var5 = "Add point intents for mininet hosts h12 and h22 " +\
- "ONOS hosts hC and h16"
- main.case(var5)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003012/1",
- "of:0000000000006022/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h12' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006022/1",
- "of:0000000000003012/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h22' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var6 = "Add point intents for mininet hosts h13 and h23 or" +\
- " ONOS hosts hD and h17"
- main.case(var6)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003013/1",
- "of:0000000000006023/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h13' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006023/1",
- "of:0000000000003013/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h23' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var7 = "Add point intents for mininet hosts h14 and h24 or" +\
- " ONOS hosts hE and h18"
- main.case(var7)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003014/1",
- "of:0000000000006024/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h14' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006024/1",
- "of:0000000000003014/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h24' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var8 = "Add point intents for mininet hosts h15 and h25 or" +\
- " ONOS hosts hF and h19"
- main.case(var8)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003015/1",
- "of:0000000000006025/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h15' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006025/1",
- "of:0000000000003015/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h25' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var9 = "Add intents for mininet hosts h16 and h26 or" +\
- " ONOS hosts h10 and h1A"
- main.case(var9)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003016/1",
- "of:0000000000006026/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h16' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006026/1",
- "of:0000000000003016/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h26' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var10 = "Add point intents for mininet hosts h17 and h27 or" +\
- " ONOS hosts h11 and h1B"
- main.case(var10)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003017/1",
- "of:0000000000006027/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h17' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- #main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006027/1",
- "of:0000000000003017/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h27' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- #main.log.info( getIntentResult )
-
- print(
- "___________________________________________________________" )
-
- flowHandle = main.ONOS2.flows()
- #main.log.info( "flows :" + flowHandle )
-
- count = 1
- i = 8
- PingResult = main.TRUE
- while i < 18:
- main.log.info(
- "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- if ping == main.FALSE and count < 5:
- count += 1
- # i = 8
- PingResult = main.FALSE
- main.log.report( "Ping between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- " failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.report( "All ping attempts between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "have failed" )
- i = 19
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "passed!" )
- i += 1
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
-
- if PingResult == main.FALSE:
- main.log.report(
- "Point intents have not ben installed correctly. Cleaning up" )
- # main.cleanup()
- # main.exit()
- if PingResult == main.TRUE:
- main.log.report( "Point Intents have been installed correctly" )
-
- case9Result = PingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case9Result,
- onpass="Point intents addition and Pingall Test successful",
- onfail="Point intents addition and Pingall Test NOT successful" )
diff --git a/TestON/tests/ProdFunc/ProdFunc.topo b/TestON/tests/ProdFunc/ProdFunc.topo
deleted file mode 100755
index 292a8a4..0000000
--- a/TestON/tests/ProdFunc/ProdFunc.topo
+++ /dev/null
@@ -1,93 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOS1>
- <host>10.128.10.11</host>
- <user>sdn</user>
- <password>sdn</password>
- <type>OnosDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
-
- <Mininet1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> --switch ovs,protocols=OpenFlow10 </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet1>
-
- <Mininet2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> --switch ovs,protocols=OpenFlow10 </arg3>
- <arg4> --mac </arg4>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet2>
-
- <LincOE1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>LincOEDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </LincOE1>
-
- <LincOE2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </LincOE2>
-
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/ProdFunc/__init__.py b/TestON/tests/ProdFunc/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/ProdFunc/__init__.py
+++ /dev/null
diff --git a/TestON/tests/ProdFunc13/ProdFunc13.params b/TestON/tests/ProdFunc13/ProdFunc13.params
deleted file mode 100755
index b926dad..0000000
--- a/TestON/tests/ProdFunc13/ProdFunc13.params
+++ /dev/null
@@ -1,43 +0,0 @@
-<PARAMS>
- #1,4,10,5,6,7,8,9,8,11,8,20,21,22,10,23,24
- <testcases>1,4,10,5,6,7,8,9,8,11,8,2,20,21,22,10,23,24</testcases>
- #Environment variables
- <ENV>
- <cellName>driver_test</cellName>
- </ENV>
- <GIT>
- <pull>False</pull>
- </GIT>
- <CTRL>
- <ip1>10.128.20.11</ip1>
- <port1>6633</port1>
- </CTRL>
-
- <PING>
- <source1>h8</source1>
- <source2>h9</source2>
- <source3>h10</source3>
- <source4>h11</source4>
- <source5>h12</source5>
- <source6>h13</source6>
- <source7>h14</source7>
- <source8>h15</source8>
- <source9>h16</source9>
- <source10>h17</source10>
- <target1>10.0.0.18</target1>
- <target2>10.0.0.19</target2>
- <target3>10.0.0.20</target3>
- <target4>10.0.0.21</target4>
- <target5>10.0.0.22</target5>
- <target6>10.0.0.23</target6>
- <target7>10.0.0.24</target7>
- <target8>10.0.0.25</target8>
- <target9>10.0.0.26</target9>
- <target10>10.0.0.27</target10>
- </PING>
-
- <timers>
- <LinkDiscovery>5</LinkDiscovery>
- <SwitchDiscovery>15</SwitchDiscovery>
- </timers>
-</PARAMS>
diff --git a/TestON/tests/ProdFunc13/ProdFunc13.py b/TestON/tests/ProdFunc13/ProdFunc13.py
deleted file mode 100644
index a274c07..0000000
--- a/TestON/tests/ProdFunc13/ProdFunc13.py
+++ /dev/null
@@ -1,1752 +0,0 @@
-
-# Testing the basic functionality of ONOS Next
-# For sanity and driver functionality excercises only.
-
-import time
-# import sys
-# import os
-# import re
-import json
-
-time.sleep( 1 )
-
-
-class ProdFunc13:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
- import time
- """
- Startup sequence:
- cell <name>
- onos-verify-cell
- onos-remove-raft-log
- git pull
- mvn clean install
- onos-package
- onos-install -f
- onos-wait-for-start
- """
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- gitPull = main.params[ 'GIT' ][ 'pull' ]
-
- main.case( "Setting up test environment" )
- main.log.report(
- "This testcase is testing setting up test environment" )
- main.log.report( "__________________________________" )
-
- main.step( "Applying cell variable to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- main.step( "Git checkout and get version" )
- main.ONOSbench.gitCheckout( "master" )
- if gitPull == 'True':
- gitPullResult = main.ONOSbench.gitPull()
- if gitPullResult == 1:
- main.step( "Using mvn clean & install" )
- main.ONOSbench.cleanInstall()
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
- elif gitPullResult == 0:
- main.log.report(
- "Git Pull Failed, look into logs for detailed reason" )
- main.cleanup()
- main.exit()
- main.log.info( "git_pull_result = " + str( gitPullResult ))
- else:
- main.log.info( "Skipping git pull" )
- main.ONOSbench.getVersion( report=True )
- packageResult = main.TRUE
-
- main.step( "Uninstalling ONOS package" )
- onosInstallResult = main.ONOSbench.onosUninstall( ONOS1Ip )
- if onosInstallResult == main.TRUE:
- main.log.report( "Uninstalling ONOS package successful" )
- else:
- main.log.report( "Uninstalling ONOS package failed" )
-
- time.sleep( 20 )
- main.step( "Installing ONOS package" )
- onosInstallResult = main.ONOSbench.onosInstall( ONOS1Ip )
- print onosInstallResult
- if onosInstallResult == main.TRUE:
- main.log.report( "Installing ONOS package successful" )
- else:
- main.log.report( "Installing ONOS package failed" )
-
- time.sleep( 20 )
- onos1Isup = main.ONOSbench.isup()
- if onos1Isup == main.TRUE:
- main.log.report( "ONOS instance is up and ready" )
- else:
- main.log.report( "ONOS instance may not be up" )
-
- startResult = main.TRUE
- #main.step( "Starting ONOS service" )
- #startResult = main.ONOSbench.onosStart( ONOS1Ip )
-
- main.ONOS2.startOnosCli( ONOS1Ip )
- main.step( "Starting Mininet CLI..." )
-
- # Starting the mininet using the old way
- main.step( "Starting Mininet ..." )
- netIsUp = main.Mininet1.startNet()
- if netIsUp:
- main.log.info("Mininet CLI is up")
-
- case1Result = ( packageResult and
- cellResult and verifyResult
- and onosInstallResult and
- onos1Isup and startResult )
- utilities.assert_equals( expect=main.TRUE, actual=case1Result,
- onpass="Test startup successful",
- onfail="Test startup NOT successful" )
-
- def CASE2( self, main ):
- """
- Switch Down
- """
- # NOTE: You should probably run a topology check after this
- import time
-
- main.case( "Switch down discovery" )
- main.log.report( "This testcase is testing a switch down discovery" )
- main.log.report( "__________________________________" )
-
- switchSleep = int( main.params[ 'timers' ][ 'SwitchDiscovery' ] )
-
- description = "Killing a switch to ensure it is discovered correctly"
- main.log.report( description )
- main.case( description )
-
- # TODO: Make this switch parameterizable
- main.step( "Kill s28 " )
- main.log.report( "Deleting s28" )
- # FIXME: use new dynamic topo functions
- main.Mininet1.delSwitch( "s28" )
- main.log.info(
- "Waiting " +
- str( switchSleep ) +
- " seconds for switch down to be discovered" )
- time.sleep( switchSleep )
- # Peek at the deleted switch
- device = main.ONOS2.getDevice( dpid="0028" )
- print "device = ", device
- if device[ u'available' ] == 'False':
- case2Result = main.FALSE
- else:
- case2Result = main.TRUE
- utilities.assert_equals( expect=main.TRUE, actual=case2Result,
- onpass="Switch down discovery successful",
- onfail="Switch down discovery failed" )
-
- def CASE101( self, main ):
- """
- Cleanup sequence:
- onos-service <nodeIp> stop
- onos-uninstall
-
- TODO: Define rest of cleanup
-
- """
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-
- main.case( "Cleaning up test environment" )
-
- main.step( "Testing ONOS kill function" )
- killResult = main.ONOSbench.onosKill( ONOS1Ip )
-
- main.step( "Stopping ONOS service" )
- stopResult = main.ONOSbench.onosStop( ONOS1Ip )
-
- main.step( "Uninstalling ONOS service" )
- uninstallResult = main.ONOSbench.onosUninstall()
-
- case11Result = killResult and stopResult and uninstallResult
- utilities.assert_equals( expect=main.TRUE, actual=case11Result,
- onpass="Cleanup successful",
- onfail="Cleanup failed" )
-
- def CASE3( self, main ):
- """
- Test 'onos' command and its functionality in driver
- """
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-
- main.case( "Testing 'onos' command" )
-
- main.step( "Sending command 'onos -w <onos-ip> system:name'" )
- cmdstr1 = "system:name"
- cmdResult1 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr1 )
- main.log.info( "onos command returned: " + cmdResult1 )
-
- main.step( "Sending command 'onos -w <onos-ip> onos:topology'" )
- cmdstr2 = "onos:topology"
- cmdResult2 = main.ONOSbench.onosCli( ONOS1Ip, cmdstr2 )
- main.log.info( "onos command returned: " + cmdResult2 )
-
- def CASE20( self ):
- """
- Exit from mininet cli
- reinstall ONOS
- """
- import time
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-
- main.log.report( "This testcase exits the mininet cli and reinstalls" +
- "ONOS to switch over to Packet Optical topology" )
- main.log.report( "_____________________________________________" )
- main.case( "Disconnecting mininet and restarting ONOS" )
-
- main.step( "Disconnecting mininet and restarting ONOS" )
- step1Result = main.TRUE
- mininetDisconnect = main.Mininet1.disconnect()
- print "mininetDisconnect = ", mininetDisconnect
- step1Result = mininetDisconnect
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Mininet disconnect successfully",
- onfail="Mininet failed to disconnect")
- """
- main.step( "Removing raft logs before a clean installation of ONOS" )
- step2Result = main.TRUE
- removeRaftLogsResult = main.ONOSbench.onosRemoveRaftLogs()
- step2Result = removeRaftLogsResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Raft logs removed successfully",
- onfail="Failed to remove raft logs")
- """
- main.step( "Applying cell variable to environment" )
- step3Result = main.TRUE
- setCellResult = main.ONOSbench.setCell( cellName )
- verifyCellResult = main.ONOSbench.verifyCell()
- step3Result = setCellResult and verifyCellResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step3Result,
- onpass="Cell applied successfully",
- onfail="Failed to apply cell")
-
- main.step( "Uninstalling ONOS package" )
- step4Result = main.TRUE
- ONOSip1 = main.params[ 'CTRL' ][ 'ip1' ]
- onosUninstallResult = main.ONOSbench.onosUninstall( nodeIp = ONOSip1)
- step4Result = onosUninstallResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step4Result,
- onpass="Successfully uninstalled ONOS",
- onfail="Failed to uninstall ONOS")
-
- time.sleep( 5 )
- main.step( "Installing ONOS package" )
- step5Result = main.TRUE
- onosInstallResult = main.ONOSbench.onosInstall( node = ONOSip1 )
- step5Result = onosInstallResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step5Result,
- onpass="Successfully installed ONOS",
- onfail="Failed to install ONOS")
-
- onos1Isup = main.ONOSbench.isup()
- if onos1Isup == main.TRUE:
- main.log.report( "ONOS instance is up and ready" )
- else:
- main.log.report( "ONOS instance may not be up" )
-
- main.step( "Starting ONOS service" )
- step6Result = main.TRUE
- startResult = main.ONOSbench.onosStart( ONOS1Ip )
- step6Result = startResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step6Result,
- onpass="Successfully started ONOS",
- onfail="Failed to start ONOS")
-
- main.step( "Starting ONOS cli" )
- step7Result = main.TRUE
- cliResult = main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
- step7Result = cliResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step7Result,
- onpass="Successfully started ONOS cli",
- onfail="Failed to start ONOS cli")
-
- def CASE21( self, main ):
- """
- On ONOS bench, run this command:
- sudo -E python ~/onos/tools/test/topos/opticalTest.py -OC1
- which spawns packet optical topology and copies the links
- json file to the onos instance.
- Note that in case of Packet Optical, the links are not learnt
- from the topology, instead the links are learnt
- from the json config file
- """
- import time
- main.log.report(
- "This testcase starts the packet layer topology and REST" )
- main.log.report( "_____________________________________________" )
- main.case( "Starting LINC-OE and other components" )
-
- main.step( "Activate optical app" )
- step1Result = main.TRUE
- activateOpticalResult = main.ONOS2.activateApp( "org.onosproject.optical" )
- step1Result = activateOpticalResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully activated optical app",
- onfail="Failed to activate optical app")
-
- appCheck = main.ONOS2.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOS2.apps() )
- main.log.warn( main.ONOS2.appIDs() )
-
- main.step( "Starting mininet and LINC-OE" )
- step2Result = main.TRUE
- time.sleep( 10 )
- opticalMnScript = main.LincOE2.runOpticalMnScript(ctrllerIP = main.params[ 'CTRL' ][ 'ip1' ])
- step2Result = opticalMnScript
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Started the topology successfully ",
- onfail="Failed to start the topology")
-
- def CASE22( self, main ):
- """
- Curretly we use, 10 optical switches(ROADM's) and
- 6 packet layer mininet switches each with one host.
- Therefore, the roadmCount variable = 10,
- packetLayerSWCount variable = 6, hostCount=6 and
- links=46.
- All this is hardcoded in the testcase. If the topology changes,
- these hardcoded values need to be changed
- """
- import time
- main.log.report(
- "This testcase compares the optical+packet topology against what" +
- " is expected" )
- main.case( "Topology comparision" )
-
- main.step( "Starts new ONOS cli" )
- step1Result = main.TRUE
- cliResult = main.ONOS3.startOnosCli( ONOSIp=main.params[ 'CTRL' ]\
- [ 'ip1' ] )
- step1Result = cliResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully starts a new cli",
- onfail="Failed to start new cli" )
-
- main.step( "Compare topology" )
- step2Result = main.TRUE
- devicesResult = main.ONOS3.devices( jsonFormat=False )
- print "devices_result :\n", devicesResult
- devicesLinewise = devicesResult.split( "\n" )
- roadmCount = 0
- packetLayerSWCount = 0
- for line in devicesLinewise:
- components = line.split( "," )
- availability = components[ 1 ].split( "=" )[ 1 ]
- type = components[ 3 ].split( "=" )[ 1 ]
- if availability == 'true' and type == 'ROADM':
- roadmCount += 1
- elif availability == 'true' and type == 'SWITCH':
- packetLayerSWCount += 1
- if roadmCount == 10:
- print "Number of Optical Switches = %d and is" % roadmCount +\
- " correctly detected"
- main.log.info(
- "Number of Optical Switches = " +
- str( roadmCount ) +
- " and is correctly detected" )
- opticalSWResult = main.TRUE
- else:
- print "Number of Optical Switches = %d and is wrong" % roadmCount
- main.log.info(
- "Number of Optical Switches = " +
- str( roadmCount ) +
- " and is wrong" )
- opticalSWResult = main.FALSE
- if packetLayerSWCount == 6:
- print "Number of Packet layer or mininet Switches = %d "\
- % packetLayerSWCount + "and is correctly detected"
- main.log.info(
- "Number of Packet layer or mininet Switches = " +
- str( packetLayerSWCount ) +
- " and is correctly detected" )
- packetSWResult = main.TRUE
- else:
- print "Number of Packet layer or mininet Switches = %d and"\
- % packetLayerSWCount + " is wrong"
- main.log.info(
- "Number of Packet layer or mininet Switches = " +
- str( packetLayerSWCount ) +
- " and is wrong" )
- packetSWResult = main.FALSE
- # sleeps for sometime so the state of the switches will be active
- time.sleep( 30 )
- print "_________________________________"
- linksResult = main.ONOS3.links( jsonFormat=False )
- print "links_result = ", linksResult
- print "_________________________________"
- linkActiveCount = linksResult.count("state=ACTIVE")
- main.log.info( "linkActiveCount = " + str( linkActiveCount ))
- if linkActiveCount == 46:
- linkActiveResult = main.TRUE
- main.log.info(
- "Number of links in ACTIVE state are correct")
- else:
- linkActiveResult = main.FALSE
- main.log.info(
- "Number of links in ACTIVE state are wrong")
- step2Result = opticalSWResult and packetSWResult and \
- linkActiveResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Successfully loaded packet optical topology",
- onfail="Failed to load packet optical topology" )
-
- def CASE23( self, main ):
- import time
- """
- Add bidirectional point intents between 2 packet layer( mininet )
- devices and
- ping mininet hosts
- """
- main.log.report(
- "This testcase adds bidirectional point intents between 2 " +
- "packet layer( mininet ) devices and ping mininet hosts" )
- main.case( "Install point intents between 2 packet layer device and " +
- "ping the hosts" )
-
- main.step( "Adding point intents" )
- checkFlowResult = main.TRUE
- step1Result = main.TRUE
- main.pIntentsId = []
- pIntent1 = main.ONOS3.addPointIntent(
- "of:0000ffffffff0001/1",
- "of:0000ffffffff0005/1" )
- pIntent2 = main.ONOS3.addPointIntent(
- "of:0000ffffffff0005/1",
- "of:0000ffffffff0001/1" )
- main.pIntentsId.append( pIntent1 )
- main.pIntentsId.append( pIntent2 )
- time.sleep( 10 )
- main.log.info( "Checking intents state")
- checkStateResult = main.ONOS3.checkIntentState(
- intentsId = main.pIntentsId )
- time.sleep( 10 )
- main.log.info( "Checking flows state")
- checkFlowResult = main.ONOS3.checkFlowsState()
- # Sleep for 30 seconds to provide time for the intent state to change
- time.sleep( 10 )
- main.log.info( "Checking intents state one more time")
- checkStateResult = main.ONOS3.checkIntentState(
- intentsId = main.pIntentsId )
- step1Result = checkStateResult and checkFlowResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully added point intents",
- onfail="Failed to add point intents")
-
- main.step( "Ping h1 and h5" )
- step2Result = main.TRUE
- main.log.info( "\n\nh1 is Pinging h5" )
- pingResult = main.LincOE2.pingHostOptical( src="h1", target="h5" )
- step2Result = pingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Successfully pinged h1 and h5",
- onfail="Failed to ping between h1 and h5")
-
- def CASE24( self, main ):
- import time
- import json
- """
- LINC uses its own switch IDs. You can use the following
- command on the LINC console to find the mapping between
- DPIDs and LINC IDs.
- rp(application:get_all_key(linc)).
-
- Test Rerouting of Packet Optical by bringing a port down
- ( port 20 ) of a switch( switchID=1, or LincOE switchID =9 ),
- so that link
- ( between switch1 port20 - switch5 port50 ) is inactive
- and do a ping test. If rerouting is successful,
- ping should pass. also check the flows
- """
- main.log.report(
- "This testcase tests rerouting and pings mininet hosts" )
- main.case( "Test rerouting and pings mininet hosts" )
-
- main.step( "Attach to the Linc-OE session" )
- step1Result = main.TRUE
- attachConsole = main.LincOE1.attachLincOESession()
- step1Result = attachConsole
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully attached Linc-OE session",
- onfail="Failed to attached Linc-OE session")
-
- main.step( "Bring a port down and verify the link state" )
- step2Result = main.TRUE
- main.LincOE1.portDown( swId="9", ptId="20" )
- linksNonjson = main.ONOS3.links( jsonFormat=False )
- main.log.info( "links = " + linksNonjson )
- linkInactiveCount = linksNonjson.count( "state=INACTIVE" )
- main.log.info( "linkInactiveCount = " + str( linkInactiveCount ))
- if linkInactiveCount == 2:
- main.log.info(
- "Number of links in INACTIVE state are correct")
- else:
- main.log.info(
- "Number of links in INACTIVE state are wrong")
- links = main.ONOS3.links()
- main.log.info( "links = " + links )
- linksResult = json.loads( links )
- linksStateResult = main.FALSE
- for item in linksResult:
- if item[ 'src' ][ 'device' ] == "of:0000ffffffffff01" and item[
- 'src' ][ 'port' ] == "20":
- if item[ 'dst' ][ 'device' ] == "of:0000ffffffffff05" and item[
- 'dst' ][ 'port' ] == "50":
- linksState = item[ 'state' ]
- if linksState == "INACTIVE":
- main.log.info(
- "Links state is inactive as expected due to one" +
- " of the ports being down" )
- main.log.report(
- "Links state is inactive as expected due to one" +
- " of the ports being down" )
- linksStateResult = main.TRUE
- break
- else:
- main.log.info(
- "Links state is not inactive as expected" )
- main.log.report(
- "Links state is not inactive as expected" )
- linksStateResult = main.FALSE
- time.sleep( 10 )
- checkFlowsState = main.ONOS3.checkFlowsState()
- step2Result = linksStateResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step2Result,
- onpass="Successfuly brought down a link",
- onfail="Failed to bring down a link")
-
- main.step( "Verify Rerouting by a ping test" )
- step3Result = main.TRUE
- main.log.info( "\n\nh1 is Pinging h5" )
- pingResult = main.LincOE2.pingHostOptical( src="h1", target="h5" )
- step3Result = pingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step3Result,
- onpass="Successfully pinged h1 and h5",
- onfail="Failed to ping between h1 and h5")
-
- main.step( "Bring the downed port up and verify the link state" )
- step4Result = main.TRUE
- main.LincOE1.portUp( swId="9", ptId="20" )
- linksNonjson = main.ONOS3.links( jsonFormat=False )
- main.log.info( "links = " + linksNonjson )
- linkInactiveCount = linksNonjson.count( "state=INACTIVE" )
- main.log.info( "linkInactiveCount = " + str( linkInactiveCount ))
- if linkInactiveCount == 0:
- main.log.info(
- "Number of links in INACTIVE state are correct")
- else:
- main.log.info(
- "Number of links in INACTIVE state are wrong")
- step4Result = main.FALSE
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step4Result,
- onpass="Successfully brought the port up",
- onfail="Failed to bring the port up")
- """
- main.step( "Removing host intents" )
- step5Result = main.TRUE
- removeResult = main.TRUE
- # Check remaining intents
- intentsJson = json.loads( main.ONOS3.intents() )
- main.ONOS3.removeIntent( intentId=intent1, purge=True )
- main.ONOS3.removeIntent( intentId=intent2, purge=True )
- for intents in intentsJson:
- main.ONOS3.removeIntent( intentId=intents.get( 'id' ),
- app='org.onosproject.optical',
- purge=True )
- print json.loads( main.ONOS3.intents() )
- if len( json.loads( main.ONOS3.intents() ) ):
- removeResult = main.FALSE
- step5Result = removeResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step5Result,
- onpass="Successfully removed host intents",
- onfail="Failed to remove host intents" )
- """
- def CASE10( self ):
- main.log.report(
- "This testcase uninstalls the reactive forwarding app" )
- main.log.report( "__________________________________" )
- main.case( "Uninstalling reactive forwarding app" )
- main.step( "Uninstalling reactive forwarding app" )
- step1Result = main.TRUE
- # Unistall onos-app-fwd app to disable reactive forwarding
- main.log.info( "deactivate reactive forwarding app" )
- appUninstallResult = main.ONOS2.deactivateApp( "org.onosproject.fwd" )
- appCheck = main.ONOS2.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOS2.apps() )
- main.log.warn( main.ONOS2.appIDs() )
- step1Result = appUninstallResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Successfully deactivate reactive forwarding app",
- onfail="Failed to deactivate reactive forwarding app")
- # After reactive forwarding is disabled, the reactive flows on
- # switches timeout in 10-15s
- # So sleep for 15s
- time.sleep( 15 )
- flows = main.ONOS2.flows()
- main.log.info( flows )
-
- def CASE25( self ):
- """
- Add host intents between 2 packet layer host
- """
- import time
- import json
- main.log.report( "Adding host intents between 2 optical layer host" )
- main.case( "Test add host intents between optical layer host" )
-
- main.step( "Discover host using arping" )
- step1Result = main.TRUE
- main.hostMACs = []
- main.hostId = []
- #Listing host MAC addresses
- for i in range( 1 , 7 ):
- main.hostMACs.append( "00:00:00:00:00:" +
- str( hex( i )[ 2: ] ).zfill( 2 ).upper() )
- for macs in main.hostMACs:
- main.hostId.append( macs + "/-1" )
- host1 = main.hostId[ 0 ]
- host2 = main.hostId[ 1 ]
- # Use arping to discover the hosts
- main.LincOE2.arping( host = "h1" )
- main.LincOE2.arping( host = "h2" )
- time.sleep( 5 )
- hostsDict = main.ONOS3.hosts()
- if not len( hostsDict ):
- step1Result = main.FALSE
- # Adding host intent
- utilities.assert_equals(
- expect=main.TRUE,
- actual=step1Result,
- onpass="Hosts discovered",
- onfail="Failed to discover hosts")
-
- main.step( "Adding host intents to h1 and h2" )
- step2Result = main.TRUE
- intentsId = []
- intent1 = main.ONOS3.addHostIntent( hostIdOne = host1,
- hostIdTwo = host2 )
- intentsId.append( intent1 )
- time.sleep( 5 )
- intent2 = main.ONOS3.addHostIntent( hostIdOne = host2,
- hostIdTwo = host1 )
- intentsId.append( intent2 )
- # Checking intents state before pinging
- main.log.info( "Checking intents state" )
- time.sleep( 15 )
- intentResult = main.ONOS3.checkIntentState( intentsId = intentsId )
- #check intent state again if intents are not in installed state
- if not intentResult:
- intentResult = main.ONOS3.checkIntentState( intentsId = intentsId )
- step2Result = intentResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step2Result,
- onpass="All intents are in INSTALLED state ",
- onfail="Some of the intents are not in " +
- "INSTALLED state " )
-
- # pinging h1 to h2 and then ping h2 to h1
- main.step( "Pinging h1 and h2" )
- step3Result = main.TRUE
- pingResult = main.TRUE
- pingResult = main.LincOE2.pingHostOptical( src="h1", target="h2" )
- pingResult = pingResult and main.LincOE2.pingHostOptical( src="h2",
- target="h1" )
- step3Result = pingResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step3Result,
- onpass="Pinged successfully between h1 and h2",
- onfail="Pinged failed between h1 and h2" )
- # Removed all added host intents
- main.step( "Removing host intents" )
- step4Result = main.TRUE
- removeResult = main.TRUE
- # Check remaining intents
- intentsJson = json.loads( main.ONOS3.intents() )
- main.ONOS3.removeIntent( intentId=intent1, purge=True )
- main.ONOS3.removeIntent( intentId=intent2, purge=True )
- for intents in intentsJson:
- main.ONOS3.removeIntent( intentId=intents.get( 'id' ),
- app='org.onosproject.optical',
- purge=True )
- print json.loads( main.ONOS3.intents() )
- if len( json.loads( main.ONOS3.intents() ) ):
- removeResult = main.FALSE
- step4Result = removeResult
- utilities.assert_equals( expect=main.TRUE,
- actual=step4Result,
- onpass="Successfully removed host intents",
- onfail="Failed to remove host intents" )
-
- def CASE4( self, main ):
- import re
- import time
- main.log.report( "This testcase is testing the assignment of" +
- " all the switches to all the controllers and" +
- " discovering the hosts in reactive mode" )
- main.log.report( "__________________________________" )
-
- main.case( "Pingall Test" )
- main.step( "Assigning switches to controllers" )
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- ONOS1Port = main.params[ 'CTRL' ][ 'port1' ]
- for i in range( 1, 29 ):
- if i == 1:
- main.Mininet1.assignSwController(
- sw=str( i ),
- ip1=ONOS1Ip,
- port1=ONOS1Port )
- elif i >= 2 and i < 5:
- main.Mininet1.assignSwController(
- sw=str( i ),
- ip1=ONOS1Ip,
- port1=ONOS1Port )
- elif i >= 5 and i < 8:
- main.Mininet1.assignSwController(
- sw=str( i ),
- ip1=ONOS1Ip,
- port1=ONOS1Port )
- elif i >= 8 and i < 18:
- main.Mininet1.assignSwController(
- sw=str( i ),
- ip1=ONOS1Ip,
- port1=ONOS1Port )
- elif i >= 18 and i < 28:
- main.Mininet1.assignSwController(
- sw=str( i ),
- ip1=ONOS1Ip,
- port1=ONOS1Port )
- else:
- main.Mininet1.assignSwController(
- sw=str( i ),
- ip1=ONOS1Ip,
- port1=ONOS1Port )
- SwitchMastership = main.TRUE
- for i in range( 1, 29 ):
- if i == 1:
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- SwitchMastership = SwitchMastership and main.TRUE
- else:
- SwitchMastership = main.FALSE
- elif i >= 2 and i < 5:
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- SwitchMastership = SwitchMastership and main.TRUE
- else:
- SwitchMastership = main.FALSE
- elif i >= 5 and i < 8:
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- SwitchMastership = SwitchMastership and main.TRUE
- else:
- SwitchMastership = main.FALSE
- elif i >= 8 and i < 18:
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- SwitchMastership = SwitchMastership and main.TRUE
- else:
- SwitchMastership = main.FALSE
- elif i >= 18 and i < 28:
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is " + str( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- SwitchMastership = SwitchMastership and main.TRUE
- else:
- SwitchMastership = main.FALSE
- else:
- response = main.Mininet1.getSwController( "s" + str( i ) )
- print( "Response is" + str( response ) )
- if re.search( "tcp:" + ONOS1Ip, response ):
- SwitchMastership = SwitchMastership and main.TRUE
- else:
- SwitchMastership = main.FALSE
-
- if SwitchMastership == main.TRUE:
- main.log.report( "Controller assignmnet successful" )
- else:
- main.log.report( "Controller assignmnet failed" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=SwitchMastership,
- onpass="MasterControllers assigned correctly" )
- """
- for i in range ( 1,29 ):
- main.Mininet1.assignSwController( sw=str( i ),count=5,
- ip1=ONOS1Ip,port1=ONOS1Port,
- ip2=ONOS2Ip,port2=ONOS2Port,
- ip3=ONOS3Ip,port3=ONOS3Port,
- ip4=ONOS4Ip,port4=ONOS4Port,
- ip5=ONOS5Ip,port5=ONOS5Port )
- """
- # REACTIVE FWD test
- main.log.info( "Activate fwd app" )
- appInstallResult = main.ONOS2.activateApp( "org.onosproject.fwd" )
- appCheck = main.ONOS2.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOS2.apps() )
- main.log.warn( main.ONOS2.appIDs() )
- time.sleep( 10 )
-
- main.step( "Get list of hosts from Mininet" )
- hostList = main.Mininet1.getHosts().keys()
- main.log.info( hostList )
-
- main.step( "Get host list in ONOS format" )
- hostOnosList = main.ONOS2.getHostsId( hostList )
- main.log.info( hostOnosList )
- # time.sleep( 5 )
-
- main.step( "Pingall" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall()
- time2 = time.time()
- print "Time for pingall: %2f seconds" % ( time2 - time1 )
-
- # Start onos cli again because u might have dropped out of
- # onos prompt to the shell prompt
- # if there was no activity
- main.ONOS2.startOnosCli( ONOSIp=main.params[ 'CTRL' ][ 'ip1' ] )
-
- case4Result = SwitchMastership and pingResult
- if pingResult == main.TRUE:
- main.log.report( "Pingall Test in reactive mode to" +
- " discover the hosts successful" )
- else:
- main.log.report( "Pingall Test in reactive mode to" +
- " discover the hosts failed" )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case4Result,
- onpass="Controller assignment and Pingall Test successful",
- onfail="Controller assignment and Pingall Test NOT successful" )
-
- def CASE11( self ):
- # NOTE: This testcase require reactive forwarding mode enabled
- # NOTE: in the beginning and then uninstall it before adding
- # NOTE: point intents. Again the app is installed so that
- # NOTE: testcase 10 can be ran successively
- import time
- main.log.report(
- "This testcase moves a host from one switch to another to add" +
- "point intents between them and then perform ping" )
- main.log.report( "__________________________________" )
- main.log.info( "Moving host from one switch to another" )
- main.case( "Moving host from a device and attach it to another device" )
- main.step( "Moving host h9 from device s9 and attach it to s8" )
- main.Mininet1.moveHost(host = 'h9', oldSw = 's9', newSw = 's8')
-
- main.log.info( "Activate fwd app" )
- appInstallResult = main.ONOS2.activateApp( "org.onosproject.fwd" )
- appCheck = main.ONOS2.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOS2.apps() )
- main.log.warn( main.ONOS2.appIDs() )
-
- time.sleep(25) #Time delay to have all the flows ready
- main.step( "Pingall" )
- pingResult = main.FALSE
- time1 = time.time()
- pingResult = main.Mininet1.pingall( timeout=120,
- shortCircuit=True,
- acceptableFailed=20 )
- time2 = time.time()
- print "Time for pingall: %2f seconds" % ( time2 - time1 )
-
- hosts = main.ONOS2.hosts( jsonFormat = False )
- main.log.info( hosts )
-
- main.log.info( "deactivate reactive forwarding app" )
- appUninstallResult = main.ONOS2.deactivateApp( "org.onosproject.fwd" )
- appCheck = main.ONOS2.appToIDCheck()
- if appCheck != main.TRUE:
- main.log.warn( main.ONOS2.apps() )
- main.log.warn( main.ONOS2.appIDs() )
-
- main.step( "Add point intents between hosts on the same device")
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003008/1",
- "of:0000000000003008/3",
- ethType='IPV4',
- ethSrc='00:00:00:00:00:08',
- ethDst='00:00:00:00:00:09' )
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003008/3",
- "of:0000000000003008/1",
- ethType='IPV4',
- ethSrc='00:00:00:00:00:09',
- ethDst='00:00:00:00:00:08' )
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- main.case( "Ping hosts on the same devices" )
- ping = main.Mininet1.pingHost( src = 'h8', target = 'h9' )
-
- '''
- main.case( "Installing reactive forwarding app" )
- # Install onos-app-fwd app to enable reactive forwarding
- appUninstallResult = main.ONOS2.featureInstall( "onos-app-fwd" )
- main.log.info( "onos-app-fwd installed" )
- '''
-
- if ping == main.FALSE:
- main.log.report(
- "Point intents for hosts on same devices haven't" +
- " been installed correctly. Cleaning up" )
- if ping == main.TRUE:
- main.log.report(
- "Point intents for hosts on same devices" +
- "installed correctly. Cleaning up" )
-
- case11Result = ping
- utilities.assert_equals(
- expect = main.TRUE,
- actual = case11Result,
- onpass = "Point intents for hosts on same devices" +
- "Ping Test successful",
- onfail = "Point intents for hosts on same devices" +
- "Ping Test NOT successful" )
-
- def CASE12( self ):
- """
- Verify the default flows on each switch in proactive mode
- """
- main.log.report( "This testcase is verifying num of default" +
- " flows on each switch" )
- main.log.report( "__________________________________" )
- main.case( "Verify num of default flows on each switch" )
- main.step( "Obtaining the device id's and flowrule count on them" )
-
- case12Result = main.TRUE
- idList = main.ONOS2.getAllDevicesId()
- for id in idList:
- count = main.ONOS2.FlowAddedCount( id )
- main.log.info("count = " +count)
- if int(count) != 3:
- case12Result = main.FALSE
- break
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case12Result,
- onpass = "Expected default num of flows exist",
- onfail = "Expected default num of flows do not exist")
-
- def CASE6( self ):
- import time
- main.log.report( "This testcase is testing the addition of" +
- " host intents and then does pingall" )
- main.log.report( "__________________________________" )
- main.case( "Obtaining host id's" )
- main.step( "Get hosts" )
- hosts = main.ONOS2.hosts()
- main.log.info( hosts )
-
- main.step( "Get all devices id" )
- devicesIdList = main.ONOS2.getAllDevicesId()
- main.log.info( devicesIdList )
-
- # ONOS displays the hosts in hex format unlike mininet which does
- # in decimal format
- # So take care while adding intents
- """
- main.step( "Add host-to-host intents for mininet hosts h8 and h18 or
- ONOS hosts h8 and h12" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:08/-1", "00:00:00:00:00:12/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:09/-1", "00:00:00:00:00:13/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:0A/-1", "00:00:00:00:00:14/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:0B/-1", "00:00:00:00:00:15/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:0C/-1", "00:00:00:00:00:16/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:0D/-1", "00:00:00:00:00:17/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:0E/-1", "00:00:00:00:00:18/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:0F/-1", "00:00:00:00:00:19/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:10/-1", "00:00:00:00:00:1A/-1" )
- hthIntentResult = main.ONOS2.addHostIntent(
- "00:00:00:00:00:11/-1", "00:00:00:00:00:1B/-1" )
- print "______________________________________________________"
- """
- intentsId = []
- for i in range( 8, 18 ):
- main.log.info(
- "Adding host intent between h" + str( i ) +
- " and h" + str( i + 10 ) )
- host1 = "00:00:00:00:00:" + \
- str( hex( i )[ 2: ] ).zfill( 2 ).upper()
- host2 = "00:00:00:00:00:" + \
- str( hex( i + 10 )[ 2: ] ).zfill( 2 ).upper()
- # NOTE: get host can return None
- if host1:
- host1Id = main.ONOS2.getHost( host1 )[ 'id' ]
- if host2:
- host2Id = main.ONOS2.getHost( host2 )[ 'id' ]
- if host1Id and host2Id:
- intentsId.append( main.ONOS2.addHostIntent( host1Id, host2Id ) )
-
- checkIntentResult = main.ONOS2.checkIntentState( intentsId )
- time.sleep( 10 )
- hIntents = main.ONOS2.intents( jsonFormat=False )
- main.log.info( "intents:" + hIntents )
- flows = main.ONOS2.flows()
- main.log.info( "flows:" + flows )
-
- count = 1
- i = 8
- PingResult = main.TRUE
- # while i<10:
- while i < 18:
- main.log.info(
- "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- if ping == main.FALSE and count < 5:
- count += 1
- # i = 8
- PingResult = main.FALSE
- main.log.report( "Ping between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- " failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.report( "All ping attempts between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "have failed" )
- i = 19
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "passed!" )
- i += 1
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
- if PingResult == main.FALSE:
- main.log.report(
- "Ping all test after Host intent addition failed.Cleaning up" )
- # main.cleanup()
- # main.exit()
- if PingResult == main.TRUE:
- main.log.report(
- "Ping all test after Host intent addition successful" )
-
- checkIntentResult = main.ONOS2.checkIntentState( intentsId )
-
- case6Result = PingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case6Result,
- onpass="Pingall Test after Host intents addition successful",
- onfail="Pingall Test after Host intents addition failed" )
-
- def CASE5( self, main ):
- """
- Check ONOS topology matches with mininet
- """
- import json
- main.log.report( "This testcase is testing if all ONOS nodes" +
- " are in topology sync with mininet" )
- main.log.report( "__________________________________" )
- main.case( "Comparing Mininet topology with the topology of ONOS" )
- main.step( "Start continuous pings" )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source1' ],
- target=main.params[ 'PING' ][ 'target1' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source2' ],
- target=main.params[ 'PING' ][ 'target2' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source3' ],
- target=main.params[ 'PING' ][ 'target3' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source4' ],
- target=main.params[ 'PING' ][ 'target4' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source5' ],
- target=main.params[ 'PING' ][ 'target5' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source6' ],
- target=main.params[ 'PING' ][ 'target6' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source7' ],
- target=main.params[ 'PING' ][ 'target7' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source8' ],
- target=main.params[ 'PING' ][ 'target8' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source9' ],
- target=main.params[ 'PING' ][ 'target9' ],
- pingTime=500 )
- main.Mininet2.pingLong(
- src=main.params[ 'PING' ][ 'source10' ],
- target=main.params[ 'PING' ][ 'target10' ],
- pingTime=500 )
-
- TopologyCheck = main.TRUE
- main.step( "Compare ONOS Topology to MN Topology" )
- devicesJson = main.ONOS2.devices()
- linksJson = main.ONOS2.links()
- portsJson = main.ONOS2.ports()
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
-
- result1 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devicesJson ), json.loads( portsJson ) )
- result2 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( linksJson ) )
-
- result = result1 and result2
-
- print "***********************"
- if result == main.TRUE:
- main.log.report( "ONOS" + " Topology matches MN Topology" )
- else:
- main.log.report( "ONOS" + " Topology does not match MN Topology" )
-
- utilities.assert_equals(
- expect=main.TRUE,
- actual=result,
- onpass="ONOS" +
- " Topology matches MN Topology",
- onfail="ONOS" +
- " Topology does not match MN Topology" )
-
- TopologyCheck = TopologyCheck and result
- utilities.assert_equals(
- expect=main.TRUE,
- actual=TopologyCheck,
- onpass="Topology checks passed",
- onfail="Topology checks failed" )
-
- def CASE7( self, main ):
- """
- Link discovery test case. Checks if ONOS can discover a link
- down or up properly.
- """
- linkSleep = int( main.params[ 'timers' ][ 'LinkDiscovery' ] )
-
- main.log.report( "This testscase is killing a link to ensure that" +
- " link discovery is consistent" )
- main.log.report( "__________________________________" )
- main.log.report( "Killing a link to ensure that link discovery" +
- " is consistent" )
- main.case( "Killing a link to Ensure that Link Discovery" +
- "is Working Properly" )
- """
- main.step( "Start continuous pings" )
-
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source1' ],
- target=main.params[ 'PING' ][ 'target1' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source2' ],
- target=main.params[ 'PING' ][ 'target2' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source3' ],
- target=main.params[ 'PING' ][ 'target3' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source4' ],
- target=main.params[ 'PING' ][ 'target4' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source5' ],
- target=main.params[ 'PING' ][ 'target5' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source6' ],
- target=main.params[ 'PING' ][ 'target6' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source7' ],
- target=main.params[ 'PING' ][ 'target7' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source8' ],
- target=main.params[ 'PING' ][ 'target8' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source9' ],
- target=main.params[ 'PING' ][ 'target9' ],
- pingTime=500 )
- main.Mininet2.pingLong( src=main.params[ 'PING' ][ 'source10' ],
- target=main.params[ 'PING' ][ 'target10' ],
- pingTime=500 )
- """
- main.step( "Determine the current number of switches and links" )
- topologyOutput = main.ONOS2.topology()
- topologyResult = main.ONOS1.getTopology( topologyOutput )
- activeSwitches = topologyResult[ 'devices' ]
- links = topologyResult[ 'links' ]
- print "activeSwitches = ", type( activeSwitches )
- print "links = ", type( links )
- main.log.info(
- "Currently there are %s switches and %s links" %
- ( str( activeSwitches ), str( links ) ) )
-
- main.step( "Kill Link between s3 and s28" )
- main.Mininet1.link( END1="s3", END2="s28", OPTION="down" )
- time.sleep( linkSleep )
- topologyOutput = main.ONOS2.topology()
- LinkDown = main.ONOS1.checkStatus(
- topologyOutput, activeSwitches, str(
- int( links ) - 2 ) )
- if LinkDown == main.TRUE:
- main.log.report( "Link Down discovered properly" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=LinkDown,
- onpass="Link Down discovered properly",
- onfail="Link down was not discovered in " +
- str( linkSleep ) +
- " seconds" )
-
- # Check ping result here..add code for it
-
- main.step( "Bring link between s3 and s28 back up" )
- LinkUp = main.Mininet1.link( END1="s3", END2="s28", OPTION="up" )
- time.sleep( linkSleep )
- topologyOutput = main.ONOS2.topology()
- LinkUp = main.ONOS1.checkStatus(
- topologyOutput,
- activeSwitches,
- str( links ) )
- if LinkUp == main.TRUE:
- main.log.report( "Link up discovered properly" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=LinkUp,
- onpass="Link up discovered properly",
- onfail="Link up was not discovered in " +
- str( linkSleep ) +
- " seconds" )
-
- # NOTE Check ping result here..add code for it
-
- main.step( "Compare ONOS Topology to MN Topology" )
- TopologyCheck = main.TRUE
-
- devicesJson = main.ONOS2.devices()
- linksJson = main.ONOS2.links()
- portsJson = main.ONOS2.ports()
- mnSwitches = main.Mininet1.getSwitches()
- mnLinks = main.Mininet1.getLinks()
-
- result1 = main.Mininet1.compareSwitches(
- mnSwitches, json.loads( devicesJson ), json.loads( portsJson ) )
- result2 = main.Mininet1.compareLinks(
- mnSwitches, mnLinks, json.loads( linksJson ) )
-
- result = result1 and result2
- print "***********************"
-
- if result == main.TRUE:
- main.log.report( "ONOS" + " Topology matches MN Topology" )
- utilities.assert_equals(
- expect=main.TRUE,
- actual=result,
- onpass="ONOS" +
- " Topology matches MN Topology",
- onfail="ONOS" +
- " Topology does not match MN Topology" )
-
- TopologyCheck = TopologyCheck and result
- utilities.assert_equals(
- expect=main.TRUE,
- actual=TopologyCheck,
- onpass="Topology checks passed",
- onfail="Topology checks failed" )
-
- result = LinkDown and LinkUp and TopologyCheck
- utilities.assert_equals( expect=main.TRUE, actual=result,
- onpass="Link failure is discovered correctly",
- onfail="Link Discovery failed" )
-
- def CASE8( self ):
- """
- Intent removal
- """
- import time
- main.log.report( "This testcase removes any previously added intents" +
- " before adding any new set of intents" )
- main.log.report( "__________________________________" )
- main.log.info( "intent removal" )
- main.case( "Removing installed intents" )
- main.step( "Obtain the intent id's" )
- currentIntents = main.ONOS2.intents( jsonFormat=False )
- main.log.info( "intent_result = " + currentIntents )
- intentLinewise = currentIntents.split( "\n" )
-
- intentList = [line for line in intentLinewise \
- if line.startswith( "id=")]
- intentids = [line.split( "," )[ 0 ].split( "=" )[ 1 ] for line in \
- intentList]
- for id in intentids:
- print "id = ", id
-
- main.step(
- "Iterate through the intentids list and remove each intent" )
- for id in intentids:
- main.ONOS2.removeIntent( intentId=id ,purge=True)
-
- remainingIntents = main.ONOS2.intents( jsonFormat=False )
- main.log.info( "intent_result = " + remainingIntents )
- if remainingIntents:
- main.log.info( "There are still remaining intents " )
- intentResult = main.FALSE
- else:
- intentResult = main.TRUE
-
- intentList = [line for line in remainingIntents.split( "\n" ) \
- if line.startswith( "id=")]
- intentState = [line.split( "," )[ 1 ].split( "=" )[ 1 ] for line in \
- intentList]
- for state in intentState:
- print state
-
- case8Result = main.TRUE
- for state in intentState:
- if state != 'WITHDRAWN':
- case8Result = main.FALSE
- break
-
- PingResult = main.TRUE
- """
- if case8Result == main.TRUE:
- i = 8
- while i < 18:
- main.log.info(
- "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- if ping == main.TRUE:
- i = 19
- PingResult = PingResult and main.TRUE
- elif ping == main.FALSE:
- i += 1
- PingResult = PingResult and main.FALSE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
-
- # Note: If the ping result failed, that means the intents have been
- # withdrawn correctly.
- if PingResult == main.TRUE:
- main.log.report( "Installed intents have not been withdrawn correctly" )
- # main.cleanup()
- # main.exit()
- if PingResult == main.FALSE:
- main.log.report( "Installed intents have been withdrawn correctly" )
- """
-
- if case8Result:
- main.log.report( "Intent removal successful" )
- else:
- main.log.report( "Intent removal failed" )
-
- utilities.assert_equals( expect=main.TRUE, actual=case8Result,
- onpass="Intent removal test passed",
- onfail="Intent removal test failed" )
-
- def CASE9( self ):
- """
- Testing Point intents
- """
- main.log.report(
- "This test case adds point intents and then does pingall" )
- main.log.report( "__________________________________" )
- main.log.info( "Adding point intents" )
- main.case(
- "Adding bidirectional point for mn hosts" +
- "( h8-h18, h9-h19, h10-h20, h11-h21, h12-h22, " +
- "h13-h23, h14-h24, h15-h25, h16-h26, h17-h27 )" )
- macsDict = {}
- for i in range( 1,29 ):
- macsDict[ 'h' + str( i ) ]= main.Mininet1.getMacAddress( host='h'+ str( i ) )
- print macsDict
- main.step( "Add point intents for mn hosts h8 and h18 or" +
- "ONOS hosts h8 and h12" )
- # main.step(var1)
- ptpIntentResult = main.ONOS2.addPointIntent(
- ingressDevice="of:0000000000003008/1",
- egressDevice="of:0000000000006018/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h8' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- ingressDevice="of:0000000000006018/1",
- egressDevice="of:0000000000003008/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h18' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var2 = "Add point intents for mn hosts h9&h19 or ONOS hosts h9&h13"
- main.step(var2)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003009/1",
- "of:0000000000006019/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h9' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006019/1",
- "of:0000000000003009/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h19' ))
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var3 = "Add point intents for MN hosts h10&h20 or ONOS hosts hA&h14"
- main.step(var3)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003010/1",
- "of:0000000000006020/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h10' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006020/1",
- "of:0000000000003010/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h20' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var4 = "Add point intents for mininet hosts h11 and h21 or" +\
- " ONOS hosts hB and h15"
- main.case(var4)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003011/1",
- "of:0000000000006021/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h11' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006021/1",
- "of:0000000000003011/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h21' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var5 = "Add point intents for mininet hosts h12 and h22 " +\
- "ONOS hosts hC and h16"
- main.case(var5)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003012/1",
- "of:0000000000006022/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h12' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006022/1",
- "of:0000000000003012/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h22' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var6 = "Add point intents for mininet hosts h13 and h23 or" +\
- " ONOS hosts hD and h17"
- main.case(var6)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003013/1",
- "of:0000000000006023/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h13' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006023/1",
- "of:0000000000003013/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h23' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var7 = "Add point intents for mininet hosts h14 and h24 or" +\
- " ONOS hosts hE and h18"
- main.case(var7)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003014/1",
- "of:0000000000006024/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h14' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006024/1",
- "of:0000000000003014/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h24' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var8 = "Add point intents for mininet hosts h15 and h25 or" +\
- " ONOS hosts hF and h19"
- main.case(var8)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003015/1",
- "of:0000000000006025/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h15' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006025/1",
- "of:0000000000003015/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h25' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var9 = "Add intents for mininet hosts h16 and h26 or" +\
- " ONOS hosts h10 and h1A"
- main.case(var9)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003016/1",
- "of:0000000000006026/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h16' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006026/1",
- "of:0000000000003016/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h26' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- # main.log.info( getIntentResult )
-
- var10 = "Add point intents for mininet hosts h17 and h27 or" +\
- " ONOS hosts h11 and h1B"
- main.case(var10)
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000003017/1",
- "of:0000000000006027/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h17' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- #main.log.info( getIntentResult )
-
- ptpIntentResult = main.ONOS2.addPointIntent(
- "of:0000000000006027/1",
- "of:0000000000003017/1",
- ethType='IPV4',
- ethSrc=macsDict.get( 'h27' ))
-
- if ptpIntentResult == main.TRUE:
- getIntentResult = main.ONOS2.intents()
- main.log.info( "Point to point intent install successful" )
- #main.log.info( getIntentResult )
-
- print(
- "___________________________________________________________" )
-
- flowHandle = main.ONOS2.flows()
- #main.log.info( "flows :" + flowHandle )
-
- count = 1
- i = 8
- PingResult = main.TRUE
- while i < 18:
- main.log.info(
- "\n\nh" + str( i ) + " is Pinging h" + str( i + 10 ) )
- ping = main.Mininet1.pingHost(
- src="h" + str( i ), target="h" + str( i + 10 ) )
- if ping == main.FALSE and count < 5:
- count += 1
- # i = 8
- PingResult = main.FALSE
- main.log.report( "Ping between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- " failed. Making attempt number " +
- str( count ) +
- " in 2 seconds" )
- time.sleep( 2 )
- elif ping == main.FALSE:
- main.log.report( "All ping attempts between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "have failed" )
- i = 19
- PingResult = main.FALSE
- elif ping == main.TRUE:
- main.log.info( "Ping test between h" +
- str( i ) +
- " and h" +
- str( i +
- 10 ) +
- "passed!" )
- i += 1
- PingResult = main.TRUE
- else:
- main.log.info( "Unknown error" )
- PingResult = main.ERROR
-
- if PingResult == main.FALSE:
- main.log.report(
- "Point intents have not ben installed correctly. Cleaning up" )
- # main.cleanup()
- # main.exit()
- if PingResult == main.TRUE:
- main.log.report( "Point Intents have been installed correctly" )
-
- case9Result = PingResult
- utilities.assert_equals(
- expect=main.TRUE,
- actual=case9Result,
- onpass="Point intents addition and Pingall Test successful",
- onfail="Point intents addition and Pingall Test NOT successful" )
diff --git a/TestON/tests/ProdFunc13/ProdFunc13.topo b/TestON/tests/ProdFunc13/ProdFunc13.topo
deleted file mode 100755
index 2605b2e..0000000
--- a/TestON/tests/ProdFunc13/ProdFunc13.topo
+++ /dev/null
@@ -1,93 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOS1>
- <host>10.128.10.11</host>
- <user>sdn</user>
- <password>sdn</password>
- <type>OnosDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
-
- <Mininet1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> --switch ovs,protocols=OpenFlow13 </arg3>
- <arg4> --mac </arg4>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet1>
-
- <Mininet2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS>
- #Specify the Option for mininet
- <arg1> --custom ~/mininet/custom/topo-HA.py </arg1>
- <arg2> --topo mytopo </arg2>
- <arg3> --switch ovs,protocols=OpenFlow13 </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet2>
-
- <LincOE1>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>LincOEDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </LincOE1>
-
- <LincOE2>
- <host>10.128.10.11</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS>
- </COMPONENTS>
- </LincOE2>
-
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/ProdFunc13/__init__.py b/TestON/tests/ProdFunc13/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/ProdFunc13/__init__.py
+++ /dev/null
diff --git a/TestON/tests/FuncStartTemplate/FuncStartTemplate.params b/TestON/tests/SAMPstartTemplate/SAMPstartTemplate.params
similarity index 100%
rename from TestON/tests/FuncStartTemplate/FuncStartTemplate.params
rename to TestON/tests/SAMPstartTemplate/SAMPstartTemplate.params
diff --git a/TestON/tests/FuncStartTemplate/FuncStartTemplate.py b/TestON/tests/SAMPstartTemplate/SAMPstartTemplate.py
similarity index 98%
rename from TestON/tests/FuncStartTemplate/FuncStartTemplate.py
rename to TestON/tests/SAMPstartTemplate/SAMPstartTemplate.py
index 59c242c..9df58af 100644
--- a/TestON/tests/FuncStartTemplate/FuncStartTemplate.py
+++ b/TestON/tests/SAMPstartTemplate/SAMPstartTemplate.py
@@ -2,12 +2,7 @@
# Testing the basic functionality of ONOS Next
# For sanity and driver functionality excercises only.
-import time
-import json
-
-time.sleep( 1 )
-
-class FuncStartTemplate:
+class SAMPstartTemplate:
def __init__( self ):
self.default = ''
diff --git a/TestON/tests/FuncStartTemplate/FuncStartTemplate.topo b/TestON/tests/SAMPstartTemplate/SAMPstartTemplate.topo
similarity index 100%
rename from TestON/tests/FuncStartTemplate/FuncStartTemplate.topo
rename to TestON/tests/SAMPstartTemplate/SAMPstartTemplate.topo
diff --git a/TestON/tests/FuncStartTemplate/__init__.py b/TestON/tests/SAMPstartTemplate/__init__.py
similarity index 100%
rename from TestON/tests/FuncStartTemplate/__init__.py
rename to TestON/tests/SAMPstartTemplate/__init__.py
diff --git a/TestON/tests/SCPFcbench/SCPFcbench.params b/TestON/tests/SCPFcbench/SCPFcbench.params
new file mode 100644
index 0000000..8a11b56
--- /dev/null
+++ b/TestON/tests/SCPFcbench/SCPFcbench.params
@@ -0,0 +1,40 @@
+<PARAMS>
+
+ <testcases>1,2</testcases>
+
+ <SCALE>1</SCALE>
+ <availableNodes>1</availableNodes>
+
+ <ENV>
+ <cellName>Cbenchcell</cellName>
+ </ENV>
+
+ <TEST>
+ <skipCleanInstall>yes</skipCleanInstall>
+ <mode>t</mode> #t throughput
+ </TEST>
+
+ <GIT>
+ <autopull>off</autopull>
+ <checkout>master</checkout>
+ </GIT>
+
+ <CTRL>
+ <USER>admin</USER>
+ <ip1>OC1</ip1>
+ <port1>6633</port1>
+ </CTRL>
+
+ <MN>
+ <ip1>OC1</ip1>
+ </MN>
+
+ <BENCH>
+ <user>admin</user>
+ <ip1>localhost</ip1>
+ </BENCH>
+
+ <JSON>
+ </JSON>
+
+</PARAMS>
diff --git a/TestON/tests/CbenchBM/CbenchBM.py b/TestON/tests/SCPFcbench/SCPFcbench.py
similarity index 88%
rename from TestON/tests/CbenchBM/CbenchBM.py
rename to TestON/tests/SCPFcbench/SCPFcbench.py
index d042f45..79cdce2 100644
--- a/TestON/tests/CbenchBM/CbenchBM.py
+++ b/TestON/tests/SCPFcbench/SCPFcbench.py
@@ -5,17 +5,19 @@
# cameron@onlab.us
import sys
+import os
import os.path
-class CbenchBM:
+class SCPFcbench:
def __init__( self ):
self.default = ''
def CASE1( self, main ):
- import time
+ import time
+ import os
global init
try:
if type(init) is not bool:
@@ -47,8 +49,8 @@
#Populate ONOSIp with ips from params
for i in range(1, maxNodes + 1):
- ipString = 'ip' + str(i)
- ONOSIp.append(main.params[ 'CTRL' ][ ipString ])
+ ipString = os.environ[main.params['CTRL']['ip1']]
+ ONOSIp.append(ipString)
#mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
if skipMvn != "yes":
@@ -81,10 +83,23 @@
for i in range(1, maxNodes + 1):
main.log.info(" Uninstalling ONOS " + str(i) )
main.ONOSbench.onosUninstall( ONOSIp[i] )
-
+
+ time.sleep(10)
+ main.ONOSbench.handle.sendline(" ")
+ main.ONOSbench.handle.expect(":~")
+ print "pexpect: \n" + main.ONOSbench.handle.before
+
+
+ print "Cellname is: "+ cellName + "ONOS IP is: " + str(ONOSIp)
+ main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,"drivers,openflow,fwd",ONOSIp[1])
+
main.step( "Set Cell" )
main.ONOSbench.setCell(cellName)
-
+
+ #main.ONOSbench.handle.sendline(" ")
+ #main.ONOSbench.handle.expect(":~")
+ #print "pexpect: \n" + main.ONOSbench.handle.before
+
main.step( "Creating ONOS package" )
packageResult = main.ONOSbench.onosPackage()
@@ -165,7 +180,7 @@
commit = main.ONOSbench.getVersion()
commit = (commit.split(" "))[1]
- dbfile = open("CbenchBMDB", "w+")
+ dbfile = open("CbenchDB", "w+")
temp = "'" + commit + "',"
temp += "'" + mode + "',"
temp += "'" + avg + "',"
diff --git a/TestON/tests/SCPFcbench/SCPFcbench.topo b/TestON/tests/SCPFcbench/SCPFcbench.topo
new file mode 100644
index 0000000..cae9c93
--- /dev/null
+++ b/TestON/tests/SCPFcbench/SCPFcbench.topo
@@ -0,0 +1,35 @@
+<TOPOLOGY>
+
+ <COMPONENT>
+
+ <ONOSbench>
+ <host>localhost</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosDriver</type>
+ <connect_order>1</connect_order>
+ <COMPONENTS><home>~/onos</home></COMPONENTS>
+ </ONOSbench>
+
+ <ONOS1cli>
+ <host>OCN</host>
+ <user>admin</user>
+ <password>onos_test</password>
+ <type>OnosCliDriver</type>
+ <connect_order>2</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS1cli>
+
+ <ONOS1>
+ <host>OC1</host>
+ <user>sdn</user>
+ <password>rocks</password>
+ <type>OnosDriver</type>
+ <connect_order>9</connect_order>
+ <COMPONENTS> </COMPONENTS>
+ </ONOS1>
+
+ </COMPONENT>
+
+</TOPOLOGY>
+
diff --git a/TestON/tests/SdnIpTest/__init__.py b/TestON/tests/SCPFcbench/__init__.py
similarity index 100%
rename from TestON/tests/SdnIpTest/__init__.py
rename to TestON/tests/SCPFcbench/__init__.py
diff --git a/TestON/tests/IntentEventTP/IntentEventTP.params b/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.params
similarity index 100%
rename from TestON/tests/IntentEventTP/IntentEventTP.params
rename to TestON/tests/SCPFintentEventTp/SCPFintentEventTp.params
diff --git a/TestON/tests/IntentEventTP/IntentEventTP.py b/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
similarity index 98%
rename from TestON/tests/IntentEventTP/IntentEventTP.py
rename to TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
index 44178b2..069f1c4 100644
--- a/TestON/tests/IntentEventTP/IntentEventTP.py
+++ b/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.py
@@ -8,7 +8,7 @@
import os.path
-class IntentEventTP:
+class SCPFintentEventTp:
def __init__( self ):
self.default = ''
@@ -212,7 +212,7 @@
main.ONOSbench.handle.sendline("onos $OC1 summary")
main.ONOSbench.handle.expect(":~")
main.log.info("before" + main.ONOSbench.handle.before)
- clusterCheck = ((main.ONOSbench.handle.before).splitlines())[3]
+ clusterCheck = main.ONOSbench.handle.before
print("\nBefore: " + str(clusterCheck))
if ("SCC(s)=1,") in clusterCheck:
break
diff --git a/TestON/tests/IntentEventTP/IntentEventTP.topo b/TestON/tests/SCPFintentEventTp/SCPFintentEventTp.topo
similarity index 100%
rename from TestON/tests/IntentEventTP/IntentEventTP.topo
rename to TestON/tests/SCPFintentEventTp/SCPFintentEventTp.topo
diff --git a/TestON/tests/SdnIpSingleSwitch/__init__.py b/TestON/tests/SCPFintentEventTp/__init__.py
similarity index 100%
rename from TestON/tests/SdnIpSingleSwitch/__init__.py
rename to TestON/tests/SCPFintentEventTp/__init__.py
diff --git a/TestON/tests/SdnIpSingleSwitch/CASE4-ping-as2host.sh b/TestON/tests/SdnIpSingleSwitch/CASE4-ping-as2host.sh
deleted file mode 100755
index 52768b2..0000000
--- a/TestON/tests/SdnIpSingleSwitch/CASE4-ping-as2host.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-
-
-#all the address in this for loop should work
-
-# ping test between as2 and as3
-for ((i=0;i<10;i++)); do
-
- #echo '------from 3.0.0.x to 4.0.1.'$j'------'
-
- for ((j=0; j<10; ++j )) ; do
- echo '3.0.'$i'.1 -> 4.0.'$j'.1'
- ping -c 1 -w 1 -I 3.0.$i.1 4.0.$j.1 | grep 'from 4.0.'$j'.1'
-
- done
-
-done
-for ((i=0;i<10;i++)); do
-
- #echo '------from 3.0.0.x to 5.0.1.'$j'------'
-
- for ((j=0; j<10; ++j )) ; do
- echo '3.0.'$i'.1 -> 5.0.'$j'.1'
- ping -c 1 -w 1 -I 3.0.$i.1 5.0.$j.1 | grep 'from 5.0.'$j'.1'
-
- done
-
-done
-
-# ping test between as2 and as4
-for ((i=1;i<2;i++)); do
- for ((prefix=101; prefix<=200; ++prefix)) ; do
- for ((j=0; j<10; ++j )) ; do
- echo '3.0.0.'$i' - > '$prefix'.0.'$j'.1'
- ping -c 1 -w 1 -I 3.0.0.$i $prefix.0.$j.1 | grep 'from '$prefix'.0.'$j'.1'
-
- done
- done
-
-done
-
diff --git a/TestON/tests/SdnIpSingleSwitch/SdnIpSingleSwitch.params b/TestON/tests/SdnIpSingleSwitch/SdnIpSingleSwitch.params
deleted file mode 100755
index 467141d..0000000
--- a/TestON/tests/SdnIpSingleSwitch/SdnIpSingleSwitch.params
+++ /dev/null
@@ -1,25 +0,0 @@
-<PARAMS>
-
- <testcases>4</testcases>
-
- #Environment variables
- <ENV>
- <cellName>sdnip_single_instance</cellName>
- </ENV>
-
- <CTRL>
- <ip1>127.0.0.1</ip1>
- <port1>6633</port1>
- </CTRL>
-
- <GIT>
- <autoPull>off</autoPull>
- <checkout>master</checkout>
- </GIT>
-
- <JSON>
- <prefix>prefix</prefix>
- <nextHop>nextHop</nextHop>
- </JSON>
-
-</PARAMS>
diff --git a/TestON/tests/SdnIpSingleSwitch/SdnIpSingleSwitch.py b/TestON/tests/SdnIpSingleSwitch/SdnIpSingleSwitch.py
deleted file mode 100644
index d13bdb3..0000000
--- a/TestON/tests/SdnIpSingleSwitch/SdnIpSingleSwitch.py
+++ /dev/null
@@ -1,1133 +0,0 @@
-# from cupshelpers.config import prefix
-
-# Testing the basic functionality of SDN-IP
-
-
-class SdnIpSingleSwitch:
-
- def __init__( self ):
- self.default = ''
-
-# from cupshelpers.config import prefix
-
-# Testing the basic functionality of SDN-IP
-
-
-class SdnIpSingleSwitch:
-
- def __init__( self ):
- self.default = ''
-
- def CASE4( self, main ):
- """
- Test the SDN-IP functionality
- allRoutesExpected: all expected routes for all BGP peers
- routeIntentsExpected: all expected MultiPointToSinglePointIntent \
- intents
- bgpIntentsExpected: expected PointToPointIntent intents
- allRoutesActual: all routes from ONOS LCI
- routeIntentsActual: actual MultiPointToSinglePointIntent intents from \
- ONOS CLI
- bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
- """
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- main.case("The test case is to help to setup the TestON environment \
- and test new drivers" )
- # SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
- SDNIPJSONFILEPATH = \
- "/home/sdnip/TestON/tests/SdnIpSingleSwitch/sdnip.json"
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
- main.log.info( "Generate prefixes for host3" )
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host5" )
- prefixesHost5 = main.QuaggaCliHost5.generatePrefixes( 5, 10 )
- main.log.info( prefixesHost5 )
- for prefix in prefixesHost5:
- allRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- routeIntentsExpectedHost5 = \
- main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
- prefixesHost5, "192.168.60.1", "00:00:00:00:06:02",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4 + routeIntentsExpectedHost5
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f", node=ONOS1Ip )
-
- main.step( "Checking if ONOS is up yet" )
- time.sleep( 20 )
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- main.step( "Start ONOS-cli" )
-
- main.ONOScli.startOnosCli( ONOS1Ip )
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing sdn-ip feature" )
- main.ONOScli.featureInstall( "onos-app-sdnip" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
-
- main.log.info( "Login Quagga CLI on host5" )
- main.QuaggaCliHost5.loginQuagga( "1.168.30.5" )
- main.log.info( "Enter configuration model of Quagga CLI on host5" )
- main.QuaggaCliHost5.enterConfig( 64521 )
- main.log.info( "Add routes to Quagga on host5" )
- main.QuaggaCliHost5.addRoutes( prefixesHost5, 1 )
-
- time.sleep( 60 )
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- time.sleep( 20 )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
-
- main.step( "Check MultiPointToSinglePointIntent intents installed" )
- # routeIntentsExpected are generated when generating routes
- # get rpoute intents from ONOS CLI
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
- routeIntentsStrActual = str( routeIntentsActual ).replace( 'u', "" )
- main.log.info( "MultiPointToSinglePoint intents expected:" )
- main.log.info( routeIntentsStrExpected )
- main.log.info( "MultiPointToSinglePoint intents get from ONOS CLI:" )
- main.log.info( routeIntentsStrActual )
- utilities.assertEquals(
- expect=True,
- actual=eq( routeIntentsStrExpected, routeIntentsStrActual ),
- onpass="***MultiPointToSinglePoint Intents in SDN-IP are \
- correct!***",
- onfail="***MultiPointToSinglePoint Intents in SDN-IP are \
- wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report( "***MultiPointToSinglePoint Intents before \
- deleting routes correct!***" )
- else:
- main.log.report( "***MultiPointToSinglePoint Intents before \
- deleting routes wrong!***" )
-
- main.step( "Check BGP PointToPointIntent intents installed" )
- # bgp intents expected
- bgpIntentsExpected = \
- main.QuaggaCliHost3.generateExpectedBgpIntents( SDNIPJSONFILEPATH )
- # get BGP intents from ONOS CLI
- bgpIntentsActual = \
- main.QuaggaCliHost3.extractActualBgpIntents( getIntentsResult )
-
- bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
- bgpIntentsStrActual = str( bgpIntentsActual )
- main.log.info( "PointToPointIntent intents expected:" )
- main.log.info( bgpIntentsStrExpected )
- main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
- main.log.info( bgpIntentsStrActual )
-
- utilities.assertEquals(
- expect=True,
- actual=eq( bgpIntentsStrExpected, bgpIntentsStrActual ),
- onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
- onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are correct!***" )
- else:
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- main.log.info( "Ping Test Start" )
- time.sleep(1000000)
-
- #============================= Ping Test ========================
- # wait until all MultiPointToSinglePoint
- time.sleep( 20 )
- pingTestScript = "CASE4-ping-as2host.sh"
- pingTestResultsFile = \
- "~/CASE4-ping-results-before-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- time.sleep( 20 )
-
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
- main.QuaggaCliHost5.deleteRoutes( prefixesHost5, 1 )
-
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report( "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
-
- main.step( "Check intents after deleting routes" )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- main.log.info( "main.ONOScli.intents()= " )
- main.log.info( routeIntentsActual )
- utilities.assertEquals(
- expect="[]", actual=str( routeIntentsActual ),
- onpass="***MultiPointToSinglePoint Intents number in SDN-IP is 0, \
- correct!***",
- onfail="***MultiPointToSinglePoint Intents number in SDN-IP is 0, \
- wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report( "***MultiPointToSinglePoint Intents after \
- deleting routes correct!***" )
- else:
- main.log.report( "***MultiPointToSinglePoint Intents after \
- deleting routes wrong!***" )
-
- time.sleep( 20 )
- pingTestScript = "CASE4-ping-as2host.sh"
- pingTestResultsFile = \
- "~/CASE4-ping-results-after-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- time.sleep( 100 )
-
- # main.step( "Test whether Mininet is started" )
- # main.Mininet2.handle.sendline( "xterm host1" )
- # main.Mininet2.handle.expect( "mininet>" )
-
- def CASE3( self, main ):
- """
- Test the SDN-IP functionality
- allRoutesExpected: all expected routes for all BGP peers
- routeIntentsExpected: all expected MultiPointToSinglePointIntent intents
- bgpIntentsExpected: expected PointToPointIntent intents
- allRoutesActual: all routes from ONOS LCI
- routeIntentsActual: actual MultiPointToSinglePointIntent intents from \
- ONOS CLI
- bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
- """
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- main.case( "The test case is to help to setup the TestON \
- environment and test new drivers" )
- # SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
- SDNIPJSONFILEPATH = \
- "/home/admin/workspace/onos/tools/package/config/sdnip.json"
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
- main.log.info( "Generate prefixes for host3" )
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f", node=ONOS1Ip )
-
- main.step( "Checking if ONOS is up yet" )
- time.sleep( 60 )
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- main.step( "Start ONOS-cli" )
-
- main.ONOScli.startOnosCli( ONOS1Ip )
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing sdn-ip feature" )
- main.ONOScli.featureInstall( "onos-app-sdnip" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
-
- for i in range( 101, 201 ):
- prefixesHostX = \
- main.QuaggaCliHost.generatePrefixes( str( i ), 10 )
- main.log.info( prefixesHostX )
- for prefix in prefixesHostX:
- allRoutesExpected.append(
- prefix + "/" + "192.168.40." + str( i - 100 ) )
-
- routeIntentsExpectedHostX = \
- main.QuaggaCliHost.generateExpectedOnePeerRouteIntents(
- prefixesHostX, "192.168.40." + str( i - 100 ),
- "00:00:%02d:00:00:90" % ( i - 101 ), SDNIPJSONFILEPATH )
- routeIntentsExpected = routeIntentsExpected + \
- routeIntentsExpectedHostX
-
- main.log.info( "Login Quagga CLI on host" + str( i ) )
- QuaggaCliHostX = getattr( main, ( 'QuaggaCliHost' + str( i ) ) )
- QuaggaCliHostX.loginQuagga( "1.168.30." + str( i ) )
- main.log.info(
- "Enter configuration model of Quagga CLI on host" + str( i ) )
- QuaggaCliHostX.enterConfig( 65000 + i - 100 )
- main.log.info( "Add routes to Quagga on host" + str( i ) )
- QuaggaCliHostX.addRoutes( prefixesHostX, 1 )
-
- time.sleep( 60 )
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- time.sleep( 20 )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
-
- main.step( "Check MultiPointToSinglePointIntent intents installed" )
- # routeIntentsExpected are generated when generating routes
- # get rpoute intents from ONOS CLI
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
- routeIntentsStrActual = str( routeIntentsActual ).replace( 'u', "" )
- main.log.info( "MultiPointToSinglePoint intents expected:" )
- main.log.info( routeIntentsStrExpected )
- main.log.info( "MultiPointToSinglePoint intents get from ONOS CLI:" )
- main.log.info( routeIntentsStrActual )
- utilities.assertEquals(
- expect=True,
- actual=eq( routeIntentsStrExpected, routeIntentsStrActual ),
- onpass="***MultiPointToSinglePoint Intents in SDN-IP are \
- correct!***",
- onfail="***MultiPointToSinglePoint Intents in SDN-IP are \
- wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report(
- "***MultiPointToSinglePoint Intents before deleting routes \
- correct!***" )
- else:
- main.log.report(
- "***MultiPointToSinglePoint Intents before deleting routes \
- wrong!***" )
-
- main.step( "Check BGP PointToPointIntent intents installed" )
- # bgp intents expected
- bgpIntentsExpected = main.QuaggaCliHost3.generateExpectedBgpIntents(
- SDNIPJSONFILEPATH )
- # get BGP intents from ONOS CLI
- bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents(
- getIntentsResult )
-
- bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
- bgpIntentsStrActual = str( bgpIntentsActual )
- main.log.info( "PointToPointIntent intents expected:" )
- main.log.info( bgpIntentsStrExpected )
- main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
- main.log.info( bgpIntentsStrActual )
-
- utilities.assertEquals(
- expect=True,
- actual=eq( bgpIntentsStrExpected, bgpIntentsStrActual ),
- onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
- onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are correct!***" )
- else:
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- #============================= Ping Test ========================
- # wait until all MultiPointToSinglePoint
- time.sleep( 20 )
- pingTestScript = "~/SDNIP/test-tools/CASE3-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE3-ping-results-before-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- time.sleep( 20 )
-
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
- for i in range( 101, 201 ):
- prefixesHostX = \
- main.QuaggaCliHost.generatePrefixes( str( i ), 10 )
- main.log.info( prefixesHostX )
- QuaggaCliHostX = getattr( main, ( 'QuaggaCliHost' + str( i ) ) )
- QuaggaCliHostX.deleteRoutes( prefixesHostX, 1 )
-
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
- getRoutesResult )
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after deleting wrong!***" )
-
- main.step( "Check intents after deleting routes" )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- main.log.info( "main.ONOScli.intents()= " )
- main.log.info( routeIntentsActual )
- utilities.assertEquals(
- expect="[]", actual=str( routeIntentsActual ),
- onpass="***MultiPointToSinglePoint Intents number in SDN-IP is \
- 0, correct!***",
- onfail="***MultiPointToSinglePoint Intents number in SDN-IP is \
- 0, wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report(
- "***MultiPointToSinglePoint Intents after deleting routes \
- correct!***" )
- else:
- main.log.report(
- "***MultiPointToSinglePoint Intents after deleting routes \
- wrong!***" )
-
- time.sleep( 20 )
- pingTestScript = "~/SDNIP/test-tools/CASE3-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE3-ping-results-after-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- time.sleep( 100 )
-
- # main.step( "Test whether Mininet is started" )
- # main.Mininet2.handle.sendline( "xterm host1" )
- # main.Mininet2.handle.expect( "mininet>" )
-
- def CASE1( self, main ):
- """
- Test the SDN-IP functionality
- allRoutesExpected: all expected routes for all BGP peers
- routeIntentsExpected: all expected MultiPointToSinglePointIntent \
- intents
- bgpIntentsExpected: expected PointToPointIntent intents
- allRoutesActual: all routes from ONOS LCI
- routeIntentsActual: actual MultiPointToSinglePointIntent intents \
- from ONOS CLI
- bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
- """
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- main.case("The test case is to help to setup the TestON environment \
- and test new drivers" )
- SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
- # bgpPeerHosts = []
- # for i in range( 3, 5 ):
- # bgpPeerHosts.append( "host" + str( i ) )
- # main.log.info( "BGP Peer Hosts are:" + bgpPeerHosts )
-
- # for i in range( 3, 5 ):
- # QuaggaCliHost = "QuaggaCliHost" + str( i )
- # prefixes = main.QuaggaCliHost.generatePrefixes( 3, 10 )
-
- # main.log.info( prefixes )
- # allRoutesExpected.append( prefixes )
- main.log.info( "Generate prefixes for host3" )
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Starting ONOS service" )
- # TODO: start ONOS from Mininet Script
- # startResult = main.ONOSbench.onosStart( "127.0.0.1" )
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f", node=ONOS1Ip )
-
- main.step( "Checking if ONOS is up yet" )
- time.sleep( 60 )
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- main.step( "Start ONOS-cli" )
- # TODO: change the hardcode in startOnosCli method in ONOS CLI driver
-
- main.ONOScli.startOnosCli( ONOS1Ip )
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing sdn-ip feature" )
- main.ONOScli.featureInstall( "onos-app-sdnip" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
- time.sleep( 60 )
-
- # get all routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- time.sleep( 20 )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
-
- main.step( "Check MultiPointToSinglePointIntent intents installed" )
- # routeIntentsExpected are generated when generating routes
- # get rpoute intents from ONOS CLI
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
- routeIntentsStrActual = str( routeIntentsActual ).replace( 'u', "" )
- main.log.info( "MultiPointToSinglePoint intents expected:" )
- main.log.info( routeIntentsStrExpected )
- main.log.info( "MultiPointToSinglePoint intents get from ONOS CLI:" )
- main.log.info( routeIntentsStrActual )
- utilities.assertEquals(
- expect=True,
- actual=eq( routeIntentsStrExpected, routeIntentsStrActual ),
- onpass="***MultiPointToSinglePoint Intents in SDN-IP are \
- correct!***",
- onfail="***MultiPointToSinglePoint Intents in SDN-IP are \
- wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report(
- "***MultiPointToSinglePoint Intents before deleting routes \
- correct!***" )
- else:
- main.log.report(
- "***MultiPointToSinglePoint Intents before deleting routes \
- wrong!***" )
-
- main.step( "Check BGP PointToPointIntent intents installed" )
- # bgp intents expected
- bgpIntentsExpected = \
- main.QuaggaCliHost3.generateExpectedBgpIntents( SDNIPJSONFILEPATH )
- # get BGP intents from ONOS CLI
- bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents(
- getIntentsResult )
-
- bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
- bgpIntentsStrActual = str( bgpIntentsActual )
- main.log.info( "PointToPointIntent intents expected:" )
- main.log.info( bgpIntentsStrExpected )
- main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
- main.log.info( bgpIntentsStrActual )
-
- utilities.assertEquals(
- expect=True,
- actual=eq( bgpIntentsStrExpected, bgpIntentsStrActual ),
- onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
- onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are correct!***" )
- else:
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- #============================= Ping Test ========================
- # wait until all MultiPointToSinglePoint
- time.sleep( 20 )
- pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE1-ping-results-before-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
-
- # ping test
-
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
-
- # main.log.info( "main.ONOScli.get_routes_num() = " )
- # main.log.info( main.ONOScli.getRoutesNum() )
- # utilities.assertEquals( expect="Total SDN-IP routes = 1", actual=
- # main.ONOScli.getRoutesNum(),
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after deleting wrong!***" )
-
- main.step( "Check intents after deleting routes" )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- main.log.info( "main.ONOScli.intents()= " )
- main.log.info( routeIntentsActual )
- utilities.assertEquals(
- expect="[]", actual=str( routeIntentsActual ),
- onpass="***MultiPointToSinglePoint Intents number in SDN-IP is \
- 0, correct!***",
- onfail="***MultiPointToSinglePoint Intents number in SDN-IP is \
- 0, wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report(
- "***MultiPointToSinglePoint Intents after deleting routes \
- correct!***" )
- else:
- main.log.report(
- "***MultiPointToSinglePoint Intents after deleting routes \
- wrong!***" )
-
- time.sleep( 20 )
- pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE1-ping-results-after-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- time.sleep( 30 )
-
- # main.step( "Test whether Mininet is started" )
- # main.Mininet2.handle.sendline( "xterm host1" )
- # main.Mininet2.handle.expect( "mininet>" )
-
- def CASE2( self, main ):
- """
- Test the SDN-IP functionality
- allRoutesExpected: all expected routes for all BGP peers
- routeIntentsExpected: all expected MultiPointToSinglePointIntent \
- intents
- bgpIntentsExpected: expected PointToPointIntent intents
- allRoutesActual: all routes from ONOS LCI
- routeIntentsActual: actual MultiPointToSinglePointIntent intents \
- from ONOS CLI
- bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
- """
- import time
- import json
- from operator import eq
- from time import localtime, strftime
-
- main.case(
- "The test case is to help to setup the TestON environment and \
- test new drivers" )
- SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
-
- main.log.info( "Generate prefixes for host3" )
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4
-
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
- # main.log.report( "Removing raft logs" )
- # main.ONOSbench.onosRemoveRaftLogs()
- # main.log.report( "Uninstalling ONOS" )
- # main.ONOSbench.onosUninstall( ONOS1Ip )
- main.step( "Creating ONOS package" )
- # packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Installing ONOS package" )
- # onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
- # node=ONOS1Ip )
-
- main.step( "Checking if ONOS is up yet" )
- # time.sleep( 60 )
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- main.step( "Start ONOS-cli" )
- main.ONOScli.startOnosCli( ONOS1Ip )
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing sdn-ip feature" )
- main.ONOScli.featureInstall( "onos-app-sdnip" )
- time.sleep( 10 )
-
- main.step( "Check BGP PointToPointIntent intents installed" )
- # bgp intents expected
- bgpIntentsExpected = main.QuaggaCliHost3.generateExpectedBgpIntents(
- SDNIPJSONFILEPATH )
- # get BGP intents from ONOS CLI
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
- bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents(
- getIntentsResult )
-
- bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
- bgpIntentsStrActual = str( bgpIntentsActual )
- main.log.info( "PointToPointIntent intents expected:" )
- main.log.info( bgpIntentsStrExpected )
- main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
- main.log.info( bgpIntentsStrActual )
-
- utilities.assertEquals(
- expect=True,
- actual=eq( bgpIntentsStrExpected, bgpIntentsStrActual ),
- onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
- onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are correct!***" )
- else:
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
- pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
- # roundNum = 0;
- # while( True ):
- for roundNum in range( 1, 6 ):
- # round = round + 1;
- main.log.report( "The Round " + str( roundNum ) +
- " test starts................................" )
-
- main.step( "Login all BGP peers and add routes into peers" )
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info(
- "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info(
- "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
- time.sleep( 60 )
-
- # get all routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- # allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding wrong!***" )
-
- time.sleep( 20 )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
-
- main.step(
- "Check MultiPointToSinglePointIntent intents installed" )
- # routeIntentsExpected are generated when generating routes
- # get route intents from ONOS CLI
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- # routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
- routeIntentsStrActual = str(
- routeIntentsActual ).replace( 'u', "" )
- main.log.info( "MultiPointToSinglePoint intents expected:" )
- main.log.info( routeIntentsStrExpected )
- main.log.info(
- "MultiPointToSinglePoint intents get from ONOS CLI:" )
- main.log.info( routeIntentsStrActual )
- utilities.assertEquals(
- expect=True,
- actual=eq( routeIntentsStrExpected, routeIntentsStrActual ),
- onpass="***MultiPointToSinglePoint Intents in SDN-IP are \
- correct!***",
- onfail="***MultiPointToSinglePoint Intents in SDN-IP are \
- wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report(
- "***MultiPointToSinglePoint Intents after adding routes \
- correct!***" )
- else:
- main.log.report(
- "***MultiPointToSinglePoint Intents after adding routes \
- wrong!***" )
-
- #============================= Ping Test ========================
- # wait until all MultiPointToSinglePoint
- time.sleep( 20 )
- # pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE2-Round" \
- + str( roundNum ) + "-ping-results-before-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- # ping test
-
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.log.info( "Delete routes to Quagga on host3" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.log.info( "Delete routes to Quagga on host4" )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
-
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after deleting wrong!***" )
-
- main.step( "Check intents after deleting routes" )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- main.log.info( "main.ONOScli.intents()= " )
- main.log.info( routeIntentsActual )
- utilities.assertEquals(
- expect="[]", actual=str( routeIntentsActual ),
- onpass=
- "***MultiPointToSinglePoint Intents number in SDN-IP \
- is 0, correct!***",
- onfail="***MultiPointToSinglePoint Intents number in SDN-IP \
- is 0, wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report(
- "***MultiPointToSinglePoint Intents after deleting \
- routes correct!***" )
- else:
- main.log.report(
- "***MultiPointToSinglePoint Intents after deleting \
- routes wrong!***" )
-
- time.sleep( 20 )
- # pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE2-Round" \
- + str( roundNum ) + "-ping-results-after-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- time.sleep( 30 )
-
diff --git a/TestON/tests/SdnIpSingleSwitch/SdnIpSingleSwitch.topo b/TestON/tests/SdnIpSingleSwitch/SdnIpSingleSwitch.topo
deleted file mode 100755
index df9f7d2..0000000
--- a/TestON/tests/SdnIpSingleSwitch/SdnIpSingleSwitch.topo
+++ /dev/null
@@ -1,73 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>127.0.0.1</host>
- <user>sdnip</user>
- <password>sdnip</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS>
- <home>~/onos</home>
- </COMPONENTS>
- </ONOSbench>
-
- <ONOScli>
- <host>127.0.0.1</host>
- <user>sdnip</user>
- <password>sdnip</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS>
- <home>~/onos</home>
- </COMPONENTS>
- </ONOScli>
-
- <ONOS1>
- <host>127.0.0.1</host>
- <user>sdnip</user>
- <password>sdnip</password>
- <type>OnosDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS>
- <home>~/onos</home>
- </COMPONENTS>
- </ONOS1>
-
- <QuaggaCliHost3>
- <host>1.168.30.2</host>
- <user>sdnip</user>
- <password>sdnip</password>
- <type>QuaggaCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost3>
- <QuaggaCliHost4>
- <host>1.168.30.3</host>
- <user>sdnip</user>
- <password>sdnip</password>
- <type>QuaggaCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost4>
- <QuaggaCliHost5>
- <host>1.168.30.5</host>
- <user>sdnip</user>
- <password>sdnip</password>
- <type>QuaggaCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost5>
- <QuaggaCliHost>
- <host>1.168.30.100</host>
- <user>sdnip</user>
- <password>sdnip</password>
- <type>QuaggaCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost>
-
-
- </COMPONENT>
-</TOPOLOGY>
-
diff --git a/TestON/tests/SdnIpSingleSwitch/addresses.json b/TestON/tests/SdnIpSingleSwitch/addresses.json
deleted file mode 100644
index 203de9b..0000000
--- a/TestON/tests/SdnIpSingleSwitch/addresses.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "addresses" : [
- {
- "dpid" : "00:00:00:00:00:00:00:a1",
- "port" : "2",
- "ips" : ["192.168.10.101/24"],
- "mac" : "00:00:00:00:00:01"
-
- },
- {
- "dpid" : "00:00:00:00:00:00:00:a1",
- "port" : "3",
- "ips" : ["192.168.20.101/24"],
- "mac" : "00:00:00:00:00:01"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:a1",
- "port" : "4",
- "ips" : ["192.168.30.101/24"],
- "mac" : "00:00:00:00:00:01"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:a1",
- "port" : "5",
- "ips" : ["192.168.60.101/24"],
- "mac" : "00:00:00:00:00:01"
- }
-
- ]
-}
diff --git a/TestON/tests/SdnIpSingleSwitch/intents.json b/TestON/tests/SdnIpSingleSwitch/intents.json
deleted file mode 100644
index d17715f..0000000
--- a/TestON/tests/SdnIpSingleSwitch/intents.json
+++ /dev/null
@@ -1,1468 +0,0 @@
-[
- {
- "id":"0xffffffffcb2cb6ec",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.10.101/32}, IPV4_DST{ip=192.168.10.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a3",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x140a3304",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a3, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.10.101/32}, IPV4_DST{ip=192.168.10.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a3, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffcb2d9828",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.10.1/32}, IPV4_DST{ip=192.168.10.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a3",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x1a89f138",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a3, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.10.1/32}, IPV4_DST{ip=192.168.10.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a3, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffd1418988",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.30.101/32}, IPV4_DST{ip=192.168.30.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x2cd85684",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a2, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.30.101/32}, IPV4_DST{ip=192.168.30.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a2, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x3122a56b",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.40.101/32}, IPV4_DST{ip=192.168.40.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a6",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x5874487",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a6, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a6, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.40.101/32}, IPV4_DST{ip=192.168.40.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a6, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a6, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x6ae96523",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.10.101/32}, IPV4_DST{ip=192.168.10.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a3",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x217361ed",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a3, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.10.101/32}, IPV4_DST{ip=192.168.10.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a3, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffaee31428",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.30.1/32}, IPV4_DST{ip=192.168.30.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x68cad35c",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a2, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.30.1/32}, IPV4_DST{ip=192.168.30.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a2, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffed2b21fa",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.20.1/32}, IPV4_DST{ip=192.168.20.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a5",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffa5dbcf50",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a5, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.20.1/32}, IPV4_DST{ip=192.168.20.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a5, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x373774a3",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.60.101/32}, IPV4_DST{ip=192.168.60.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a4",
- "port":"4"
- },
- "installable":[
- {
- "id":"0x5a75d509",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a4, portNumber=4}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.60.101/32}, IPV4_DST{ip=192.168.60.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a4, portNumber=4}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffff8d492c5d",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.10.1/32}, IPV4_DST{ip=192.168.10.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a3",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffef408263",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a3, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.10.1/32}, IPV4_DST{ip=192.168.10.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a3, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffff8ce7d031",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.20.1/32}, IPV4_DST{ip=192.168.20.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a5",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffb344fe39",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a5, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.20.1/32}, IPV4_DST{ip=192.168.20.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a5, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xf2665f1",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.30.1/32}, IPV4_DST{ip=192.168.30.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x5b61a473",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a2, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.30.1/32}, IPV4_DST{ip=192.168.30.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a2, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffd0e186b8",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.40.1/32}, IPV4_DST{ip=192.168.40.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a6",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x4d8d4942",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a6, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.40.1/32}, IPV4_DST{ip=192.168.40.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a6, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x3738d163",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.60.1/32}, IPV4_DST{ip=192.168.60.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a4",
- "port":"4"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffff993b0fc9",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a4, portNumber=4}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.60.1/32}, IPV4_DST{ip=192.168.60.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a4, portNumber=4}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xfffffffff33e39a0",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.40.101/32}, IPV4_DST{ip=192.168.40.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a6",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffda3dd5b2",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a6, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a6, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.40.101/32}, IPV4_DST{ip=192.168.40.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a6, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a6, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffff8ce60db9",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.20.101/32}, IPV4_DST{ip=192.168.20.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a5",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xfeca8b9",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a5, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.20.101/32}, IPV4_DST{ip=192.168.20.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a5, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x3124d881",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.40.1/32}, IPV4_DST{ip=192.168.40.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a6",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x40241a59",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a6, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.40.1/32}, IPV4_DST{ip=192.168.40.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a6, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffd141fa26",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.30.1/32}, IPV4_DST{ip=192.168.30.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x3018359e",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a2, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.30.1/32}, IPV4_DST{ip=192.168.30.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a2, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffaee2a38a",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.30.101/32}, IPV4_DST{ip=192.168.30.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x658af442",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a2, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.30.101/32}, IPV4_DST{ip=192.168.30.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a2, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffaf46b62f",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.20.1/32}, IPV4_DST{ip=192.168.20.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a5",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x7a92607b",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a5, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.20.1/32}, IPV4_DST{ip=192.168.20.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a5, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffff8d484b21",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.10.101/32}, IPV4_DST{ip=192.168.10.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a3",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffe8c0c42f",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a3, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.10.101/32}, IPV4_DST{ip=192.168.10.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a3, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffed295f82",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.20.101/32}, IPV4_DST{ip=192.168.20.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a5",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x28379d0",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a5, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.20.101/32}, IPV4_DST{ip=192.168.20.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a5, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffdba23bce",
- "type":"MultiPointToSinglePointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_DST{ip=172.16.30.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "ingress":[
- {
- "device":"of:00000000000000a3",
- "port":"1"
- },
- {
- "device":"of:00000000000000a4",
- "port":"4"
- },
- {
- "device":"of:00000000000000a6",
- "port":"1"
- },
- {
- "device":"of:00000000000000a5",
- "port":"1"
- }
- ],
- "egress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x5e70036",
- "type":"LinkCollectionIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_DST{ip=172.16.30.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "links":[
- {
- "src":{
- "device":"of:00000000000000a4",
- "port":"1"
- },
- "dst":{
- "device":"of:00000000000000a2",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a5",
- "port":"2"
- },
- "dst":{
- "device":"of:00000000000000a3",
- "port":"4"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a6",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a3",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"2"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- }
- ]
- }
- ]
- },
- {
- "id":"0xffffffffaf44f3b7",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.20.101/32}, IPV4_DST{ip=192.168.20.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a5",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffd73a0afb",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a5, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.20.101/32}, IPV4_DST{ip=192.168.20.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a5, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x751d3d2e",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.60.1/32}, IPV4_DST{ip=192.168.60.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a4",
- "port":"4"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffc4847e9e",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a4, portNumber=4}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.60.1/32}, IPV4_DST{ip=192.168.60.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a4, portNumber=4}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x3fb23806",
- "type":"MultiPointToSinglePointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_DST{ip=2.0.0.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "ingress":[
- {
- "device":"of:00000000000000a3",
- "port":"1"
- },
- {
- "device":"of:00000000000000a4",
- "port":"4"
- },
- {
- "device":"of:00000000000000a6",
- "port":"1"
- },
- {
- "device":"of:00000000000000a5",
- "port":"1"
- }
- ],
- "egress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x23d68afe",
- "type":"LinkCollectionIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_DST{ip=2.0.0.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "links":[
- {
- "src":{
- "device":"of:00000000000000a4",
- "port":"1"
- },
- "dst":{
- "device":"of:00000000000000a2",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a5",
- "port":"2"
- },
- "dst":{
- "device":"of:00000000000000a3",
- "port":"4"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a6",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a3",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"2"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- }
- ]
- }
- ]
- },
- {
- "id":"0x751be06e",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.60.101/32}, IPV4_DST{ip=192.168.60.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a4",
- "port":"4"
- },
- "installable":[
- {
- "id":"0xffffffff85bf43de",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a4, portNumber=4}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.60.101/32}, IPV4_DST{ip=192.168.60.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a4, portNumber=4}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x6aea465f",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.10.1/32}, IPV4_DST{ip=192.168.10.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a3",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x27f32021",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a3, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.10.1/32}, IPV4_DST{ip=192.168.10.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a3, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xf25f553",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.30.101/32}, IPV4_DST{ip=192.168.30.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x5821c559",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a2, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.30.101/32}, IPV4_DST{ip=192.168.30.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a2, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xfffffffff3406cb6",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.40.1/32}, IPV4_DST{ip=192.168.40.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a6",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x14daab84",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a6, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.40.1/32}, IPV4_DST{ip=192.168.40.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a6, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffd7d10b27",
- "type":"MultiPointToSinglePointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_DST{ip=1.0.0.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "ingress":[
- {
- "device":"of:00000000000000a3",
- "port":"1"
- },
- {
- "device":"of:00000000000000a4",
- "port":"4"
- },
- {
- "device":"of:00000000000000a6",
- "port":"1"
- },
- {
- "device":"of:00000000000000a5",
- "port":"1"
- }
- ],
- "egress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffff8f921bfd",
- "type":"LinkCollectionIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_DST{ip=1.0.0.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "links":[
- {
- "src":{
- "device":"of:00000000000000a4",
- "port":"1"
- },
- "dst":{
- "device":"of:00000000000000a2",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a5",
- "port":"2"
- },
- "dst":{
- "device":"of:00000000000000a3",
- "port":"4"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a6",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a3",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"2"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- }
- ]
- }
- ]
- },
- {
- "id":"0xffffffffa79364e5",
- "type":"MultiPointToSinglePointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_DST{ip=3.0.0.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "ingress":[
- {
- "device":"of:00000000000000a3",
- "port":"1"
- },
- {
- "device":"of:00000000000000a4",
- "port":"4"
- },
- {
- "device":"of:00000000000000a6",
- "port":"1"
- },
- {
- "device":"of:00000000000000a5",
- "port":"1"
- }
- ],
- "egress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffb81af9ff",
- "type":"LinkCollectionIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_DST{ip=3.0.0.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "links":[
- {
- "src":{
- "device":"of:00000000000000a4",
- "port":"1"
- },
- "dst":{
- "device":"of:00000000000000a2",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a5",
- "port":"2"
- },
- "dst":{
- "device":"of:00000000000000a3",
- "port":"4"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a6",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a3",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"2"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- }
- ]
- }
- ]
- },
- {
- "id":"0x14d9eb65",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.60.1/32}, IPV4_DST{ip=192.168.60.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a4",
- "port":"4"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffd1edad87",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a4, portNumber=4}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.60.1/32}, IPV4_DST{ip=192.168.60.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a4, portNumber=4}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x14d88ea5",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.60.101/32}, IPV4_DST{ip=192.168.60.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a4",
- "port":"4"
- },
- "installable":[
- {
- "id":"0xffffffff932872c7",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a4, portNumber=4}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.60.101/32}, IPV4_DST{ip=192.168.60.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a4, portNumber=4}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffd0df53a2",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.40.101/32}, IPV4_DST{ip=192.168.40.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a6",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x12f07370",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a6, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a6, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.40.101/32}, IPV4_DST{ip=192.168.40.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a6, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a6, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- }
-]
\ No newline at end of file
diff --git a/TestON/tests/SdnIpSingleSwitch/sdnip.json b/TestON/tests/SdnIpSingleSwitch/sdnip.json
deleted file mode 100644
index 6f719cf..0000000
--- a/TestON/tests/SdnIpSingleSwitch/sdnip.json
+++ /dev/null
@@ -1,59 +0,0 @@
-{
-
- "bgpPeers" : [
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:a1",
- "attachmentPort" : "2",
- "ipAddress" : "192.168.10.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:a1",
- "attachmentPort" : "3",
- "ipAddress" : "192.168.20.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:a1",
- "attachmentPort" : "4",
- "ipAddress" : "192.168.30.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:a1",
- "attachmentPort" : "5",
- "ipAddress" : "192.168.60.2"
- }
-
- ],
- "bgpSpeakers" : [
- {
- "name" : "bgpSpeaker1",
- "attachmentDpid" : "00:00:00:00:00:00:00:a1",
- "attachmentPort" : "1",
- "macAddress" : "00:00:00:00:00:01",
- "interfaceAddresses" : [
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:a1",
- "interfacePort" : "2",
- "ipAddress" : "192.168.10.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:a1",
- "interfacePort" : "3",
- "ipAddress" : "192.168.20.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:a1",
- "interfacePort" : "4",
- "ipAddress" : "192.168.30.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:a1",
- "interfacePort" : "5",
- "ipAddress" : "192.168.60.101"
- }
-
- ]
-
- }
-
- ]
-}
diff --git a/TestON/tests/SdnIpSingleSwitch/topology/SdnIpSingleSwitchMininet.py b/TestON/tests/SdnIpSingleSwitch/topology/SdnIpSingleSwitchMininet.py
deleted file mode 100755
index 6befc1b..0000000
--- a/TestON/tests/SdnIpSingleSwitch/topology/SdnIpSingleSwitchMininet.py
+++ /dev/null
@@ -1,333 +0,0 @@
-#!/usr/bin/python
-
-"""
-Start up the SDN-IP demo topology
-"""
-
-"""
-AS1 = 64513, (SDN AS)
-AS2 = 64514, reachable by 192.168.10.1, 192.168.20.1
-AS3 = 64516, reachable by 192.168.30.1
-AS4 = 64517, reachable by 192.168.40.1
-AS6 = 64520, reachable by 192.168.60.2, (route server 192.168.60.1)
-"""
-
-from mininet.net import Mininet
-from mininet.node import Controller, RemoteController
-from mininet.log import setLogLevel, info
-from mininet.cli import CLI
-from mininet.topo import Topo
-from mininet.util import quietRun
-from mininet.moduledeps import pathCheck
-
-import os.path
-import time
-from subprocess import Popen, STDOUT, PIPE
-
-QUAGGA_DIR = '/usr/lib/quagga'
-#QUAGGA_DIR = '/usr/local/sbin'
-QUAGGA_RUN_DIR = '/usr/local/var/run/quagga'
-
-
-class SDNIpModifiedTopo( Topo ):
- "SDN Ip Modified Topology"
-
- def __init__( self, *args, **kwargs ):
- global numHost101
- global numHost200
- numHost101 = 101
- numHost200 = 200
- Topo.__init__( self, *args, **kwargs )
- sw1 = self.addSwitch('sw1', dpid='00000000000000a1')
- #sw2 = self.addSwitch('sw2', dpid='00000000000000a2')
- #sw3 = self.addSwitch('sw3', dpid='00000000000000a3')
- #sw4 = self.addSwitch('sw4', dpid='00000000000000a4')
- #sw5 = self.addSwitch('sw5', dpid='00000000000000a5')
- #sw6 = self.addSwitch('sw6', dpid='00000000000000a6')
- #add a switch for 3 quagga hosts
- swTestOn = self.addSwitch('swTestOn', dpid='0000000000000102')
- #Note this switch isn't part of the SDN topology
- #We'll use the ovs-controller to turn this into a learning switch
- as6sw = self.addSwitch('as6sw', dpid='00000000000000a7')
-
- host1 = self.addHost( 'host1' )
- root1 = self.addHost( 'root1', inNamespace=False , ip='0')
- rootTestOn = self.addHost( 'rootTestOn', inNamespace=False, ip='0' )
-
- #AS2 host
- host3 = self.addHost( 'host3' )
- as2host = self.addHost( 'as2host' )
- #AS3 host
- host4 = self.addHost( 'host4' )
- as3host = self.addHost( 'as3host' )
- #AS6 host
- host5 = self.addHost( 'host5' )
- as6host = self.addHost( 'as6host' )
-
- self.addLink( host1, sw1 )
- #Links to the multihomed AS
- self.addLink( host3, sw1 )
- self.addLink( host3, sw1 )
- self.addLink( as2host, host3 )
- #Single links to the remaining two ASes
- self.addLink( host4, sw1 )
- self.addLink( as3host, host4 )
-
- #AS3-AS4 link
- #self.addLink( host4, host5)
- #Add new AS6 to its bridge
- self.addLink( host5, as6sw )
- self.addLink( as6host, host5 )
- #test the host behind the router(behind the router server)
-# for i in range(1, 10):
- # host = self.addHost('as6host%d' % i)
- # self.addLink(host, as6router)
-
- ## Internal Connection To Hosts ##
- self.addLink( root1, host1 )
-
- # self.addLink( sw1, sw2 )
- # self.addLink( sw1, sw3 )
- # self.addLink( sw2, sw4 )
- # self.addLink( sw3, sw4 )
- # self.addLink( sw3, sw5 )
- # self.addLink( sw4, sw6 )
- # self.addLink( sw5, sw6 )
- self.addLink( as6sw, sw1 )
-
-
- self.addLink(swTestOn, rootTestOn)
- #self.addLink(swTestOn, host1)
- self.addLink(swTestOn, host3)
- self.addLink(swTestOn, host4)
- self.addLink(swTestOn, host5)
- self.addLink(swTestOn, as2host)
-
-
- #self.addLink(rootTestOn, host4)
-
-def startsshd( host ):
- "Start sshd on host"
- info( '*** Starting sshd\n' )
- name, intf, ip = host.name, host.defaultIntf(), host.IP()
- banner = '/tmp/%s.banner' % name
- host.cmd( 'echo "Welcome to %s at %s" > %s' % ( name, ip, banner ) )
- host.cmd( '/usr/sbin/sshd -o "Banner %s"' % banner, '-o "UseDNS no"' )
- info( '***', host.name, 'is running sshd on', intf, 'at', ip, '\n' )
-
-def startsshds ( hosts ):
- for h in hosts:
- startsshd( h )
-
-def stopsshd( ):
- "Stop *all* sshd processes with a custom banner"
- info( '*** Shutting down stale sshd/Banner processes ',
- quietRun( "pkill -9 -f Banner" ), '\n' )
-
-def startquagga( host, num, config_file ):
- info( '*** Starting Quagga on %s\n' % host )
- zebra_cmd = 'sudo %s/zebra -d -f zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid' % (QUAGGA_DIR, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
- quagga_cmd = 'sudo %s/bgpd -d -f %s -z %s/zserv%s.api -i %s/bgpd%s.pid' % (QUAGGA_DIR, config_file, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
-
- print zebra_cmd
- print quagga_cmd
-
- host.cmd( zebra_cmd )
- host.cmd( quagga_cmd )
-
-def startquaggahost5( host, num ):
- info( '*** Starting Quagga on %s\n' % host )
- zebra_cmd = 'sudo %s/zebra -d -f zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid' % (QUAGGA_DIR, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
- quagga_cmd = 'sudo %s/bgpd -d -f ./as4quaggas/quagga%s.conf -z %s/zserv%s.api -i %s/bgpd%s.pid' % (QUAGGA_DIR, num, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num)
-
- host.cmd( zebra_cmd )
- host.cmd( quagga_cmd )
-
-
-def stopquagga( ):
- quietRun( 'sudo pkill -9 -f bgpd' )
- quietRun( 'sudo pkill -9 -f zebra' )
-
-def sdn1net():
- topo = SDNIpModifiedTopo()
- info( '*** Creating network\n' )
- net = Mininet( topo=topo, controller=RemoteController )
- net = Mininet( topo=topo, controller=RemoteController )
-
- host1, host3, host4, host5 = net.get( 'host1', 'host3', 'host4', 'host5' )
-
- #host100.setIP('1.168.30.' + str(i), 24, str(host100) + "-eth2")
-
- #host500.setMAC('00:00:00:00:04:%d' % (i-101), 'host%d-eth0' %(i))
- #add IP prefixes
- #for j in range(0,121):
- #host100.cmd('sudo ip addr add %s.0.40.%s/24 dev host%s-eth0' %(i,j,i))
-
- ## Adding 2nd, 3rd and 4th interface to host1 connected to sw1 (for another BGP peering)
- #sw1 = net.get('sw1')
- host1.setMAC('00:00:00:00:00:01', 'host1-eth0')
- host1.cmd('ip addr add 192.168.20.101/24 dev host1-eth0')
- host1.cmd('ip addr add 192.168.30.101/24 dev host1-eth0')
- #host1.cmd('ip addr add 192.168.40.101/24 dev host1-eth0')
- host1.cmd('ip addr add 192.168.60.101/24 dev host1-eth0')
-
- # Net has to be start after adding the above link
- net.start()
-
- # Set up as6sw as a learning switch as quickly as possible so it
- # hopefully doesn't connect to the actual controller
- # TODO figure out how to change controller before starting switch
- as6sw = net.get('as6sw')
- as6sw.cmd('ovs-vsctl set-controller as6sw none')
- as6sw.cmd('ovs-vsctl set-fail-mode as6sw standalone')
-
-
- sw1 = net.get('sw1')
- sw1.cmd('ovs-vsctl set-controller sw1 tcp:127.0.0.1:6633')
-# sw2.cmd('ovs-vsctl set-controller sw2 tcp:127.0.0.1:6633')
-# sw3.cmd('ovs-vsctl set-controller sw3 tcp:127.0.0.1:6633')
-# sw4.cmd('ovs-vsctl set-controller sw4 tcp:127.0.0.1:6633')
-# sw5.cmd('ovs-vsctl set-controller sw5 tcp:127.0.0.1:6633')
-# sw6.cmd('ovs-vsctl set-controller sw6 tcp:127.0.0.1:6633')
-
-
- swTestOn = net.get('swTestOn')
- swTestOn.cmd('ovs-vsctl set-controller swTestOn none')
- swTestOn.cmd('ovs-vsctl set-fail-mode swTestOn standalone')
-
- host1.defaultIntf().setIP('192.168.10.101/24')
- # Run BGPd
- #host1.cmd('%s -d -f %s' % (BGPD, BGPD_CONF))
- #host1.cmd('/sbin/route add default gw 192.168.10.254 dev %s-eth0' % (host1.name))
-
- # Configure new host interfaces
- #host2.defaultIntf().setIP('172.16.10.2/24')
- #host2.defaultIntf().setMAC('00:00:00:00:01:02')
- #host2.cmd('/sbin/route add default gw 172.16.10.254 dev %s-eth0' % (host2.name))
-
- # Set up AS2
- host3.setIP('192.168.10.1', 24, 'host3-eth0')
- #host3.cmd('sudo ip addr add 172.16.20.1/24 dev host3-eth0')
- host3.setIP('192.168.20.1', 24, 'host3-eth1')
- host3.setMAC('00:00:00:00:02:01', 'host3-eth0')
- host3.setMAC('00:00:00:00:02:02', 'host3-eth1')
- #host3.setIP('172.16.20.254', 24, 'host3-eth2')
- host3.setIP('3.0.0.254', 8, 'host3-eth2')
- host3.cmd('sysctl net.ipv4.conf.all.forwarding=1')
-
- host3.setIP('1.168.30.2', 24, 'host3-eth3')
- host3.cmd('sysctl net.ipv4.conf.all.arp_ignore=1')
- host3.cmd('sysctl net.ipv4.conf.all.arp_announce=1')
- as2host = net.get('as2host')
- #as2host.defaultIntf().setIP('172.16.20.1/24')
- for i in range(0, 20):
- as2host.cmd('sudo ip addr add 3.0.%d.1/24 dev as2host-eth0' %i)
- as2host.setIP('1.168.30.100', 24, 'as2host-eth1')
-
- as2host.cmd('ip route add default via 3.0.0.254')
-
- # Set up AS3
- host4.setIP('192.168.30.1', 24, 'host4-eth0')
- host4.setMAC('00:00:00:00:03:01', 'host4-eth0')
- host4.setIP('4.0.0.254', 8, 'host4-eth1')
- host4.setMAC('00:00:00:00:03:99', 'host4-eth1')
- host4.cmd('sysctl net.ipv4.conf.all.forwarding=1')
- as3host = net.get('as3host')
- for i in range(0, 20):
- as3host.cmd('sudo ip addr add 4.0.%d.1/24 dev as3host-eth0' %i)
- as3host.cmd('ip route add default via 4.0.0.254')
-
- #root space
- host4.setIP('1.168.30.3', 24, 'host4-eth2')
- host4.setMAC('00:00:00:00:03:03', 'host4-eth2')
-
- # Set up AS4
- #as4host = net.get('as4host')
- #as4host.defaultIntf().setIP('172.16.40.1/24')
- #as4host.cmd('ip route add default via 172.16.40.254')
-
- # setup interface address for 100 quagga hosts
- time.sleep(10)
- #for i in range(numHost101, numHost200 + 1):
- #host100 = net.get('host' + str(i))
- #host100.cmd(str(i)+'.0.1.254', 24, 'host'+str(i)+'-eth1')
- #as4host100 = net.get('as4host%s' %(i))
- #as4host100.defaultIntf().setIP(str(i) + '.0.0.1/24')
- #as4host100.cmd('ip route add default via ' + str(i) + '.0.0.254')
- #for j in range(0, 100):
- #as4host100.cmd('sudo ip addr add %d.0.%d.1/24 dev %s-eth0' %(i, j, as4host100))
-
- # Set up AS6 - This has a router and a route server
- #as6rs, host5 = net.get('as6rs', 'host5')
- host5 = net.get('host5')
- #as6rs.setIP('192.168.60.1', 24, 'as6rs-eth0')
- #as6rs.setMAC('00:00:00:00:06:01', 'as6rs-eth0')
- host5.setIP('192.168.60.2', 24, 'host5-eth0')
- host5.setMAC('00:00:00:00:06:02', 'host5-eth0')
- #as6router.setIP('172.16.60.254', 24, 'as6router-eth1')
- host5.setIP('5.0.0.254', 8, 'host5-eth1')
- host5.cmd('sysctl net.ipv4.conf.all.forwarding=1')
- host5.setIP('1.168.30.5', 24, 'host5-eth2')
- host5.setMAC('00:00:00:00:06:05', 'host5-eth2')
-
- as6host = net.get('as6host')
- #as6host.defaultIntf().setIP('5.0.0.1/24')
- for i in range(0, 10):
- as6host.cmd('sudo ip addr add 5.0.%d.1/24 dev as6host-eth0' %i)
- as6host.cmd('ip route add default via 5.0.0.254')
-
- # test the host in the as6
- #for i in range(1, 10):
- # baseip = (i-1)*4
- # host = net.get('as6host%d' % i)
- # host.defaultIntf().setIP('172.16.70.%d/24' % (baseip+1))
- # host.cmd('ip route add default via 172.16.70.%d' % (baseip+2))
- # as6router.setIP('172.16.70.%d' % (baseip+2), 30, 'as6router-eth%d' % (i+1))
-
- # Start Quagga on border routers
- startquagga(host3, 1, 'quagga1.conf')
- startquagga(host4, 2, 'quagga2.conf')
- #for i in range(numHost101, numHost200 + 1):
- #host100=net.get('host%d' % (i))
- #startquaggahost5(host100, i)
-
- #startquagga(as6rs, 4, 'quagga-as6-rs.conf')
- startquagga(host5, 5, 'quagga-as6.conf')
-
- #root1, root2, rootTestOn = net.get( 'root1', 'root2', 'rootTestOn' )
- root1, rootTestOn = net.get( 'root1', 'rootTestOn' )
- host1.intf('host1-eth1').setIP('1.1.1.1/24')
- root1.intf('root1-eth0').setIP('1.1.1.2/24')
- #host2.intf('host2-eth1').setIP('1.1.2.1/24')
- #root2.intf('root2-eth0').setIP('1.1.2.2/24')
-
- #rootTestOn.cmd('ip addr add 1.168.30.102/24 dev rootTestOn-eth0')
- rootTestOn.cmd('ip addr add 1.168.30.99/24 dev rootTestOn-eth0')
-
- stopsshd()
-
- startquagga(host1, 100, 'quagga-sdn-modified.conf')
- hosts = [ host1, host3, host4, host5, as2host ];
- #sshdHosts = sshdHosts + hosts
- startsshds( hosts )
- #
- onos1 = '127.0.0.1'
- forwarding1 = '%s:2000:%s:2000' % ('1.1.1.2', onos1)
- root1.cmd( 'ssh -nNT -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -l sdn -L %s %s & ' % (forwarding1, onos1) )
-
- # Forward 2605 to root namespace for easier access to SDN domain BGPd
- # If root can ssh to itself without a password this should work
- root1.cmd('ssh -N -o "PasswordAuthentication no" -o "StrictHostKeyChecking no" -L 2605:1.1.1.1:2605 1.1.1.1 &')
- #time.sleep(3000000000)
- CLI( net )
-
- # Close the ssh port forwarding
- #quietRun('sudo pkill -f 1.1.1.1')
-
- stopsshd()
- stopquagga()
- net.stop()
-
-if __name__ == '__main__':
- setLogLevel( 'debug' )
- sdn1net()
diff --git a/TestON/tests/SdnIpSingleSwitch/topology/quagga-as6-rs.conf b/TestON/tests/SdnIpSingleSwitch/topology/quagga-as6-rs.conf
deleted file mode 100644
index 1eac0dd..0000000
--- a/TestON/tests/SdnIpSingleSwitch/topology/quagga-as6-rs.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64520
- bgp router-id 192.168.60.1
- neighbor 192.168.60.101 remote-as 64513
- neighbor 192.168.60.101 route-server-client
- neighbor 192.168.60.2 remote-as 64521
- neighbor 192.168.60.2 route-server-client
-! network 172.16.60.0/24
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/SdnIpSingleSwitch/topology/quagga-as6.conf b/TestON/tests/SdnIpSingleSwitch/topology/quagga-as6.conf
deleted file mode 100644
index 434f983..0000000
--- a/TestON/tests/SdnIpSingleSwitch/topology/quagga-as6.conf
+++ /dev/null
@@ -1,39 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64521
- bgp router-id 192.168.60.2
- neighbor 192.168.60.101 remote-as 64513
-! neighbor 192.168.60.1 remote-as 64520
-! neighbor 192.168.60.3 remote-as 64520
-! network 172.16.60.0/24
-! network 172.16.70.4/30
- ! network 172.16.70.8/30
- ! network 172.16.70.12/30
- ! network 172.16.70.16/30
- ! network 172.16.70.20/30
- ! network 172.16.70.24/30
- ! network 172.16.70.28/30
- ! network 172.16.70.32/30
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/SdnIpSingleSwitch/topology/quagga-sdn-modified.conf b/TestON/tests/SdnIpSingleSwitch/topology/quagga-sdn-modified.conf
deleted file mode 100644
index d334c2a..0000000
--- a/TestON/tests/SdnIpSingleSwitch/topology/quagga-sdn-modified.conf
+++ /dev/null
@@ -1,49 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-route-map AS65000 permit 1
- set as-path prepend 65000
-!
-router bgp 64513
- bgp router-id 192.168.10.101
- timers bgp 1 3
- !timers bgp 3 9
- neighbor 192.168.10.1 remote-as 64514
- neighbor 192.168.10.1 ebgp-multihop
- neighbor 192.168.10.1 timers connect 5
- neighbor 192.168.20.1 remote-as 64514
- neighbor 192.168.20.1 ebgp-multihop
- neighbor 192.168.20.1 timers connect 5
- neighbor 192.168.20.1 route-map AS65000 in
- neighbor 192.168.30.1 remote-as 64516
- neighbor 192.168.30.1 ebgp-multihop
- neighbor 192.168.30.1 timers connect 5
- neighbor 192.168.60.2 remote-as 64521
- neighbor 192.168.60.2 ebgp-multihop
- neighbor 192.168.60.2 timers connect 5
- neighbor 1.1.1.2 remote-as 64513
- neighbor 1.1.1.2 port 2000
- neighbor 1.1.1.2 timers connect 5
-
-
-
- network 172.16.10.0/24
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/SdnIpSingleSwitch/topology/quagga-sdn.conf b/TestON/tests/SdnIpSingleSwitch/topology/quagga-sdn.conf
deleted file mode 100644
index 77392a6..0000000
--- a/TestON/tests/SdnIpSingleSwitch/topology/quagga-sdn.conf
+++ /dev/null
@@ -1,349 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-route-map AS65000 permit 1
- set as-path prepend 65000
-!
-router bgp 64513
- bgp router-id 192.168.10.101
- timers bgp 1 3
- !timers bgp 3 9
- neighbor 192.168.10.1 remote-as 64514
- neighbor 192.168.10.1 ebgp-multihop
- neighbor 192.168.10.1 timers connect 5
- neighbor 192.168.20.1 remote-as 64514
- neighbor 192.168.20.1 ebgp-multihop
- neighbor 192.168.20.1 timers connect 5
- neighbor 192.168.20.1 route-map AS65000 in
- neighbor 192.168.30.1 remote-as 64516
- neighbor 192.168.30.1 ebgp-multihop
- neighbor 192.168.30.1 timers connect 5
- neighbor 192.168.60.1 remote-as 64520
- neighbor 192.168.60.1 ebgp-multihop
- neighbor 192.168.60.1 timers connect 5
- neighbor 1.1.1.2 remote-as 64513
- neighbor 1.1.1.2 port 2000
- neighbor 1.1.1.2 timers connect 5
-
-
-neighbor 192.168.40.1 remote-as 65001
-neighbor 192.168.40.1 ebgp-multihop
-neighbor 192.168.40.1 timers connect 10
-neighbor 192.168.40.2 remote-as 65002
-neighbor 192.168.40.2 ebgp-multihop
-neighbor 192.168.40.2 timers connect 10
-neighbor 192.168.40.3 remote-as 65003
-neighbor 192.168.40.3 ebgp-multihop
-neighbor 192.168.40.3 timers connect 10
-neighbor 192.168.40.4 remote-as 65004
-neighbor 192.168.40.4 ebgp-multihop
-neighbor 192.168.40.4 timers connect 10
-neighbor 192.168.40.5 remote-as 65005
-neighbor 192.168.40.5 ebgp-multihop
-neighbor 192.168.40.5 timers connect 10
-neighbor 192.168.40.6 remote-as 65006
-neighbor 192.168.40.6 ebgp-multihop
-neighbor 192.168.40.6 timers connect 10
-neighbor 192.168.40.7 remote-as 65007
-neighbor 192.168.40.7 ebgp-multihop
-neighbor 192.168.40.7 timers connect 10
-neighbor 192.168.40.8 remote-as 65008
-neighbor 192.168.40.8 ebgp-multihop
-neighbor 192.168.40.8 timers connect 10
-neighbor 192.168.40.9 remote-as 65009
-neighbor 192.168.40.9 ebgp-multihop
-neighbor 192.168.40.9 timers connect 10
-neighbor 192.168.40.10 remote-as 65010
-neighbor 192.168.40.10 ebgp-multihop
-neighbor 192.168.40.10 timers connect 10
-neighbor 192.168.40.11 remote-as 65011
-neighbor 192.168.40.11 ebgp-multihop
-neighbor 192.168.40.11 timers connect 10
-neighbor 192.168.40.12 remote-as 65012
-neighbor 192.168.40.12 ebgp-multihop
-neighbor 192.168.40.12 timers connect 10
-neighbor 192.168.40.13 remote-as 65013
-neighbor 192.168.40.13 ebgp-multihop
-neighbor 192.168.40.13 timers connect 10
-neighbor 192.168.40.14 remote-as 65014
-neighbor 192.168.40.14 ebgp-multihop
-neighbor 192.168.40.14 timers connect 10
-neighbor 192.168.40.15 remote-as 65015
-neighbor 192.168.40.15 ebgp-multihop
-neighbor 192.168.40.15 timers connect 10
-neighbor 192.168.40.16 remote-as 65016
-neighbor 192.168.40.16 ebgp-multihop
-neighbor 192.168.40.16 timers connect 10
-neighbor 192.168.40.17 remote-as 65017
-neighbor 192.168.40.17 ebgp-multihop
-neighbor 192.168.40.17 timers connect 10
-neighbor 192.168.40.18 remote-as 65018
-neighbor 192.168.40.18 ebgp-multihop
-neighbor 192.168.40.18 timers connect 10
-neighbor 192.168.40.19 remote-as 65019
-neighbor 192.168.40.19 ebgp-multihop
-neighbor 192.168.40.19 timers connect 10
-neighbor 192.168.40.20 remote-as 65020
-neighbor 192.168.40.20 ebgp-multihop
-neighbor 192.168.40.20 timers connect 10
-neighbor 192.168.40.21 remote-as 65021
-neighbor 192.168.40.21 ebgp-multihop
-neighbor 192.168.40.21 timers connect 10
-neighbor 192.168.40.22 remote-as 65022
-neighbor 192.168.40.22 ebgp-multihop
-neighbor 192.168.40.22 timers connect 10
-neighbor 192.168.40.23 remote-as 65023
-neighbor 192.168.40.23 ebgp-multihop
-neighbor 192.168.40.23 timers connect 10
-neighbor 192.168.40.24 remote-as 65024
-neighbor 192.168.40.24 ebgp-multihop
-neighbor 192.168.40.24 timers connect 10
-neighbor 192.168.40.25 remote-as 65025
-neighbor 192.168.40.25 ebgp-multihop
-neighbor 192.168.40.25 timers connect 10
-neighbor 192.168.40.26 remote-as 65026
-neighbor 192.168.40.26 ebgp-multihop
-neighbor 192.168.40.26 timers connect 10
-neighbor 192.168.40.27 remote-as 65027
-neighbor 192.168.40.27 ebgp-multihop
-neighbor 192.168.40.27 timers connect 10
-neighbor 192.168.40.28 remote-as 65028
-neighbor 192.168.40.28 ebgp-multihop
-neighbor 192.168.40.28 timers connect 10
-neighbor 192.168.40.29 remote-as 65029
-neighbor 192.168.40.29 ebgp-multihop
-neighbor 192.168.40.29 timers connect 10
-neighbor 192.168.40.30 remote-as 65030
-neighbor 192.168.40.30 ebgp-multihop
-neighbor 192.168.40.30 timers connect 10
-neighbor 192.168.40.31 remote-as 65031
-neighbor 192.168.40.31 ebgp-multihop
-neighbor 192.168.40.31 timers connect 10
-neighbor 192.168.40.32 remote-as 65032
-neighbor 192.168.40.32 ebgp-multihop
-neighbor 192.168.40.32 timers connect 10
-neighbor 192.168.40.33 remote-as 65033
-neighbor 192.168.40.33 ebgp-multihop
-neighbor 192.168.40.33 timers connect 10
-neighbor 192.168.40.34 remote-as 65034
-neighbor 192.168.40.34 ebgp-multihop
-neighbor 192.168.40.34 timers connect 10
-neighbor 192.168.40.35 remote-as 65035
-neighbor 192.168.40.35 ebgp-multihop
-neighbor 192.168.40.35 timers connect 10
-neighbor 192.168.40.36 remote-as 65036
-neighbor 192.168.40.36 ebgp-multihop
-neighbor 192.168.40.36 timers connect 10
-neighbor 192.168.40.37 remote-as 65037
-neighbor 192.168.40.37 ebgp-multihop
-neighbor 192.168.40.37 timers connect 10
-neighbor 192.168.40.38 remote-as 65038
-neighbor 192.168.40.38 ebgp-multihop
-neighbor 192.168.40.38 timers connect 10
-neighbor 192.168.40.39 remote-as 65039
-neighbor 192.168.40.39 ebgp-multihop
-neighbor 192.168.40.39 timers connect 10
-neighbor 192.168.40.40 remote-as 65040
-neighbor 192.168.40.40 ebgp-multihop
-neighbor 192.168.40.40 timers connect 10
-neighbor 192.168.40.41 remote-as 65041
-neighbor 192.168.40.41 ebgp-multihop
-neighbor 192.168.40.41 timers connect 10
-neighbor 192.168.40.42 remote-as 65042
-neighbor 192.168.40.42 ebgp-multihop
-neighbor 192.168.40.42 timers connect 10
-neighbor 192.168.40.43 remote-as 65043
-neighbor 192.168.40.43 ebgp-multihop
-neighbor 192.168.40.43 timers connect 10
-neighbor 192.168.40.44 remote-as 65044
-neighbor 192.168.40.44 ebgp-multihop
-neighbor 192.168.40.44 timers connect 10
-neighbor 192.168.40.45 remote-as 65045
-neighbor 192.168.40.45 ebgp-multihop
-neighbor 192.168.40.45 timers connect 10
-neighbor 192.168.40.46 remote-as 65046
-neighbor 192.168.40.46 ebgp-multihop
-neighbor 192.168.40.46 timers connect 10
-neighbor 192.168.40.47 remote-as 65047
-neighbor 192.168.40.47 ebgp-multihop
-neighbor 192.168.40.47 timers connect 10
-neighbor 192.168.40.48 remote-as 65048
-neighbor 192.168.40.48 ebgp-multihop
-neighbor 192.168.40.48 timers connect 10
-neighbor 192.168.40.49 remote-as 65049
-neighbor 192.168.40.49 ebgp-multihop
-neighbor 192.168.40.49 timers connect 10
-neighbor 192.168.40.50 remote-as 65050
-neighbor 192.168.40.50 ebgp-multihop
-neighbor 192.168.40.50 timers connect 10
-neighbor 192.168.40.51 remote-as 65051
-neighbor 192.168.40.51 ebgp-multihop
-neighbor 192.168.40.51 timers connect 10
-neighbor 192.168.40.52 remote-as 65052
-neighbor 192.168.40.52 ebgp-multihop
-neighbor 192.168.40.52 timers connect 10
-neighbor 192.168.40.53 remote-as 65053
-neighbor 192.168.40.53 ebgp-multihop
-neighbor 192.168.40.53 timers connect 10
-neighbor 192.168.40.54 remote-as 65054
-neighbor 192.168.40.54 ebgp-multihop
-neighbor 192.168.40.54 timers connect 10
-neighbor 192.168.40.55 remote-as 65055
-neighbor 192.168.40.55 ebgp-multihop
-neighbor 192.168.40.55 timers connect 10
-neighbor 192.168.40.56 remote-as 65056
-neighbor 192.168.40.56 ebgp-multihop
-neighbor 192.168.40.56 timers connect 10
-neighbor 192.168.40.57 remote-as 65057
-neighbor 192.168.40.57 ebgp-multihop
-neighbor 192.168.40.57 timers connect 10
-neighbor 192.168.40.58 remote-as 65058
-neighbor 192.168.40.58 ebgp-multihop
-neighbor 192.168.40.58 timers connect 10
-neighbor 192.168.40.59 remote-as 65059
-neighbor 192.168.40.59 ebgp-multihop
-neighbor 192.168.40.59 timers connect 10
-neighbor 192.168.40.60 remote-as 65060
-neighbor 192.168.40.60 ebgp-multihop
-neighbor 192.168.40.60 timers connect 10
-neighbor 192.168.40.61 remote-as 65061
-neighbor 192.168.40.61 ebgp-multihop
-neighbor 192.168.40.61 timers connect 10
-neighbor 192.168.40.62 remote-as 65062
-neighbor 192.168.40.62 ebgp-multihop
-neighbor 192.168.40.62 timers connect 10
-neighbor 192.168.40.63 remote-as 65063
-neighbor 192.168.40.63 ebgp-multihop
-neighbor 192.168.40.63 timers connect 10
-neighbor 192.168.40.64 remote-as 65064
-neighbor 192.168.40.64 ebgp-multihop
-neighbor 192.168.40.64 timers connect 10
-neighbor 192.168.40.65 remote-as 65065
-neighbor 192.168.40.65 ebgp-multihop
-neighbor 192.168.40.65 timers connect 10
-neighbor 192.168.40.66 remote-as 65066
-neighbor 192.168.40.66 ebgp-multihop
-neighbor 192.168.40.66 timers connect 10
-neighbor 192.168.40.67 remote-as 65067
-neighbor 192.168.40.67 ebgp-multihop
-neighbor 192.168.40.67 timers connect 10
-neighbor 192.168.40.68 remote-as 65068
-neighbor 192.168.40.68 ebgp-multihop
-neighbor 192.168.40.68 timers connect 10
-neighbor 192.168.40.69 remote-as 65069
-neighbor 192.168.40.69 ebgp-multihop
-neighbor 192.168.40.69 timers connect 10
-neighbor 192.168.40.70 remote-as 65070
-neighbor 192.168.40.70 ebgp-multihop
-neighbor 192.168.40.70 timers connect 10
-neighbor 192.168.40.71 remote-as 65071
-neighbor 192.168.40.71 ebgp-multihop
-neighbor 192.168.40.71 timers connect 10
-neighbor 192.168.40.72 remote-as 65072
-neighbor 192.168.40.72 ebgp-multihop
-neighbor 192.168.40.72 timers connect 10
-neighbor 192.168.40.73 remote-as 65073
-neighbor 192.168.40.73 ebgp-multihop
-neighbor 192.168.40.73 timers connect 10
-neighbor 192.168.40.74 remote-as 65074
-neighbor 192.168.40.74 ebgp-multihop
-neighbor 192.168.40.74 timers connect 10
-neighbor 192.168.40.75 remote-as 65075
-neighbor 192.168.40.75 ebgp-multihop
-neighbor 192.168.40.75 timers connect 10
-neighbor 192.168.40.76 remote-as 65076
-neighbor 192.168.40.76 ebgp-multihop
-neighbor 192.168.40.76 timers connect 10
-neighbor 192.168.40.77 remote-as 65077
-neighbor 192.168.40.77 ebgp-multihop
-neighbor 192.168.40.77 timers connect 10
-neighbor 192.168.40.78 remote-as 65078
-neighbor 192.168.40.78 ebgp-multihop
-neighbor 192.168.40.78 timers connect 10
-neighbor 192.168.40.79 remote-as 65079
-neighbor 192.168.40.79 ebgp-multihop
-neighbor 192.168.40.79 timers connect 10
-neighbor 192.168.40.80 remote-as 65080
-neighbor 192.168.40.80 ebgp-multihop
-neighbor 192.168.40.80 timers connect 10
-neighbor 192.168.40.81 remote-as 65081
-neighbor 192.168.40.81 ebgp-multihop
-neighbor 192.168.40.81 timers connect 10
-neighbor 192.168.40.82 remote-as 65082
-neighbor 192.168.40.82 ebgp-multihop
-neighbor 192.168.40.82 timers connect 10
-neighbor 192.168.40.83 remote-as 65083
-neighbor 192.168.40.83 ebgp-multihop
-neighbor 192.168.40.83 timers connect 10
-neighbor 192.168.40.84 remote-as 65084
-neighbor 192.168.40.84 ebgp-multihop
-neighbor 192.168.40.84 timers connect 10
-neighbor 192.168.40.85 remote-as 65085
-neighbor 192.168.40.85 ebgp-multihop
-neighbor 192.168.40.85 timers connect 10
-neighbor 192.168.40.86 remote-as 65086
-neighbor 192.168.40.86 ebgp-multihop
-neighbor 192.168.40.86 timers connect 10
-neighbor 192.168.40.87 remote-as 65087
-neighbor 192.168.40.87 ebgp-multihop
-neighbor 192.168.40.87 timers connect 10
-neighbor 192.168.40.88 remote-as 65088
-neighbor 192.168.40.88 ebgp-multihop
-neighbor 192.168.40.88 timers connect 10
-neighbor 192.168.40.89 remote-as 65089
-neighbor 192.168.40.89 ebgp-multihop
-neighbor 192.168.40.89 timers connect 10
-neighbor 192.168.40.90 remote-as 65090
-neighbor 192.168.40.90 ebgp-multihop
-neighbor 192.168.40.90 timers connect 10
-neighbor 192.168.40.91 remote-as 65091
-neighbor 192.168.40.91 ebgp-multihop
-neighbor 192.168.40.91 timers connect 10
-neighbor 192.168.40.92 remote-as 65092
-neighbor 192.168.40.92 ebgp-multihop
-neighbor 192.168.40.92 timers connect 10
-neighbor 192.168.40.93 remote-as 65093
-neighbor 192.168.40.93 ebgp-multihop
-neighbor 192.168.40.93 timers connect 10
-neighbor 192.168.40.94 remote-as 65094
-neighbor 192.168.40.94 ebgp-multihop
-neighbor 192.168.40.94 timers connect 10
-neighbor 192.168.40.95 remote-as 65095
-neighbor 192.168.40.95 ebgp-multihop
-neighbor 192.168.40.95 timers connect 10
-neighbor 192.168.40.96 remote-as 65096
-neighbor 192.168.40.96 ebgp-multihop
-neighbor 192.168.40.96 timers connect 10
-neighbor 192.168.40.97 remote-as 65097
-neighbor 192.168.40.97 ebgp-multihop
-neighbor 192.168.40.97 timers connect 10
-neighbor 192.168.40.98 remote-as 65098
-neighbor 192.168.40.98 ebgp-multihop
-neighbor 192.168.40.98 timers connect 10
-neighbor 192.168.40.99 remote-as 65099
-neighbor 192.168.40.99 ebgp-multihop
-neighbor 192.168.40.99 timers connect 10
-neighbor 192.168.40.100 remote-as 65100
-neighbor 192.168.40.100 ebgp-multihop
-neighbor 192.168.40.100 timers connect 10
-
- network 172.16.10.0/24
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/SdnIpSingleSwitch/topology/quagga1.conf b/TestON/tests/SdnIpSingleSwitch/topology/quagga1.conf
deleted file mode 100644
index 264f85e..0000000
--- a/TestON/tests/SdnIpSingleSwitch/topology/quagga1.conf
+++ /dev/null
@@ -1,32 +0,0 @@
-!
-! Zebra configuration saved from vty
-! 2014/11/25 11:22:24
-!
-hostname bgpd
-password hello
-log stdout
-!
-router bgp 64514
- bgp router-id 192.168.10.1
-! network 3.0.0.0/24
-! network 3.0.1.0/24
-! network 3.0.2.0/24
-! network 3.0.3.0/24
-! network 3.0.4.0/24
-! network 3.0.5.0/24
-! network 3.0.6.0/24
-! network 3.0.7.0/24
-! network 3.0.8.0/24
-! network 3.0.9.0/24
- neighbor 192.168.20.101 remote-as 64513
- neighbor 192.168.20.101 route-map PREPEND2 in
- neighbor 192.168.20.101 route-map PREPEND2 out
-!
-route-map PREPEND1 permit 1
- set as-path prepend 64514
-!
-route-map PREPEND2 permit 2
- set as-path prepend 64514 64514
-!
-line vty
-!
diff --git a/TestON/tests/SdnIpSingleSwitch/topology/quagga2.conf b/TestON/tests/SdnIpSingleSwitch/topology/quagga2.conf
deleted file mode 100644
index 20ca9e4..0000000
--- a/TestON/tests/SdnIpSingleSwitch/topology/quagga2.conf
+++ /dev/null
@@ -1,31 +0,0 @@
-! -*- bgp -*-
-!
-! BGPd sample configuratin file
-!
-! $Id: bgpd.conf.sample,v 1.1 2002/12/13 20:15:29 paul Exp $
-!
-hostname bgpd
-password hello
-!enable password please-set-at-here
-!
-!bgp mulitple-instance
-!
-router bgp 64516
- bgp router-id 192.168.30.1
-! timers bgp 1 3
- neighbor 192.168.30.101 remote-as 64513
-! neighbor 192.168.50.2 remote-as 65001
-! network 172.16.30.0/24
-! neighbor 10.0.0.2 route-map set-nexthop out
-! neighbor 10.0.0.2 ebgp-multihop
-! neighbor 10.0.0.2 next-hop-self
-!
-! access-list all permit any
-!
-!route-map set-nexthop permit 10
-! match ip address all
-! set ip next-hop 10.0.0.1
-!
-!log file /usr/local/var/log/quagga/bgpd.log
-!
-log stdout
diff --git a/TestON/tests/SdnIpSingleSwitch/topology/zebra.conf b/TestON/tests/SdnIpSingleSwitch/topology/zebra.conf
deleted file mode 100644
index 0f8e3a2..0000000
--- a/TestON/tests/SdnIpSingleSwitch/topology/zebra.conf
+++ /dev/null
@@ -1,26 +0,0 @@
-! -*- zebra -*-
-!
-! zebra sample configuration file
-!
-! $Id: zebra.conf.sample,v 1.1 2002/12/13 20:15:30 paul Exp $
-!
-hostname zebra
-password hello
-enable password 0fw0rk
-log stdout
-!
-! Interfaces description.
-!
-!interface lo
-! description test of desc.
-!
-!interface sit0
-! multicast
-
-!
-! Static default route sample.
-!
-!ip route 0.0.0.0/0 203.181.89.241
-!
-
-!log file /usr/local/var/log/quagga/zebra.log
diff --git a/TestON/tests/SdnIpTest/SdnIpTest.params b/TestON/tests/SdnIpTest/SdnIpTest.params
deleted file mode 100755
index c84af17..0000000
--- a/TestON/tests/SdnIpTest/SdnIpTest.params
+++ /dev/null
@@ -1,27 +0,0 @@
-<PARAMS>
-
- <testcases>100, [4]*5</testcases>
-
- #Environment variables
- <ENV>
- <cellName>sdnip_single_instance</cellName>
- </ENV>
-
- <CTRL>
- <numCtrl>1</numCtrl>
- <ip1>10.128.4.52</ip1>
- <port1>6633</port1>
- </CTRL>
-
- <GIT>
- <autoPull>on</autoPull>
- <branch1>master</branch1>
- <branch2>onos-1.2</branch2>
- </GIT>
-
- <JSON>
- <prefix>prefix</prefix>
- <nextHop>nextHop</nextHop>
- </JSON>
-
-</PARAMS>
diff --git a/TestON/tests/SdnIpTest/SdnIpTest.py b/TestON/tests/SdnIpTest/SdnIpTest.py
deleted file mode 100644
index 43bf580..0000000
--- a/TestON/tests/SdnIpTest/SdnIpTest.py
+++ /dev/null
@@ -1,1469 +0,0 @@
-
-# Testing the functionality of SDN-IP with single ONOS instance
-class SdnIpTest:
-
- def __init__( self ):
- self.default = ''
- global branchName
-
- # This case is to setup ONOS
- def CASE100( self, main ):
- """
- CASE100 is to compile ONOS and push it to the test machines
- Startup sequence:
- git pull
- mvn clean install
- onos-package
- cell <name>
- onos-verify-cell
- onos-install -f
- onos-wait-for-start
- """
- import time
- main.case( "Setting up test environment" )
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
-
- main.step( "Applying cell variable to environment" )
- cellResult = main.ONOSbench.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- branchName = main.ONOSbench.getBranchName()
- main.log.info( "ONOS is on branch: " + branchName )
-
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- cleanInstallResult = main.TRUE
- gitPullResult = main.TRUE
-
- main.step( "Git pull" )
- gitPullResult = main.ONOSbench.gitPull()
-
- main.step( "Using mvn clean & install" )
- cleanInstallResult = main.TRUE
-# if gitPullResult == main.TRUE:
-# cleanInstallResult = main.ONOSbench.cleanInstall()
-# else:
-# main.log.warn( "Did not pull new code so skipping mvn " +
-# "clean install" )
- cleanInstallResult = main.ONOSbench.cleanInstall( mciTimeout= 1000 )
- main.ONOSbench.getVersion( report=True )
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage( opTimeout=500 )
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
- node=ONOS1Ip )
-
- main.step( "Checking if ONOS is up yet" )
- for i in range( 2 ):
- onos1Isup = main.ONOSbench.isup( ONOS1Ip, timeout=420 )
- if onos1Isup:
- break
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- cliResult = main.ONOScli.startOnosCli( ONOS1Ip,
- commandlineTimeout=100, onosStartTimeout=600)
-
- case1Result = ( cleanInstallResult and packageResult and
- cellResult and verifyResult and
- onos1InstallResult and
- onos1Isup and cliResult )
-
- utilities.assert_equals( expect=main.TRUE, actual=case1Result,
- onpass="ONOS startup successful",
- onfail="ONOS startup NOT successful" )
-
- if case1Result == main.FALSE:
- main.cleanup()
- main.exit()
-
- def CASE4( self, main ):
- """
- Test the SDN-IP functionality
- allRoutesExpected: all expected routes for all BGP peers
- routeIntentsExpected: all expected MultiPointToSinglePointIntent \
- intents
- bgpIntentsExpected: expected PointToPointIntent intents
- allRoutesActual: all routes from ONOS LCI
- routeIntentsActual: actual MultiPointToSinglePointIntent intents from \
- ONOS CLI
- bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
- """
- import time
- import json
- from operator import eq
- from time import localtime, strftime
-
- main.case("This case is to testing the functionality of SDN-IP with \
- single ONOS instance" )
- SDNIPJSONFILEPATH = \
- "/home/admin/ONOS/tools/package/config/sdnip.json"
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
- main.log.info( "Generate prefixes for host3" )
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host5" )
- prefixesHost5 = main.QuaggaCliHost5.generatePrefixes( 5, 10 )
- main.log.info( prefixesHost5 )
- for prefix in prefixesHost5:
- allRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- routeIntentsExpectedHost5 = \
- main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
- prefixesHost5, "192.168.60.1", "00:00:00:00:06:02",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4 + routeIntentsExpectedHost5
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Activate sdn-ip application" )
- main.ONOScli.activateApp( "org.onosproject.sdnip" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
-
- main.log.info( "Login Quagga CLI on host5" )
- main.QuaggaCliHost5.loginQuagga( "1.168.30.5" )
- main.log.info( "Enter configuration model of Quagga CLI on host5" )
- main.QuaggaCliHost5.enterConfig( 64521 )
- main.log.info( "Add routes to Quagga on host5" )
- main.QuaggaCliHost5.addRoutes( prefixesHost5, 1 )
-
- for i in range( 101, 201 ):
- prefixesHostX = main.QuaggaCliHost.generatePrefixes( str( i ), 10 )
- main.log.info( prefixesHostX )
- for prefix in prefixesHostX:
- allRoutesExpected.append( prefix + "/" + "192.168.40."
- + str( i - 100 ) )
-
- routeIntentsExpectedHostX = \
- main.QuaggaCliHost.generateExpectedOnePeerRouteIntents(
- prefixesHostX, "192.168.40." + str( i - 100 ),
- "00:00:%02d:00:00:90" % ( i - 101 ), SDNIPJSONFILEPATH )
- routeIntentsExpected = routeIntentsExpected + \
- routeIntentsExpectedHostX
-
- main.log.info( "Login Quagga CLI on host" + str( i ) )
- QuaggaCliHostX = getattr( main, ( 'QuaggaCliHost' + str( i ) ) )
- QuaggaCliHostX.loginQuagga( "1.168.30." + str( i ) )
- main.log.info(
- "Enter configuration model of Quagga CLI on host" + str( i ) )
- QuaggaCliHostX.enterConfig( 65000 + i - 100 )
- main.log.info( "Add routes to Quagga on host" + str( i ) )
- QuaggaCliHostX.addRoutes( prefixesHostX, 1 )
-
- time.sleep( 60 )
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutesMaster( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- time.sleep( 20 )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
-
- main.step( "Check MultiPointToSinglePointIntent intents installed" )
- # routeIntentsExpected are generated when generating routes
- # get route intents from ONOS CLI
- routeIntentsActualNum = \
- main.QuaggaCliHost3.extractActualRouteIntentNum( getIntentsResult )
- routeIntentsExpectedNum = 1030
- main.log.info( "MultiPointToSinglePoint Intent Num expected is:" )
- main.log.info( routeIntentsExpectedNum )
- main.log.info( "MultiPointToSinglePoint Intent NUM Actual is:" )
- main.log.info( routeIntentsActualNum )
- utilities.assertEquals(
- expect=True,
- actual=eq( routeIntentsExpectedNum, routeIntentsActualNum ),
- onpass="***MultiPointToSinglePoint Intent Num in SDN-IP is \
- correct!***",
- onfail="***MultiPointToSinglePoint Intent Num in SDN-IP is \
- wrong!***" )
-
- if( eq( routeIntentsExpectedNum, routeIntentsActualNum ) ):
- main.log.report( "***MultiPointToSinglePoint Intents before \
- deleting routes correct!***" )
- else:
- main.log.report( "***MultiPointToSinglePoint Intents before \
- deleting routes wrong!***" )
-
- main.step( "Check BGP PointToPointIntent intents installed" )
-
- bgpIntentsActualNum = \
- main.QuaggaCliHost3.extractActualBgpIntentNum( getIntentsResult )
- bgpIntentsExpectedNum = 624
- main.log.info( "bgpIntentsExpected num is:" )
- main.log.info( bgpIntentsExpectedNum )
- main.log.info( "bgpIntentsActual num is:" )
- main.log.info( bgpIntentsActualNum)
- utilities.assertEquals(
- expect=True,
- actual=eq( bgpIntentsExpectedNum, bgpIntentsActualNum ),
- onpass="***PointToPointIntent Intent Num in SDN-IP are correct!***",
- onfail="***PointToPointIntent Intent Num in SDN-IP are wrong!***" )
- if ( eq( bgpIntentsExpectedNum, bgpIntentsActualNum ) ):
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are correct!***" )
- else:
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- #============================= Ping Test ========================
- # Wait until all MultiPointToSinglePoint intents are in system
- time.sleep( 20 )
- pingTestScript = "~/SDNIP/test-tools/CASE4-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE4-ping-results-before-delete-routes-"\
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- time.sleep( 20 )
-
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
- main.QuaggaCliHost5.deleteRoutes( prefixesHost5, 1 )
-
- for i in range( 101, 201 ):
- prefixesHostX = main.QuaggaCliHost.generatePrefixes( str( i ), 10 )
- main.log.info( prefixesHostX )
- QuaggaCliHostX = getattr( main, ( 'QuaggaCliHost' + str( i ) ) )
- QuaggaCliHostX.deleteRoutes( prefixesHostX, 1 )
-
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutesMaster( getRoutesResult )
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report( "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
-
- main.step( "Check intents after deleting routes" )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
- routeIntentsActualNum = \
- main.QuaggaCliHost3.extractActualRouteIntentNum(
- getIntentsResult )
- main.log.info( "route Intents Actual Num is: " )
- main.log.info( routeIntentsActualNum )
- utilities.assertEquals(
- expect=0, actual=routeIntentsActualNum,
- onpass="***MultiPointToSinglePoint Intent Num in SDN-IP is 0, \
- correct!***",
- onfail="***MultiPointToSinglePoint Intent Num in SDN-IP is not 0, \
- wrong!***" )
-
- if( eq( 0, routeIntentsActualNum ) ):
- main.log.report( "***MultiPointToSinglePoint Intents after \
- deleting routes correct!***" )
- else:
- main.log.report( "***MultiPointToSinglePoint Intents after \
- deleting routes wrong!***" )
-
- time.sleep( 20 )
- pingTestScript = "~/SDNIP/test-tools/CASE4-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE4-ping-results-after-delete-routes-"\
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- time.sleep( 100 )
-
- def CASE_4_origin( self, main ):
- """
- Test the SDN-IP functionality
- allRoutesExpected: all expected routes for all BGP peers
- routeIntentsExpected: all expected MultiPointToSinglePointIntent \
- intents
- bgpIntentsExpected: expected PointToPointIntent intents
- allRoutesActual: all routes from ONOS LCI
- routeIntentsActual: actual MultiPointToSinglePointIntent intents from \
- ONOS CLI
- bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
- """
- import time
- import json
- from operator import eq
- from time import localtime, strftime
-
- main.case("This case is to testing the functionality of SDN-IP with \
- single ONOS instance" )
- SDNIPJSONFILEPATH = \
- "/home/admin/ONOS/tools/package/config/sdnip.json"
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
- main.log.info( "Generate prefixes for host3" )
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host5" )
- prefixesHost5 = main.QuaggaCliHost5.generatePrefixes( 5, 10 )
- main.log.info( prefixesHost5 )
- for prefix in prefixesHost5:
- allRoutesExpected.append( prefix + "/" + "192.168.60.2" )
- routeIntentsExpectedHost5 = \
- main.QuaggaCliHost5.generateExpectedOnePeerRouteIntents(
- prefixesHost5, "192.168.60.1", "00:00:00:00:06:02",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4 + routeIntentsExpectedHost5
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- if branchName == "onos-1.1":
- main.log.info( "Installing sdn-ip feature" )
- main.ONOScli.featureInstall( "onos-app-sdnip" )
- else:
- main.log.info( "Activate sdn-ip application" )
- main.ONOScli.activateApp( "org.onosproject.sdnip" )
- #main.log.info( "Installing sdn-ip feature" )
- #main.ONOScli.featureInstall( "onos-app-sdnip" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
-
- main.log.info( "Login Quagga CLI on host5" )
- main.QuaggaCliHost5.loginQuagga( "1.168.30.5" )
- main.log.info( "Enter configuration model of Quagga CLI on host5" )
- main.QuaggaCliHost5.enterConfig( 64521 )
- main.log.info( "Add routes to Quagga on host5" )
- main.QuaggaCliHost5.addRoutes( prefixesHost5, 1 )
-
- for i in range( 101, 201 ):
- prefixesHostX = main.QuaggaCliHost.generatePrefixes( str( i ), 10 )
- main.log.info( prefixesHostX )
- for prefix in prefixesHostX:
- allRoutesExpected.append( prefix + "/" + "192.168.40."
- + str( i - 100 ) )
-
- routeIntentsExpectedHostX = \
- main.QuaggaCliHost.generateExpectedOnePeerRouteIntents(
- prefixesHostX, "192.168.40." + str( i - 100 ),
- "00:00:%02d:00:00:90" % ( i - 101 ), SDNIPJSONFILEPATH )
- routeIntentsExpected = routeIntentsExpected + \
- routeIntentsExpectedHostX
-
- main.log.info( "Login Quagga CLI on host" + str( i ) )
- QuaggaCliHostX = getattr( main, ( 'QuaggaCliHost' + str( i ) ) )
- QuaggaCliHostX.loginQuagga( "1.168.30." + str( i ) )
- main.log.info(
- "Enter configuration model of Quagga CLI on host" + str( i ) )
- QuaggaCliHostX.enterConfig( 65000 + i - 100 )
- main.log.info( "Add routes to Quagga on host" + str( i ) )
- QuaggaCliHostX.addRoutes( prefixesHostX, 1 )
-
- time.sleep( 60 )
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- #if branchName == "master":
- # allRoutesActual = \
- # main.QuaggaCliHost3.extractActualRoutesMaster( getRoutesResult )
- #elif branchName == "onos-1.0":
- # allRoutesActual = \
- # main.QuaggaCliHost3.extractActualRoutesOneDotZero( getRoutesResult )
- #else:
- # main.log("ONOS is on wrong branch")
- # exit
-
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutesMaster( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- time.sleep( 20 )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
-
- main.step( "Check MultiPointToSinglePointIntent intents installed" )
- # routeIntentsExpected are generated when generating routes
- # get route intents from ONOS CLI
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
- routeIntentsStrActual = str( routeIntentsActual ).replace( 'u', "" )
- main.log.info( "MultiPointToSinglePoint intents expected:" )
- main.log.info( routeIntentsStrExpected )
- main.log.info( "MultiPointToSinglePoint intents get from ONOS CLI:" )
- main.log.info( routeIntentsStrActual )
- utilities.assertEquals(
- expect=True,
- actual=eq( routeIntentsStrExpected, routeIntentsStrActual ),
- onpass="***MultiPointToSinglePoint Intents in SDN-IP are \
- correct!***",
- onfail="***MultiPointToSinglePoint Intents in SDN-IP are \
- wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report( "***MultiPointToSinglePoint Intents before \
- deleting routes correct!***" )
- else:
- main.log.report( "***MultiPointToSinglePoint Intents before \
- deleting routes wrong!***" )
-
- main.step( "Check BGP PointToPointIntent intents installed" )
- # bgp intents expected
- bgpIntentsExpected = \
- main.QuaggaCliHost3.generateExpectedBgpIntents( SDNIPJSONFILEPATH )
- # get BGP intents from ONOS CLI
- bgpIntentsActual = \
- main.QuaggaCliHost3.extractActualBgpIntents( getIntentsResult )
-
- bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
- bgpIntentsStrActual = str( bgpIntentsActual )
- main.log.info( "PointToPointIntent intents expected:" )
- main.log.info( bgpIntentsStrExpected )
- main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
- main.log.info( bgpIntentsStrActual )
-
- utilities.assertEquals(
- expect=True,
- actual=eq( bgpIntentsStrExpected, bgpIntentsStrActual ),
- onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
- onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are correct!***" )
- else:
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- #============================= Ping Test ========================
- # Wait until all MultiPointToSinglePoint intents are in system
- time.sleep( 20 )
- pingTestScript = "~/SDNIP/test-tools/CASE4-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE4-ping-results-before-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- time.sleep( 20 )
-
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
- main.QuaggaCliHost5.deleteRoutes( prefixesHost5, 1 )
-
- for i in range( 101, 201 ):
- prefixesHostX = main.QuaggaCliHost.generatePrefixes( str( i ), 10 )
- main.log.info( prefixesHostX )
- QuaggaCliHostX = getattr( main, ( 'QuaggaCliHost' + str( i ) ) )
- QuaggaCliHostX.deleteRoutes( prefixesHostX, 1 )
-
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report( "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report( "***Routes in SDN-IP after deleting wrong!***" )
-
- main.step( "Check intents after deleting routes" )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- main.log.info( "main.ONOScli.intents()= " )
- main.log.info( routeIntentsActual )
- utilities.assertEquals(
- expect="[]", actual=str( routeIntentsActual ),
- onpass="***MultiPointToSinglePoint Intents number in SDN-IP is 0, \
- correct!***",
- onfail="***MultiPointToSinglePoint Intents number in SDN-IP is 0, \
- wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report( "***MultiPointToSinglePoint Intents after \
- deleting routes correct!***" )
- else:
- main.log.report( "***MultiPointToSinglePoint Intents after \
- deleting routes wrong!***" )
-
- time.sleep( 20 )
- pingTestScript = "~/SDNIP/test-tools/CASE4-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE4-ping-results-after-delete-routes-"\
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- time.sleep( 100 )
-
- def CASE3( self, main ):
- """
- Test the SDN-IP functionality
- allRoutesExpected: all expected routes for all BGP peers
- routeIntentsExpected: all expected MultiPointToSinglePointIntent \
- intents
- bgpIntentsExpected: expected PointToPointIntent intents
- allRoutesActual: all routes from ONOS LCI
- routeIntentsActual: actual MultiPointToSinglePointIntent intents from \
- ONOS CLI
- bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
- """
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- main.case( "The test case is to help to setup the TestON \
- environment and test new drivers" )
- # SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
- SDNIPJSONFILEPATH = \
- "/home/admin/ONOS/tools/package/config/sdnip.json"
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
- main.log.info( "Generate prefixes for host3" )
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f", node=ONOS1Ip )
-
- main.step( "Checking if ONOS is up yet" )
- time.sleep( 60 )
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- main.step( "Start ONOS-cli" )
-
- main.ONOScli.startOnosCli( ONOS1Ip )
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- if branchName == "onos-1.1":
- main.log.info( "Installing sdn-ip feature" )
- main.ONOScli.featureInstall( "onos-app-sdnip" )
- else:
- main.log.info( "Activate sdn-ip application" )
- main.ONOScli.activateApp( "org.onosproject.sdnip" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
-
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
-
- for i in range( 101, 201 ):
- prefixesHostX = \
- main.QuaggaCliHost.generatePrefixes( str( i ), 10 )
- main.log.info( prefixesHostX )
- for prefix in prefixesHostX:
- allRoutesExpected.append(
- prefix + "/" + "192.168.40." + str( i - 100 ) )
-
- routeIntentsExpectedHostX = \
- main.QuaggaCliHost.generateExpectedOnePeerRouteIntents(
- prefixesHostX, "192.168.40." + str( i - 100 ),
- "00:00:%02d:00:00:90" % ( i - 101 ), SDNIPJSONFILEPATH )
- routeIntentsExpected = routeIntentsExpected + \
- routeIntentsExpectedHostX
-
- main.log.info( "Login Quagga CLI on host" + str( i ) )
- QuaggaCliHostX = getattr( main, ( 'QuaggaCliHost' + str( i ) ) )
- QuaggaCliHostX.loginQuagga( "1.168.30." + str( i ) )
- main.log.info(
- "Enter configuration model of Quagga CLI on host" + str( i ) )
- QuaggaCliHostX.enterConfig( 65000 + i - 100 )
- main.log.info( "Add routes to Quagga on host" + str( i ) )
- QuaggaCliHostX.addRoutes( prefixesHostX, 1 )
-
- time.sleep( 60 )
-
- # get routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- time.sleep( 20 )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
-
- main.step( "Check MultiPointToSinglePointIntent intents installed" )
- # routeIntentsExpected are generated when generating routes
- # get rpoute intents from ONOS CLI
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
- routeIntentsStrActual = str( routeIntentsActual ).replace( 'u', "" )
- main.log.info( "MultiPointToSinglePoint intents expected:" )
- main.log.info( routeIntentsStrExpected )
- main.log.info( "MultiPointToSinglePoint intents get from ONOS CLI:" )
- main.log.info( routeIntentsStrActual )
- utilities.assertEquals(
- expect=True,
- actual=eq( routeIntentsStrExpected, routeIntentsStrActual ),
- onpass="***MultiPointToSinglePoint Intents in SDN-IP are \
- correct!***",
- onfail="***MultiPointToSinglePoint Intents in SDN-IP are \
- wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report(
- "***MultiPointToSinglePoint Intents before deleting routes \
- correct!***" )
- else:
- main.log.report(
- "***MultiPointToSinglePoint Intents before deleting routes \
- wrong!***" )
-
- main.step( "Check BGP PointToPointIntent intents installed" )
- # bgp intents expected
- bgpIntentsExpected = main.QuaggaCliHost3.generateExpectedBgpIntents(
- SDNIPJSONFILEPATH )
- # get BGP intents from ONOS CLI
- bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents(
- getIntentsResult )
-
- bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
- bgpIntentsStrActual = str( bgpIntentsActual )
- main.log.info( "PointToPointIntent intents expected:" )
- main.log.info( bgpIntentsStrExpected )
- main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
- main.log.info( bgpIntentsStrActual )
-
- utilities.assertEquals(
- expect=True,
- actual=eq( bgpIntentsStrExpected, bgpIntentsStrActual ),
- onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
- onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are correct!***" )
- else:
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- #============================= Ping Test ========================
- # wait until all MultiPointToSinglePoint
- time.sleep( 20 )
- pingTestScript = "~/SDNIP/test-tools/CASE3-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE3-ping-results-before-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- time.sleep( 20 )
-
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
- for i in range( 101, 201 ):
- prefixesHostX = \
- main.QuaggaCliHost.generatePrefixes( str( i ), 10 )
- main.log.info( prefixesHostX )
- QuaggaCliHostX = getattr( main, ( 'QuaggaCliHost' + str( i ) ) )
- QuaggaCliHostX.deleteRoutes( prefixesHostX, 1 )
-
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = main.QuaggaCliHost3.extractActualRoutes(
- getRoutesResult )
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after deleting wrong!***" )
-
- main.step( "Check intents after deleting routes" )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- main.log.info( "main.ONOScli.intents()= " )
- main.log.info( routeIntentsActual )
- utilities.assertEquals(
- expect="[]", actual=str( routeIntentsActual ),
- onpass="***MultiPointToSinglePoint Intents number in SDN-IP is \
- 0, correct!***",
- onfail="***MultiPointToSinglePoint Intents number in SDN-IP is \
- 0, wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report(
- "***MultiPointToSinglePoint Intents after deleting routes \
- correct!***" )
- else:
- main.log.report(
- "***MultiPointToSinglePoint Intents after deleting routes \
- wrong!***" )
-
- time.sleep( 20 )
- pingTestScript = "~/SDNIP/test-tools/CASE3-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE3-ping-results-after-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- time.sleep( 100 )
-
- # main.step( "Test whether Mininet is started" )
- # main.Mininet2.handle.sendline( "xterm host1" )
- # main.Mininet2.handle.expect( "mininet>" )
-
- def CASE1( self, main ):
- """
- Test the SDN-IP functionality
- allRoutesExpected: all expected routes for all BGP peers
- routeIntentsExpected: all expected MultiPointToSinglePointIntent \
- intents
- bgpIntentsExpected: expected PointToPointIntent intents
- allRoutesActual: all routes from ONOS LCI
- routeIntentsActual: actual MultiPointToSinglePointIntent intents \
- from ONOS CLI
- bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
- """
- import time
- import json
- from operator import eq
- # from datetime import datetime
- from time import localtime, strftime
-
- main.case("The test case is to help to setup the TestON environment \
- and test new drivers" )
- SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
- # bgpPeerHosts = []
- # for i in range( 3, 5 ):
- # bgpPeerHosts.append( "host" + str( i ) )
- # main.log.info( "BGP Peer Hosts are:" + bgpPeerHosts )
-
- # for i in range( 3, 5 ):
- # QuaggaCliHost = "QuaggaCliHost" + str( i )
- # prefixes = main.QuaggaCliHost.generatePrefixes( 3, 10 )
-
- # main.log.info( prefixes )
- # allRoutesExpected.append( prefixes )
- main.log.info( "Generate prefixes for host3" )
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Starting ONOS service" )
- # TODO: start ONOS from Mininet Script
- # startResult = main.ONOSbench.onosStart( "127.0.0.1" )
- main.step( "Installing ONOS package" )
- onos1InstallResult = main.ONOSbench.onosInstall(
- options="-f", node=ONOS1Ip )
-
- main.step( "Checking if ONOS is up yet" )
- time.sleep( 60 )
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- main.step( "Start ONOS-cli" )
- # TODO: change the hardcode in startOnosCli method in ONOS CLI driver
-
- main.ONOScli.startOnosCli( ONOS1Ip )
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing sdn-ip feature" )
- main.ONOScli.featureInstall( "onos-app-sdnip" )
- time.sleep( 10 )
- main.step( "Login all BGP peers and add routes into peers" )
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info( "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info( "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
- time.sleep( 60 )
-
- # get all routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding routes are correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding routes are wrong!***" )
-
- time.sleep( 20 )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
-
- main.step( "Check MultiPointToSinglePointIntent intents installed" )
- # routeIntentsExpected are generated when generating routes
- # get rpoute intents from ONOS CLI
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
- routeIntentsStrActual = str( routeIntentsActual ).replace( 'u', "" )
- main.log.info( "MultiPointToSinglePoint intents expected:" )
- main.log.info( routeIntentsStrExpected )
- main.log.info( "MultiPointToSinglePoint intents get from ONOS CLI:" )
- main.log.info( routeIntentsStrActual )
- utilities.assertEquals(
- expect=True,
- actual=eq( routeIntentsStrExpected, routeIntentsStrActual ),
- onpass="***MultiPointToSinglePoint Intents in SDN-IP are \
- correct!***",
- onfail="***MultiPointToSinglePoint Intents in SDN-IP are \
- wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report(
- "***MultiPointToSinglePoint Intents before deleting routes \
- correct!***" )
- else:
- main.log.report(
- "***MultiPointToSinglePoint Intents before deleting routes \
- wrong!***" )
-
- main.step( "Check BGP PointToPointIntent intents installed" )
- # bgp intents expected
- bgpIntentsExpected = \
- main.QuaggaCliHost3.generateExpectedBgpIntents( SDNIPJSONFILEPATH )
- # get BGP intents from ONOS CLI
- bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents(
- getIntentsResult )
-
- bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
- bgpIntentsStrActual = str( bgpIntentsActual )
- main.log.info( "PointToPointIntent intents expected:" )
- main.log.info( bgpIntentsStrExpected )
- main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
- main.log.info( bgpIntentsStrActual )
-
- utilities.assertEquals(
- expect=True,
- actual=eq( bgpIntentsStrExpected, bgpIntentsStrActual ),
- onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
- onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are correct!***" )
- else:
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- #============================= Ping Test ========================
- # wait until all MultiPointToSinglePoint
- time.sleep( 20 )
- pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE1-ping-results-before-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
-
- # ping test
-
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
-
- # main.log.info( "main.ONOScli.get_routes_num() = " )
- # main.log.info( main.ONOScli.getRoutesNum() )
- # utilities.assertEquals( expect="Total SDN-IP routes = 1", actual=
- # main.ONOScli.getRoutesNum(),
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after deleting wrong!***" )
-
- main.step( "Check intents after deleting routes" )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- main.log.info( "main.ONOScli.intents()= " )
- main.log.info( routeIntentsActual )
- utilities.assertEquals(
- expect="[]", actual=str( routeIntentsActual ),
- onpass="***MultiPointToSinglePoint Intents number in SDN-IP is \
- 0, correct!***",
- onfail="***MultiPointToSinglePoint Intents number in SDN-IP is \
- 0, wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report(
- "***MultiPointToSinglePoint Intents after deleting routes \
- correct!***" )
- else:
- main.log.report(
- "***MultiPointToSinglePoint Intents after deleting routes \
- wrong!***" )
-
- time.sleep( 20 )
- pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE1-ping-results-after-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- time.sleep( 30 )
-
- # main.step( "Test whether Mininet is started" )
- # main.Mininet2.handle.sendline( "xterm host1" )
- # main.Mininet2.handle.expect( "mininet>" )
-
- def CASE2( self, main ):
- """
- Test the SDN-IP functionality
- allRoutesExpected: all expected routes for all BGP peers
- routeIntentsExpected: all expected MultiPointToSinglePointIntent \
- intents
- bgpIntentsExpected: expected PointToPointIntent intents
- allRoutesActual: all routes from ONOS LCI
- routeIntentsActual: actual MultiPointToSinglePointIntent intents \
- from ONOS CLI
- bgpIntentsActual: actual PointToPointIntent intents from ONOS CLI
- """
- import time
- import json
- from operator import eq
- from time import localtime, strftime
-
- main.case(
- "The test case is to help to setup the TestON environment and \
- test new drivers" )
- SDNIPJSONFILEPATH = "../tests/SdnIpTest/sdnip.json"
- # all expected routes for all BGP peers
- allRoutesExpected = []
- main.step( "Start to generate routes for all BGP peers" )
-
- main.log.info( "Generate prefixes for host3" )
- prefixesHost3 = main.QuaggaCliHost3.generatePrefixes( 3, 10 )
- main.log.info( prefixesHost3 )
- # generate route with next hop
- for prefix in prefixesHost3:
- allRoutesExpected.append( prefix + "/" + "192.168.20.1" )
- routeIntentsExpectedHost3 = \
- main.QuaggaCliHost3.generateExpectedOnePeerRouteIntents(
- prefixesHost3, "192.168.20.1", "00:00:00:00:02:02",
- SDNIPJSONFILEPATH )
-
- main.log.info( "Generate prefixes for host4" )
- prefixesHost4 = main.QuaggaCliHost4.generatePrefixes( 4, 10 )
- main.log.info( prefixesHost4 )
- # generate route with next hop
- for prefix in prefixesHost4:
- allRoutesExpected.append( prefix + "/" + "192.168.30.1" )
- routeIntentsExpectedHost4 = \
- main.QuaggaCliHost4.generateExpectedOnePeerRouteIntents(
- prefixesHost4, "192.168.30.1", "00:00:00:00:03:01",
- SDNIPJSONFILEPATH )
-
- routeIntentsExpected = routeIntentsExpectedHost3 + \
- routeIntentsExpectedHost4
-
- main.log.report( "Removing raft logs" )
- main.ONOSbench.onosRemoveRaftLogs()
- main.log.report( "Uninstalling ONOS" )
- main.ONOSbench.onosUninstall( ONOS1Ip )
-
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- ONOS1Ip = main.params[ 'CTRL' ][ 'ip1' ]
- main.step( "Set cell for ONOS-cli environment" )
- main.ONOScli.setCell( cellName )
- verifyResult = main.ONOSbench.verifyCell()
- # main.log.report( "Removing raft logs" )
- # main.ONOSbench.onosRemoveRaftLogs()
- # main.log.report( "Uninstalling ONOS" )
- # main.ONOSbench.onosUninstall( ONOS1Ip )
- main.step( "Creating ONOS package" )
- # packageResult = main.ONOSbench.onosPackage()
-
- main.step( "Installing ONOS package" )
- # onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
- # node=ONOS1Ip )
-
- main.step( "Checking if ONOS is up yet" )
- # time.sleep( 60 )
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
- if not onos1Isup:
- main.log.report( "ONOS1 didn't start!" )
-
- main.step( "Start ONOS-cli" )
- main.ONOScli.startOnosCli( ONOS1Ip )
-
- main.step( "Get devices in the network" )
- listResult = main.ONOScli.devices( jsonFormat=False )
- main.log.info( listResult )
- time.sleep( 10 )
- main.log.info( "Installing sdn-ip feature" )
- main.ONOScli.featureInstall( "onos-app-sdnip" )
- time.sleep( 10 )
-
- main.step( "Check BGP PointToPointIntent intents installed" )
- # bgp intents expected
- bgpIntentsExpected = main.QuaggaCliHost3.generateExpectedBgpIntents(
- SDNIPJSONFILEPATH )
- # get BGP intents from ONOS CLI
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
- bgpIntentsActual = main.QuaggaCliHost3.extractActualBgpIntents(
- getIntentsResult )
-
- bgpIntentsStrExpected = str( bgpIntentsExpected ).replace( 'u', "" )
- bgpIntentsStrActual = str( bgpIntentsActual )
- main.log.info( "PointToPointIntent intents expected:" )
- main.log.info( bgpIntentsStrExpected )
- main.log.info( "PointToPointIntent intents get from ONOS CLI:" )
- main.log.info( bgpIntentsStrActual )
-
- utilities.assertEquals(
- expect=True,
- actual=eq( bgpIntentsStrExpected, bgpIntentsStrActual ),
- onpass="***PointToPointIntent Intents in SDN-IP are correct!***",
- onfail="***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- if ( eq( bgpIntentsStrExpected, bgpIntentsStrActual ) ):
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are correct!***" )
- else:
- main.log.report(
- "***PointToPointIntent Intents in SDN-IP are wrong!***" )
-
- allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
- pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
- # roundNum = 0;
- # while( True ):
- for roundNum in range( 1, 6 ):
- # round = round + 1;
- main.log.report( "The Round " + str( roundNum ) +
- " test starts................................" )
-
- main.step( "Login all BGP peers and add routes into peers" )
- main.log.info( "Login Quagga CLI on host3" )
- main.QuaggaCliHost3.loginQuagga( "1.168.30.2" )
- main.log.info(
- "Enter configuration model of Quagga CLI on host3" )
- main.QuaggaCliHost3.enterConfig( 64514 )
- main.log.info( "Add routes to Quagga on host3" )
- main.QuaggaCliHost3.addRoutes( prefixesHost3, 1 )
-
- main.log.info( "Login Quagga CLI on host4" )
- main.QuaggaCliHost4.loginQuagga( "1.168.30.3" )
- main.log.info(
- "Enter configuration model of Quagga CLI on host4" )
- main.QuaggaCliHost4.enterConfig( 64516 )
- main.log.info( "Add routes to Quagga on host4" )
- main.QuaggaCliHost4.addRoutes( prefixesHost4, 1 )
- time.sleep( 60 )
-
- # get all routes inside SDN-IP
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
-
- # parse routes from ONOS CLI
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
-
- # allRoutesStrExpected = str( sorted( allRoutesExpected ) )
- allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
- main.step( "Check routes installed" )
- main.log.info( "Routes expected:" )
- main.log.info( allRoutesStrExpected )
- main.log.info( "Routes get from ONOS CLI:" )
- main.log.info( allRoutesStrActual )
- utilities.assertEquals(
- expect=allRoutesStrExpected, actual=allRoutesStrActual,
- onpass="***Routes in SDN-IP are correct!***",
- onfail="***Routes in SDN-IP are wrong!***" )
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after adding correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after adding wrong!***" )
-
- time.sleep( 20 )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
-
- main.step(
- "Check MultiPointToSinglePointIntent intents installed" )
- # routeIntentsExpected are generated when generating routes
- # get route intents from ONOS CLI
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- # routeIntentsStrExpected = str( sorted( routeIntentsExpected ) )
- routeIntentsStrActual = str(
- routeIntentsActual ).replace( 'u', "" )
- main.log.info( "MultiPointToSinglePoint intents expected:" )
- main.log.info( routeIntentsStrExpected )
- main.log.info(
- "MultiPointToSinglePoint intents get from ONOS CLI:" )
- main.log.info( routeIntentsStrActual )
- utilities.assertEquals(
- expect=True,
- actual=eq( routeIntentsStrExpected, routeIntentsStrActual ),
- onpass="***MultiPointToSinglePoint Intents in SDN-IP are \
- correct!***",
- onfail="***MultiPointToSinglePoint Intents in SDN-IP are \
- wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report(
- "***MultiPointToSinglePoint Intents after adding routes \
- correct!***" )
- else:
- main.log.report(
- "***MultiPointToSinglePoint Intents after adding routes \
- wrong!***" )
-
- #============================= Ping Test ========================
- # wait until all MultiPointToSinglePoint
- time.sleep( 20 )
- # pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE2-Round" \
- + str( roundNum ) + "-ping-results-before-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- # ping test
-
- #============================= Deleting Routes ==================
- main.step( "Check deleting routes installed" )
- main.log.info( "Delete routes to Quagga on host3" )
- main.QuaggaCliHost3.deleteRoutes( prefixesHost3, 1 )
- main.log.info( "Delete routes to Quagga on host4" )
- main.QuaggaCliHost4.deleteRoutes( prefixesHost4, 1 )
-
- getRoutesResult = main.ONOScli.routes( jsonFormat=True )
- allRoutesActual = \
- main.QuaggaCliHost3.extractActualRoutes( getRoutesResult )
- main.log.info( "allRoutes_actual = " )
- main.log.info( allRoutesActual )
-
- utilities.assertEquals(
- expect="[]", actual=str( allRoutesActual ),
- onpass="***Route number in SDN-IP is 0, correct!***",
- onfail="***Routes number in SDN-IP is not 0, wrong!***" )
-
- if( eq( allRoutesStrExpected, allRoutesStrActual ) ):
- main.log.report(
- "***Routes in SDN-IP after deleting correct!***" )
- else:
- main.log.report(
- "***Routes in SDN-IP after deleting wrong!***" )
-
- main.step( "Check intents after deleting routes" )
- getIntentsResult = main.ONOScli.intents( jsonFormat=True )
- routeIntentsActual = \
- main.QuaggaCliHost3.extractActualRouteIntents(
- getIntentsResult )
- main.log.info( "main.ONOScli.intents()= " )
- main.log.info( routeIntentsActual )
- utilities.assertEquals(
- expect="[]", actual=str( routeIntentsActual ),
- onpass=
- "***MultiPointToSinglePoint Intents number in SDN-IP \
- is 0, correct!***",
- onfail="***MultiPointToSinglePoint Intents number in SDN-IP \
- is 0, wrong!***" )
-
- if( eq( routeIntentsStrExpected, routeIntentsStrActual ) ):
- main.log.report(
- "***MultiPointToSinglePoint Intents after deleting \
- routes correct!***" )
- else:
- main.log.report(
- "***MultiPointToSinglePoint Intents after deleting \
- routes wrong!***" )
-
- time.sleep( 20 )
- # pingTestScript = "~/SDNIP/SdnIpIntentDemo/CASE1-ping-as2host.sh"
- pingTestResultsFile = \
- "~/SDNIP/SdnIpIntentDemo/log/CASE2-Round" \
- + str( roundNum ) + "-ping-results-after-delete-routes-" \
- + strftime( "%Y-%m-%d_%H:%M:%S", localtime() ) + ".txt"
- pingTestResults = main.QuaggaCliHost.pingTest(
- "1.168.30.100", pingTestScript, pingTestResultsFile )
- main.log.info( pingTestResults )
- time.sleep( 30 )
-
diff --git a/TestON/tests/SdnIpTest/SdnIpTest.topo b/TestON/tests/SdnIpTest/SdnIpTest.topo
deleted file mode 100755
index fe9d1bb..0000000
--- a/TestON/tests/SdnIpTest/SdnIpTest.topo
+++ /dev/null
@@ -1,870 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOScli>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOScli>
-
- <ONOS1>
- <host>10.128.4.52</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <QuaggaCliHost3>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost3>
- <QuaggaCliHost4>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost4>
- <QuaggaCliHost5>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost5>
-
- <QuaggaCliHost>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost>
-
- <QuaggaCliHost101>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>101</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost101>
- <QuaggaCliHost102>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>102</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost102>
- <QuaggaCliHost103>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>103</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost103>
- <QuaggaCliHost104>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>104</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost104>
- <QuaggaCliHost105>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>105</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost105>
- <QuaggaCliHost106>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>106</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost106>
- <QuaggaCliHost107>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>107</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost107>
- <QuaggaCliHost108>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>108</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost108>
- <QuaggaCliHost109>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>109</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost109>
- <QuaggaCliHost110>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>110</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost110>
- <QuaggaCliHost111>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>111</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost111>
- <QuaggaCliHost112>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>112</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost112>
- <QuaggaCliHost113>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>113</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost113>
- <QuaggaCliHost114>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>114</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost114>
- <QuaggaCliHost115>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>115</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost115>
- <QuaggaCliHost116>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>116</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost116>
- <QuaggaCliHost117>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>117</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost117>
- <QuaggaCliHost118>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>118</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost118>
- <QuaggaCliHost119>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>119</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost119>
- <QuaggaCliHost120>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>120</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost120>
- <QuaggaCliHost121>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>121</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost121>
- <QuaggaCliHost122>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>122</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost122>
- <QuaggaCliHost123>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>123</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost123>
- <QuaggaCliHost124>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>124</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost124>
- <QuaggaCliHost125>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>125</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost125>
- <QuaggaCliHost126>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>126</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost126>
- <QuaggaCliHost127>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>127</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost127>
- <QuaggaCliHost128>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>128</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost128>
- <QuaggaCliHost129>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>129</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost129>
- <QuaggaCliHost130>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>130</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost130>
- <QuaggaCliHost131>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>131</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost131>
- <QuaggaCliHost132>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>132</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost132>
- <QuaggaCliHost133>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>133</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost133>
- <QuaggaCliHost134>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>134</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost134>
- <QuaggaCliHost135>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>135</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost135>
- <QuaggaCliHost136>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>136</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost136>
- <QuaggaCliHost137>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>137</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost137>
- <QuaggaCliHost138>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>138</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost138>
- <QuaggaCliHost139>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>139</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost139>
- <QuaggaCliHost140>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>140</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost140>
- <QuaggaCliHost141>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>141</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost141>
- <QuaggaCliHost142>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>142</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost142>
- <QuaggaCliHost143>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>143</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost143>
- <QuaggaCliHost144>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>144</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost144>
- <QuaggaCliHost145>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>145</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost145>
- <QuaggaCliHost146>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>146</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost146>
- <QuaggaCliHost147>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>147</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost147>
- <QuaggaCliHost148>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>148</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost148>
- <QuaggaCliHost149>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>149</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost149>
- <QuaggaCliHost150>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>150</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost150>
- <QuaggaCliHost151>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>151</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost151>
- <QuaggaCliHost152>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>152</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost152>
- <QuaggaCliHost153>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>153</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost153>
- <QuaggaCliHost154>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>154</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost154>
- <QuaggaCliHost155>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>155</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost155>
- <QuaggaCliHost156>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>156</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost156>
- <QuaggaCliHost157>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>157</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost157>
- <QuaggaCliHost158>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>158</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost158>
- <QuaggaCliHost159>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>159</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost159>
- <QuaggaCliHost160>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>160</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost160>
- <QuaggaCliHost161>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>161</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost161>
- <QuaggaCliHost162>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>162</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost162>
- <QuaggaCliHost163>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>163</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost163>
- <QuaggaCliHost164>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>164</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost164>
- <QuaggaCliHost165>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>165</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost165>
- <QuaggaCliHost166>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>166</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost166>
- <QuaggaCliHost167>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>167</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost167>
- <QuaggaCliHost168>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>168</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost168>
- <QuaggaCliHost169>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>169</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost169>
- <QuaggaCliHost170>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>170</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost170>
- <QuaggaCliHost171>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>171</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost171>
- <QuaggaCliHost172>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>172</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost172>
- <QuaggaCliHost173>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>173</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost173>
- <QuaggaCliHost174>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>174</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost174>
- <QuaggaCliHost175>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>175</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost175>
- <QuaggaCliHost176>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>176</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost176>
- <QuaggaCliHost177>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>177</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost177>
- <QuaggaCliHost178>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>178</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost178>
- <QuaggaCliHost179>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>179</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost179>
- <QuaggaCliHost180>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>180</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost180>
- <QuaggaCliHost181>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>181</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost181>
- <QuaggaCliHost182>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>182</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost182>
- <QuaggaCliHost183>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>183</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost183>
- <QuaggaCliHost184>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>184</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost184>
- <QuaggaCliHost185>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>185</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost185>
- <QuaggaCliHost186>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>186</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost186>
- <QuaggaCliHost187>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>187</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost187>
- <QuaggaCliHost188>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>188</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost188>
- <QuaggaCliHost189>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>189</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost189>
- <QuaggaCliHost190>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>190</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost190>
- <QuaggaCliHost191>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>191</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost191>
- <QuaggaCliHost192>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>192</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost192>
- <QuaggaCliHost193>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>193</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost193>
-
- <QuaggaCliHost194>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>194</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost194>
- <QuaggaCliHost195>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>195</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost195>
- <QuaggaCliHost196>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>196</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost196>
- <QuaggaCliHost197>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>197</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost197>
- <QuaggaCliHost198>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>198</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost198>
- <QuaggaCliHost199>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>199</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost199>
- <QuaggaCliHost200>
- <host>127.0.0.1</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>QuaggaCliDriver</type>
- <connect_order>200</connect_order>
- <COMPONENTS> </COMPONENTS>
- </QuaggaCliHost200>
-
-
- </COMPONENT>
-</TOPOLOGY>
-
diff --git a/TestON/tests/SdnIpTest/addresses.json b/TestON/tests/SdnIpTest/addresses.json
deleted file mode 100644
index f7eb983..0000000
--- a/TestON/tests/SdnIpTest/addresses.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "addresses" : [
- {
- "dpid" : "00:00:00:00:00:00:00:a3",
- "port" : "1",
- "ips" : ["192.168.10.0/24"],
- "mac" : "00:00:00:00:00:01"
-
- },
- {
- "dpid" : "00:00:00:00:00:00:00:a5",
- "port" : "1",
- "ips" : ["192.168.20.0/24"],
- "mac" : "00:00:00:00:00:01"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:a2",
- "port" : "1",
- "ips" : ["192.168.30.0/24"],
- "mac" : "00:00:00:00:00:01"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:a6",
- "port" : "1",
- "ips" : ["192.168.40.0/24"],
- "mac" : "00:00:00:00:00:01"
- },
- {
- "dpid" : "00:00:00:00:00:00:00:a4",
- "port" : "4",
- "ips" : ["192.168.60.0/24"],
- "mac" : "00:00:00:00:00:01"
- }
-
- ]
-}
\ No newline at end of file
diff --git a/TestON/tests/SdnIpTest/intents.json b/TestON/tests/SdnIpTest/intents.json
deleted file mode 100644
index d17715f..0000000
--- a/TestON/tests/SdnIpTest/intents.json
+++ /dev/null
@@ -1,1468 +0,0 @@
-[
- {
- "id":"0xffffffffcb2cb6ec",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.10.101/32}, IPV4_DST{ip=192.168.10.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a3",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x140a3304",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a3, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.10.101/32}, IPV4_DST{ip=192.168.10.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a3, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffcb2d9828",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.10.1/32}, IPV4_DST{ip=192.168.10.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a3",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x1a89f138",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a3, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.10.1/32}, IPV4_DST{ip=192.168.10.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a3, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffd1418988",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.30.101/32}, IPV4_DST{ip=192.168.30.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x2cd85684",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a2, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.30.101/32}, IPV4_DST{ip=192.168.30.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a2, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x3122a56b",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.40.101/32}, IPV4_DST{ip=192.168.40.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a6",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x5874487",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a6, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a6, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.40.101/32}, IPV4_DST{ip=192.168.40.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a6, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a6, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x6ae96523",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.10.101/32}, IPV4_DST{ip=192.168.10.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a3",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x217361ed",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a3, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.10.101/32}, IPV4_DST{ip=192.168.10.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a3, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffaee31428",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.30.1/32}, IPV4_DST{ip=192.168.30.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x68cad35c",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a2, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.30.1/32}, IPV4_DST{ip=192.168.30.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a2, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffed2b21fa",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.20.1/32}, IPV4_DST{ip=192.168.20.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a5",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffa5dbcf50",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a5, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.20.1/32}, IPV4_DST{ip=192.168.20.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a5, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x373774a3",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.60.101/32}, IPV4_DST{ip=192.168.60.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a4",
- "port":"4"
- },
- "installable":[
- {
- "id":"0x5a75d509",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a4, portNumber=4}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.60.101/32}, IPV4_DST{ip=192.168.60.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a4, portNumber=4}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffff8d492c5d",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.10.1/32}, IPV4_DST{ip=192.168.10.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a3",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffef408263",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a3, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.10.1/32}, IPV4_DST{ip=192.168.10.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a3, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffff8ce7d031",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.20.1/32}, IPV4_DST{ip=192.168.20.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a5",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffb344fe39",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a5, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.20.1/32}, IPV4_DST{ip=192.168.20.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a5, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xf2665f1",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.30.1/32}, IPV4_DST{ip=192.168.30.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x5b61a473",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a2, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.30.1/32}, IPV4_DST{ip=192.168.30.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a2, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffd0e186b8",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.40.1/32}, IPV4_DST{ip=192.168.40.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a6",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x4d8d4942",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a6, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.40.1/32}, IPV4_DST{ip=192.168.40.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a6, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x3738d163",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.60.1/32}, IPV4_DST{ip=192.168.60.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a4",
- "port":"4"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffff993b0fc9",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a4, portNumber=4}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.60.1/32}, IPV4_DST{ip=192.168.60.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a4, portNumber=4}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xfffffffff33e39a0",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.40.101/32}, IPV4_DST{ip=192.168.40.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a6",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffda3dd5b2",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a6, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a6, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.40.101/32}, IPV4_DST{ip=192.168.40.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a6, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a6, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffff8ce60db9",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.20.101/32}, IPV4_DST{ip=192.168.20.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a5",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xfeca8b9",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a5, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.20.101/32}, IPV4_DST{ip=192.168.20.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a5, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x3124d881",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.40.1/32}, IPV4_DST{ip=192.168.40.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a6",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x40241a59",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a6, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.40.1/32}, IPV4_DST{ip=192.168.40.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a6, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffd141fa26",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.30.1/32}, IPV4_DST{ip=192.168.30.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x3018359e",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a2, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.30.1/32}, IPV4_DST{ip=192.168.30.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a2, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffaee2a38a",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.30.101/32}, IPV4_DST{ip=192.168.30.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x658af442",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a2, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.30.101/32}, IPV4_DST{ip=192.168.30.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a2, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffaf46b62f",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.20.1/32}, IPV4_DST{ip=192.168.20.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a5",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x7a92607b",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a5, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.20.1/32}, IPV4_DST{ip=192.168.20.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a5, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffff8d484b21",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.10.101/32}, IPV4_DST{ip=192.168.10.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a3",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffe8c0c42f",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a3, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.10.101/32}, IPV4_DST{ip=192.168.10.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a3, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffed295f82",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.20.101/32}, IPV4_DST{ip=192.168.20.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a5",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x28379d0",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a5, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.20.101/32}, IPV4_DST{ip=192.168.20.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a5, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffdba23bce",
- "type":"MultiPointToSinglePointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_DST{ip=172.16.30.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "ingress":[
- {
- "device":"of:00000000000000a3",
- "port":"1"
- },
- {
- "device":"of:00000000000000a4",
- "port":"4"
- },
- {
- "device":"of:00000000000000a6",
- "port":"1"
- },
- {
- "device":"of:00000000000000a5",
- "port":"1"
- }
- ],
- "egress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x5e70036",
- "type":"LinkCollectionIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_DST{ip=172.16.30.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "links":[
- {
- "src":{
- "device":"of:00000000000000a4",
- "port":"1"
- },
- "dst":{
- "device":"of:00000000000000a2",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a5",
- "port":"2"
- },
- "dst":{
- "device":"of:00000000000000a3",
- "port":"4"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a6",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a3",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"2"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- }
- ]
- }
- ]
- },
- {
- "id":"0xffffffffaf44f3b7",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.20.101/32}, IPV4_DST{ip=192.168.20.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a5",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffd73a0afb",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a5, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.20.101/32}, IPV4_DST{ip=192.168.20.1/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a5, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x751d3d2e",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.60.1/32}, IPV4_DST{ip=192.168.60.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a4",
- "port":"4"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffc4847e9e",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a4, portNumber=4}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.60.1/32}, IPV4_DST{ip=192.168.60.101/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a4, portNumber=4}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x3fb23806",
- "type":"MultiPointToSinglePointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_DST{ip=2.0.0.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "ingress":[
- {
- "device":"of:00000000000000a3",
- "port":"1"
- },
- {
- "device":"of:00000000000000a4",
- "port":"4"
- },
- {
- "device":"of:00000000000000a6",
- "port":"1"
- },
- {
- "device":"of:00000000000000a5",
- "port":"1"
- }
- ],
- "egress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x23d68afe",
- "type":"LinkCollectionIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_DST{ip=2.0.0.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "links":[
- {
- "src":{
- "device":"of:00000000000000a4",
- "port":"1"
- },
- "dst":{
- "device":"of:00000000000000a2",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a5",
- "port":"2"
- },
- "dst":{
- "device":"of:00000000000000a3",
- "port":"4"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a6",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a3",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"2"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- }
- ]
- }
- ]
- },
- {
- "id":"0x751be06e",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.60.101/32}, IPV4_DST{ip=192.168.60.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a4",
- "port":"4"
- },
- "installable":[
- {
- "id":"0xffffffff85bf43de",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a4, portNumber=4}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.60.101/32}, IPV4_DST{ip=192.168.60.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a4, portNumber=4}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x6aea465f",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.10.1/32}, IPV4_DST{ip=192.168.10.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a3",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x27f32021",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a3, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.10.1/32}, IPV4_DST{ip=192.168.10.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a3, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xf25f553",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.30.101/32}, IPV4_DST{ip=192.168.30.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x5821c559",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a2, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.30.101/32}, IPV4_DST{ip=192.168.30.1/32}, IP_PROTO{protocol=1}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a2, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xfffffffff3406cb6",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.40.1/32}, IPV4_DST{ip=192.168.40.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "ingress":{
- "device":"of:00000000000000a6",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x14daab84",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a6, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.40.1/32}, IPV4_DST{ip=192.168.40.101/32}, IP_PROTO{protocol=6}, ETH_TYPE{ethType=800}, TCP_DST{tcpPort=179}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a6, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffd7d10b27",
- "type":"MultiPointToSinglePointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_DST{ip=1.0.0.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "ingress":[
- {
- "device":"of:00000000000000a3",
- "port":"1"
- },
- {
- "device":"of:00000000000000a4",
- "port":"4"
- },
- {
- "device":"of:00000000000000a6",
- "port":"1"
- },
- {
- "device":"of:00000000000000a5",
- "port":"1"
- }
- ],
- "egress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffff8f921bfd",
- "type":"LinkCollectionIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_DST{ip=1.0.0.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "links":[
- {
- "src":{
- "device":"of:00000000000000a4",
- "port":"1"
- },
- "dst":{
- "device":"of:00000000000000a2",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a5",
- "port":"2"
- },
- "dst":{
- "device":"of:00000000000000a3",
- "port":"4"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a6",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a3",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"2"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- }
- ]
- }
- ]
- },
- {
- "id":"0xffffffffa79364e5",
- "type":"MultiPointToSinglePointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_DST{ip=3.0.0.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "ingress":[
- {
- "device":"of:00000000000000a3",
- "port":"1"
- },
- {
- "device":"of:00000000000000a4",
- "port":"4"
- },
- {
- "device":"of:00000000000000a6",
- "port":"1"
- },
- {
- "device":"of:00000000000000a5",
- "port":"1"
- }
- ],
- "egress":{
- "device":"of:00000000000000a2",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffb81af9ff",
- "type":"LinkCollectionIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a6, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_DST{ip=3.0.0.0/24}, ETH_TYPE{ethType=800}]",
- "treatment":"[ETH_DST{mac=00:00:00:00:03:01}]",
- "links":[
- {
- "src":{
- "device":"of:00000000000000a4",
- "port":"1"
- },
- "dst":{
- "device":"of:00000000000000a2",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a5",
- "port":"2"
- },
- "dst":{
- "device":"of:00000000000000a3",
- "port":"4"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a6",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"3"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- },
- {
- "src":{
- "device":"of:00000000000000a3",
- "port":"3"
- },
- "dst":{
- "device":"of:00000000000000a4",
- "port":"2"
- },
- "type":"DIRECT",
- "state":"ACTIVE",
- "annotations":{
-
- }
- }
- ]
- }
- ]
- },
- {
- "id":"0x14d9eb65",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.60.1/32}, IPV4_DST{ip=192.168.60.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a4",
- "port":"4"
- },
- "egress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "installable":[
- {
- "id":"0xffffffffd1edad87",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a4, portNumber=4}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.60.1/32}, IPV4_DST{ip=192.168.60.101/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a4, portNumber=4}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, dst=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a1, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0x14d88ea5",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.60.101/32}, IPV4_DST{ip=192.168.60.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a4",
- "port":"4"
- },
- "installable":[
- {
- "id":"0xffffffff932872c7",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a4, portNumber=4}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.60.101/32}, IPV4_DST{ip=192.168.60.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a2, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a2, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a4, portNumber=1}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a4, portNumber=4}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- },
- {
- "id":"0xffffffffd0df53a2",
- "type":"PointToPointIntent",
- "appId":"org.onlab.onos.sdnip",
- "state":"INSTALLED",
- "selector":"[IPV4_SRC{ip=192.168.40.101/32}, IPV4_DST{ip=192.168.40.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "ingress":{
- "device":"of:00000000000000a1",
- "port":"1"
- },
- "egress":{
- "device":"of:00000000000000a6",
- "port":"1"
- },
- "installable":[
- {
- "id":"0x12f07370",
- "type":"PathIntent",
- "appId":"org.onlab.onos.sdnip",
- "resources":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a6, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a6, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ],
- "selector":"[IPV4_SRC{ip=192.168.40.101/32}, IPV4_DST{ip=192.168.40.1/32}, IP_PROTO{protocol=6}, TCP_SRC{tcpPort=179}, ETH_TYPE{ethType=800}]",
- "path":[
- "DefaultEdgeLink{src=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, dst=HostLocation{elementId=of:00000000000000a1, portNumber=1}, type=EDGE, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a1, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a3, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a3, portNumber=4}, dst=ConnectPoint{elementId=of:00000000000000a5, portNumber=2}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultLink{src=ConnectPoint{elementId=of:00000000000000a5, portNumber=3}, dst=ConnectPoint{elementId=of:00000000000000a6, portNumber=4}, type=DIRECT, state=ACTIVE, durable=false}",
- "DefaultEdgeLink{src=HostLocation{elementId=of:00000000000000a6, portNumber=1}, dst=ConnectPoint{elementId=00:00:00:00:00:00/-1, portNumber=0}, type=EDGE, state=ACTIVE, durable=false}"
- ]
- }
- ]
- }
-]
\ No newline at end of file
diff --git a/TestON/tests/SdnIpTest/sdnip.json b/TestON/tests/SdnIpTest/sdnip.json
deleted file mode 100644
index a5d1867..0000000
--- a/TestON/tests/SdnIpTest/sdnip.json
+++ /dev/null
@@ -1,69 +0,0 @@
-{
-
- "bgpPeers" : [
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:a3",
- "attachmentPort" : "1",
- "ipAddress" : "192.168.10.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:a5",
- "attachmentPort" : "1",
- "ipAddress" : "192.168.20.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:a2",
- "attachmentPort" : "1",
- "ipAddress" : "192.168.30.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:a6",
- "attachmentPort" : "1",
- "ipAddress" : "192.168.40.1"
- },
- {
- "attachmentDpid" : "00:00:00:00:00:00:00:a4",
- "attachmentPort" : "4",
- "ipAddress" : "192.168.60.1"
- }
-
- ],
- "bgpSpeakers" : [
- {
- "name" : "bgpSpeaker1",
- "attachmentDpid" : "00:00:00:00:00:00:00:a1",
- "attachmentPort" : "1",
- "macAddress" : "00:00:00:00:00:01",
- "interfaceAddresses" : [
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:a3",
- "interfacePort" : "1",
- "ipAddress" : "192.168.10.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:a5",
- "interfacePort" : "1",
- "ipAddress" : "192.168.20.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:a2",
- "interfacePort" : "1",
- "ipAddress" : "192.168.30.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:a6",
- "interfacePort" : "1",
- "ipAddress" : "192.168.40.101"
- },
- {
- "interfaceDpid" : "00:00:00:00:00:00:00:a4",
- "interfacePort" : "4",
- "ipAddress" : "192.168.60.101"
- }
-
- ]
-
- }
-
- ]
-}
\ No newline at end of file
diff --git a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.params b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.params
deleted file mode 100644
index eba319c..0000000
--- a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.params
+++ /dev/null
@@ -1,96 +0,0 @@
-<PARAMS>
- <testcases>1,2,3,4,2,3,4,2,3,4,2,3</testcases>
-
- <ENV>
- <cellName>topo_perf_test</cellName>
- <cellFeatures>"drivers,metrics,openflow"</cellFeatures>
- </ENV>
-
- <GIT>
- #autoPull 'on' or 'off'
- <autoPull>off</autoPull>
- <checkout>master</checkout>
- </GIT>
-
- <CTRL>
- <user>admin</user>
- <ip1>10.254.1.201</ip1>
- <port1>6633</port1>
- <ip2>10.254.1.202</ip2>
- <port2>6633</port2>
- <ip3>10.254.1.203</ip3>
- <port3>6633</port3>
- <ip4>10.254.1.204</ip4>
-
- <ip5>10.254.1.205</ip5>
- <ip6>10.254.1.206</ip6>
- <ip7>10.254.1.207</ip7>
- </CTRL>
-
- <MN>
- <ip1>10.254.1.200</ip1>
- <ip2>10.254.1.200</ip2>
- </MN>
-
- <BENCH>
- <ip>10.254.1.200</ip>
- </BENCH>
-
- <TSHARK>
- <ofpPortStatus>OF 1.3 146</ofpPortStatus>
- <ofpRoleReply>OF 1.3 90 of_role_reply</ofpRoleReply>
- <featureReply>OF 1.3 98 of_features_reply</featureReply>
- <roleRequest>OF 1.3 90 of_role_request</roleRequest>
- <tcpSynAck>TCP 74 6633</tcpSynAck>
- <finAckSequence>FIN</finAckSequence>
- </TSHARK>
-
- <TEST>
- #'on' or 'off' debug mode.
- #If on, logging will be more verbose and
- #tshark pcap will be enabled
- #pcap file located at /tmp/'capture_name'
- <debugMode>off</debugMode>
- <onosLogFile>/opt/onos/log/karaf*</onosLogFile>
- <mci>off</mci>
-
- <topoConfigFile>
- single_topo_event_accumulator.cfg
- </topoConfigFile>
- <topoConfigName>
- org.onlab.onos.net.topology.impl.DefaultTopologyProvider.cfg
- </topoConfigName>
-
- #Number of times to iterate each case
- <numIter>13</numIter>
- <numSwitch>2</numSwitch>
- #Number of iterations to ignore initially
- <iterIgnore>2</iterIgnore>
-
- <singleSwThreshold>0,1000</singleSwThreshold>
- <portUpThreshold>0,1000</portUpThreshold>
- <portDownThreshold>0,1000</portDownThreshold>
- <linkUpThreshold>0,10000</linkUpThreshold>
- <linkDownThreshold>0,10000</linkDownThreshold>
- <swDisc100Threshold>0,10000</swDisc100Threshold>
-
- <tabletFile>tablets_3node.json</tabletFile>
- </TEST>
-
- <DB>
- <postToDB>on</postToDB>
- <portEventResultPath>
- /home/admin/ONLabTest/TestON/tests/TopoPerfNextBM/portEventResultDb.log
- </portEventResultPath>
- <switchEventResultPath>
- /home/admin/ONLabTest/TestON/tests/TopoPerfNextBM/switchEventResultDb.log
- </switchEventResultPath>
- </DB>
-
- <JSON>
- <deviceTimestamp>topologyDeviceEventTimestamp</deviceTimestamp>
- <hostTimestamp>topologyHostEventTimestamp</hostTimestamp>
- <linkTimestamp>topologyLinkEventTimestamp</linkTimestamp>
- <graphTimestamp>topologyGraphEventTimestamp</graphTimestamp>
- </JSON>
-</PARAMS>
diff --git a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py
deleted file mode 100644
index e2245ba..0000000
--- a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.py
+++ /dev/null
@@ -1,1306 +0,0 @@
-# 2015.03.12 10:22:05 PDT
-#Embedded file name: ../tests/TopoPerfNextBM/TopoPerfNextBM.py
-import time
-import sys
-import os
-import re
-
-class TopoPerfNextBM:
-
- def __init__(self):
- self.default = ''
-
- def CASE1(self, main):
- """
- ONOS startup sequence
- """
- global clusterCount
- global timeToPost
- global runNum
- global jenkinsBuildNumber
-
- import time
- import os
-
- clusterCount = 1
- timeToPost = time.strftime('%Y-%m-%d %H:%M:%S')
- runNum = time.strftime('%d%H%M%S')
- cellName = main.params['ENV']['cellName']
- gitPull = main.params['GIT']['autoPull']
- checkoutBranch = main.params['GIT']['checkout']
-
- # Get jenkins build number from environment.
- # This environment variable will only exist when
- # triggered by a jenkins job
- try:
- jenkinsBuildNumber = str(os.environ['BUILD_NUMBER'])
- main.log.report( 'Jenkins build number: ' +
- jenkinsBuildNumber )
- except KeyError:
- # Jenkins build number is also used in posting to DB
- # If this test is not triggered by jenkins, give
- # it 0 instead, ensuring that
- # the DB post will recognize it as a non-jenkins run
- jenkinsBuildNumber = str(0)
- main.log.info( 'Job is not run by jenkins. '+
- 'Build number set to: ' + jenkinsBuildNumber)
-
- global CLIs
- CLIs = []
- global nodes
- nodes = []
- global nodeIpList
- nodeIpList = []
- for i in range( 1, 8 ):
- CLIs.append( getattr( main, 'ONOS' + str( i ) + 'cli' ) )
- nodes.append( getattr( main, 'ONOS' + str( i ) ) )
- nodeIpList.append( main.params[ 'CTRL' ][ 'ip'+str(i) ] )
-
- MN1Ip = main.params['MN']['ip1']
- BENCHIp = main.params['BENCH']['ip']
- cellFeatures = main.params['ENV']['cellFeatures']
- topoCfgFile = main.params['TEST']['topoConfigFile']
- topoCfgName = main.params['TEST']['topoConfigName']
- portEventResultPath = main.params['DB']['portEventResultPath']
- switchEventResultPath = main.params['DB']['switchEventResultPath']
- mvnCleanInstall = main.params['TEST']['mci']
-
- main.case('Setting up test environment')
-
- # NOTE: Below is deprecated after new way to install features
- #main.log.info('Copying topology event accumulator config' +
- # ' to ONOS /package/etc')
- #main.ONOSbench.handle.sendline('cp ~/' +
- # topoCfgFile + ' ~/ONOS/tools/package/etc/' +
- # topoCfgName)
- #main.ONOSbench.handle.expect('\\$')
-
- main.log.report('Setting up test environment')
-
- main.step('Starting mininet topology ')
- main.Mininet1.startNet()
-
- main.step('Cleaning previously installed ONOS if any')
- # Nodes 2 ~ 7
- for i in range( 1, 7 ):
- main.ONOSbench.onosUninstall(nodeIp=nodeIpList[i])
-
- main.step('Clearing previous DB log file')
-
- fPortLog = open(portEventResultPath, 'w')
- fPortLog.write('')
- fPortLog.close()
- fSwitchLog = open(switchEventResultPath, 'w')
- fSwitchLog.write('')
- fSwitchLog.close()
-
- main.step('Creating cell file')
- cellFileResult = main.ONOSbench.createCellFile(
- BENCHIp, cellName, MN1Ip, cellFeatures, nodeIpList[0])
-
- main.step('Applying cell file to environment')
- cellApplyResult = main.ONOSbench.setCell(cellName)
- verifyCellResult = main.ONOSbench.verifyCell()
-
- main.step('Git checkout and pull ' + checkoutBranch)
- if gitPull == 'on':
- checkoutResult = main.TRUE
- pullResult = main.ONOSbench.gitPull()
- else:
- checkoutResult = main.TRUE
- pullResult = main.TRUE
- main.log.info('Skipped git checkout and pull')
-
- main.log.report('Commit information - ')
- main.ONOSbench.getVersion(report=True)
- main.step('Using mvn clean & install')
- if mvnCleanInstall == 'on':
- mvnResult = main.ONOSbench.cleanInstall()
- elif mvnCleanInstall == 'off':
- main.log.info('mci turned off by settings')
- mvnResult = main.TRUE
- main.step('Set cell for ONOS cli env')
- CLIs[0].setCell(cellName)
-
- main.step('Creating ONOS package')
- packageResult = main.ONOSbench.onosPackage()
-
- main.step('Installing ONOS package')
- install1Result = main.ONOSbench.onosInstall(node=nodeIpList[0])
-
- time.sleep(10)
-
- main.step('Start onos cli')
- cli1 = CLIs[0].startOnosCli(nodeIpList[0])
-
- main.step( 'activating essential applications' )
- CLIs[0].activateApp( 'org.onosproject.metrics' )
- CLIs[0].activateApp( 'org.onosproject.openflow' )
-
- main.step( 'Configuring application parameters' )
-
- configName = 'org.onosproject.net.topology.impl.DefaultTopologyProvider'
- configParam = 'maxEvents 1'
- main.ONOSbench.onosCfgSet( nodeIpList[0], configName, configParam )
- configParam = 'maxBatchMs 0'
- main.ONOSbench.onosCfgSet( nodeIpList[0], configName, configParam )
- configParam = 'maxIdleMs 0'
- main.ONOSbench.onosCfgSet( nodeIpList[0], configName, configParam )
-
- utilities.assert_equals(expect=main.TRUE,
- actual=cellFileResult and cellApplyResult and\
- verifyCellResult and checkoutResult and\
- pullResult and mvnResult and\
- install1Result,
- onpass='Test Environment setup successful',
- onfail='Failed to setup test environment')
-
- def CASE2(self, main):
- """
- Assign s3 to ONOS1 and measure latency
-
- There are 4 levels of latency measurements to this test:
- 1 ) End-to-end measurement: Complete end-to-end measurement
- from TCP ( SYN/ACK ) handshake to Graph change
- 2 ) OFP-to-graph measurement: 'ONOS processing' snippet of
- measurement from OFP Vendor message to Graph change
- 3 ) OFP-to-device measurement: 'ONOS processing without
- graph change' snippet of measurement from OFP vendor
- message to Device change timestamp
- 4 ) T0-to-device measurement: Measurement that includes
- the switch handshake to devices timestamp without
- the graph view change. ( TCP handshake -> Device
- change )
- """
- import time
- import subprocess
- import json
- import requests
- import os
- import numpy
-
- ONOSUser = main.params['CTRL']['user']
- defaultSwPort = main.params['CTRL']['port1']
- numIter = main.params['TEST']['numIter']
- iterIgnore = int(main.params['TEST']['iterIgnore'])
-
- deviceTimestampKey = main.params['JSON']['deviceTimestamp']
- graphTimestampKey = main.params['JSON']['graphTimestamp']
-
- debugMode = main.params['TEST']['debugMode']
- onosLog = main.params['TEST']['onosLogFile']
- resultPath = main.params['DB']['switchEventResultPath']
- thresholdStr = main.params['TEST']['singleSwThreshold']
- thresholdObj = thresholdStr.split(',')
- thresholdMin = int(thresholdObj[0])
- thresholdMax = int(thresholdObj[1])
-
- # Look for 'role-request' messages,
- # which replaces the 'vendor' messages previously seen
- # on OVS 2.0.1
- tsharkTcpString = main.params[ 'TSHARK' ][ 'tcpSynAck' ]
- tsharkFeatureReply = main.params[ 'TSHARK' ][ 'featureReply' ]
- tsharkRoleRequest = main.params[ 'TSHARK' ][ 'roleRequest' ]
- tsharkOfString = main.params[ 'TSHARK' ][ 'ofpRoleReply' ]
- tsharkFinAckSequence = main.params[ 'TSHARK' ][ 'finAckSequence' ]
-
- tsharkOfOutput = '/tmp/tshark_of_topo.txt'
- tsharkTcpOutput = '/tmp/tshark_tcp_topo.txt'
- tsharkRoleOutput = '/tmp/tshark_role_request.txt'
- tsharkFeatureOutput = '/tmp/tshark_feature_reply.txt'
- tsharkFinAckOutput = '/tmp/tshark_fin_ack.txt'
-
- # Switch connect measurement list
- # TCP Syn/Ack -> Feature Reply latency collection for each node
- tcpToFeatureLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
- # Feature Reply -> Role Request latency collection for each node
- featureToRoleRequestLatNodeIter = numpy.zeros((clusterCount,
- int(numIter)))
- # Role Request -> Role Reply latency collection for each node
- roleRequestToRoleReplyLatNodeIter = numpy.zeros((clusterCount,
- int(numIter)))
- # Role Reply -> Device Update latency collection for each node
- roleReplyToDeviceLatNodeIter = numpy.zeros((clusterCount,
- int(numIter)))
- # Device Update -> Graph Update latency collection for each node
- deviceToGraphLatNodeIter = numpy.zeros((clusterCount,
- int(numIter)))
- endToEndLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
-
- # Switch disconnect measurement lists
- # Mininet Fin / Ack -> Mininet Ack
- finAckTransactionLatNodeIter = numpy.zeros((clusterCount,
- int(numIter)))
- # Mininet Ack -> Device Event
- ackToDeviceLatNodeIter = numpy.zeros((clusterCount,
- int(numIter)))
- # Device event -> Graph event
- deviceToGraphDiscLatNodeIter = numpy.zeros((clusterCount,
- int(numIter)))
- endToEndDiscLatNodeIter = numpy.zeros((clusterCount, int(numIter)))
-
- assertion = main.TRUE
- localTime = time.strftime('%x %X')
- localTime = localTime.replace('/', '')
- localTime = localTime.replace(' ', '_')
- localTime = localTime.replace(':', '')
-
- if debugMode == 'on':
- main.ONOS1.tsharkPcap('eth0',
- '/tmp/single_sw_lat_pcap_' + localTime)
- main.log.info('Debug mode is on')
- main.log.report('Latency of adding one switch to controller')
- main.log.report('First ' + str(iterIgnore) +
- ' iterations ignored' + ' for jvm warmup time')
- main.log.report('Total iterations of test: ' + str(numIter))
-
- for i in range(0, int(numIter)):
- main.log.info('Starting tshark capture')
- main.ONOS1.tsharkGrep(tsharkTcpString, tsharkTcpOutput)
- main.ONOS1.tsharkGrep(tsharkOfString, tsharkOfOutput)
- main.ONOS1.tsharkGrep(tsharkRoleRequest, tsharkRoleOutput)
- main.ONOS1.tsharkGrep(tsharkFeatureReply, tsharkFeatureOutput)
-
- time.sleep(10)
-
- main.log.info('Assigning s3 to controller')
- main.Mininet1.assignSwController(sw='3',
- ip1=nodeIpList[0], port1=defaultSwPort)
-
- jsonStr = []
- for node in range (0, clusterCount):
- metricsSwUp = CLIs[node].topologyEventsMetrics()
- jsonStr.append(metricsSwUp)
-
- main.log.info('Stopping all Tshark processes')
- main.ONOS1.tsharkStop()
-
- time.sleep(5)
-
- main.log.info('Copying over tshark files')
- os.system('scp ' + ONOSUser + '@' + nodeIpList[0] +
- ':' + tsharkTcpOutput + ' /tmp/')
- os.system('scp ' + ONOSUser + '@' + nodeIpList[0] +
- ':' + tsharkRoleOutput + ' /tmp/')
- os.system('scp ' + ONOSUser + '@' + nodeIpList[0] +
- ':' + tsharkFeatureOutput + ' /tmp/')
- os.system('scp ' + ONOSUser + '@' +
- nodeIpList[0] + ':' + tsharkOfOutput + ' /tmp/')
-
- # Get tcp syn / ack output
- time.sleep(1)
-
- tcpFile = open(tsharkTcpOutput, 'r')
- tempText = tcpFile.readline()
- tempText = tempText.split(' ')
- main.log.info('Object read in from TCP capture: ' +
- str(tempText))
-
- if len(tempText) > 1:
- t0Tcp = float(tempText[1]) * 1000.0
- else:
- main.log.error('Tshark output file for TCP' +
- ' returned unexpected results')
- t0Tcp = 0
- assertion = main.FALSE
- tcpFile.close()
-
- # Get Role reply output
- ofFile = open(tsharkOfOutput, 'r')
- lineOfp = ''
- while True:
- tempText = ofFile.readline()
- if tempText != '':
- lineOfp = tempText
- else:
- break
- obj = lineOfp.split(' ')
- main.log.info('Object read in from OFP capture: ' +
- str(lineOfp))
- if len(obj) > 1:
- t0Ofp = float(obj[1]) * 1000.0
- else:
- main.log.error('Tshark output file for OFP' +
- ' returned unexpected results')
- t0Ofp = 0
- assertion = main.FALSE
- ofFile.close()
-
- # Get role request output
- roleFile = open(tsharkRoleOutput, 'r')
- tempText = roleFile.readline()
- tempText = tempText.split(' ')
- if len(tempText) > 1:
- main.log.info('Object read in from role request capture:' +
- str(tempText))
- roleTimestamp = float(tempText[1]) * 1000.0
- else:
- main.log.error('Tshark output file for role request' +
- ' returned unexpected results')
- timeRoleRequest = 0
- assertion = main.FALSE
- roleFile.close()
-
- # Get feature reply output
- featureFile = open(tsharkFeatureOutput, 'r')
- tempText = featureFile.readline()
- tempText = tempText.split(' ')
- if len(tempText) > 1:
- main.log.info('Object read in from feature reply capture: '+
- str(tempText))
- if tempText[1] != ' ' and float(tempText[1]) > 1400000000.0:
- temp = tempText[1]
- elif tempText[2] != ' ' and float(tempText[2]) > 1400000000.0:
- temp = tempText[2]
- else:
- temp = 0
- featureTimestamp = float(temp) * 1000.0
- else:
- main.log.error('Tshark output file for feature reply' +
- ' returned unexpected results')
- timeFeatureReply = 0
- assertion = main.FALSE
- featureFile.close()
-
- for node in range(0, clusterCount):
- nodeNum = node+1
- #metricsSwUp = CLIs[node].topologyEventsMetrics
- #jsonStr = metricsSwUp()
- jsonObj = json.loads(jsonStr[node])
- if jsonObj:
- graphTimestamp = jsonObj[graphTimestampKey]['value']
- deviceTimestamp = jsonObj[deviceTimestampKey]['value']
- else:
- main.log.error( "Unexpected JSON object" )
- # If we could not obtain the JSON object,
- # set the timestamps to 0, which will be
- # excluded from the measurement later on
- # (realized as invalid)
- graphTimestamp = 0
- deviceTimestamp = 0
-
- endToEnd = int(graphTimestamp) - int(t0Tcp)
-
- # Below are measurement breakdowns of the end-to-end
- # measurement.
- tcpToFeature = int(featureTimestamp) - int(t0Tcp)
- featureToRole = int(roleTimestamp) - int(featureTimestamp)
- roleToOfp = float(t0Ofp) - float(roleTimestamp)
- ofpToDevice = float(deviceTimestamp) - float(t0Ofp)
- # Timestamps gathered from ONOS are millisecond
- # precision. They are returned as integers, thus no
- # need to be more precise than 'int'. However,
- # the processing seems to be mostly under 1 ms,
- # thus this may be a problem point to handle any
- # submillisecond output that we are unsure of.
- # For now, this will be treated as 0 ms if less than 1 ms
- deviceToGraph = int(graphTimestamp) - int(deviceTimestamp)
-
- if endToEnd >= thresholdMin and\
- endToEnd < thresholdMax and i >= iterIgnore:
- endToEndLatNodeIter[node][i] = endToEnd
- main.log.info("ONOS "+str(nodeNum)+ " end-to-end: "+
- str(endToEnd) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+ " end-to-end "+
- "measurement ignored due to excess in "+
- "threshold or premature iteration: ")
- main.log.info(str(endToEnd))
-
- if tcpToFeature >= thresholdMin and\
- tcpToFeature < thresholdMax and i >= iterIgnore:
- tcpToFeatureLatNodeIter[node][i] = tcpToFeature
- main.log.info("ONOS "+str(nodeNum)+ " tcp-to-feature: "+
- str(tcpToFeature) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+ " tcp-to-feature "+
- "measurement ignored due to excess in "+
- "threshold or premature iteration: ")
- main.log.info(str(tcpToFeature))
-
- if featureToRole >= thresholdMin and\
- featureToRole < thresholdMax and i >= iterIgnore:
- featureToRoleRequestLatNodeIter[node][i] = featureToRole
- main.log.info("ONOS "+str(nodeNum)+ " feature-to-role: "+
- str(featureToRole) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+ " feature-to-role "+
- "measurement ignored due to excess in "+
- "threshold or premature iteration: ")
- main.log.info(str(featureToRole))
-
- if roleToOfp >= thresholdMin and\
- roleToOfp < thresholdMax and i >= iterIgnore:
- roleRequestToRoleReplyLatNodeIter[node][i] = roleToOfp
- main.log.info("ONOS "+str(nodeNum)+ " role-to-reply: "+
- str(roleToOfp) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+ " role-to-reply "+
- "measurement ignored due to excess in "+
- "threshold or premature iteration: ")
- main.log.info(str(roleToOfp))
-
- if ofpToDevice >= thresholdMin and\
- ofpToDevice < thresholdMax and i >= iterIgnore:
- roleReplyToDeviceLatNodeIter[node][i] = ofpToDevice
- main.log.info("ONOS "+str(nodeNum)+ " reply-to-device: "+
- str(ofpToDevice) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+ " reply-to-device "+
- "measurement ignored due to excess in "+
- "threshold or premature iteration: ")
- main.log.info(str(ofpToDevice))
-
- if deviceToGraph >= thresholdMin and\
- deviceToGraph < thresholdMax and i >= iterIgnore:
- deviceToGraphLatNodeIter[node][i] = deviceToGraph
- main.log.info("ONOS "+str(nodeNum)+ " device-to-graph: "+
- str(deviceToGraph) + " ms")
- else:
- if deviceToGraph == 0:
- deviceToGraphLatNodeIter[node][i] = 0
- main.log.info("ONOS "+str(nodeNum) +
- " device-to-graph measurement "+
- "was set to 0 ms because of precision "+
- "uncertainty. ")
- else:
- main.log.info("ONOS "+str(nodeNum)+
- " device-to-graph "+
- "measurement ignored due to excess in "+
- "threshold or premature iteration: ")
- main.log.info(str(deviceToGraph))
-
- # ********************
- time.sleep(5)
-
- # Get device id to remove
- deviceIdJsonStr = main.ONOS1cli.devices()
-
- main.log.info( "Device obj obtained: " + str(deviceIdJsonStr) )
- deviceId = json.loads(deviceIdJsonStr)
-
- deviceList = []
- for device in deviceId:
- deviceList.append(device['id'])
-
- # Measure switch down metrics
- # TCP FIN/ACK -> TCP FIN
- # TCP FIN -> Device Event
- # Device Event -> Graph Event
- # Capture switch down FIN / ACK packets
-
- # The -A 1 grep option allows us to grab 1 extra line after the
- # last tshark output grepped originally
- main.ONOS1.tsharkGrep( tsharkFinAckSequence, tsharkFinAckOutput,
- grepOptions = '-A 1' )
-
- time.sleep( 5 )
-
- removeJsonList = []
-
- main.step('Remove switch from controller')
- main.Mininet1.deleteSwController('s3')
- firstDevice = deviceList[0]
-
- # We need to get metrics before removing
- # device from the store below.
- for node in range(0, clusterCount):
- metricsSwDown = CLIs[node].topologyEventsMetrics
- jsonStr = metricsSwDown()
- removeJsonList.append( json.loads(jsonStr) )
-
- main.ONOS1.tsharkStop()
-
- main.log.info( "Removing device " +str(firstDevice)+
- " from ONOS" )
-
- #if deviceId:
- main.ONOS1cli.deviceRemove(firstDevice)
-
- main.log.info('Copying over tshark files')
- os.system('scp ' + ONOSUser + '@' + nodeIpList[0] +
- ':' + tsharkFinAckOutput + ' /tmp/')
-
- time.sleep( 10 )
- finAckOutputList = []
- with open(tsharkFinAckOutput, 'r') as f:
- tempLine = f.readlines()
- main.log.info('Object read in from FinAck capture: ' +
- "\n".join(tempLine))
-
- index = 1
- for line in tempLine:
- obj = line.split(' ')
-
- # There are at least 3 objects in field (valid
- # tshark output is lengthy)
- if len(obj) > 2:
- # If first index of object is like an epoch time
- if obj[1] != ' ' and float(obj[1]) > 1400000000.0:
- temp = obj[1]
- elif obj[2] != ' 'and float(obj[2]) > 1400000000.0:
- temp = obj[2]
- elif obj[3] != ' 'and float(obj[3]) > 1400000000.0:
- temp = obj[3]
- else:
- temp = 0
- if index == 1:
- tFinAck = float(temp) * 1000.0
- elif index == 2:
- continue
- elif index == 3:
- tAck = float(temp) * 1000.0
- else:
- tFinAck = 0
- tAck = 0
- else:
- main.log.error('Tshark output file for OFP' +
- ' returned unexpected results')
- tFinAck = 0
- tAck = 0
- assertion = main.FALSE
-
- index = index+1
-
- # with open() as f takes care of closing file
-
- time.sleep(5)
-
- for node in range(0, clusterCount):
- nodeNum = node+1
- jsonObj = removeJsonList[node]
- if jsonObj:
- graphTimestamp = jsonObj[graphTimestampKey]['value']
- deviceTimestamp = jsonObj[deviceTimestampKey]['value']
- main.log.info("Graph timestamp: "+str(graphTimestamp))
- main.log.info("Device timestamp: "+str(deviceTimestamp))
- else:
- main.log.error( "Unexpected JSON object" )
- # If we could not obtain the JSON object,
- # set the timestamps to 0, which will be
- # excluded from the measurement later on
- # (realized as invalid)
- graphTimestamp = 0
- deviceTimestamp = 0
-
- finAckTransaction = float(tAck) - float(tFinAck)
- ackToDevice = float(deviceTimestamp) - float(tAck)
- deviceToGraph = float(graphTimestamp) - float(deviceTimestamp)
- endToEndDisc = int(graphTimestamp) - int(tFinAck)
-
- if endToEndDisc >= thresholdMin and\
- endToEndDisc < thresholdMax and i >= iterIgnore:
- endToEndDiscLatNodeIter[node][i] = endToEndDisc
- main.log.info("ONOS "+str(nodeNum) +
- "end-to-end disconnection: "+
- str(endToEndDisc) + " ms" )
- else:
- main.log.info("ONOS " + str(nodeNum) +
- " end-to-end disconnection "+
- "measurement ignored due to excess in "+
- "threshold or premature iteration: ")
- main.log.info(str(endToEndDisc))
-
- if finAckTransaction >= thresholdMin and\
- finAckTransaction < thresholdMax and i >= iterIgnore:
- finAckTransactionLatNodeIter[node][i] = finAckTransaction
- main.log.info("ONOS "+str(nodeNum)+
- " fin/ack transaction: "+
- str(finAckTransaction) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+
- " fin/ack transaction "+
- "measurement ignored due to excess in "+
- "threshold or premature iteration: ")
- main.log.info(str(finAckTransaction))
-
- if ackToDevice >= thresholdMin and\
- ackToDevice < thresholdMax and i >= iterIgnore:
- ackToDeviceLatNodeIter[node][i] = ackToDevice
- main.log.info("ONOS "+str(nodeNum)+
- " ack-to-device: "+
- str(ackToDevice) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+
- " ack-to-device "+
- "measurement ignored due to excess in "+
- "threshold or premature iteration: ")
- main.log.info(str(ackToDevice))
-
- if deviceToGraph >= thresholdMin and\
- deviceToGraph < thresholdMax and i >= iterIgnore:
- deviceToGraphDiscLatNodeIter[node][i] = deviceToGraph
- main.log.info("ONOS "+str(nodeNum)+
- " device-to-graph disconnect: "+
- str(deviceToGraph) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+
- " device-to-graph disconnect "+
- "measurement ignored due to excess in "+
- "threshold or premature iteration: ")
- main.log.info(str(deviceToGraph))
-
- endToEndAvg = 0
- ofpToGraphAvg = 0
- dbCmdList = []
- for node in range(0, clusterCount):
- # List of latency for each node
- endToEndList = []
- tcpToFeatureList = []
- featureToRoleList = []
- roleToOfpList = []
- ofpToDeviceList = []
- deviceToGraphList = []
-
- finAckTransactionList = []
- ackToDeviceList = []
- deviceToGraphDiscList = []
- endToEndDiscList = []
-
- # LatNodeIter 2d arrays contain all iteration latency
- # for each node of the current scale cluster size
- # Switch connection measurements
- # Set further acceptance criteria for measurements
- # here if you would like to filter reporting results
- for item in endToEndLatNodeIter[node]:
- if item > 0.0:
- endToEndList.append(item)
-
- for item in tcpToFeatureLatNodeIter[node]:
- if item > 0.0:
- tcpToFeatureList.append(item)
-
- for item in featureToRoleRequestLatNodeIter[node]:
- if item > 0.0:
- featureToRoleList.append(item)
-
- for item in roleRequestToRoleReplyLatNodeIter[node]:
- if item > 0.0:
- roleToOfpList.append(item)
-
- for item in roleReplyToDeviceLatNodeIter[node]:
- if item >= 0.0:
- ofpToDeviceList.append(item)
-
- for item in featureToRoleRequestLatNodeIter[node]:
- if item > 0.0:
- featureToRoleList.append(item)
-
- for item in deviceToGraphLatNodeIter[node]:
- if item >= 0.0:
- deviceToGraphList.append(item)
-
- # Switch disconnect measurements
- for item in endToEndDiscLatNodeIter[node]:
- if item > 0.0:
- endToEndDiscList.append(item)
-
- for item in finAckTransactionLatNodeIter[node]:
- if item > 0.0:
- finAckTransactionList.append(item)
-
- for item in ackToDeviceLatNodeIter[node]:
- if item > 0.0:
- ackToDeviceList.append(item)
-
- for item in deviceToGraphDiscLatNodeIter[node]:
- if item >= 0.0:
- deviceToGraphDiscList.append(item)
-
- endToEndAvg = round(numpy.mean(endToEndList), 2)
- endToEndStdDev = round(numpy.std(endToEndList), 2)
-
- tcpToFeatureAvg = round(numpy.mean(tcpToFeatureList), 2)
- tcpToFeatureStdDev = round(numpy.std(tcpToFeatureList), 2)
-
- featureToRoleAvg = round(numpy.mean(featureToRoleList), 2)
- featureToRoleStdDev = round(numpy.std(featureToRoleList), 2)
-
- roleToOfpAvg = round(numpy.mean(roleToOfpList), 2)
- roleToOfpStdDev = round(numpy.std(roleToOfpList), 2)
-
- ofpToDeviceAvg = round(numpy.mean(ofpToDeviceList), 2)
- ofpToDeviceStdDev = round(numpy.std(ofpToDeviceList), 2)
-
- deviceToGraphAvg = round(numpy.mean(deviceToGraphList), 2)
- deviceToGraphStdDev = round(numpy.std(deviceToGraphList), 2)
-
- endToEndDiscAvg = round(numpy.mean(endToEndDiscList), 2)
- endToEndDiscStdDev = round(numpy.std(endToEndDiscList), 2)
-
- finAckAvg = round(numpy.mean(finAckTransactionList), 2)
- finAckStdDev = round(numpy.std(finAckTransactionList), 2)
-
- ackToDeviceAvg = round(numpy.mean(ackToDeviceList), 2)
- ackToDeviceStdDev = round(numpy.std(ackToDeviceList), 2)
-
- deviceToGraphDiscAvg = round(numpy.mean(deviceToGraphDiscList), 2)
- deviceToGraphDiscStdDev = round(numpy.std(deviceToGraphDiscList), 2)
-
- main.log.report(' - Node ' + str(node + 1) + ' Summary - ')
- main.log.report(' - Switch Connection Statistics - ')
-
- main.log.report(' End-to-end Avg: ' + str(endToEndAvg) +
- ' ms' + ' End-to-end Std dev: ' +
- str(endToEndStdDev) + ' ms')
-
- main.log.report(' Tcp-to-feature-reply Avg: ' +
- str(tcpToFeatureAvg) + ' ms')
- main.log.report(' Tcp-to-feature-reply Std dev: '+
- str(tcpToFeatureStdDev) + ' ms')
-
- main.log.report(' Feature-reply-to-role-request Avg: ' +
- str(featureToRoleAvg) + ' ms')
- main.log.report(' Feature-reply-to-role-request Std Dev: ' +
- str(featureToRoleStdDev) + ' ms')
-
- main.log.report(' Role-request-to-role-reply Avg: ' +
- str(roleToOfpAvg) +' ms')
- main.log.report(' Role-request-to-role-reply Std dev: ' +
- str(roleToOfpStdDev) + ' ms')
-
- main.log.report(' Role-reply-to-device Avg: ' +
- str(ofpToDeviceAvg) +' ms')
- main.log.report(' Role-reply-to-device Std dev: ' +
- str(ofpToDeviceStdDev) + ' ms')
-
- main.log.report(' Device-to-graph Avg: ' +
- str(deviceToGraphAvg) + ' ms')
- main.log.report( 'Device-to-graph Std dev: ' +
- str(deviceToGraphStdDev) + ' ms')
-
- main.log.report(' - Switch Disconnection Statistics - ')
- main.log.report(' End-to-end switch disconnect Avg: ' +
- str(endToEndDiscAvg) + ' ms')
- main.log.report(' End-to-end switch disconnect Std dev: ' +
- str(endToEndDiscStdDev) + ' ms')
- main.log.report(' Fin/Ack-to-Ack Avg: ' + str(finAckAvg) + ' ms')
- main.log.report(' Fin/Ack-to-Ack Std dev: ' +
- str(finAckStdDev) + ' ms')
-
- main.log.report(' Ack-to-device Avg: ' + str(ackToDeviceAvg) +
- ' ms')
- main.log.report(' Ack-to-device Std dev: ' + str(ackToDeviceStdDev) +
- ' ms')
-
- main.log.report(' Device-to-graph (disconnect) Avg: ' +
- str(deviceToGraphDiscAvg) + ' ms')
- main.log.report(' Device-to-graph (disconnect) Std dev: ' +
- str(deviceToGraphDiscStdDev) + ' ms')
-
- # For database schema, refer to Amazon web services
- dbCmdList.append(
- "INSERT INTO switch_latency_details VALUES('" +
- timeToPost + "','switch_latency_results'," +
- jenkinsBuildNumber + ',' + str(clusterCount) + ",'baremetal" +
- str(node + 1) + "'," +
- str(endToEndAvg) + ',' +
- str(tcpToFeatureAvg) + ',' +
- str(featureToRoleAvg) + ',' +
- str(roleToOfpAvg) + ',' +
- str(ofpToDeviceAvg) + ',' +
- str(deviceToGraphAvg) + ',' +
- str(endToEndDiscAvg) + ',' +
- str(finAckAvg) + ',' +
- str(ackToDeviceAvg) + ',' +
- str(deviceToGraphDiscAvg) +
- ');')
-
- if debugMode == 'on':
- main.ONOS1.cpLogsToDir('/opt/onos/log/karaf.log',
- '/tmp/', copyFileName='sw_lat_karaf')
- fResult = open(resultPath, 'a')
- for line in dbCmdList:
- if line:
- fResult.write(line + '\n')
- fResult.close()
-
- assertion = main.TRUE
-
- utilities.assert_equals(expect=main.TRUE, actual=assertion,
- onpass='Switch latency test successful',
- onfail='Switch latency test failed')
-
- def CASE3(self, main):
- """
- Bring port up / down and measure latency.
- Port enable / disable is simulated by ifconfig up / down
-
- In ONOS-next, we must ensure that the port we are
- manipulating is connected to another switch with a valid
- connection. Otherwise, graph view will not be updated.
- """
- import time
- import subprocess
- import os
- import requests
- import json
- import numpy
- ONOS1Ip = main.params['CTRL']['ip1']
- ONOS2Ip = main.params['CTRL']['ip2']
- ONOS3Ip = main.params['CTRL']['ip3']
- ONOSUser = main.params['CTRL']['user']
- defaultSwPort = main.params['CTRL']['port1']
- assertion = main.TRUE
- numIter = main.params['TEST']['numIter']
- iterIgnore = int(main.params['TEST']['iterIgnore'])
-
- deviceTimestampKey = main.params['JSON']['deviceTimestamp']
- graphTimestampKey = main.params['JSON']['graphTimestamp']
- linkTimestampKey = main.params['JSON']['linkTimestamp']
-
- tsharkPortUp = '/tmp/tshark_port_up.txt'
- tsharkPortDown = '/tmp/tshark_port_down.txt'
- tsharkPortStatus = main.params[ 'TSHARK' ][ 'ofpPortStatus' ]
-
- debugMode = main.params['TEST']['debugMode']
- postToDB = main.params['DB']['postToDB']
- resultPath = main.params['DB']['portEventResultPath']
- localTime = time.strftime('%x %X')
- localTime = localTime.replace('/', '')
- localTime = localTime.replace(' ', '_')
- localTime = localTime.replace(':', '')
-
- if debugMode == 'on':
- main.ONOS1.tsharkPcap('eth0', '/tmp/port_lat_pcap_' + localTime)
-
- upThresholdStr = main.params['TEST']['portUpThreshold']
- downThresholdStr = main.params['TEST']['portDownThreshold']
- upThresholdObj = upThresholdStr.split(',')
- downThresholdObj = downThresholdStr.split(',')
- upThresholdMin = int(upThresholdObj[0])
- upThresholdMax = int(upThresholdObj[1])
- downThresholdMin = int(downThresholdObj[0])
- downThresholdMax = int(downThresholdObj[1])
-
- interfaceConfig = 's1-eth1'
- main.log.report('Port enable / disable latency')
- main.log.report('Simulated by ifconfig up / down')
- main.log.report('Total iterations of test: ' + str(numIter))
- main.step('Assign switches s1 and s2 to controller 1')
-
- main.Mininet1.assignSwController(sw='1',
- ip1=ONOS1Ip, port1=defaultSwPort)
- main.Mininet1.assignSwController(sw='2',
- ip1=ONOS1Ip, port1=defaultSwPort)
-
- time.sleep(15)
-
- portUpEndToEndNodeIter = numpy.zeros((clusterCount, int(numIter)))
- portUpOfpToDevNodeIter = numpy.zeros((clusterCount, int(numIter)))
- portUpDevToLinkNodeIter = numpy.zeros((clusterCount, int(numIter)))
- portUpLinkToGraphNodeIter = numpy.zeros((clusterCount, int(numIter)))
-
- portDownEndToEndNodeIter = numpy.zeros((clusterCount, int(numIter)))
- portDownOfpToDevNodeIter = numpy.zeros((clusterCount, int(numIter)))
- portDownDevToLinkNodeIter = numpy.zeros((clusterCount, int(numIter)))
- portDownLinkToGraphNodeIter = numpy.zeros((clusterCount, int(numIter)))
-
- for i in range(0, int(numIter)):
- main.step('Starting wireshark capture for port status down')
- main.ONOS1.tsharkGrep(tsharkPortStatus, tsharkPortDown)
-
- time.sleep(5)
-
- main.step('Disable port: ' + interfaceConfig)
- main.Mininet1.handle.sendline('sh ifconfig ' +
- interfaceConfig + ' down')
- main.Mininet1.handle.expect('mininet>')
-
- jsonStrPtDown = []
- for node in range (0, clusterCount):
- metricsPortDown = CLIs[node].topologyEventsMetrics()
- jsonStrPtDown.append(metricsPortDown)
-
- time.sleep(3)
-
- main.ONOS1.tsharkStop()
-
- os.system('scp ' + ONOSUser + '@' + ONOS1Ip + ':' +
- tsharkPortDown + ' /tmp/')
-
- fPortDown = open(tsharkPortDown, 'r')
- fLine = fPortDown.readline()
- objDown = fLine.split(' ')
- if len(fLine) > 0:
- timestampBeginPtDown = int(float(objDown[1]) * 1000)
- # At times, tshark reports timestamp at the 3rd
- # index of the array. If initial readings were
- # unlike the epoch timestamp, then check the 3rd
- # index and set that as a timestamp
- if timestampBeginPtDown < 1400000000000:
- timestampBeginPtDown = int(float(objDown[2]) * 1000)
- # If there are any suspicion of invalid results
- # check this reported value
- main.log.info('Port down begin timestamp: ' +
- str(timestampBeginPtDown))
- else:
- main.log.info('Tshark output file returned unexpected' +
- ' results: ' + str(objDown))
- timestampBeginPtDown = 0
- fPortDown.close()
-
- for node in range(0, clusterCount):
- nodeNum = node+1
- # metricsDown = CLIs[node].topologyEventsMetrics
- #jsonStrPtDown[node] = metricsDown()
- jsonObj = json.loads(jsonStrPtDown[node])
-
- if jsonObj:
- graphTimestamp = jsonObj[graphTimestampKey]['value']
- deviceTimestamp = jsonObj[deviceTimestampKey]['value']
- linkTimestamp = jsonObj[linkTimestampKey]['value']
- else:
- main.log.error( "Unexpected json object" )
- graphTimestamp = 0
- deviceTimestamp = 0
- linkTimestamp = 0
-
- ptDownEndToEnd = int(graphTimestamp) - int(timestampBeginPtDown)
- ptDownOfpToDevice = float(deviceTimestamp) - float(timestampBeginPtDown)
- ptDownDeviceToLink = float(linkTimestamp) - float(deviceTimestamp)
- ptDownLinkToGraph = float(graphTimestamp) - float(linkTimestamp)
-
- if ptDownEndToEnd >= downThresholdMin and\
- ptDownEndToEnd < downThresholdMax and i >= iterIgnore:
- portDownEndToEndNodeIter[node][i] = ptDownEndToEnd
- main.log.info("ONOS "+str(nodeNum)+
- " port down End-to-end: "+
- str(ptDownEndToEnd) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+
- " port down End-to-end ignored"+
- " due to excess in threshold or premature iteration")
-
- if ptDownOfpToDevice >= downThresholdMin and\
- ptDownOfpToDevice < downThresholdMax and i >= iterIgnore:
- portDownOfpToDevNodeIter[node][i] = ptDownOfpToDevice
- main.log.info("ONOS "+str(nodeNum)+
- " port down Ofp-to-device: "+
- str(ptDownOfpToDevice) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+
- " port down Ofp-to-device ignored"+
- " due to excess in threshold or premature iteration")
-
- if ptDownDeviceToLink >= downThresholdMin and\
- ptDownDeviceToLink < downThresholdMax and i >= iterIgnore:
- portDownDevToLinkNodeIter[node][i] = ptDownDeviceToLink
- main.log.info("ONOS "+str(nodeNum)+
- " port down Device-to-link "+
- str(ptDownDeviceToLink) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+
- " port down Device-to-link ignored"+
- " due to excess in threshold or premature iteration")
-
- if ptDownLinkToGraph >= downThresholdMin and\
- ptDownLinkToGraph < downThresholdMax and i >= iterIgnore:
- portDownLinkToGraphNodeIter[node][i] = ptDownLinkToGraph
- main.log.info("ONOS "+str(nodeNum)+
- " port down Link-to-graph "+
- str(ptDownLinkToGraph) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+
- " port down Link-to-graph ignored"+
- " due to excess in threshold or premature iteration")
-
- time.sleep(3)
-
- main.step('Starting wireshark capture for port status up')
- main.ONOS1.tsharkGrep(tsharkPortStatus, tsharkPortUp)
-
- time.sleep(5)
- main.step('Enable port and obtain timestamp')
- main.Mininet1.handle.sendline('sh ifconfig ' + interfaceConfig + ' up')
- main.Mininet1.handle.expect('mininet>')
-
- jsonStrPtUp = []
- for node in range (0, clusterCount):
- metricsPortUp = CLIs[node].topologyEventsMetrics()
- jsonStrPtUp.append(metricsPortUp)
-
- time.sleep(5)
- main.ONOS1.tsharkStop()
-
- time.sleep(3)
- os.system('scp ' + ONOSUser + '@' +
- ONOS1Ip + ':' + tsharkPortUp + ' /tmp/')
-
- fPortUp = open(tsharkPortUp, 'r')
- fLine = fPortUp.readline()
- objUp = fLine.split(' ')
- if len(fLine) > 0:
- timestampBeginPtUp = int(float(objUp[1]) * 1000)
- if timestampBeginPtUp < 1400000000000:
- timestampBeginPtUp = int(float(objUp[2]) * 1000)
- main.log.info('Port up begin timestamp: ' + str(timestampBeginPtUp))
- else:
- main.log.info('Tshark output file returned unexpected' + ' results.')
- timestampBeginPtUp = 0
- fPortUp.close()
-
- for node in range(0, clusterCount):
- nodeNum = node+1
- #metricsUp = CLIs[node].topologyEventsMetrics
- #jsonStrUp = metricsUp()
- jsonObj = json.loads(jsonStrPtUp[node])
-
- if jsonObj:
- graphTimestamp = jsonObj[graphTimestampKey]['value']
- deviceTimestamp = jsonObj[deviceTimestampKey]['value']
- linkTimestamp = jsonObj[linkTimestampKey]['value']
- else:
- main.log.error( "Unexpected json object" )
- graphTimestamp = 0
- deviceTimestamp = 0
- linkTimestamp = 0
-
- ptUpEndToEnd = int(graphTimestamp) - int(timestampBeginPtUp)
- ptUpOfpToDevice = float(deviceTimestamp) - float(timestampBeginPtUp)
- ptUpDeviceToLink = float(linkTimestamp) - float(deviceTimestamp)
- ptUpLinkToGraph = float(graphTimestamp) - float(linkTimestamp)
-
- if ptUpEndToEnd >= upThresholdMin and\
- ptUpEndToEnd < upThresholdMax and i > iterIgnore:
- portUpEndToEndNodeIter[node][i] = ptUpEndToEnd
- main.log.info("ONOS "+str(nodeNum)+
- " port up End-to-end: "+
- str(ptUpEndToEnd) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+
- " port up End-to-end ignored"+
- " due to excess in threshold or premature iteration")
-
- if ptUpOfpToDevice >= upThresholdMin and\
- ptUpOfpToDevice < upThresholdMax and i > iterIgnore:
- portUpOfpToDevNodeIter[node][i] = ptUpOfpToDevice
- main.log.info("ONOS "+str(nodeNum)+
- " port up Ofp-to-device: "+
- str(ptUpOfpToDevice) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+
- " port up Ofp-to-device ignored"+
- " due to excess in threshold or premature iteration")
-
- if ptUpDeviceToLink >= upThresholdMin and\
- ptUpDeviceToLink < upThresholdMax and i > iterIgnore:
- portUpDevToLinkNodeIter[node][i] = ptUpDeviceToLink
- main.log.info("ONOS "+str(nodeNum)+
- " port up Device-to-link: "+
- str(ptUpDeviceToLink) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+
- " port up Device-to-link ignored"+
- " due to excess in threshold or premature iteration")
-
- if ptUpLinkToGraph >= upThresholdMin and\
- ptUpLinkToGraph < upThresholdMax and i > iterIgnore:
- portUpLinkToGraphNodeIter[node][i] = ptUpLinkToGraph
- main.log.info("ONOS "+str(nodeNum)+
- " port up Link-to-graph: "+
- str(ptUpLinkToGraph) + " ms")
- else:
- main.log.info("ONOS "+str(nodeNum)+
- " port up Link-to-graph ignored"+
- " due to excess in threshold or premature iteration")
-
- dbCmdList = []
- for node in range(0, clusterCount):
- portUpEndToEndList = []
- portUpOfpToDevList = []
- portUpDevToLinkList = []
- portUpLinkToGraphList = []
-
- portDownEndToEndList = []
- portDownOfpToDevList = []
- portDownDevToLinkList = []
- portDownLinkToGraphList = []
-
- portUpEndToEndAvg = 0
- portUpOfpToDevAvg = 0
- portUpDevToLinkAvg = 0
- portUpLinkToGraphAvg = 0
-
- portDownEndToEndAvg = 0
- portDownOfpToDevAvg = 0
- portDownDevToLinkAvg = 0
- portDownLinkToGraphAvg = 0
-
- # TODO: Update for more pythonic way to get list
- # portUpDevList = [item for item in portUpDevNodeIter[node]
- # if item > 0.0]
- for item in portUpEndToEndNodeIter[node]:
- if item > 0.0:
- portUpEndToEndList.append(item)
-
- for item in portUpOfpToDevNodeIter[node]:
- if item > 0.0:
- portUpOfpToDevList.append(item)
-
- for item in portUpDevToLinkNodeIter[node]:
- if item > 0.0:
- portUpDevToLinkList.append(item)
-
- for item in portUpLinkToGraphNodeIter[node]:
- if item >= 0.0:
- portUpLinkToGraphList.append(item)
-
- for item in portDownEndToEndNodeIter[node]:
- if item > 0.0:
- portDownEndToEndList.append(item)
-
- for item in portDownOfpToDevNodeIter[node]:
- if item > 0.0:
- portDownOfpToDevList.append(item)
-
- for item in portDownDevToLinkNodeIter[node]:
- if item >= 0.0:
- portDownDevToLinkList.append(item)
-
- for item in portDownLinkToGraphNodeIter[node]:
- if item >= 0.0:
- portDownLinkToGraphList.append(item)
-
- portUpEndToEndAvg = round(numpy.mean(portUpEndToEndList), 2)
- portUpOfpToDevAvg = round(numpy.mean(portUpOfpToDevList), 2)
- portUpDevToLinkAvg = round(numpy.mean(portUpDevToLinkList), 2)
- portUpLinkToGraphAvg = round(numpy.mean(portUpLinkToGraphList), 2)
-
- portDownEndToEndAvg = round(numpy.mean(portDownEndToEndList), 2)
- portDownOfpToDevAvg = round(numpy.mean(portDownOfpToDevList), 2)
- portDownDevToLinkAvg = round(numpy.mean(portDownDevToLinkList), 2)
- portDownLinkToGraphAvg = round(numpy.mean(portDownLinkToGraphList), 2)
-
- portUpStdDev = round(numpy.std(portUpEndToEndList), 2)
- portDownStdDev = round(numpy.std(portDownEndToEndList), 2)
-
- main.log.report(' - Node ' + str(node + 1) + ' Summary - ')
- main.log.report(' Port up End-to-end ' +
- str(portUpEndToEndAvg) + ' ms')
- main.log.report(' Port up Ofp-to-device ' +
- str(portUpOfpToDevAvg) + ' ms')
- main.log.report(' Port up Device-to-link ' +
- str(portUpDevToLinkAvg) + ' ms')
- main.log.report(' Port up Link-to-graph ' +
- str(portUpLinkToGraphAvg) + ' ms')
-
- main.log.report(' Port down End-to-end ' +
- str(round(portDownEndToEndAvg, 2)) + ' ms')
- main.log.report(' Port down Ofp-to-device ' +
- str(portDownOfpToDevAvg) + ' ms')
- main.log.report(' Port down Device-to-link ' +
- str(portDownDevToLinkAvg) + ' ms')
- main.log.report(' Port down Link-to-graph' +
- str(portDownLinkToGraphAvg) + ' ms')
-
- dbCmdList.append("INSERT INTO port_latency_details VALUES('" +
- timeToPost + "','port_latency_results'," + jenkinsBuildNumber +
- ',' + str(clusterCount) + ",'baremetal" + str(node + 1) +
- "'," +
- str(portUpEndToEndAvg) +',' +
- str(portUpOfpToDevAvg) + ',' +
- str(portUpDevToLinkAvg) + ',' +
- str(portUpLinkToGraphAvg) + ',' +
- str(portDownEndToEndAvg) + ',' +
- str(portDownOfpToDevAvg) + ',' +
- str(portDownDevToLinkAvg) + ',' +
- str(portDownLinkToGraphAvg) +
- ');')
-
- fResult = open(resultPath, 'a')
- for line in dbCmdList:
- if line:
- fResult.write(line + '\n')
-
- fResult.close()
-
- # Delete switches from controller to prepare for next
- # set of tests
- main.Mininet1.deleteSwController('s1')
- main.Mininet1.deleteSwController('s2')
- utilities.assert_equals(expect=main.TRUE,
- actual=assertion,
- onpass='Port discovery latency calculation successful',
- onfail='Port discovery test failed')
-
- def CASE4(self, main):
- """
- Increase number of nodes and initiate CLI
-
- With the most recent implementation, we need a method to
- ensure all ONOS nodes are killed, as well as redefine
- the cell files to ensure all nodes that will be used
- is in the cell file. Otherwise, exceptions will
- prohibit test from running successfully.
-
- 3/12/15
-
- """
- global clusterCount
- import time
- import os
-
- clusterCount += 2
-
- benchIp = main.params[ 'BENCH' ][ 'ip' ]
- features = main.params[ 'ENV' ][ 'cellFeatures' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- mininetIp = main.params[ 'MN' ][ 'ip1' ]
-
- main.log.report('Increasing cluster size to ' + str(clusterCount))
-
- main.log.step( "Killing all ONOS processes before scale-out" )
-
- for i in range( 1, 8 ):
- main.ONOSbench.onosDie(
- main.params[ 'CTRL' ][ 'ip'+str(i) ] )
- main.ONOSbench.onosUninstall(
- main.params[ 'CTRL' ][ 'ip'+str(i) ] )
-
- main.step( "Creating scale-out cell file" )
- cellIp = []
- for node in range( 1, clusterCount + 1 ):
- cellIp.append( main.params[ 'CTRL' ][ 'ip'+str(node) ] )
-
- main.log.info( "Cell Ip list: " + str(cellIp) )
- main.ONOSbench.createCellFile( benchIp, cellName, mininetIp,
- str(features), *cellIp )
-
- main.step( "Setting cell definition" )
- main.ONOSbench.setCell(cellName)
-
- main.step( "Packaging cell definition" )
- main.ONOSbench.onosPackage()
-
- for node in range( 1, clusterCount + 1 ):
- main.ONOSbench.onosInstall(
- node = main.params[ 'CTRL' ][ 'ip'+str(node) ])
-
- time.sleep( 20 )
-
- for node in range( 1, clusterCount + 1):
- for i in range( 2 ):
- isup = main.ONOSbench.isup(
- main.params[ 'CTRL' ][ 'ip'+str(node) ] )
- if isup:
- main.log.info( "ONOS "+str(node) + " is up\n")
- break
- if not isup:
- main.log.error( "ONOS "+str(node) + " did not start" )
-
- for node in range( 0, clusterCount ):
- CLIs[node].startOnosCli( cellIp[node] )
-
- main.step( 'Setting configurations for metrics' )
- configParam = 'maxEvents 1'
- main.ONOSbench.onosCfgSet( nodeIpList[0], configName, configParam )
- configParam = 'maxBatchMs 0'
- main.ONOSbench.onosCfgSet( nodeIpList[0], configName, configParam )
- configParam = 'maxIdleMs 0'
- main.ONOSbench.onosCfgSet( nodeIpList[0], configName, configParam )
-
- main.step( 'Activating essential applications' )
- CLIs[0].activateApp( 'org.onosproject.metrics' )
- CLIs[0].activateApp( 'org.onosproject.openflow' )
-
diff --git a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.topo b/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.topo
deleted file mode 100644
index 570dece..0000000
--- a/TestON/tests/TopoPerfNextBM/TopoPerfNextBM.topo
+++ /dev/null
@@ -1,163 +0,0 @@
-<TOPOLOGY>
- <COMPONENT>
-
- <ONOSbench>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOSbench>
-
- <ONOS1cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1cli>
-
- <ONOS2cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2cli>
-
- <ONOS3cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3cli>
-
- <ONOS4cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4cli>
-
- <ONOS5cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5cli>
-
- <ONOS6cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6cli>
-
- <ONOS7cli>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7cli>
-
- <ONOS1>
- <host>10.254.1.201</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>10.254.1.202</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>10</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>10.254.1.203</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>11</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
- <ONOS4>
- <host>10.254.1.204</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>12</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4>
-
- <ONOS5>
- <host>10.254.1.205</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>13</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5>
-
- <ONOS6>
- <host>10.254.1.206</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>14</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6>
-
- <ONOS7>
- <host>10.254.1.207</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>15</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7>
-
- <Mininet1>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>MininetCliDriver</type>
- <connect_order>16</connect_order>
- <COMPONENTS>
- <arg1> --custom topo-perf-2sw.py </arg1>
- <arg2> --topo mytopo</arg2>
- <arg3> </arg3>
- <controller> remote </controller>
- </COMPONENTS>
- </Mininet1>
-
- <Mininet2>
- <host>10.254.1.200</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>RemoteMininetDriver</type>
- <connect_order>17</connect_order>
- <COMPONENTS> </COMPONENTS>
- </Mininet2>
-
- </COMPONENT>
-</TOPOLOGY>
diff --git a/TestON/tests/TopoPerfNextBM/__init__.py b/TestON/tests/TopoPerfNextBM/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/TopoPerfNextBM/__init__.py
+++ /dev/null
diff --git a/TestON/tests/TopoPerfNextBM/backup/TopoPerfNextBM.params b/TestON/tests/TopoPerfNextBM/backup/TopoPerfNextBM.params
deleted file mode 100644
index d681433..0000000
--- a/TestON/tests/TopoPerfNextBM/backup/TopoPerfNextBM.params
+++ /dev/null
@@ -1,96 +0,0 @@
-<PARAMS>
- <testcases>1,2,3,4,2,3,4,2,3,4,2,3</testcases>
-
- <ENV>
- <cellName>topo_perf_test</cellName>
- <cellFeatures>"org.onosproject.metrics,org.onosproject.openflow"</cellFeatures>
- </ENV>
-
- <GIT>
- #autoPull 'on' or 'off'
- <autoPull>off</autoPull>
- <checkout>master</checkout>
- </GIT>
-
- <CTRL>
- <user>sdn</user>
- <ip1>10.128.174.1</ip1>
- <port1>6633</port1>
- <ip2>10.128.174.2</ip2>
- <port2>6633</port2>
- <ip3>10.128.174.3</ip3>
- <port3>6633</port3>
- <ip4>10.128.174.4</ip4>
-
- <ip5>10.128.174.5</ip5>
- <ip6>10.128.174.6</ip6>
- <ip7>10.128.174.7</ip7>
- </CTRL>
-
- <MN>
- <ip1>10.128.10.90</ip1>
- <ip2>10.128.10.91</ip2>
- </MN>
-
- <BENCH>
- <ip>10.128.174.10</ip>
- </BENCH>
-
- <TSHARK>
- <ofpPortStatus>OF 1.3 146</ofpPortStatus>
- <ofpRoleReply>OF 1.3 90 of_role_reply</ofpRoleReply>
- <featureReply>OF 1.3 98 of_features_reply</featureReply>
- <roleRequest>OF 1.3 90 of_role_request</roleRequest>
- <tcpSynAck>TCP 74 6633</tcpSynAck>
- <finAckSequence>FIN</finAckSequence>
- </TSHARK>
-
- <TEST>
- #'on' or 'off' debug mode.
- #If on, logging will be more verbose and
- #tshark pcap will be enabled
- #pcap file located at /tmp/'capture_name'
- <debugMode>off</debugMode>
- <onosLogFile>/opt/onos/log/karaf*</onosLogFile>
- <mci>off</mci>
-
- <topoConfigFile>
- single_topo_event_accumulator.cfg
- </topoConfigFile>
- <topoConfigName>
- org.onlab.onos.net.topology.impl.DefaultTopologyProvider.cfg
- </topoConfigName>
-
- #Number of times to iterate each case
- <numIter>10</numIter>
- <numSwitch>2</numSwitch>
- #Number of iterations to ignore initially
- <iterIgnore>2</iterIgnore>
-
- <singleSwThreshold>0,1000</singleSwThreshold>
- <portUpThreshold>0,1000</portUpThreshold>
- <portDownThreshold>0,1000</portDownThreshold>
- <linkUpThreshold>0,10000</linkUpThreshold>
- <linkDownThreshold>0,10000</linkDownThreshold>
- <swDisc100Threshold>0,10000</swDisc100Threshold>
-
- <tabletFile>tablets_3node.json</tabletFile>
- </TEST>
-
- <DB>
- <postToDB>on</postToDB>
- <portEventResultPath>
- /home/admin/ONLabTest/TestON/tests/TopoPerfNextBM/portEventResultDb.log
- </portEventResultPath>
- <switchEventResultPath>
- /home/admin/ONLabTest/TestON/tests/TopoPerfNextBM/switchEventResultDb.log
- </switchEventResultPath>
- </DB>
-
- <JSON>
- <deviceTimestamp>topologyDeviceEventTimestamp</deviceTimestamp>
- <hostTimestamp>topologyHostEventTimestamp</hostTimestamp>
- <linkTimestamp>topologyLinkEventTimestamp</linkTimestamp>
- <graphTimestamp>topologyGraphEventTimestamp</graphTimestamp>
- </JSON>
-</PARAMS>
diff --git a/TestON/tests/TopoPerfNextBM/portEventResultDb.log b/TestON/tests/TopoPerfNextBM/portEventResultDb.log
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/TopoPerfNextBM/portEventResultDb.log
+++ /dev/null
diff --git a/TestON/tests/TopoPerfNextBM/switchEventResultDb.log b/TestON/tests/TopoPerfNextBM/switchEventResultDb.log
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/TopoPerfNextBM/switchEventResultDb.log
+++ /dev/null
diff --git a/TestON/tests/flowTP1g/__init__.py b/TestON/tests/flowTP1g/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/TestON/tests/flowTP1g/__init__.py
+++ /dev/null
diff --git a/TestON/tests/flowTP1g/flowTP1g.params b/TestON/tests/flowTP1g/flowTP1g.params
deleted file mode 100644
index a3b104f..0000000
--- a/TestON/tests/flowTP1g/flowTP1g.params
+++ /dev/null
@@ -1,73 +0,0 @@
-<PARAMS>
-
- <testcases>1,2,1,2,1,2,1,2,1,2,1,2,1,2</testcases>
-
- <isOnBaremetal>True</isOnBaremetal>
- <SCALE>1,3,3,5,5,7,7</SCALE>
- <availableNodes>7</availableNodes>
-
-
-
- <ENV>
- <cellName>flowTP</cellName>
- <cellApps>drivers,null,demo</cellApps>
- </ENV>
-
- <TEST>
- <enableFlowRuleStoreBackup>true</enableFlowRuleStoreBackup>
- <skipCleanInstall>yes</skipCleanInstall>
- <warmUp>5</warmUp> #number of runs to warm up the system
- <sampleSize>20</sampleSize> #number of runs to take data from
- <neighbors>0,a</neighbors> #list of number of neighbors, a = all
- <flows>122500</flows>
- <switches>35</switches>
- <cooldown>10</cooldown>
- <testCMD0>flow-tester.py -f</testCMD0> #base command
- <testCMD1> -n </testCMD1> #neighbors
-
- </TEST>
-
- <GIT>
- <autopull>off</autopull>
- <checkout>master</checkout>
- </GIT>
-
- <CTRL>
- <USER>admin</USER>
-
- <ip1>OC1</ip1>
- <port1>6633</port1>
-
- <ip2>OC2</ip2>
- <port2>6633</port2>
-
- <ip3>OC3</ip3>
- <port3>6633</port3>
-
- <ip4>OC4</ip4>
- <port4>6633</port4>
-
- <ip5>OC5</ip5>
- <port5>6633</port5>
-
- <ip6>OC6</ip6>
- <port6>6633</port6>
-
- <ip7>OC7</ip7>
- <port7>6633</port7>
-
- </CTRL>
-
- <MN>
- <ip1>OCN</ip1>
- </MN>
-
- <BENCH>
- <user>admin</user>
- <ip1>OCN</ip1>
- </BENCH>
-
- <JSON>
- </JSON>
-
-</PARAMS>
diff --git a/TestON/tests/flowTP1g/flowTP1g.py b/TestON/tests/flowTP1g/flowTP1g.py
deleted file mode 100644
index 1f6ecbf..0000000
--- a/TestON/tests/flowTP1g/flowTP1g.py
+++ /dev/null
@@ -1,416 +0,0 @@
-# ScaleOutTemplate -> flowTP
-#
-# CASE1 starts number of nodes specified in param file
-#
-# cameron@onlab.us
-
-import sys
-import os.path
-
-
-class flowTP1g:
-
- def __init__( self ):
- self.default = ''
-
- def CASE1( self, main ):
-
- import time
- global init
- try:
- if type(init) is not bool:
- init = False
- except NameError:
- init = False
-
- #Load values from params file
- checkoutBranch = main.params[ 'GIT' ][ 'checkout' ]
- gitPull = main.params[ 'GIT' ][ 'autopull' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- Apps = main.params[ 'ENV' ][ 'cellApps' ]
- BENCHUser = main.params[ 'BENCH' ][ 'user' ]
- maxNodes = int(main.params[ 'availableNodes' ])
- skipMvn = main.params[ 'TEST' ][ 'skipCleanInstall' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
-
- main.log.info("==========DEBUG VERSION 3===========")
-
- main.exceptions = [0]*11
- main.warnings = [0]*11
- main.errors = [0]*11
-
- # -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
- init = True
- global clusterCount #number of nodes running
- global ONOSIp #list of ONOS IP addresses
- global scale
- global commit
-
- clusterCount = 0
- ONOSIp = [ 0 ]
- scale = (main.params[ 'SCALE' ]).split(",")
- clusterCount = int(scale[0])
-
- #Populate ONOSIp with ips from params
- for i in range(1, maxNodes + 1):
- ipString = 'ip' + str(i)
- ONOSIp.append(main.params[ 'CTRL' ][ ipString ])
-
- ONOSIp = [0]
- ONOSIp.extend(main.ONOSbench.getOnosIps())
-
- #mvn clean install, for debugging set param 'skipCleanInstall' to yes to speed up test
- if skipMvn != "yes":
- mvnResult = main.ONOSbench.cleanInstall()
-
- #git
- main.step( "Git checkout and pull " + checkoutBranch )
- if gitPull == 'on':
- checkoutResult = main.ONOSbench.gitCheckout( checkoutBranch )
- pullResult = main.ONOSbench.gitPull()
-
- else:
- checkoutResult = main.TRUE
- pullResult = main.TRUE
- main.log.info( "Skipped git checkout and pull" )
-
- commit = main.ONOSbench.getVersion()
- commit = (commit.split(" "))[1]
-
- resultsDB = open("flowTP1gDB", "w+")
- resultsDB.close()
-
- # -- END OF INIT SECTION --#
-
- clusterCount = int(scale[0])
- scale.remove(scale[0])
- main.log.info("CLUSTER COUNT: " + str(clusterCount))
-
- MN1Ip = ONOSIp[len(ONOSIp)-1]
- BENCHIp = ONOSIp[len(ONOSIp)-2]
-
- #kill off all onos processes
- main.log.step("Safety check, killing all ONOS processes")
- main.log.step("before initiating enviornment setup")
- for node in range(1, maxNodes + 1):
- main.ONOSbench.onosDie(ONOSIp[node])
-
- #Uninstall everywhere
- main.log.step( "Cleaning Enviornment..." )
- for i in range(1, maxNodes + 1):
- main.log.info(" Uninstalling ONOS " + str(i) )
- main.ONOSbench.onosUninstall( ONOSIp[i] )
-
- #construct the cell file
- main.log.info("Creating cell file")
- cellIp = []
- for node in range (1, clusterCount + 1):
- cellIp.append(ONOSIp[node])
-
- main.ONOSbench.createCellFile(BENCHIp,cellName,MN1Ip,str(Apps), *cellIp)
- main.log.info("Cell Ip list: " + str(cellIp))
-
- main.step( "Set Cell" )
- main.ONOSbench.setCell(cellName)
-
- main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
-
- main.step( "verify cells" )
- verifyCellResult = main.ONOSbench.verifyCell()
-
- main.log.report( "Initializeing " + str( clusterCount ) + " node cluster." )
- for node in range(1, clusterCount + 1):
- main.log.info("Starting ONOS " + str(node) + " at IP: " + ONOSIp[node])
- main.ONOSbench.onosInstall( ONOSIp[node])
-
- for node in range(1, clusterCount + 1):
- for i in range( 2 ):
- isup = main.ONOSbench.isup( ONOSIp[node] )
- if isup:
- main.log.info("ONOS " + str(node) + " is up\n")
- break
- if not isup:
- main.log.report( "ONOS " + str(node) + " didn't start!" )
-
- for node in range(1, clusterCount + 1):
- exec "a = main.ONOS%scli.startOnosCli" %str(node)
- a(ONOSIp[node])
-
- main.log.info("Startup sequence complete")
- main.ONOSbench.onosErrorLog(ONOSIp[1])
-
- def CASE2( self, main ):
- #
- # This is the flow TP test
- #
- import os.path
- import numpy
- import math
- import time
- import datetime
- import traceback
-
- global currentNeighbors
- try:
- currentNeighbors
- except:
- currentNeighbors = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")[0]
- else:
- if currentNeighbors == "r": #reset
- currentNeighbors = "0"
- else:
- currentNeighbors = "a"
-
- testCMD = [ 0,0,0,0 ]
- warmUp = int(main.params[ 'TEST' ][ 'warmUp' ])
- sampleSize = int(main.params[ 'TEST' ][ 'sampleSize' ])
- switches = int(main.params[ 'TEST' ][ 'switches' ])
- neighborList = (main.params[ 'TEST' ][ 'neighbors' ]).split(",")
- testCMD[0] = main.params[ 'TEST' ][ 'testCMD0' ]
- testCMD[1] = main.params[ 'TEST' ][ 'testCMD1' ]
- maxNodes = main.params[ 'availableNodes' ]
- onBaremetal = main.params['isOnBaremetal']
- cooldown = main.params[ 'TEST' ][ 'cooldown' ]
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
- BENCHUser = main.params[ 'BENCH' ][ 'user' ]
- MN1Ip = main.params[ 'MN' ][ 'ip1' ]
- maxNodes = int(main.params[ 'availableNodes' ])
- homeDir = os.path.expanduser('~')
- flowRuleBackup = str(main.params[ 'TEST' ][ 'enableFlowRuleStoreBackup' ])
- main.log.info("Flow Rule Backup is set to:" + flowRuleBackup)
-
- servers = str(clusterCount)
-
- if clusterCount == 1:
- neighborList = ['0']
- currentNeighbors = "r"
- else:
- if currentNeighbors == "a":
- neighborList = [str(clusterCount-1)]
- currentNeighbors = "r"
- else:
- neighborList = ['0']
-
- main.log.info("neightborlist: " + str(neighborList))
-
- ts = time.time()
- st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')
-
- #write file to change mem limit to 32 gigs (BAREMETAL ONLY!)
- if onBaremetal == "true":
- filename = "/onos/tools/package/bin/onos-service"
- serviceConfig = open(homeDir + filename, 'w+')
- serviceConfig.write("#!/bin/bash\n ")
- serviceConfig.write("#------------------------------------- \n ")
- serviceConfig.write("# Starts ONOS Apache Karaf container\n ")
- serviceConfig.write("#------------------------------------- \n ")
- serviceConfig.write("#export JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-openjdk-amd64/}\n ")
- serviceConfig.write("""export JAVA_OPTS="${JAVA_OPTS:--Xms8G -Xmx8G}" \n """)
- serviceConfig.write("")
- serviceConfig.write("ONOS_HOME=/opt/onos \n ")
- serviceConfig.write("")
- serviceConfig.write("[ -d $ONOS_HOME ] && cd $ONOS_HOME || ONOS_HOME=$(dirname $0)/..\n")
- serviceConfig.write("""${ONOS_HOME}/apache-karaf-$KARAF_VERSION/bin/karaf "$@" \n """)
- serviceConfig.close()
-
- for n in neighborList:
- main.log.step("\tSTARTING TEST")
- main.log.step("\tLOADING FROM SERVERS: \t" + str(clusterCount) )
- main.log.step("\tNEIGHBORS:\t" + n )
- main.log.info("=============================================================")
- main.log.info("=============================================================")
- #write file to configure nil link
- ipCSV = ""
- for i in range (1, int(maxNodes) + 1):
- tempstr = "ip" + str(i)
- ipCSV += main.params[ 'CTRL' ][ tempstr ]
- if i < int(maxNodes):
- ipCSV +=","
-
- for i in range(5):
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders deviceCount 35" """)
- main.ONOSbench.handle.expect(":~")
- time.sleep(3)
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.provider.nil.NullProviders topoShape linear" """)
- main.ONOSbench.handle.expect(":~")
- time.sleep(3)
- main.ONOSbench.handle.sendline("""onos $OC1 "null-simulation start" """)
- main.ONOSbench.handle.expect(":~")
- time.sleep(3)
- main.ONOSbench.handle.sendline("""onos $OC1 "balance-masters" """)
- main.ONOSbench.handle.expect(":~")
- time.sleep(3)
- main.log.info("""onos $OC1 "cfg set org.onosproject.store.flow.impl.NewDistributedFlowRuleStore backupEnabled """ + flowRuleBackup + """" """)
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg set org.onosproject.store.flow.impl.NewDistributedFlowRuleStore backupEnabled """ + flowRuleBackup + """" """)
- main.ONOSbench.handle.expect(":~")
-
- main.ONOSbench.handle.sendline("""onos $OC1 "cfg get" """)
- main.ONOSbench.handle.expect(":~")
- main.log.info(main.ONOSbench.handle.before)
-
- time.sleep(3)
- main.ONOSbench.handle.sendline("onos $OC1 summary")
- main.ONOSbench.handle.expect(":~")
- check = main.ONOSbench.handle.before
- main.log.info("\nStart up check: \n" + check + "\n")
- if "SCC(s)=1," in check:
- break
- time.sleep(5)
-
- #devide flows
- flows = int(main.params[ 'TEST' ][ 'flows' ])
- main.log.info("Flow Target = " + str(flows))
-
- flows = (flows *max(int(n)+1,int(servers)))/((int(n) + 1)*int(servers)*(switches))
-
- main.log.info("Flows per switch = " + str(flows))
-
- #build list of servers in "$OC1, $OC2...." format
- serverEnvVars = ""
- for i in range (1,int(servers)+1):
- serverEnvVars += ("-s " + ONOSIp[i] + " ")
-
- data = [[""]*int(servers)]*int(sampleSize)
- maxes = [""]*int(sampleSize)
-
- flowCMD = "python3 " + homeDir + "/onos/tools/test/bin/"
- flowCMD += testCMD[0] + " " + str(flows) + " " + testCMD[1]
- flowCMD += " " + str(n) + " " + str(serverEnvVars) + "-j"
-
- main.log.info(flowCMD)
- #time.sleep(60)
-
- for test in range(0, warmUp + sampleSize):
- if test < warmUp:
- main.log.info("Warm up " + str(test + 1) + " of " + str(warmUp))
- else:
- main.log.info("====== Test run: " + str(test-warmUp+1) + " ======")
-
- main.ONOSbench.handle.sendline(flowCMD)
- main.ONOSbench.handle.expect(":~")
- rawResult = main.ONOSbench.handle.before
- main.log.info("Raw results: \n" + rawResult + "\n")
-
- if "failed" in rawResult:
- main.log.report("FLOW_TESTER.PY FAILURE")
- main.log.report( " \n" + rawResult + " \n")
- for i in range(clusterCount):
- main.log.report("=======================================================")
- main.log.report(" ONOS " + str(i) + "LOG REPORT")
- main.ONOSbench.logReport(ONOSIp[i], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
- main.ONOSbench.handle.sendline("onos $OC1 flows")
- main.ONOSbench.handle.expect(":~")
- main.log.info(main.ONOSbench.handle.before)
-
- break
-
- ########################################################################################
- result = [""]*(clusterCount)
- rawResult = rawResult.splitlines()
-
- for node in range(1, clusterCount + 1):
- for line in rawResult:
- #print("line: " + line)
- if ONOSIp[node] in line and "server" in line:
- temp = line.split(" ")
- for word in temp:
- #print ("word: " + word)
- if "elapsed" in repr(word):
- index = temp.index(word) + 1
- myParsed = (temp[index]).replace(",","")
- myParsed = myParsed.replace("}","")
- myParsed = int(myParsed)
- result[node-1] = myParsed
- main.log.info( ONOSIp[node] + " : " + str(myParsed))
- break
-
- if test >= warmUp:
- for i in result:
- if i == "":
- main.log.error("Missing data point, critical failure incoming")
-
- print result
- maxes[test-warmUp] = max(result)
- main.log.info("Data collection iteration: " + str(test-warmUp) + " of " + str(sampleSize))
- main.log.info("Throughput time: " + str(maxes[test-warmUp]) + "(ms)")
-
- data[test-warmUp] = result
-
- # wait for flows = 0
- for checkCount in range(0,5):
- time.sleep(10)
- main.ONOSbench.handle.sendline("onos $OC1 summary")
- main.ONOSbench.handle.expect(":~")
- flowCheck = main.ONOSbench.handle.before
- if "flows=0," in flowCheck:
- main.log.info("Flows removed")
- break
- else:
- for line in flowCheck.splitlines():
- if "flows=" in line:
- main.log.info("Current Summary: " + line)
- if checkCount == 2:
- main.log.info("Flows are stuck, moving on ")
-
-
- time.sleep(5)
-
- main.log.info("raw data: " + str(data))
- main.log.info("maxes:" + str(maxes))
-
-
- # report data
- print("")
- main.log.info("\t Results (measurments are in milliseconds)")
- print("")
-
- nodeString = ""
- for i in range(1, int(servers) + 1):
- nodeString += ("\tNode " + str(i))
-
- for test in range(0, sampleSize ):
- main.log.info("\t Test iteration " + str(test + 1) )
- main.log.info("\t------------------")
- main.log.info(nodeString)
- resultString = ""
-
- for i in range(0, int(servers) ):
- resultString += ("\t" + str(data[test][i]) )
- main.log.info(resultString)
-
- print("\n")
-
- avgOfMaxes = numpy.mean(maxes)
- main.log.info("Average of max value from each test iteration: " + str(avgOfMaxes))
-
- stdOfMaxes = numpy.std(maxes)
- main.log.info("Standard Deviation of max values: " + str(stdOfMaxes))
- print("\n\n")
-
- avgTP = int(main.params[ 'TEST' ][ 'flows' ]) / avgOfMaxes #result in kflows/second
-
- tp = []
- for i in maxes:
- tp.append((int(main.params[ 'TEST' ][ 'flows' ]) / i ))
-
- stdTP = numpy.std(tp)
-
- main.log.info("Average thoughput: " + str(avgTP) + " Kflows/second" )
- main.log.info("Standard deviation of throughput: " + str(stdTP) + " Kflows/second")
-
- resultsLog = open("flowTP1gDB","a")
- resultString = ("'" + commit + "',")
- resultString += ("'1gig',")
- resultString += ((main.params[ 'TEST' ][ 'flows' ]) + ",")
- resultString += (str(clusterCount) + ",")
- resultString += (str(n) + ",")
- resultString += (str(avgTP) + "," + str(stdTP) + "\n")
- resultsLog.write(resultString)
- resultsLog.close()
-
- main.log.report("Result line to file: " + resultString)
-
- main.ONOSbench.logReport(ONOSIp[1], ["ERROR", "WARNING", "EXCEPT"], outputMode="d")
diff --git a/TestON/tests/flowTP1g/flowTP1g.topo b/TestON/tests/flowTP1g/flowTP1g.topo
deleted file mode 100644
index d82f3fd..0000000
--- a/TestON/tests/flowTP1g/flowTP1g.topo
+++ /dev/null
@@ -1,144 +0,0 @@
-<TOPOLOGY>
-
- <COMPONENT>
-
- <ONOSbench>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosDriver</type>
- <connect_order>1</connect_order>
- <COMPONENTS><home>~/onos</home></COMPONENTS>
- </ONOSbench>
-
- <ONOS1cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>2</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1cli>
-
- <ONOS2cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>3</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2cli>
-
- <ONOS3cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>4</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3cli>
-
- <ONOS4cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>5</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4cli>
-
- <ONOS5cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>6</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5cli>
-
- <ONOS6cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>7</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6cli>
-
- <ONOS7cli>
- <host>OCN</host>
- <user>admin</user>
- <password>onos_test</password>
- <type>OnosCliDriver</type>
- <connect_order>8</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7cli>
-
- <ONOS1>
- <host>OC1</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>9</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS1>
-
- <ONOS2>
- <host>OC2</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>10</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS2>
-
- <ONOS3>
- <host>OC3</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>11</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS3>
-
- <ONOS4>
- <host>OC4</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>12</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS4>
-
-
- <ONOS5>
- <host>OC5</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>13</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS5>
-
- <ONOS6>
- <host>OC6</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>14</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS6>
-
- <ONOS7>
- <host>OC7</host>
- <user>sdn</user>
- <password>rocks</password>
- <type>OnosDriver</type>
- <connect_order>15</connect_order>
- <COMPONENTS> </COMPONENTS>
- </ONOS7>
-
- </COMPONENT>
-
-</TOPOLOGY>
-