[ONOS-7039] [ONOS-7044] Fix PEP8 Warnings in TestON
Change-Id: Ied79ff9caff5487a6df50466307f757468d7ca3a
diff --git a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
index 3e21612..b7825e8 100644
--- a/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
+++ b/TestON/tests/CHOTestMonkey/CHOTestMonkey.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
CHOTestMonkey class
Author: you@onlab.us
@@ -95,7 +94,7 @@
main.caseResult = main.TRUE
stepResult = main.testSetUp.envSetup()
except Exception as e:
- main.testSetUp.envSetupException(e)
+ main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
diff --git a/TestON/tests/CHOTestMonkey/dependencies/EventGenerator.py b/TestON/tests/CHOTestMonkey/dependencies/EventGenerator.py
index c19715e..7100fae 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/EventGenerator.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/EventGenerator.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
This file contains the event generator class for CHOTestMonkey
Author: you@onlab.us
@@ -129,10 +128,10 @@
This function triggers an event from inside of CHOTestMonkey
"""
import time
- if not typeIndex in EventType().map.keys():
+ if typeIndex not in EventType().map.keys():
main.log.warn( "Event Generator - Unknown event type: " + str( typeIndex ) )
return
- if not scheduleMethod in EventScheduleMethod().map.keys():
+ if scheduleMethod not in EventScheduleMethod().map.keys():
main.log.warn( "Event Generator - Unknown event schedule method: " + str( scheduleMethod ) )
return
while not main.eventScheduler.isAvailable():
@@ -145,7 +144,7 @@
"""
if typeIndex > 100:
# Handle group events
- if not typeIndex in main.enabledEvents.keys():
+ if typeIndex not in main.enabledEvents.keys():
main.log.warn( "Event Generator - event type %s not enabled" % ( typeIndex ) )
return
function = getattr( self, main.enabledEvents[ typeIndex ] )
diff --git a/TestON/tests/CHOTestMonkey/dependencies/EventTrigger.py b/TestON/tests/CHOTestMonkey/dependencies/EventTrigger.py
index 878071e..2bfdd35 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/EventTrigger.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/EventTrigger.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Insert network/ONOS/app events into CHOTestMonkey
Author: you@onlab.us
@@ -104,5 +103,5 @@
print e
if __name__ == '__main__':
- #testLoop( 2 )
+ # testLoop( 2 )
replayFromFile()
diff --git a/TestON/tests/CHOTestMonkey/dependencies/GraphHelper.py b/TestON/tests/CHOTestMonkey/dependencies/GraphHelper.py
index 8ae1ff0..f2ae618 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/GraphHelper.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/GraphHelper.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Graph algorithm implementations for CHOTestMonkey
Author: you@onlab.us
@@ -71,14 +70,14 @@
else:
key = self.DFI[ neighbor.index ]
if key in self.backEdges.keys():
- if not link in self.backEdges[ key ] and\
- not backwardLink in self.backEdges[ key ]:
+ if link not in self.backEdges[ key ] and\
+ backwardLink not in self.backEdges[ key ]:
self.backEdges[ key ].append( backwardLink )
else:
tempKey = self.DFI[ device.index ]
if tempKey in self.backEdges.keys():
- if not link in self.backEdges[ tempKey ] and\
- not backwardLink in self.backEdges[ tempKey ]:
+ if link not in self.backEdges[ tempKey ] and\
+ backwardLink not in self.backEdges[ tempKey ]:
self.backEdges[ key ] = [ backwardLink ]
else:
self.backEdges[ key ] = [ backwardLink ]
diff --git a/TestON/tests/CHOTestMonkey/dependencies/cli.py b/TestON/tests/CHOTestMonkey/dependencies/cli.py
index aa080f5..6e67107 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/cli.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/cli.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Start CLI for CHOTestMonkey
Author: you@onlab.us
diff --git a/TestON/tests/CHOTestMonkey/dependencies/elements/NetworkElement.py b/TestON/tests/CHOTestMonkey/dependencies/elements/NetworkElement.py
index b6e1520..50d6159 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/elements/NetworkElement.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/elements/NetworkElement.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
This file contains device, host and link class for CHOTestMonkey
Author: you@onlab.us
diff --git a/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py b/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py
index e18e0b3..688324c 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
This file contains intent class for CHOTestMonkey
Author: you@onlab.us
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
index 45df912..8d347c1 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/AppEvent.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
This file contains classes for CHOTestMonkey that are related to application event
Author: you@onlab.us
@@ -88,7 +87,7 @@
def startEvent( self, args ):
with self.eventLock:
- #main.log.info( "%s - starting event" % ( self.typeString ) )
+ # main.log.info( "%s - starting event" % ( self.typeString ) )
if self.typeIndex == EventType().APP_INTENT_HOST_ADD or self.typeIndex == EventType().APP_INTENT_HOST_DEL:
if len( args ) < 3:
main.log.warn( "%s - Not enough arguments: %s" % ( self.typeString, args ) )
@@ -237,7 +236,7 @@
def startEvent( self, args ):
with self.eventLock:
- #main.log.info( "%s - starting event" % ( self.typeString ) )
+ # main.log.info( "%s - starting event" % ( self.typeString ) )
if self.typeIndex == EventType().APP_INTENT_POINT_ADD or self.typeIndex == EventType().APP_INTENT_POINT_DEL:
if len( args ) < 3:
main.log.warn( "%s - Not enough arguments: %s" % ( self.typeString, args ) )
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py
index fc03203..579b17f 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/CheckEvent.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
This file contains classes for CHOTestMonkey that are related to check event
Author: you@onlab.us
@@ -152,7 +151,7 @@
if controller.isUp():
with controller.CLILock:
topoState = controller.CLI.checkStatus( upDeviceNum, upLinkNum )
- #if not topoState:
+ # if not topoState:
# main.log.warn( "Topo Check - link or device number discoverd by ONOS%s is incorrect" % ( controller.index ) )
# checkResult = EventStates().FAIL
# Compare ONOS and Mininet topologies
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/Event.py b/TestON/tests/CHOTestMonkey/dependencies/events/Event.py
index 2a637e6..e6b9e25 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/events/Event.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/Event.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
This file contains the Event class for CHOTestMonkey
Author: you@onlab.us
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/NetworkEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/NetworkEvent.py
index 4d676cd..5632e12 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/events/NetworkEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/NetworkEvent.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
This file contains classes for CHOTestMonkey that are related to network event
Author: you@onlab.us
@@ -42,7 +41,7 @@
args are the names of the two link ends, e.g. [ 's1', 's2' ]
"""
with self.eventLock:
- #main.log.info( "%s - starting event" % ( self.typeString ) )
+ # main.log.info( "%s - starting event" % ( self.typeString ) )
if len( args ) < 2:
main.log.warn( "%s - Not enough arguments: %s" % ( self.typeString, args ) )
return EventStates().ABORT
@@ -178,7 +177,7 @@
args are the names of the device, e.g. 's1'
"""
with self.eventLock:
- #main.log.info( "%s - starting event" % ( self.typeString ) )
+ # main.log.info( "%s - starting event" % ( self.typeString ) )
if len( args ) < 1:
main.log.warn( "%s - Not enough arguments: %s" % ( self.typeString, args ) )
return EventStates().ABORT
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/ONOSEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/ONOSEvent.py
index e8b7281..1630066 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/events/ONOSEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/ONOSEvent.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
This file contains classes for CHOTestMonkey that are related to application event
Author: you@onlab.us
@@ -34,7 +33,7 @@
def startEvent( self, args ):
with self.eventLock:
- #main.log.info( "%s - starting event" % ( self.typeString ) )
+ # main.log.info( "%s - starting event" % ( self.typeString ) )
result = EventStates().PASS
if self.typeIndex == EventType().ONOS_ONOS_DOWN or self.typeIndex == EventType().ONOS_ONOS_UP:
if len( args ) < 1:
@@ -123,7 +122,7 @@
def startEvent( self, args ):
with self.eventLock:
- #main.log.info( "%s - starting event" % ( self.typeString ) )
+ # main.log.info( "%s - starting event" % ( self.typeString ) )
result = self.startCfgEvent( args )
return result
diff --git a/TestON/tests/CHOTestMonkey/dependencies/events/TestEvent.py b/TestON/tests/CHOTestMonkey/dependencies/events/TestEvent.py
index a7f99b9..866c219 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/events/TestEvent.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/events/TestEvent.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
This file contains classes for CHOTestMonkey that are related to check event
Author: you@onlab.us
diff --git a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoAtt.py b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoAtt.py
old mode 100755
new mode 100644
index c464f19..8cc532e
--- a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoAtt.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoAtt.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Custom topology for Mininet
"""
@@ -35,6 +34,7 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class attTopo( Topo ):
def __init__( self, **opts ):
@@ -98,106 +98,107 @@
PHNX_host = self.addHost( 'h25' )
# add edges between switch and corresponding host
- self.addLink( NY54 , NY54_host )
- self.addLink( CMBR , CMBR_host )
- self.addLink( CHCG , CHCG_host )
- self.addLink( CLEV , CLEV_host )
- self.addLink( RLGH , RLGH_host )
- self.addLink( ATLN , ATLN_host )
- self.addLink( PHLA , PHLA_host )
- self.addLink( WASH , WASH_host )
- self.addLink( NSVL , NSVL_host )
- self.addLink( STLS , STLS_host )
- self.addLink( NWOR , NWOR_host )
- self.addLink( HSTN , HSTN_host )
- self.addLink( SNAN , SNAN_host )
- self.addLink( DLLS , DLLS_host )
- self.addLink( ORLD , ORLD_host )
- self.addLink( DNVR , DNVR_host )
- self.addLink( KSCY , KSCY_host )
- self.addLink( SNFN , SNFN_host )
- self.addLink( SCRM , SCRM_host )
- self.addLink( PTLD , PTLD_host )
- self.addLink( STTL , STTL_host )
- self.addLink( SLKC , SLKC_host )
- self.addLink( LA03 , LA03_host )
- self.addLink( SNDG , SNDG_host )
- self.addLink( PHNX , PHNX_host )
+ self.addLink( NY54, NY54_host )
+ self.addLink( CMBR, CMBR_host )
+ self.addLink( CHCG, CHCG_host )
+ self.addLink( CLEV, CLEV_host )
+ self.addLink( RLGH, RLGH_host )
+ self.addLink( ATLN, ATLN_host )
+ self.addLink( PHLA, PHLA_host )
+ self.addLink( WASH, WASH_host )
+ self.addLink( NSVL, NSVL_host )
+ self.addLink( STLS, STLS_host )
+ self.addLink( NWOR, NWOR_host )
+ self.addLink( HSTN, HSTN_host )
+ self.addLink( SNAN, SNAN_host )
+ self.addLink( DLLS, DLLS_host )
+ self.addLink( ORLD, ORLD_host )
+ self.addLink( DNVR, DNVR_host )
+ self.addLink( KSCY, KSCY_host )
+ self.addLink( SNFN, SNFN_host )
+ self.addLink( SCRM, SCRM_host )
+ self.addLink( PTLD, PTLD_host )
+ self.addLink( STTL, STTL_host )
+ self.addLink( SLKC, SLKC_host )
+ self.addLink( LA03, LA03_host )
+ self.addLink( SNDG, SNDG_host )
+ self.addLink( PHNX, PHNX_host )
# add edges between switches
- self.addLink( NY54 , CMBR, bw=10, delay='0.979030824185ms')
- self.addLink( NY54 , CHCG, bw=10, delay='0.806374975652ms')
- self.addLink( NY54 , PHLA, bw=10, delay='0.686192970166ms')
- self.addLink( NY54 , WASH, bw=10, delay='0.605826192092ms')
- self.addLink( CMBR , PHLA, bw=10, delay='1.4018238197ms')
- self.addLink( CHCG , CLEV, bw=10, delay='0.232315346482ms')
- self.addLink( CHCG , PHLA, bw=10, delay='1.07297714274ms')
- self.addLink( CHCG , STLS, bw=10, delay='1.12827896944ms')
- self.addLink( CHCG , DNVR, bw=10, delay='1.35964770335ms')
- self.addLink( CHCG , KSCY, bw=10, delay='1.5199778541ms')
- self.addLink( CHCG , SNFN, bw=10, delay='0.620743405435ms')
- self.addLink( CHCG , STTL, bw=10, delay='0.93027212534ms')
- self.addLink( CHCG , SLKC, bw=10, delay='0.735621751348ms')
- self.addLink( CLEV , NSVL, bw=10, delay='0.523419372248ms')
- self.addLink( CLEV , STLS, bw=10, delay='1.00360290845ms')
- self.addLink( CLEV , PHLA, bw=10, delay='0.882912133249ms')
- self.addLink( RLGH , ATLN, bw=10, delay='1.1644489729ms')
- self.addLink( RLGH , WASH, bw=10, delay='1.48176810502ms')
- self.addLink( ATLN , WASH, bw=10, delay='0.557636936322ms')
- self.addLink( ATLN , NSVL, bw=10, delay='1.32869749865ms')
- self.addLink( ATLN , STLS, bw=10, delay='0.767705554748ms')
- self.addLink( ATLN , DLLS, bw=10, delay='0.544782086448ms')
- self.addLink( ATLN , ORLD, bw=10, delay='1.46119152532ms')
- self.addLink( PHLA , WASH, bw=10, delay='0.372209320106ms')
- self.addLink( NSVL , STLS, bw=10, delay='1.43250491305ms')
- self.addLink( NSVL , DLLS, bw=10, delay='1.67698215288ms')
- self.addLink( STLS , DLLS, bw=10, delay='0.256389964194ms')
- self.addLink( STLS , KSCY, bw=10, delay='0.395511571791ms')
- self.addLink( STLS , LA03, bw=10, delay='0.257085227363ms')
- self.addLink( NWOR , HSTN, bw=10, delay='0.0952906633914ms')
- self.addLink( NWOR , DLLS, bw=10, delay='1.60231329739ms')
- self.addLink( NWOR , ORLD, bw=10, delay='0.692731063896ms')
- self.addLink( HSTN , SNAN, bw=10, delay='0.284150653798ms')
- self.addLink( HSTN , DLLS, bw=10, delay='1.65690128332ms')
- self.addLink( HSTN , ORLD, bw=10, delay='0.731886304782ms')
- self.addLink( SNAN , PHNX, bw=10, delay='1.34258627257ms')
- self.addLink( SNAN , DLLS, bw=10, delay='1.50063532341ms')
- self.addLink( DLLS , DNVR, bw=10, delay='0.251471593235ms')
- self.addLink( DLLS , KSCY, bw=10, delay='0.18026026737ms')
- self.addLink( DLLS , SNFN, bw=10, delay='0.74304274592ms')
- self.addLink( DLLS , LA03, bw=10, delay='0.506439293357ms')
- self.addLink( DNVR , KSCY, bw=10, delay='0.223328790403ms')
- self.addLink( DNVR , SNFN, bw=10, delay='0.889017541903ms')
- self.addLink( DNVR , SLKC, bw=10, delay='0.631898982721ms')
- self.addLink( KSCY , SNFN, bw=10, delay='0.922778522233ms')
- self.addLink( SNFN , SCRM, bw=10, delay='0.630352278097ms')
- self.addLink( SNFN , PTLD, bw=10, delay='0.828572513655ms')
- self.addLink( SNFN , STTL, bw=10, delay='1.54076081649ms')
- self.addLink( SNFN , SLKC, bw=10, delay='0.621507502625ms')
- self.addLink( SNFN , LA03, bw=10, delay='0.602936230151ms')
- self.addLink( SCRM , SLKC, bw=10, delay='0.461350343644ms')
- self.addLink( PTLD , STTL, bw=10, delay='1.17591515181ms')
- self.addLink( SLKC , LA03, bw=10, delay='0.243225267023ms')
- self.addLink( LA03 , SNDG, bw=10, delay='0.681264950821ms')
- self.addLink( LA03 , PHNX, bw=10, delay='0.343709457969ms')
- self.addLink( SNDG , PHNX, bw=10, delay='0.345064487693ms')
+ self.addLink( NY54, CMBR, bw=10, delay='0.979030824185ms' )
+ self.addLink( NY54, CHCG, bw=10, delay='0.806374975652ms' )
+ self.addLink( NY54, PHLA, bw=10, delay='0.686192970166ms' )
+ self.addLink( NY54, WASH, bw=10, delay='0.605826192092ms' )
+ self.addLink( CMBR, PHLA, bw=10, delay='1.4018238197ms' )
+ self.addLink( CHCG, CLEV, bw=10, delay='0.232315346482ms' )
+ self.addLink( CHCG, PHLA, bw=10, delay='1.07297714274ms' )
+ self.addLink( CHCG, STLS, bw=10, delay='1.12827896944ms' )
+ self.addLink( CHCG, DNVR, bw=10, delay='1.35964770335ms' )
+ self.addLink( CHCG, KSCY, bw=10, delay='1.5199778541ms' )
+ self.addLink( CHCG, SNFN, bw=10, delay='0.620743405435ms' )
+ self.addLink( CHCG, STTL, bw=10, delay='0.93027212534ms' )
+ self.addLink( CHCG, SLKC, bw=10, delay='0.735621751348ms' )
+ self.addLink( CLEV, NSVL, bw=10, delay='0.523419372248ms' )
+ self.addLink( CLEV, STLS, bw=10, delay='1.00360290845ms' )
+ self.addLink( CLEV, PHLA, bw=10, delay='0.882912133249ms' )
+ self.addLink( RLGH, ATLN, bw=10, delay='1.1644489729ms' )
+ self.addLink( RLGH, WASH, bw=10, delay='1.48176810502ms' )
+ self.addLink( ATLN, WASH, bw=10, delay='0.557636936322ms' )
+ self.addLink( ATLN, NSVL, bw=10, delay='1.32869749865ms' )
+ self.addLink( ATLN, STLS, bw=10, delay='0.767705554748ms' )
+ self.addLink( ATLN, DLLS, bw=10, delay='0.544782086448ms' )
+ self.addLink( ATLN, ORLD, bw=10, delay='1.46119152532ms' )
+ self.addLink( PHLA, WASH, bw=10, delay='0.372209320106ms' )
+ self.addLink( NSVL, STLS, bw=10, delay='1.43250491305ms' )
+ self.addLink( NSVL, DLLS, bw=10, delay='1.67698215288ms' )
+ self.addLink( STLS, DLLS, bw=10, delay='0.256389964194ms' )
+ self.addLink( STLS, KSCY, bw=10, delay='0.395511571791ms' )
+ self.addLink( STLS, LA03, bw=10, delay='0.257085227363ms' )
+ self.addLink( NWOR, HSTN, bw=10, delay='0.0952906633914ms' )
+ self.addLink( NWOR, DLLS, bw=10, delay='1.60231329739ms' )
+ self.addLink( NWOR, ORLD, bw=10, delay='0.692731063896ms' )
+ self.addLink( HSTN, SNAN, bw=10, delay='0.284150653798ms' )
+ self.addLink( HSTN, DLLS, bw=10, delay='1.65690128332ms' )
+ self.addLink( HSTN, ORLD, bw=10, delay='0.731886304782ms' )
+ self.addLink( SNAN, PHNX, bw=10, delay='1.34258627257ms' )
+ self.addLink( SNAN, DLLS, bw=10, delay='1.50063532341ms' )
+ self.addLink( DLLS, DNVR, bw=10, delay='0.251471593235ms' )
+ self.addLink( DLLS, KSCY, bw=10, delay='0.18026026737ms' )
+ self.addLink( DLLS, SNFN, bw=10, delay='0.74304274592ms' )
+ self.addLink( DLLS, LA03, bw=10, delay='0.506439293357ms' )
+ self.addLink( DNVR, KSCY, bw=10, delay='0.223328790403ms' )
+ self.addLink( DNVR, SNFN, bw=10, delay='0.889017541903ms' )
+ self.addLink( DNVR, SLKC, bw=10, delay='0.631898982721ms' )
+ self.addLink( KSCY, SNFN, bw=10, delay='0.922778522233ms' )
+ self.addLink( SNFN, SCRM, bw=10, delay='0.630352278097ms' )
+ self.addLink( SNFN, PTLD, bw=10, delay='0.828572513655ms' )
+ self.addLink( SNFN, STTL, bw=10, delay='1.54076081649ms' )
+ self.addLink( SNFN, SLKC, bw=10, delay='0.621507502625ms' )
+ self.addLink( SNFN, LA03, bw=10, delay='0.602936230151ms' )
+ self.addLink( SCRM, SLKC, bw=10, delay='0.461350343644ms' )
+ self.addLink( PTLD, STTL, bw=10, delay='1.17591515181ms' )
+ self.addLink( SLKC, LA03, bw=10, delay='0.243225267023ms' )
+ self.addLink( LA03, SNDG, bw=10, delay='0.681264950821ms' )
+ self.addLink( LA03, PHNX, bw=10, delay='0.343709457969ms' )
+ self.addLink( SNDG, PHNX, bw=10, delay='0.345064487693ms' )
topos = { 'att': ( lambda: attTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = attTopo()
- #if controller_ip == '':
- #controller_ip = '10.0.2.2';
+ # if controller_ip == '':
+ # controller_ip = '10.0.2.2';
# controller_ip = '127.0.0.1';
- network = Mininet(topo=topo, link=TCLink, autoSetMacs=True, controller=None)
+ network = Mininet( topo=topo, link=TCLink, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoAttIpv6.py b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoAttIpv6.py
old mode 100755
new mode 100644
index 44133c6..8475efc
--- a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoAttIpv6.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoAttIpv6.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Custom topology for Mininet
"""
@@ -35,13 +34,16 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class dualStackHost( Host ):
+
def config( self, v6Addr='1000::1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class attTopo( Topo ):
def __init__( self, **opts ):
@@ -104,106 +106,107 @@
PHNX_host = self.addHost( 'h25', ip='10.1.0.25/24', cls=dualStackHost, v6Addr='1000::25/64' )
# add edges between switch and corresponding host
- self.addLink( NY54 , NY54_host )
- self.addLink( CMBR , CMBR_host )
- self.addLink( CHCG , CHCG_host )
- self.addLink( CLEV , CLEV_host )
- self.addLink( RLGH , RLGH_host )
- self.addLink( ATLN , ATLN_host )
- self.addLink( PHLA , PHLA_host )
- self.addLink( WASH , WASH_host )
- self.addLink( NSVL , NSVL_host )
- self.addLink( STLS , STLS_host )
- self.addLink( NWOR , NWOR_host )
- self.addLink( HSTN , HSTN_host )
- self.addLink( SNAN , SNAN_host )
- self.addLink( DLLS , DLLS_host )
- self.addLink( ORLD , ORLD_host )
- self.addLink( DNVR , DNVR_host )
- self.addLink( KSCY , KSCY_host )
- self.addLink( SNFN , SNFN_host )
- self.addLink( SCRM , SCRM_host )
- self.addLink( PTLD , PTLD_host )
- self.addLink( STTL , STTL_host )
- self.addLink( SLKC , SLKC_host )
- self.addLink( LA03 , LA03_host )
- self.addLink( SNDG , SNDG_host )
- self.addLink( PHNX , PHNX_host )
+ self.addLink( NY54, NY54_host )
+ self.addLink( CMBR, CMBR_host )
+ self.addLink( CHCG, CHCG_host )
+ self.addLink( CLEV, CLEV_host )
+ self.addLink( RLGH, RLGH_host )
+ self.addLink( ATLN, ATLN_host )
+ self.addLink( PHLA, PHLA_host )
+ self.addLink( WASH, WASH_host )
+ self.addLink( NSVL, NSVL_host )
+ self.addLink( STLS, STLS_host )
+ self.addLink( NWOR, NWOR_host )
+ self.addLink( HSTN, HSTN_host )
+ self.addLink( SNAN, SNAN_host )
+ self.addLink( DLLS, DLLS_host )
+ self.addLink( ORLD, ORLD_host )
+ self.addLink( DNVR, DNVR_host )
+ self.addLink( KSCY, KSCY_host )
+ self.addLink( SNFN, SNFN_host )
+ self.addLink( SCRM, SCRM_host )
+ self.addLink( PTLD, PTLD_host )
+ self.addLink( STTL, STTL_host )
+ self.addLink( SLKC, SLKC_host )
+ self.addLink( LA03, LA03_host )
+ self.addLink( SNDG, SNDG_host )
+ self.addLink( PHNX, PHNX_host )
# add edges between switches
- self.addLink( NY54 , CMBR, bw=10, delay='0.979030824185ms')
- self.addLink( NY54 , CHCG, bw=10, delay='0.806374975652ms')
- self.addLink( NY54 , PHLA, bw=10, delay='0.686192970166ms')
- self.addLink( NY54 , WASH, bw=10, delay='0.605826192092ms')
- self.addLink( CMBR , PHLA, bw=10, delay='1.4018238197ms')
- self.addLink( CHCG , CLEV, bw=10, delay='0.232315346482ms')
- self.addLink( CHCG , PHLA, bw=10, delay='1.07297714274ms')
- self.addLink( CHCG , STLS, bw=10, delay='1.12827896944ms')
- self.addLink( CHCG , DNVR, bw=10, delay='1.35964770335ms')
- self.addLink( CHCG , KSCY, bw=10, delay='1.5199778541ms')
- self.addLink( CHCG , SNFN, bw=10, delay='0.620743405435ms')
- self.addLink( CHCG , STTL, bw=10, delay='0.93027212534ms')
- self.addLink( CHCG , SLKC, bw=10, delay='0.735621751348ms')
- self.addLink( CLEV , NSVL, bw=10, delay='0.523419372248ms')
- self.addLink( CLEV , STLS, bw=10, delay='1.00360290845ms')
- self.addLink( CLEV , PHLA, bw=10, delay='0.882912133249ms')
- self.addLink( RLGH , ATLN, bw=10, delay='1.1644489729ms')
- self.addLink( RLGH , WASH, bw=10, delay='1.48176810502ms')
- self.addLink( ATLN , WASH, bw=10, delay='0.557636936322ms')
- self.addLink( ATLN , NSVL, bw=10, delay='1.32869749865ms')
- self.addLink( ATLN , STLS, bw=10, delay='0.767705554748ms')
- self.addLink( ATLN , DLLS, bw=10, delay='0.544782086448ms')
- self.addLink( ATLN , ORLD, bw=10, delay='1.46119152532ms')
- self.addLink( PHLA , WASH, bw=10, delay='0.372209320106ms')
- self.addLink( NSVL , STLS, bw=10, delay='1.43250491305ms')
- self.addLink( NSVL , DLLS, bw=10, delay='1.67698215288ms')
- self.addLink( STLS , DLLS, bw=10, delay='0.256389964194ms')
- self.addLink( STLS , KSCY, bw=10, delay='0.395511571791ms')
- self.addLink( STLS , LA03, bw=10, delay='0.257085227363ms')
- self.addLink( NWOR , HSTN, bw=10, delay='0.0952906633914ms')
- self.addLink( NWOR , DLLS, bw=10, delay='1.60231329739ms')
- self.addLink( NWOR , ORLD, bw=10, delay='0.692731063896ms')
- self.addLink( HSTN , SNAN, bw=10, delay='0.284150653798ms')
- self.addLink( HSTN , DLLS, bw=10, delay='1.65690128332ms')
- self.addLink( HSTN , ORLD, bw=10, delay='0.731886304782ms')
- self.addLink( SNAN , PHNX, bw=10, delay='1.34258627257ms')
- self.addLink( SNAN , DLLS, bw=10, delay='1.50063532341ms')
- self.addLink( DLLS , DNVR, bw=10, delay='0.251471593235ms')
- self.addLink( DLLS , KSCY, bw=10, delay='0.18026026737ms')
- self.addLink( DLLS , SNFN, bw=10, delay='0.74304274592ms')
- self.addLink( DLLS , LA03, bw=10, delay='0.506439293357ms')
- self.addLink( DNVR , KSCY, bw=10, delay='0.223328790403ms')
- self.addLink( DNVR , SNFN, bw=10, delay='0.889017541903ms')
- self.addLink( DNVR , SLKC, bw=10, delay='0.631898982721ms')
- self.addLink( KSCY , SNFN, bw=10, delay='0.922778522233ms')
- self.addLink( SNFN , SCRM, bw=10, delay='0.630352278097ms')
- self.addLink( SNFN , PTLD, bw=10, delay='0.828572513655ms')
- self.addLink( SNFN , STTL, bw=10, delay='1.54076081649ms')
- self.addLink( SNFN , SLKC, bw=10, delay='0.621507502625ms')
- self.addLink( SNFN , LA03, bw=10, delay='0.602936230151ms')
- self.addLink( SCRM , SLKC, bw=10, delay='0.461350343644ms')
- self.addLink( PTLD , STTL, bw=10, delay='1.17591515181ms')
- self.addLink( SLKC , LA03, bw=10, delay='0.243225267023ms')
- self.addLink( LA03 , SNDG, bw=10, delay='0.681264950821ms')
- self.addLink( LA03 , PHNX, bw=10, delay='0.343709457969ms')
- self.addLink( SNDG , PHNX, bw=10, delay='0.345064487693ms')
+ self.addLink( NY54, CMBR, bw=10, delay='0.979030824185ms' )
+ self.addLink( NY54, CHCG, bw=10, delay='0.806374975652ms' )
+ self.addLink( NY54, PHLA, bw=10, delay='0.686192970166ms' )
+ self.addLink( NY54, WASH, bw=10, delay='0.605826192092ms' )
+ self.addLink( CMBR, PHLA, bw=10, delay='1.4018238197ms' )
+ self.addLink( CHCG, CLEV, bw=10, delay='0.232315346482ms' )
+ self.addLink( CHCG, PHLA, bw=10, delay='1.07297714274ms' )
+ self.addLink( CHCG, STLS, bw=10, delay='1.12827896944ms' )
+ self.addLink( CHCG, DNVR, bw=10, delay='1.35964770335ms' )
+ self.addLink( CHCG, KSCY, bw=10, delay='1.5199778541ms' )
+ self.addLink( CHCG, SNFN, bw=10, delay='0.620743405435ms' )
+ self.addLink( CHCG, STTL, bw=10, delay='0.93027212534ms' )
+ self.addLink( CHCG, SLKC, bw=10, delay='0.735621751348ms' )
+ self.addLink( CLEV, NSVL, bw=10, delay='0.523419372248ms' )
+ self.addLink( CLEV, STLS, bw=10, delay='1.00360290845ms' )
+ self.addLink( CLEV, PHLA, bw=10, delay='0.882912133249ms' )
+ self.addLink( RLGH, ATLN, bw=10, delay='1.1644489729ms' )
+ self.addLink( RLGH, WASH, bw=10, delay='1.48176810502ms' )
+ self.addLink( ATLN, WASH, bw=10, delay='0.557636936322ms' )
+ self.addLink( ATLN, NSVL, bw=10, delay='1.32869749865ms' )
+ self.addLink( ATLN, STLS, bw=10, delay='0.767705554748ms' )
+ self.addLink( ATLN, DLLS, bw=10, delay='0.544782086448ms' )
+ self.addLink( ATLN, ORLD, bw=10, delay='1.46119152532ms' )
+ self.addLink( PHLA, WASH, bw=10, delay='0.372209320106ms' )
+ self.addLink( NSVL, STLS, bw=10, delay='1.43250491305ms' )
+ self.addLink( NSVL, DLLS, bw=10, delay='1.67698215288ms' )
+ self.addLink( STLS, DLLS, bw=10, delay='0.256389964194ms' )
+ self.addLink( STLS, KSCY, bw=10, delay='0.395511571791ms' )
+ self.addLink( STLS, LA03, bw=10, delay='0.257085227363ms' )
+ self.addLink( NWOR, HSTN, bw=10, delay='0.0952906633914ms' )
+ self.addLink( NWOR, DLLS, bw=10, delay='1.60231329739ms' )
+ self.addLink( NWOR, ORLD, bw=10, delay='0.692731063896ms' )
+ self.addLink( HSTN, SNAN, bw=10, delay='0.284150653798ms' )
+ self.addLink( HSTN, DLLS, bw=10, delay='1.65690128332ms' )
+ self.addLink( HSTN, ORLD, bw=10, delay='0.731886304782ms' )
+ self.addLink( SNAN, PHNX, bw=10, delay='1.34258627257ms' )
+ self.addLink( SNAN, DLLS, bw=10, delay='1.50063532341ms' )
+ self.addLink( DLLS, DNVR, bw=10, delay='0.251471593235ms' )
+ self.addLink( DLLS, KSCY, bw=10, delay='0.18026026737ms' )
+ self.addLink( DLLS, SNFN, bw=10, delay='0.74304274592ms' )
+ self.addLink( DLLS, LA03, bw=10, delay='0.506439293357ms' )
+ self.addLink( DNVR, KSCY, bw=10, delay='0.223328790403ms' )
+ self.addLink( DNVR, SNFN, bw=10, delay='0.889017541903ms' )
+ self.addLink( DNVR, SLKC, bw=10, delay='0.631898982721ms' )
+ self.addLink( KSCY, SNFN, bw=10, delay='0.922778522233ms' )
+ self.addLink( SNFN, SCRM, bw=10, delay='0.630352278097ms' )
+ self.addLink( SNFN, PTLD, bw=10, delay='0.828572513655ms' )
+ self.addLink( SNFN, STTL, bw=10, delay='1.54076081649ms' )
+ self.addLink( SNFN, SLKC, bw=10, delay='0.621507502625ms' )
+ self.addLink( SNFN, LA03, bw=10, delay='0.602936230151ms' )
+ self.addLink( SCRM, SLKC, bw=10, delay='0.461350343644ms' )
+ self.addLink( PTLD, STTL, bw=10, delay='1.17591515181ms' )
+ self.addLink( SLKC, LA03, bw=10, delay='0.243225267023ms' )
+ self.addLink( LA03, SNDG, bw=10, delay='0.681264950821ms' )
+ self.addLink( LA03, PHNX, bw=10, delay='0.343709457969ms' )
+ self.addLink( SNDG, PHNX, bw=10, delay='0.345064487693ms' )
topos = { 'att': ( lambda: attTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = attTopo()
- #if controller_ip == '':
- #controller_ip = '10.0.2.2';
+ # if controller_ip == '':
+ # controller_ip = '10.0.2.2';
# controller_ip = '127.0.0.1';
- network = Mininet(topo=topo, link=TCLink, autoSetMacs=True, controller=None)
+ network = Mininet( topo=topo, link=TCLink, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoChordal.py b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoChordal.py
old mode 100755
new mode 100644
index 7515d8f..3cb030b
--- a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoChordal.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoChordal.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import RemoteController
@@ -32,6 +31,7 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class chordalTopo( Topo ):
def __init__( self, **opts ):
@@ -95,348 +95,349 @@
s25_host = self.addHost( 'h25' )
# add edges between switch and corresponding host
- self.addLink( s1 , s1_host )
- self.addLink( s2 , s2_host )
- self.addLink( s3 , s3_host )
- self.addLink( s4 , s4_host )
- self.addLink( s5 , s5_host )
- self.addLink( s6 , s6_host )
- self.addLink( s7 , s7_host )
- self.addLink( s8 , s8_host )
- self.addLink( s9 , s9_host )
- self.addLink( s10 , s10_host )
- self.addLink( s11 , s11_host )
- self.addLink( s12 , s12_host )
- self.addLink( s13 , s13_host )
- self.addLink( s14 , s14_host )
- self.addLink( s15 , s15_host )
- self.addLink( s16 , s16_host )
- self.addLink( s17 , s17_host )
- self.addLink( s18 , s18_host )
- self.addLink( s19 , s19_host )
- self.addLink( s20 , s20_host )
- self.addLink( s21 , s21_host )
- self.addLink( s22 , s22_host )
- self.addLink( s23 , s23_host )
- self.addLink( s24 , s24_host )
- self.addLink( s25 , s25_host )
- self.addLink(s1, s2)
- self.addLink(s1, s3)
- self.addLink(s1, s4)
- self.addLink(s1, s5)
- self.addLink(s1, s6)
- self.addLink(s1, s7)
- self.addLink(s1, s8)
- self.addLink(s1, s9)
- self.addLink(s1, s10)
- self.addLink(s1, s11)
- self.addLink(s1, s12)
- self.addLink(s1, s13)
- self.addLink(s1, s14)
- self.addLink(s1, s15)
- self.addLink(s1, s16)
- self.addLink(s1, s17)
- self.addLink(s1, s18)
- self.addLink(s1, s19)
- self.addLink(s1, s20)
- self.addLink(s1, s21)
- self.addLink(s1, s22)
- self.addLink(s1, s23)
- self.addLink(s1, s24)
- self.addLink(s1, s25)
- self.addLink(s2, s3)
- self.addLink(s2, s4)
- self.addLink(s2, s5)
- self.addLink(s2, s6)
- self.addLink(s2, s7)
- self.addLink(s2, s8)
- self.addLink(s2, s9)
- self.addLink(s2, s10)
- self.addLink(s2, s11)
- self.addLink(s2, s12)
- self.addLink(s2, s13)
- self.addLink(s2, s14)
- self.addLink(s2, s15)
- self.addLink(s2, s16)
- self.addLink(s2, s17)
- self.addLink(s2, s18)
- self.addLink(s2, s19)
- self.addLink(s2, s20)
- self.addLink(s2, s21)
- self.addLink(s2, s22)
- self.addLink(s2, s23)
- self.addLink(s2, s24)
- self.addLink(s2, s25)
- self.addLink(s3, s4)
- self.addLink(s3, s5)
- self.addLink(s3, s6)
- self.addLink(s3, s7)
- self.addLink(s3, s8)
- self.addLink(s3, s9)
- self.addLink(s3, s10)
- self.addLink(s3, s11)
- self.addLink(s3, s12)
- self.addLink(s3, s13)
- self.addLink(s3, s14)
- self.addLink(s3, s15)
- self.addLink(s3, s16)
- self.addLink(s3, s17)
- self.addLink(s3, s18)
- self.addLink(s3, s19)
- self.addLink(s3, s20)
- self.addLink(s3, s21)
- self.addLink(s3, s22)
- self.addLink(s3, s23)
- self.addLink(s3, s24)
- self.addLink(s3, s25)
- self.addLink(s4, s5)
- self.addLink(s4, s6)
- self.addLink(s4, s7)
- self.addLink(s4, s8)
- self.addLink(s4, s9)
- self.addLink(s4, s10)
- self.addLink(s4, s11)
- self.addLink(s4, s12)
- self.addLink(s4, s13)
- self.addLink(s4, s14)
- self.addLink(s4, s15)
- self.addLink(s4, s16)
- self.addLink(s4, s17)
- self.addLink(s4, s18)
- self.addLink(s4, s19)
- self.addLink(s4, s20)
- self.addLink(s4, s21)
- self.addLink(s4, s22)
- self.addLink(s4, s23)
- self.addLink(s4, s24)
- self.addLink(s4, s25)
- self.addLink(s5, s6)
- self.addLink(s5, s7)
- self.addLink(s5, s8)
- self.addLink(s5, s9)
- self.addLink(s5, s10)
- self.addLink(s5, s11)
- self.addLink(s5, s12)
- self.addLink(s5, s13)
- self.addLink(s5, s14)
- self.addLink(s5, s15)
- self.addLink(s5, s16)
- self.addLink(s5, s17)
- self.addLink(s5, s18)
- self.addLink(s5, s19)
- self.addLink(s5, s20)
- self.addLink(s5, s21)
- self.addLink(s5, s22)
- self.addLink(s5, s23)
- self.addLink(s5, s24)
- self.addLink(s5, s25)
- self.addLink(s6, s7)
- self.addLink(s6, s8)
- self.addLink(s6, s9)
- self.addLink(s6, s10)
- self.addLink(s6, s11)
- self.addLink(s6, s12)
- self.addLink(s6, s13)
- self.addLink(s6, s14)
- self.addLink(s6, s15)
- self.addLink(s6, s16)
- self.addLink(s6, s17)
- self.addLink(s6, s18)
- self.addLink(s6, s19)
- self.addLink(s6, s20)
- self.addLink(s6, s21)
- self.addLink(s6, s22)
- self.addLink(s6, s23)
- self.addLink(s6, s24)
- self.addLink(s6, s25)
- self.addLink(s7, s8)
- self.addLink(s7, s9)
- self.addLink(s7, s10)
- self.addLink(s7, s11)
- self.addLink(s7, s12)
- self.addLink(s7, s13)
- self.addLink(s7, s14)
- self.addLink(s7, s15)
- self.addLink(s7, s16)
- self.addLink(s7, s17)
- self.addLink(s7, s18)
- self.addLink(s7, s19)
- self.addLink(s7, s20)
- self.addLink(s7, s21)
- self.addLink(s7, s22)
- self.addLink(s7, s23)
- self.addLink(s7, s24)
- self.addLink(s7, s25)
- self.addLink(s8, s9)
- self.addLink(s8, s10)
- self.addLink(s8, s11)
- self.addLink(s8, s12)
- self.addLink(s8, s13)
- self.addLink(s8, s14)
- self.addLink(s8, s15)
- self.addLink(s8, s16)
- self.addLink(s8, s17)
- self.addLink(s8, s18)
- self.addLink(s8, s19)
- self.addLink(s8, s20)
- self.addLink(s8, s21)
- self.addLink(s8, s22)
- self.addLink(s8, s23)
- self.addLink(s8, s24)
- self.addLink(s8, s25)
- self.addLink(s9, s10)
- self.addLink(s9, s11)
- self.addLink(s9, s12)
- self.addLink(s9, s13)
- self.addLink(s9, s14)
- self.addLink(s9, s15)
- self.addLink(s9, s16)
- self.addLink(s9, s17)
- self.addLink(s9, s18)
- self.addLink(s9, s19)
- self.addLink(s9, s20)
- self.addLink(s9, s21)
- self.addLink(s9, s22)
- self.addLink(s9, s23)
- self.addLink(s9, s24)
- self.addLink(s9, s25)
- self.addLink(s10, s11)
- self.addLink(s10, s12)
- self.addLink(s10, s13)
- self.addLink(s10, s14)
- self.addLink(s10, s15)
- self.addLink(s10, s16)
- self.addLink(s10, s17)
- self.addLink(s10, s18)
- self.addLink(s10, s19)
- self.addLink(s10, s20)
- self.addLink(s10, s21)
- self.addLink(s10, s22)
- self.addLink(s10, s23)
- self.addLink(s10, s24)
- self.addLink(s10, s25)
- self.addLink(s11, s12)
- self.addLink(s11, s13)
- self.addLink(s11, s14)
- self.addLink(s11, s15)
- self.addLink(s11, s16)
- self.addLink(s11, s17)
- self.addLink(s11, s18)
- self.addLink(s11, s19)
- self.addLink(s11, s20)
- self.addLink(s11, s21)
- self.addLink(s11, s22)
- self.addLink(s11, s23)
- self.addLink(s11, s24)
- self.addLink(s11, s25)
- self.addLink(s12, s13)
- self.addLink(s12, s14)
- self.addLink(s12, s15)
- self.addLink(s12, s16)
- self.addLink(s12, s17)
- self.addLink(s12, s18)
- self.addLink(s12, s19)
- self.addLink(s12, s20)
- self.addLink(s12, s21)
- self.addLink(s12, s22)
- self.addLink(s12, s23)
- self.addLink(s12, s24)
- self.addLink(s12, s25)
- self.addLink(s13, s14)
- self.addLink(s13, s15)
- self.addLink(s13, s16)
- self.addLink(s13, s17)
- self.addLink(s13, s18)
- self.addLink(s13, s19)
- self.addLink(s13, s20)
- self.addLink(s13, s21)
- self.addLink(s13, s22)
- self.addLink(s13, s23)
- self.addLink(s13, s24)
- self.addLink(s13, s25)
- self.addLink(s14, s15)
- self.addLink(s14, s16)
- self.addLink(s14, s17)
- self.addLink(s14, s18)
- self.addLink(s14, s19)
- self.addLink(s14, s20)
- self.addLink(s14, s21)
- self.addLink(s14, s22)
- self.addLink(s14, s23)
- self.addLink(s14, s24)
- self.addLink(s14, s25)
- self.addLink(s15, s16)
- self.addLink(s15, s17)
- self.addLink(s15, s18)
- self.addLink(s15, s19)
- self.addLink(s15, s20)
- self.addLink(s15, s21)
- self.addLink(s15, s22)
- self.addLink(s15, s23)
- self.addLink(s15, s24)
- self.addLink(s15, s25)
- self.addLink(s16, s17)
- self.addLink(s16, s18)
- self.addLink(s16, s19)
- self.addLink(s16, s20)
- self.addLink(s16, s21)
- self.addLink(s16, s22)
- self.addLink(s16, s23)
- self.addLink(s16, s24)
- self.addLink(s16, s25)
- self.addLink(s17, s18)
- self.addLink(s17, s19)
- self.addLink(s17, s20)
- self.addLink(s17, s21)
- self.addLink(s17, s22)
- self.addLink(s17, s23)
- self.addLink(s17, s24)
- self.addLink(s17, s25)
- self.addLink(s18, s19)
- self.addLink(s18, s20)
- self.addLink(s18, s21)
- self.addLink(s18, s22)
- self.addLink(s18, s23)
- self.addLink(s18, s24)
- self.addLink(s18, s25)
- self.addLink(s19, s20)
- self.addLink(s19, s21)
- self.addLink(s19, s22)
- self.addLink(s19, s23)
- self.addLink(s19, s24)
- self.addLink(s19, s25)
- self.addLink(s20, s21)
- self.addLink(s20, s22)
- self.addLink(s20, s23)
- self.addLink(s20, s24)
- self.addLink(s20, s25)
- self.addLink(s21, s22)
- self.addLink(s21, s23)
- self.addLink(s21, s24)
- self.addLink(s21, s25)
- self.addLink(s22, s23)
- self.addLink(s22, s24)
- self.addLink(s22, s25)
- self.addLink(s23, s24)
- self.addLink(s23, s25)
- self.addLink(s24, s25)
+ self.addLink( s1, s1_host )
+ self.addLink( s2, s2_host )
+ self.addLink( s3, s3_host )
+ self.addLink( s4, s4_host )
+ self.addLink( s5, s5_host )
+ self.addLink( s6, s6_host )
+ self.addLink( s7, s7_host )
+ self.addLink( s8, s8_host )
+ self.addLink( s9, s9_host )
+ self.addLink( s10, s10_host )
+ self.addLink( s11, s11_host )
+ self.addLink( s12, s12_host )
+ self.addLink( s13, s13_host )
+ self.addLink( s14, s14_host )
+ self.addLink( s15, s15_host )
+ self.addLink( s16, s16_host )
+ self.addLink( s17, s17_host )
+ self.addLink( s18, s18_host )
+ self.addLink( s19, s19_host )
+ self.addLink( s20, s20_host )
+ self.addLink( s21, s21_host )
+ self.addLink( s22, s22_host )
+ self.addLink( s23, s23_host )
+ self.addLink( s24, s24_host )
+ self.addLink( s25, s25_host )
+ self.addLink( s1, s2 )
+ self.addLink( s1, s3 )
+ self.addLink( s1, s4 )
+ self.addLink( s1, s5 )
+ self.addLink( s1, s6 )
+ self.addLink( s1, s7 )
+ self.addLink( s1, s8 )
+ self.addLink( s1, s9 )
+ self.addLink( s1, s10 )
+ self.addLink( s1, s11 )
+ self.addLink( s1, s12 )
+ self.addLink( s1, s13 )
+ self.addLink( s1, s14 )
+ self.addLink( s1, s15 )
+ self.addLink( s1, s16 )
+ self.addLink( s1, s17 )
+ self.addLink( s1, s18 )
+ self.addLink( s1, s19 )
+ self.addLink( s1, s20 )
+ self.addLink( s1, s21 )
+ self.addLink( s1, s22 )
+ self.addLink( s1, s23 )
+ self.addLink( s1, s24 )
+ self.addLink( s1, s25 )
+ self.addLink( s2, s3 )
+ self.addLink( s2, s4 )
+ self.addLink( s2, s5 )
+ self.addLink( s2, s6 )
+ self.addLink( s2, s7 )
+ self.addLink( s2, s8 )
+ self.addLink( s2, s9 )
+ self.addLink( s2, s10 )
+ self.addLink( s2, s11 )
+ self.addLink( s2, s12 )
+ self.addLink( s2, s13 )
+ self.addLink( s2, s14 )
+ self.addLink( s2, s15 )
+ self.addLink( s2, s16 )
+ self.addLink( s2, s17 )
+ self.addLink( s2, s18 )
+ self.addLink( s2, s19 )
+ self.addLink( s2, s20 )
+ self.addLink( s2, s21 )
+ self.addLink( s2, s22 )
+ self.addLink( s2, s23 )
+ self.addLink( s2, s24 )
+ self.addLink( s2, s25 )
+ self.addLink( s3, s4 )
+ self.addLink( s3, s5 )
+ self.addLink( s3, s6 )
+ self.addLink( s3, s7 )
+ self.addLink( s3, s8 )
+ self.addLink( s3, s9 )
+ self.addLink( s3, s10 )
+ self.addLink( s3, s11 )
+ self.addLink( s3, s12 )
+ self.addLink( s3, s13 )
+ self.addLink( s3, s14 )
+ self.addLink( s3, s15 )
+ self.addLink( s3, s16 )
+ self.addLink( s3, s17 )
+ self.addLink( s3, s18 )
+ self.addLink( s3, s19 )
+ self.addLink( s3, s20 )
+ self.addLink( s3, s21 )
+ self.addLink( s3, s22 )
+ self.addLink( s3, s23 )
+ self.addLink( s3, s24 )
+ self.addLink( s3, s25 )
+ self.addLink( s4, s5 )
+ self.addLink( s4, s6 )
+ self.addLink( s4, s7 )
+ self.addLink( s4, s8 )
+ self.addLink( s4, s9 )
+ self.addLink( s4, s10 )
+ self.addLink( s4, s11 )
+ self.addLink( s4, s12 )
+ self.addLink( s4, s13 )
+ self.addLink( s4, s14 )
+ self.addLink( s4, s15 )
+ self.addLink( s4, s16 )
+ self.addLink( s4, s17 )
+ self.addLink( s4, s18 )
+ self.addLink( s4, s19 )
+ self.addLink( s4, s20 )
+ self.addLink( s4, s21 )
+ self.addLink( s4, s22 )
+ self.addLink( s4, s23 )
+ self.addLink( s4, s24 )
+ self.addLink( s4, s25 )
+ self.addLink( s5, s6 )
+ self.addLink( s5, s7 )
+ self.addLink( s5, s8 )
+ self.addLink( s5, s9 )
+ self.addLink( s5, s10 )
+ self.addLink( s5, s11 )
+ self.addLink( s5, s12 )
+ self.addLink( s5, s13 )
+ self.addLink( s5, s14 )
+ self.addLink( s5, s15 )
+ self.addLink( s5, s16 )
+ self.addLink( s5, s17 )
+ self.addLink( s5, s18 )
+ self.addLink( s5, s19 )
+ self.addLink( s5, s20 )
+ self.addLink( s5, s21 )
+ self.addLink( s5, s22 )
+ self.addLink( s5, s23 )
+ self.addLink( s5, s24 )
+ self.addLink( s5, s25 )
+ self.addLink( s6, s7 )
+ self.addLink( s6, s8 )
+ self.addLink( s6, s9 )
+ self.addLink( s6, s10 )
+ self.addLink( s6, s11 )
+ self.addLink( s6, s12 )
+ self.addLink( s6, s13 )
+ self.addLink( s6, s14 )
+ self.addLink( s6, s15 )
+ self.addLink( s6, s16 )
+ self.addLink( s6, s17 )
+ self.addLink( s6, s18 )
+ self.addLink( s6, s19 )
+ self.addLink( s6, s20 )
+ self.addLink( s6, s21 )
+ self.addLink( s6, s22 )
+ self.addLink( s6, s23 )
+ self.addLink( s6, s24 )
+ self.addLink( s6, s25 )
+ self.addLink( s7, s8 )
+ self.addLink( s7, s9 )
+ self.addLink( s7, s10 )
+ self.addLink( s7, s11 )
+ self.addLink( s7, s12 )
+ self.addLink( s7, s13 )
+ self.addLink( s7, s14 )
+ self.addLink( s7, s15 )
+ self.addLink( s7, s16 )
+ self.addLink( s7, s17 )
+ self.addLink( s7, s18 )
+ self.addLink( s7, s19 )
+ self.addLink( s7, s20 )
+ self.addLink( s7, s21 )
+ self.addLink( s7, s22 )
+ self.addLink( s7, s23 )
+ self.addLink( s7, s24 )
+ self.addLink( s7, s25 )
+ self.addLink( s8, s9 )
+ self.addLink( s8, s10 )
+ self.addLink( s8, s11 )
+ self.addLink( s8, s12 )
+ self.addLink( s8, s13 )
+ self.addLink( s8, s14 )
+ self.addLink( s8, s15 )
+ self.addLink( s8, s16 )
+ self.addLink( s8, s17 )
+ self.addLink( s8, s18 )
+ self.addLink( s8, s19 )
+ self.addLink( s8, s20 )
+ self.addLink( s8, s21 )
+ self.addLink( s8, s22 )
+ self.addLink( s8, s23 )
+ self.addLink( s8, s24 )
+ self.addLink( s8, s25 )
+ self.addLink( s9, s10 )
+ self.addLink( s9, s11 )
+ self.addLink( s9, s12 )
+ self.addLink( s9, s13 )
+ self.addLink( s9, s14 )
+ self.addLink( s9, s15 )
+ self.addLink( s9, s16 )
+ self.addLink( s9, s17 )
+ self.addLink( s9, s18 )
+ self.addLink( s9, s19 )
+ self.addLink( s9, s20 )
+ self.addLink( s9, s21 )
+ self.addLink( s9, s22 )
+ self.addLink( s9, s23 )
+ self.addLink( s9, s24 )
+ self.addLink( s9, s25 )
+ self.addLink( s10, s11 )
+ self.addLink( s10, s12 )
+ self.addLink( s10, s13 )
+ self.addLink( s10, s14 )
+ self.addLink( s10, s15 )
+ self.addLink( s10, s16 )
+ self.addLink( s10, s17 )
+ self.addLink( s10, s18 )
+ self.addLink( s10, s19 )
+ self.addLink( s10, s20 )
+ self.addLink( s10, s21 )
+ self.addLink( s10, s22 )
+ self.addLink( s10, s23 )
+ self.addLink( s10, s24 )
+ self.addLink( s10, s25 )
+ self.addLink( s11, s12 )
+ self.addLink( s11, s13 )
+ self.addLink( s11, s14 )
+ self.addLink( s11, s15 )
+ self.addLink( s11, s16 )
+ self.addLink( s11, s17 )
+ self.addLink( s11, s18 )
+ self.addLink( s11, s19 )
+ self.addLink( s11, s20 )
+ self.addLink( s11, s21 )
+ self.addLink( s11, s22 )
+ self.addLink( s11, s23 )
+ self.addLink( s11, s24 )
+ self.addLink( s11, s25 )
+ self.addLink( s12, s13 )
+ self.addLink( s12, s14 )
+ self.addLink( s12, s15 )
+ self.addLink( s12, s16 )
+ self.addLink( s12, s17 )
+ self.addLink( s12, s18 )
+ self.addLink( s12, s19 )
+ self.addLink( s12, s20 )
+ self.addLink( s12, s21 )
+ self.addLink( s12, s22 )
+ self.addLink( s12, s23 )
+ self.addLink( s12, s24 )
+ self.addLink( s12, s25 )
+ self.addLink( s13, s14 )
+ self.addLink( s13, s15 )
+ self.addLink( s13, s16 )
+ self.addLink( s13, s17 )
+ self.addLink( s13, s18 )
+ self.addLink( s13, s19 )
+ self.addLink( s13, s20 )
+ self.addLink( s13, s21 )
+ self.addLink( s13, s22 )
+ self.addLink( s13, s23 )
+ self.addLink( s13, s24 )
+ self.addLink( s13, s25 )
+ self.addLink( s14, s15 )
+ self.addLink( s14, s16 )
+ self.addLink( s14, s17 )
+ self.addLink( s14, s18 )
+ self.addLink( s14, s19 )
+ self.addLink( s14, s20 )
+ self.addLink( s14, s21 )
+ self.addLink( s14, s22 )
+ self.addLink( s14, s23 )
+ self.addLink( s14, s24 )
+ self.addLink( s14, s25 )
+ self.addLink( s15, s16 )
+ self.addLink( s15, s17 )
+ self.addLink( s15, s18 )
+ self.addLink( s15, s19 )
+ self.addLink( s15, s20 )
+ self.addLink( s15, s21 )
+ self.addLink( s15, s22 )
+ self.addLink( s15, s23 )
+ self.addLink( s15, s24 )
+ self.addLink( s15, s25 )
+ self.addLink( s16, s17 )
+ self.addLink( s16, s18 )
+ self.addLink( s16, s19 )
+ self.addLink( s16, s20 )
+ self.addLink( s16, s21 )
+ self.addLink( s16, s22 )
+ self.addLink( s16, s23 )
+ self.addLink( s16, s24 )
+ self.addLink( s16, s25 )
+ self.addLink( s17, s18 )
+ self.addLink( s17, s19 )
+ self.addLink( s17, s20 )
+ self.addLink( s17, s21 )
+ self.addLink( s17, s22 )
+ self.addLink( s17, s23 )
+ self.addLink( s17, s24 )
+ self.addLink( s17, s25 )
+ self.addLink( s18, s19 )
+ self.addLink( s18, s20 )
+ self.addLink( s18, s21 )
+ self.addLink( s18, s22 )
+ self.addLink( s18, s23 )
+ self.addLink( s18, s24 )
+ self.addLink( s18, s25 )
+ self.addLink( s19, s20 )
+ self.addLink( s19, s21 )
+ self.addLink( s19, s22 )
+ self.addLink( s19, s23 )
+ self.addLink( s19, s24 )
+ self.addLink( s19, s25 )
+ self.addLink( s20, s21 )
+ self.addLink( s20, s22 )
+ self.addLink( s20, s23 )
+ self.addLink( s20, s24 )
+ self.addLink( s20, s25 )
+ self.addLink( s21, s22 )
+ self.addLink( s21, s23 )
+ self.addLink( s21, s24 )
+ self.addLink( s21, s25 )
+ self.addLink( s22, s23 )
+ self.addLink( s22, s24 )
+ self.addLink( s22, s25 )
+ self.addLink( s23, s24 )
+ self.addLink( s23, s25 )
+ self.addLink( s24, s25 )
topos = { 'chordal': ( lambda: chordalTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = chordalTopo()
- #if controller_ip == '':
- #controller_ip = '10.0.2.2';
+ # if controller_ip == '':
+ # controller_ip = '10.0.2.2';
# controller_ip = '127.0.0.1';
- network = Mininet(topo=topo, switch=OVSSwitch,autoSetMacs=True, controller=None)
+ network = Mininet( topo=topo, switch=OVSSwitch, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoChordalIpv6.py b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoChordalIpv6.py
old mode 100755
new mode 100644
index 929949d..907fec9
--- a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoChordalIpv6.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoChordalIpv6.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import Host, RemoteController
@@ -32,13 +31,16 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class dualStackHost( Host ):
+
def config( self, v6Addr='1000::1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class chordalTopo( Topo ):
def __init__( self, **opts ):
@@ -101,348 +103,349 @@
s25_host = self.addHost( 'h25', ip='10.1.0.25/24', cls=dualStackHost, v6Addr='1000::25/64' )
# add edges between switch and corresponding host
- self.addLink( s1 , s1_host )
- self.addLink( s2 , s2_host )
- self.addLink( s3 , s3_host )
- self.addLink( s4 , s4_host )
- self.addLink( s5 , s5_host )
- self.addLink( s6 , s6_host )
- self.addLink( s7 , s7_host )
- self.addLink( s8 , s8_host )
- self.addLink( s9 , s9_host )
- self.addLink( s10 , s10_host )
- self.addLink( s11 , s11_host )
- self.addLink( s12 , s12_host )
- self.addLink( s13 , s13_host )
- self.addLink( s14 , s14_host )
- self.addLink( s15 , s15_host )
- self.addLink( s16 , s16_host )
- self.addLink( s17 , s17_host )
- self.addLink( s18 , s18_host )
- self.addLink( s19 , s19_host )
- self.addLink( s20 , s20_host )
- self.addLink( s21 , s21_host )
- self.addLink( s22 , s22_host )
- self.addLink( s23 , s23_host )
- self.addLink( s24 , s24_host )
- self.addLink( s25 , s25_host )
- self.addLink(s1, s2)
- self.addLink(s1, s3)
- self.addLink(s1, s4)
- self.addLink(s1, s5)
- self.addLink(s1, s6)
- self.addLink(s1, s7)
- self.addLink(s1, s8)
- self.addLink(s1, s9)
- self.addLink(s1, s10)
- self.addLink(s1, s11)
- self.addLink(s1, s12)
- self.addLink(s1, s13)
- self.addLink(s1, s14)
- self.addLink(s1, s15)
- self.addLink(s1, s16)
- self.addLink(s1, s17)
- self.addLink(s1, s18)
- self.addLink(s1, s19)
- self.addLink(s1, s20)
- self.addLink(s1, s21)
- self.addLink(s1, s22)
- self.addLink(s1, s23)
- self.addLink(s1, s24)
- self.addLink(s1, s25)
- self.addLink(s2, s3)
- self.addLink(s2, s4)
- self.addLink(s2, s5)
- self.addLink(s2, s6)
- self.addLink(s2, s7)
- self.addLink(s2, s8)
- self.addLink(s2, s9)
- self.addLink(s2, s10)
- self.addLink(s2, s11)
- self.addLink(s2, s12)
- self.addLink(s2, s13)
- self.addLink(s2, s14)
- self.addLink(s2, s15)
- self.addLink(s2, s16)
- self.addLink(s2, s17)
- self.addLink(s2, s18)
- self.addLink(s2, s19)
- self.addLink(s2, s20)
- self.addLink(s2, s21)
- self.addLink(s2, s22)
- self.addLink(s2, s23)
- self.addLink(s2, s24)
- self.addLink(s2, s25)
- self.addLink(s3, s4)
- self.addLink(s3, s5)
- self.addLink(s3, s6)
- self.addLink(s3, s7)
- self.addLink(s3, s8)
- self.addLink(s3, s9)
- self.addLink(s3, s10)
- self.addLink(s3, s11)
- self.addLink(s3, s12)
- self.addLink(s3, s13)
- self.addLink(s3, s14)
- self.addLink(s3, s15)
- self.addLink(s3, s16)
- self.addLink(s3, s17)
- self.addLink(s3, s18)
- self.addLink(s3, s19)
- self.addLink(s3, s20)
- self.addLink(s3, s21)
- self.addLink(s3, s22)
- self.addLink(s3, s23)
- self.addLink(s3, s24)
- self.addLink(s3, s25)
- self.addLink(s4, s5)
- self.addLink(s4, s6)
- self.addLink(s4, s7)
- self.addLink(s4, s8)
- self.addLink(s4, s9)
- self.addLink(s4, s10)
- self.addLink(s4, s11)
- self.addLink(s4, s12)
- self.addLink(s4, s13)
- self.addLink(s4, s14)
- self.addLink(s4, s15)
- self.addLink(s4, s16)
- self.addLink(s4, s17)
- self.addLink(s4, s18)
- self.addLink(s4, s19)
- self.addLink(s4, s20)
- self.addLink(s4, s21)
- self.addLink(s4, s22)
- self.addLink(s4, s23)
- self.addLink(s4, s24)
- self.addLink(s4, s25)
- self.addLink(s5, s6)
- self.addLink(s5, s7)
- self.addLink(s5, s8)
- self.addLink(s5, s9)
- self.addLink(s5, s10)
- self.addLink(s5, s11)
- self.addLink(s5, s12)
- self.addLink(s5, s13)
- self.addLink(s5, s14)
- self.addLink(s5, s15)
- self.addLink(s5, s16)
- self.addLink(s5, s17)
- self.addLink(s5, s18)
- self.addLink(s5, s19)
- self.addLink(s5, s20)
- self.addLink(s5, s21)
- self.addLink(s5, s22)
- self.addLink(s5, s23)
- self.addLink(s5, s24)
- self.addLink(s5, s25)
- self.addLink(s6, s7)
- self.addLink(s6, s8)
- self.addLink(s6, s9)
- self.addLink(s6, s10)
- self.addLink(s6, s11)
- self.addLink(s6, s12)
- self.addLink(s6, s13)
- self.addLink(s6, s14)
- self.addLink(s6, s15)
- self.addLink(s6, s16)
- self.addLink(s6, s17)
- self.addLink(s6, s18)
- self.addLink(s6, s19)
- self.addLink(s6, s20)
- self.addLink(s6, s21)
- self.addLink(s6, s22)
- self.addLink(s6, s23)
- self.addLink(s6, s24)
- self.addLink(s6, s25)
- self.addLink(s7, s8)
- self.addLink(s7, s9)
- self.addLink(s7, s10)
- self.addLink(s7, s11)
- self.addLink(s7, s12)
- self.addLink(s7, s13)
- self.addLink(s7, s14)
- self.addLink(s7, s15)
- self.addLink(s7, s16)
- self.addLink(s7, s17)
- self.addLink(s7, s18)
- self.addLink(s7, s19)
- self.addLink(s7, s20)
- self.addLink(s7, s21)
- self.addLink(s7, s22)
- self.addLink(s7, s23)
- self.addLink(s7, s24)
- self.addLink(s7, s25)
- self.addLink(s8, s9)
- self.addLink(s8, s10)
- self.addLink(s8, s11)
- self.addLink(s8, s12)
- self.addLink(s8, s13)
- self.addLink(s8, s14)
- self.addLink(s8, s15)
- self.addLink(s8, s16)
- self.addLink(s8, s17)
- self.addLink(s8, s18)
- self.addLink(s8, s19)
- self.addLink(s8, s20)
- self.addLink(s8, s21)
- self.addLink(s8, s22)
- self.addLink(s8, s23)
- self.addLink(s8, s24)
- self.addLink(s8, s25)
- self.addLink(s9, s10)
- self.addLink(s9, s11)
- self.addLink(s9, s12)
- self.addLink(s9, s13)
- self.addLink(s9, s14)
- self.addLink(s9, s15)
- self.addLink(s9, s16)
- self.addLink(s9, s17)
- self.addLink(s9, s18)
- self.addLink(s9, s19)
- self.addLink(s9, s20)
- self.addLink(s9, s21)
- self.addLink(s9, s22)
- self.addLink(s9, s23)
- self.addLink(s9, s24)
- self.addLink(s9, s25)
- self.addLink(s10, s11)
- self.addLink(s10, s12)
- self.addLink(s10, s13)
- self.addLink(s10, s14)
- self.addLink(s10, s15)
- self.addLink(s10, s16)
- self.addLink(s10, s17)
- self.addLink(s10, s18)
- self.addLink(s10, s19)
- self.addLink(s10, s20)
- self.addLink(s10, s21)
- self.addLink(s10, s22)
- self.addLink(s10, s23)
- self.addLink(s10, s24)
- self.addLink(s10, s25)
- self.addLink(s11, s12)
- self.addLink(s11, s13)
- self.addLink(s11, s14)
- self.addLink(s11, s15)
- self.addLink(s11, s16)
- self.addLink(s11, s17)
- self.addLink(s11, s18)
- self.addLink(s11, s19)
- self.addLink(s11, s20)
- self.addLink(s11, s21)
- self.addLink(s11, s22)
- self.addLink(s11, s23)
- self.addLink(s11, s24)
- self.addLink(s11, s25)
- self.addLink(s12, s13)
- self.addLink(s12, s14)
- self.addLink(s12, s15)
- self.addLink(s12, s16)
- self.addLink(s12, s17)
- self.addLink(s12, s18)
- self.addLink(s12, s19)
- self.addLink(s12, s20)
- self.addLink(s12, s21)
- self.addLink(s12, s22)
- self.addLink(s12, s23)
- self.addLink(s12, s24)
- self.addLink(s12, s25)
- self.addLink(s13, s14)
- self.addLink(s13, s15)
- self.addLink(s13, s16)
- self.addLink(s13, s17)
- self.addLink(s13, s18)
- self.addLink(s13, s19)
- self.addLink(s13, s20)
- self.addLink(s13, s21)
- self.addLink(s13, s22)
- self.addLink(s13, s23)
- self.addLink(s13, s24)
- self.addLink(s13, s25)
- self.addLink(s14, s15)
- self.addLink(s14, s16)
- self.addLink(s14, s17)
- self.addLink(s14, s18)
- self.addLink(s14, s19)
- self.addLink(s14, s20)
- self.addLink(s14, s21)
- self.addLink(s14, s22)
- self.addLink(s14, s23)
- self.addLink(s14, s24)
- self.addLink(s14, s25)
- self.addLink(s15, s16)
- self.addLink(s15, s17)
- self.addLink(s15, s18)
- self.addLink(s15, s19)
- self.addLink(s15, s20)
- self.addLink(s15, s21)
- self.addLink(s15, s22)
- self.addLink(s15, s23)
- self.addLink(s15, s24)
- self.addLink(s15, s25)
- self.addLink(s16, s17)
- self.addLink(s16, s18)
- self.addLink(s16, s19)
- self.addLink(s16, s20)
- self.addLink(s16, s21)
- self.addLink(s16, s22)
- self.addLink(s16, s23)
- self.addLink(s16, s24)
- self.addLink(s16, s25)
- self.addLink(s17, s18)
- self.addLink(s17, s19)
- self.addLink(s17, s20)
- self.addLink(s17, s21)
- self.addLink(s17, s22)
- self.addLink(s17, s23)
- self.addLink(s17, s24)
- self.addLink(s17, s25)
- self.addLink(s18, s19)
- self.addLink(s18, s20)
- self.addLink(s18, s21)
- self.addLink(s18, s22)
- self.addLink(s18, s23)
- self.addLink(s18, s24)
- self.addLink(s18, s25)
- self.addLink(s19, s20)
- self.addLink(s19, s21)
- self.addLink(s19, s22)
- self.addLink(s19, s23)
- self.addLink(s19, s24)
- self.addLink(s19, s25)
- self.addLink(s20, s21)
- self.addLink(s20, s22)
- self.addLink(s20, s23)
- self.addLink(s20, s24)
- self.addLink(s20, s25)
- self.addLink(s21, s22)
- self.addLink(s21, s23)
- self.addLink(s21, s24)
- self.addLink(s21, s25)
- self.addLink(s22, s23)
- self.addLink(s22, s24)
- self.addLink(s22, s25)
- self.addLink(s23, s24)
- self.addLink(s23, s25)
- self.addLink(s24, s25)
+ self.addLink( s1, s1_host )
+ self.addLink( s2, s2_host )
+ self.addLink( s3, s3_host )
+ self.addLink( s4, s4_host )
+ self.addLink( s5, s5_host )
+ self.addLink( s6, s6_host )
+ self.addLink( s7, s7_host )
+ self.addLink( s8, s8_host )
+ self.addLink( s9, s9_host )
+ self.addLink( s10, s10_host )
+ self.addLink( s11, s11_host )
+ self.addLink( s12, s12_host )
+ self.addLink( s13, s13_host )
+ self.addLink( s14, s14_host )
+ self.addLink( s15, s15_host )
+ self.addLink( s16, s16_host )
+ self.addLink( s17, s17_host )
+ self.addLink( s18, s18_host )
+ self.addLink( s19, s19_host )
+ self.addLink( s20, s20_host )
+ self.addLink( s21, s21_host )
+ self.addLink( s22, s22_host )
+ self.addLink( s23, s23_host )
+ self.addLink( s24, s24_host )
+ self.addLink( s25, s25_host )
+ self.addLink( s1, s2 )
+ self.addLink( s1, s3 )
+ self.addLink( s1, s4 )
+ self.addLink( s1, s5 )
+ self.addLink( s1, s6 )
+ self.addLink( s1, s7 )
+ self.addLink( s1, s8 )
+ self.addLink( s1, s9 )
+ self.addLink( s1, s10 )
+ self.addLink( s1, s11 )
+ self.addLink( s1, s12 )
+ self.addLink( s1, s13 )
+ self.addLink( s1, s14 )
+ self.addLink( s1, s15 )
+ self.addLink( s1, s16 )
+ self.addLink( s1, s17 )
+ self.addLink( s1, s18 )
+ self.addLink( s1, s19 )
+ self.addLink( s1, s20 )
+ self.addLink( s1, s21 )
+ self.addLink( s1, s22 )
+ self.addLink( s1, s23 )
+ self.addLink( s1, s24 )
+ self.addLink( s1, s25 )
+ self.addLink( s2, s3 )
+ self.addLink( s2, s4 )
+ self.addLink( s2, s5 )
+ self.addLink( s2, s6 )
+ self.addLink( s2, s7 )
+ self.addLink( s2, s8 )
+ self.addLink( s2, s9 )
+ self.addLink( s2, s10 )
+ self.addLink( s2, s11 )
+ self.addLink( s2, s12 )
+ self.addLink( s2, s13 )
+ self.addLink( s2, s14 )
+ self.addLink( s2, s15 )
+ self.addLink( s2, s16 )
+ self.addLink( s2, s17 )
+ self.addLink( s2, s18 )
+ self.addLink( s2, s19 )
+ self.addLink( s2, s20 )
+ self.addLink( s2, s21 )
+ self.addLink( s2, s22 )
+ self.addLink( s2, s23 )
+ self.addLink( s2, s24 )
+ self.addLink( s2, s25 )
+ self.addLink( s3, s4 )
+ self.addLink( s3, s5 )
+ self.addLink( s3, s6 )
+ self.addLink( s3, s7 )
+ self.addLink( s3, s8 )
+ self.addLink( s3, s9 )
+ self.addLink( s3, s10 )
+ self.addLink( s3, s11 )
+ self.addLink( s3, s12 )
+ self.addLink( s3, s13 )
+ self.addLink( s3, s14 )
+ self.addLink( s3, s15 )
+ self.addLink( s3, s16 )
+ self.addLink( s3, s17 )
+ self.addLink( s3, s18 )
+ self.addLink( s3, s19 )
+ self.addLink( s3, s20 )
+ self.addLink( s3, s21 )
+ self.addLink( s3, s22 )
+ self.addLink( s3, s23 )
+ self.addLink( s3, s24 )
+ self.addLink( s3, s25 )
+ self.addLink( s4, s5 )
+ self.addLink( s4, s6 )
+ self.addLink( s4, s7 )
+ self.addLink( s4, s8 )
+ self.addLink( s4, s9 )
+ self.addLink( s4, s10 )
+ self.addLink( s4, s11 )
+ self.addLink( s4, s12 )
+ self.addLink( s4, s13 )
+ self.addLink( s4, s14 )
+ self.addLink( s4, s15 )
+ self.addLink( s4, s16 )
+ self.addLink( s4, s17 )
+ self.addLink( s4, s18 )
+ self.addLink( s4, s19 )
+ self.addLink( s4, s20 )
+ self.addLink( s4, s21 )
+ self.addLink( s4, s22 )
+ self.addLink( s4, s23 )
+ self.addLink( s4, s24 )
+ self.addLink( s4, s25 )
+ self.addLink( s5, s6 )
+ self.addLink( s5, s7 )
+ self.addLink( s5, s8 )
+ self.addLink( s5, s9 )
+ self.addLink( s5, s10 )
+ self.addLink( s5, s11 )
+ self.addLink( s5, s12 )
+ self.addLink( s5, s13 )
+ self.addLink( s5, s14 )
+ self.addLink( s5, s15 )
+ self.addLink( s5, s16 )
+ self.addLink( s5, s17 )
+ self.addLink( s5, s18 )
+ self.addLink( s5, s19 )
+ self.addLink( s5, s20 )
+ self.addLink( s5, s21 )
+ self.addLink( s5, s22 )
+ self.addLink( s5, s23 )
+ self.addLink( s5, s24 )
+ self.addLink( s5, s25 )
+ self.addLink( s6, s7 )
+ self.addLink( s6, s8 )
+ self.addLink( s6, s9 )
+ self.addLink( s6, s10 )
+ self.addLink( s6, s11 )
+ self.addLink( s6, s12 )
+ self.addLink( s6, s13 )
+ self.addLink( s6, s14 )
+ self.addLink( s6, s15 )
+ self.addLink( s6, s16 )
+ self.addLink( s6, s17 )
+ self.addLink( s6, s18 )
+ self.addLink( s6, s19 )
+ self.addLink( s6, s20 )
+ self.addLink( s6, s21 )
+ self.addLink( s6, s22 )
+ self.addLink( s6, s23 )
+ self.addLink( s6, s24 )
+ self.addLink( s6, s25 )
+ self.addLink( s7, s8 )
+ self.addLink( s7, s9 )
+ self.addLink( s7, s10 )
+ self.addLink( s7, s11 )
+ self.addLink( s7, s12 )
+ self.addLink( s7, s13 )
+ self.addLink( s7, s14 )
+ self.addLink( s7, s15 )
+ self.addLink( s7, s16 )
+ self.addLink( s7, s17 )
+ self.addLink( s7, s18 )
+ self.addLink( s7, s19 )
+ self.addLink( s7, s20 )
+ self.addLink( s7, s21 )
+ self.addLink( s7, s22 )
+ self.addLink( s7, s23 )
+ self.addLink( s7, s24 )
+ self.addLink( s7, s25 )
+ self.addLink( s8, s9 )
+ self.addLink( s8, s10 )
+ self.addLink( s8, s11 )
+ self.addLink( s8, s12 )
+ self.addLink( s8, s13 )
+ self.addLink( s8, s14 )
+ self.addLink( s8, s15 )
+ self.addLink( s8, s16 )
+ self.addLink( s8, s17 )
+ self.addLink( s8, s18 )
+ self.addLink( s8, s19 )
+ self.addLink( s8, s20 )
+ self.addLink( s8, s21 )
+ self.addLink( s8, s22 )
+ self.addLink( s8, s23 )
+ self.addLink( s8, s24 )
+ self.addLink( s8, s25 )
+ self.addLink( s9, s10 )
+ self.addLink( s9, s11 )
+ self.addLink( s9, s12 )
+ self.addLink( s9, s13 )
+ self.addLink( s9, s14 )
+ self.addLink( s9, s15 )
+ self.addLink( s9, s16 )
+ self.addLink( s9, s17 )
+ self.addLink( s9, s18 )
+ self.addLink( s9, s19 )
+ self.addLink( s9, s20 )
+ self.addLink( s9, s21 )
+ self.addLink( s9, s22 )
+ self.addLink( s9, s23 )
+ self.addLink( s9, s24 )
+ self.addLink( s9, s25 )
+ self.addLink( s10, s11 )
+ self.addLink( s10, s12 )
+ self.addLink( s10, s13 )
+ self.addLink( s10, s14 )
+ self.addLink( s10, s15 )
+ self.addLink( s10, s16 )
+ self.addLink( s10, s17 )
+ self.addLink( s10, s18 )
+ self.addLink( s10, s19 )
+ self.addLink( s10, s20 )
+ self.addLink( s10, s21 )
+ self.addLink( s10, s22 )
+ self.addLink( s10, s23 )
+ self.addLink( s10, s24 )
+ self.addLink( s10, s25 )
+ self.addLink( s11, s12 )
+ self.addLink( s11, s13 )
+ self.addLink( s11, s14 )
+ self.addLink( s11, s15 )
+ self.addLink( s11, s16 )
+ self.addLink( s11, s17 )
+ self.addLink( s11, s18 )
+ self.addLink( s11, s19 )
+ self.addLink( s11, s20 )
+ self.addLink( s11, s21 )
+ self.addLink( s11, s22 )
+ self.addLink( s11, s23 )
+ self.addLink( s11, s24 )
+ self.addLink( s11, s25 )
+ self.addLink( s12, s13 )
+ self.addLink( s12, s14 )
+ self.addLink( s12, s15 )
+ self.addLink( s12, s16 )
+ self.addLink( s12, s17 )
+ self.addLink( s12, s18 )
+ self.addLink( s12, s19 )
+ self.addLink( s12, s20 )
+ self.addLink( s12, s21 )
+ self.addLink( s12, s22 )
+ self.addLink( s12, s23 )
+ self.addLink( s12, s24 )
+ self.addLink( s12, s25 )
+ self.addLink( s13, s14 )
+ self.addLink( s13, s15 )
+ self.addLink( s13, s16 )
+ self.addLink( s13, s17 )
+ self.addLink( s13, s18 )
+ self.addLink( s13, s19 )
+ self.addLink( s13, s20 )
+ self.addLink( s13, s21 )
+ self.addLink( s13, s22 )
+ self.addLink( s13, s23 )
+ self.addLink( s13, s24 )
+ self.addLink( s13, s25 )
+ self.addLink( s14, s15 )
+ self.addLink( s14, s16 )
+ self.addLink( s14, s17 )
+ self.addLink( s14, s18 )
+ self.addLink( s14, s19 )
+ self.addLink( s14, s20 )
+ self.addLink( s14, s21 )
+ self.addLink( s14, s22 )
+ self.addLink( s14, s23 )
+ self.addLink( s14, s24 )
+ self.addLink( s14, s25 )
+ self.addLink( s15, s16 )
+ self.addLink( s15, s17 )
+ self.addLink( s15, s18 )
+ self.addLink( s15, s19 )
+ self.addLink( s15, s20 )
+ self.addLink( s15, s21 )
+ self.addLink( s15, s22 )
+ self.addLink( s15, s23 )
+ self.addLink( s15, s24 )
+ self.addLink( s15, s25 )
+ self.addLink( s16, s17 )
+ self.addLink( s16, s18 )
+ self.addLink( s16, s19 )
+ self.addLink( s16, s20 )
+ self.addLink( s16, s21 )
+ self.addLink( s16, s22 )
+ self.addLink( s16, s23 )
+ self.addLink( s16, s24 )
+ self.addLink( s16, s25 )
+ self.addLink( s17, s18 )
+ self.addLink( s17, s19 )
+ self.addLink( s17, s20 )
+ self.addLink( s17, s21 )
+ self.addLink( s17, s22 )
+ self.addLink( s17, s23 )
+ self.addLink( s17, s24 )
+ self.addLink( s17, s25 )
+ self.addLink( s18, s19 )
+ self.addLink( s18, s20 )
+ self.addLink( s18, s21 )
+ self.addLink( s18, s22 )
+ self.addLink( s18, s23 )
+ self.addLink( s18, s24 )
+ self.addLink( s18, s25 )
+ self.addLink( s19, s20 )
+ self.addLink( s19, s21 )
+ self.addLink( s19, s22 )
+ self.addLink( s19, s23 )
+ self.addLink( s19, s24 )
+ self.addLink( s19, s25 )
+ self.addLink( s20, s21 )
+ self.addLink( s20, s22 )
+ self.addLink( s20, s23 )
+ self.addLink( s20, s24 )
+ self.addLink( s20, s25 )
+ self.addLink( s21, s22 )
+ self.addLink( s21, s23 )
+ self.addLink( s21, s24 )
+ self.addLink( s21, s25 )
+ self.addLink( s22, s23 )
+ self.addLink( s22, s24 )
+ self.addLink( s22, s25 )
+ self.addLink( s23, s24 )
+ self.addLink( s23, s25 )
+ self.addLink( s24, s25 )
topos = { 'chordal': ( lambda: chordalTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = chordalTopo()
- #if controller_ip == '':
- #controller_ip = '10.0.2.2';
+ # if controller_ip == '':
+ # controller_ip = '10.0.2.2';
# controller_ip = '127.0.0.1';
- network = Mininet(topo=topo, switch=OVSSwitch,autoSetMacs=True, controller=None)
+ network = Mininet( topo=topo, switch=OVSSwitch, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoRingIpv6.py b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoRingIpv6.py
old mode 100755
new mode 100644
index 982840e..09e0691
--- a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoRingIpv6.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoRingIpv6.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import Host, RemoteController
@@ -32,13 +31,16 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class dualStackHost( Host ):
+
def config( self, v6Addr='1000::1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class ringTopo( Topo ):
def __init__( self, **opts ):
@@ -71,43 +73,44 @@
s10_host = self.addHost( 'h10', ip='10.1.0.10/24', cls=dualStackHost, v6Addr='1000::10/64' )
# add edges between switch and corresponding host
- self.addLink( s1 , s1_host )
- self.addLink( s2 , s2_host )
- self.addLink( s3 , s3_host )
- self.addLink( s4 , s4_host )
- self.addLink( s5 , s5_host )
- self.addLink( s6 , s6_host )
- self.addLink( s7 , s7_host )
- self.addLink( s8 , s8_host )
- self.addLink( s9 , s9_host )
- self.addLink( s10 , s10_host )
- self.addLink(s1, s2)
- self.addLink(s2, s3)
- self.addLink(s3, s4)
- self.addLink(s4, s5)
- self.addLink(s5, s6)
- self.addLink(s6, s7)
- self.addLink(s7, s8)
- self.addLink(s8, s9)
- self.addLink(s9, s10)
- self.addLink(s10, s1)
+ self.addLink( s1, s1_host )
+ self.addLink( s2, s2_host )
+ self.addLink( s3, s3_host )
+ self.addLink( s4, s4_host )
+ self.addLink( s5, s5_host )
+ self.addLink( s6, s6_host )
+ self.addLink( s7, s7_host )
+ self.addLink( s8, s8_host )
+ self.addLink( s9, s9_host )
+ self.addLink( s10, s10_host )
+ self.addLink( s1, s2 )
+ self.addLink( s2, s3 )
+ self.addLink( s3, s4 )
+ self.addLink( s4, s5 )
+ self.addLink( s5, s6 )
+ self.addLink( s6, s7 )
+ self.addLink( s7, s8 )
+ self.addLink( s8, s9 )
+ self.addLink( s9, s10 )
+ self.addLink( s10, s1 )
topos = { 'ring': ( lambda: ringTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = ringTopo()
- #if controller_ip == '':
- #controller_ip = '10.0.2.2';
+ # if controller_ip == '':
+ # controller_ip = '10.0.2.2';
# controller_ip = '127.0.0.1';
- network = Mininet(topo=topo, switch=OVSSwitch, autoSetMacs=True, controller=None)
+ network = Mininet( topo=topo, switch=OVSSwitch, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoSpine.py b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoSpine.py
old mode 100755
new mode 100644
index 8914e0b..48c4619
--- a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoSpine.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoSpine.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import Controller, RemoteController, OVSController
@@ -32,6 +31,7 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class spineTopo( Topo ):
def __init__( self, **opts ):
@@ -123,16 +123,16 @@
s78 = self.addSwitch( 's78' )
# ... and now hosts
- #s1_host = self.addHost( 'h1' )
- #s2_host = self.addHost( 'h2' )
- #s3_host = self.addHost( 'h3' )
- #s4_host = self.addHost( 'h4' )
- #s5_host = self.addHost( 'h5' )
- #s6_host = self.addHost( 'h6' )
- #s7_host = self.addHost( 'h7' )
- #s8_host = self.addHost( 'h8' )
- #s9_host = self.addHost( 'h9' )
- #s10_host = self.addHost( 'h10' )
+ # s1_host = self.addHost( 'h1' )
+ # s2_host = self.addHost( 'h2' )
+ # s3_host = self.addHost( 'h3' )
+ # s4_host = self.addHost( 'h4' )
+ # s5_host = self.addHost( 'h5' )
+ # s6_host = self.addHost( 'h6' )
+ # s7_host = self.addHost( 'h7' )
+ # s8_host = self.addHost( 'h8' )
+ # s9_host = self.addHost( 'h9' )
+ # s10_host = self.addHost( 'h10' )
s11_host = self.addHost( 'h11' )
s12_host = self.addHost( 'h12' )
s13_host = self.addHost( 'h13' )
@@ -203,253 +203,254 @@
s78_host = self.addHost( 'h78' )
# add edges between switch and corresponding host
- #self.addLink( s1 , s1_host )
- #self.addLink( s2 , s2_host )
- #self.addLink( s3 , s3_host )
- #self.addLink( s4 , s4_host )
- #self.addLink( s5 , s5_host )
- #self.addLink( s6 , s6_host )
- #self.addLink( s7 , s7_host )
- #self.addLink( s8 , s8_host )
- #self.addLink( s9 , s9_host )
- #self.addLink( s10 , s10_host )
- self.addLink( s11 , s11_host )
- self.addLink( s12 , s12_host )
- self.addLink( s13 , s13_host )
- self.addLink( s14 , s14_host )
- self.addLink( s15 , s15_host )
- self.addLink( s16 , s16_host )
- self.addLink( s17 , s17_host )
- self.addLink( s18 , s18_host )
- self.addLink( s19 , s19_host )
- self.addLink( s20 , s20_host )
- self.addLink( s21 , s21_host )
- self.addLink( s22 , s22_host )
- self.addLink( s23 , s23_host )
- self.addLink( s24 , s24_host )
- self.addLink( s25 , s25_host )
- self.addLink( s26 , s26_host )
- self.addLink( s27 , s27_host )
- self.addLink( s28 , s28_host )
- self.addLink( s29 , s29_host )
- self.addLink( s30 , s30_host )
- self.addLink( s31 , s31_host )
- self.addLink( s32 , s32_host )
- self.addLink( s33 , s33_host )
- self.addLink( s34 , s34_host )
- self.addLink( s35 , s35_host )
- self.addLink( s36 , s36_host )
- self.addLink( s37 , s37_host )
- self.addLink( s38 , s38_host )
- self.addLink( s39 , s39_host )
- self.addLink( s40 , s40_host )
- self.addLink( s41 , s41_host )
- self.addLink( s42 , s42_host )
- self.addLink( s43 , s43_host )
- self.addLink( s44 , s44_host )
- self.addLink( s45 , s45_host )
- self.addLink( s46 , s46_host )
- self.addLink( s47 , s47_host )
- self.addLink( s48 , s48_host )
- self.addLink( s49 , s49_host )
- self.addLink( s50 , s50_host )
- self.addLink( s51 , s51_host )
- self.addLink( s52 , s52_host )
- self.addLink( s53 , s53_host )
- self.addLink( s54 , s54_host )
- self.addLink( s55 , s55_host )
- self.addLink( s56 , s56_host )
- self.addLink( s57 , s57_host )
- self.addLink( s58 , s58_host )
- self.addLink( s59 , s59_host )
- self.addLink( s60 , s60_host )
- self.addLink( s61 , s61_host )
- self.addLink( s62 , s62_host )
- self.addLink( s63 , s63_host )
- self.addLink( s64 , s64_host )
- self.addLink( s65 , s65_host )
- self.addLink( s66 , s66_host )
- self.addLink( s67 , s67_host )
- self.addLink( s68 , s68_host )
- self.addLink( s69 , s69_host )
- self.addLink( s70 , s70_host )
- self.addLink( s71 , s71_host )
- self.addLink( s72 , s72_host )
- self.addLink( s73 , s73_host )
- self.addLink( s74 , s74_host )
- self.addLink( s75 , s75_host )
- self.addLink( s76 , s76_host )
- self.addLink( s77 , s77_host )
- self.addLink( s78 , s78_host )
+ # self.addLink( s1 , s1_host )
+ # self.addLink( s2 , s2_host )
+ # self.addLink( s3 , s3_host )
+ # self.addLink( s4 , s4_host )
+ # self.addLink( s5 , s5_host )
+ # self.addLink( s6 , s6_host )
+ # self.addLink( s7 , s7_host )
+ # self.addLink( s8 , s8_host )
+ # self.addLink( s9 , s9_host )
+ # self.addLink( s10 , s10_host )
+ self.addLink( s11, s11_host )
+ self.addLink( s12, s12_host )
+ self.addLink( s13, s13_host )
+ self.addLink( s14, s14_host )
+ self.addLink( s15, s15_host )
+ self.addLink( s16, s16_host )
+ self.addLink( s17, s17_host )
+ self.addLink( s18, s18_host )
+ self.addLink( s19, s19_host )
+ self.addLink( s20, s20_host )
+ self.addLink( s21, s21_host )
+ self.addLink( s22, s22_host )
+ self.addLink( s23, s23_host )
+ self.addLink( s24, s24_host )
+ self.addLink( s25, s25_host )
+ self.addLink( s26, s26_host )
+ self.addLink( s27, s27_host )
+ self.addLink( s28, s28_host )
+ self.addLink( s29, s29_host )
+ self.addLink( s30, s30_host )
+ self.addLink( s31, s31_host )
+ self.addLink( s32, s32_host )
+ self.addLink( s33, s33_host )
+ self.addLink( s34, s34_host )
+ self.addLink( s35, s35_host )
+ self.addLink( s36, s36_host )
+ self.addLink( s37, s37_host )
+ self.addLink( s38, s38_host )
+ self.addLink( s39, s39_host )
+ self.addLink( s40, s40_host )
+ self.addLink( s41, s41_host )
+ self.addLink( s42, s42_host )
+ self.addLink( s43, s43_host )
+ self.addLink( s44, s44_host )
+ self.addLink( s45, s45_host )
+ self.addLink( s46, s46_host )
+ self.addLink( s47, s47_host )
+ self.addLink( s48, s48_host )
+ self.addLink( s49, s49_host )
+ self.addLink( s50, s50_host )
+ self.addLink( s51, s51_host )
+ self.addLink( s52, s52_host )
+ self.addLink( s53, s53_host )
+ self.addLink( s54, s54_host )
+ self.addLink( s55, s55_host )
+ self.addLink( s56, s56_host )
+ self.addLink( s57, s57_host )
+ self.addLink( s58, s58_host )
+ self.addLink( s59, s59_host )
+ self.addLink( s60, s60_host )
+ self.addLink( s61, s61_host )
+ self.addLink( s62, s62_host )
+ self.addLink( s63, s63_host )
+ self.addLink( s64, s64_host )
+ self.addLink( s65, s65_host )
+ self.addLink( s66, s66_host )
+ self.addLink( s67, s67_host )
+ self.addLink( s68, s68_host )
+ self.addLink( s69, s69_host )
+ self.addLink( s70, s70_host )
+ self.addLink( s71, s71_host )
+ self.addLink( s72, s72_host )
+ self.addLink( s73, s73_host )
+ self.addLink( s74, s74_host )
+ self.addLink( s75, s75_host )
+ self.addLink( s76, s76_host )
+ self.addLink( s77, s77_host )
+ self.addLink( s78, s78_host )
- #info( '*** Add Leaf links\n')
- self.addLink(s1, s9)
- self.addLink(s2, s10)
- self.addLink(s3, s9)
- self.addLink(s4, s10)
- self.addLink(s5, s9)
- self.addLink(s6, s10)
- self.addLink(s7, s9)
- self.addLink(s8, s10)
- self.addLink(s9, s11)
- self.addLink(s9, s12)
- self.addLink(s10, s13)
- self.addLink(s10, s14)
- self.addLink(s11, s12)
- self.addLink(s13, s14)
+ # info( '*** Add Leaf links\n' )
+ self.addLink( s1, s9 )
+ self.addLink( s2, s10 )
+ self.addLink( s3, s9 )
+ self.addLink( s4, s10 )
+ self.addLink( s5, s9 )
+ self.addLink( s6, s10 )
+ self.addLink( s7, s9 )
+ self.addLink( s8, s10 )
+ self.addLink( s9, s11 )
+ self.addLink( s9, s12 )
+ self.addLink( s10, s13 )
+ self.addLink( s10, s14 )
+ self.addLink( s11, s12 )
+ self.addLink( s13, s14 )
- #info( '*** Add Spine-1 links\n')
- self.addLink(s15, s1)
- self.addLink(s15, s2)
- self.addLink(s16, s1)
- self.addLink(s16, s2)
- self.addLink(s17, s1)
- self.addLink(s17, s2)
- self.addLink(s18, s1)
- self.addLink(s18, s2)
- self.addLink(s19, s1)
- self.addLink(s19, s2)
- self.addLink(s20, s1)
- self.addLink(s20, s2)
- self.addLink(s21, s1)
- self.addLink(s21, s2)
- self.addLink(s22, s1)
- self.addLink(s22, s2)
- self.addLink(s23, s1)
- self.addLink(s23, s2)
- self.addLink(s24, s1)
- self.addLink(s24, s2)
- self.addLink(s25, s1)
- self.addLink(s25, s2)
- self.addLink(s26, s1)
- self.addLink(s26, s2)
- self.addLink(s27, s1)
- self.addLink(s27, s2)
- self.addLink(s28, s1)
- self.addLink(s28, s2)
- self.addLink(s29, s1)
- self.addLink(s29, s2)
- self.addLink(s30, s1)
- self.addLink(s30, s2)
+ # info( '*** Add Spine-1 links\n' )
+ self.addLink( s15, s1 )
+ self.addLink( s15, s2 )
+ self.addLink( s16, s1 )
+ self.addLink( s16, s2 )
+ self.addLink( s17, s1 )
+ self.addLink( s17, s2 )
+ self.addLink( s18, s1 )
+ self.addLink( s18, s2 )
+ self.addLink( s19, s1 )
+ self.addLink( s19, s2 )
+ self.addLink( s20, s1 )
+ self.addLink( s20, s2 )
+ self.addLink( s21, s1 )
+ self.addLink( s21, s2 )
+ self.addLink( s22, s1 )
+ self.addLink( s22, s2 )
+ self.addLink( s23, s1 )
+ self.addLink( s23, s2 )
+ self.addLink( s24, s1 )
+ self.addLink( s24, s2 )
+ self.addLink( s25, s1 )
+ self.addLink( s25, s2 )
+ self.addLink( s26, s1 )
+ self.addLink( s26, s2 )
+ self.addLink( s27, s1 )
+ self.addLink( s27, s2 )
+ self.addLink( s28, s1 )
+ self.addLink( s28, s2 )
+ self.addLink( s29, s1 )
+ self.addLink( s29, s2 )
+ self.addLink( s30, s1 )
+ self.addLink( s30, s2 )
- #info( '*** Add Spine-2 links\n')
- self.addLink(s31, s3)
- self.addLink(s31, s4)
- self.addLink(s32, s3)
- self.addLink(s32, s4)
- self.addLink(s33, s3)
- self.addLink(s33, s4)
- self.addLink(s34, s3)
- self.addLink(s34, s4)
- self.addLink(s35, s3)
- self.addLink(s35, s4)
- self.addLink(s36, s3)
- self.addLink(s36, s4)
- self.addLink(s37, s3)
- self.addLink(s37, s4)
- self.addLink(s38, s3)
- self.addLink(s38, s4)
- self.addLink(s39, s3)
- self.addLink(s39, s4)
- self.addLink(s40, s3)
- self.addLink(s40, s4)
- self.addLink(s41, s3)
- self.addLink(s41, s4)
- self.addLink(s42, s3)
- self.addLink(s42, s4)
- self.addLink(s43, s3)
- self.addLink(s43, s4)
- self.addLink(s44, s3)
- self.addLink(s44, s4)
- self.addLink(s45, s3)
- self.addLink(s45, s4)
- self.addLink(s46, s3)
- self.addLink(s46, s4)
+ # info( '*** Add Spine-2 links\n' )
+ self.addLink( s31, s3 )
+ self.addLink( s31, s4 )
+ self.addLink( s32, s3 )
+ self.addLink( s32, s4 )
+ self.addLink( s33, s3 )
+ self.addLink( s33, s4 )
+ self.addLink( s34, s3 )
+ self.addLink( s34, s4 )
+ self.addLink( s35, s3 )
+ self.addLink( s35, s4 )
+ self.addLink( s36, s3 )
+ self.addLink( s36, s4 )
+ self.addLink( s37, s3 )
+ self.addLink( s37, s4 )
+ self.addLink( s38, s3 )
+ self.addLink( s38, s4 )
+ self.addLink( s39, s3 )
+ self.addLink( s39, s4 )
+ self.addLink( s40, s3 )
+ self.addLink( s40, s4 )
+ self.addLink( s41, s3 )
+ self.addLink( s41, s4 )
+ self.addLink( s42, s3 )
+ self.addLink( s42, s4 )
+ self.addLink( s43, s3 )
+ self.addLink( s43, s4 )
+ self.addLink( s44, s3 )
+ self.addLink( s44, s4 )
+ self.addLink( s45, s3 )
+ self.addLink( s45, s4 )
+ self.addLink( s46, s3 )
+ self.addLink( s46, s4 )
- #info( '*** Add Spine-3 links\n')
- self.addLink(s47, s5)
- self.addLink(s47, s6)
- self.addLink(s48, s5)
- self.addLink(s48, s6)
- self.addLink(s49, s5)
- self.addLink(s49, s6)
- self.addLink(s50, s5)
- self.addLink(s50, s6)
- self.addLink(s51, s5)
- self.addLink(s51, s6)
- self.addLink(s52, s5)
- self.addLink(s52, s6)
- self.addLink(s53, s5)
- self.addLink(s53, s6)
- self.addLink(s54, s5)
- self.addLink(s54, s6)
- self.addLink(s55, s5)
- self.addLink(s55, s6)
- self.addLink(s56, s5)
- self.addLink(s56, s6)
- self.addLink(s57, s5)
- self.addLink(s57, s6)
- self.addLink(s58, s5)
- self.addLink(s58, s6)
- self.addLink(s59, s5)
- self.addLink(s59, s6)
- self.addLink(s60, s5)
- self.addLink(s60, s6)
- self.addLink(s61, s5)
- self.addLink(s61, s6)
- self.addLink(s62, s5)
- self.addLink(s62, s6)
+ # info( '*** Add Spine-3 links\n' )
+ self.addLink( s47, s5 )
+ self.addLink( s47, s6 )
+ self.addLink( s48, s5 )
+ self.addLink( s48, s6 )
+ self.addLink( s49, s5 )
+ self.addLink( s49, s6 )
+ self.addLink( s50, s5 )
+ self.addLink( s50, s6 )
+ self.addLink( s51, s5 )
+ self.addLink( s51, s6 )
+ self.addLink( s52, s5 )
+ self.addLink( s52, s6 )
+ self.addLink( s53, s5 )
+ self.addLink( s53, s6 )
+ self.addLink( s54, s5 )
+ self.addLink( s54, s6 )
+ self.addLink( s55, s5 )
+ self.addLink( s55, s6 )
+ self.addLink( s56, s5 )
+ self.addLink( s56, s6 )
+ self.addLink( s57, s5 )
+ self.addLink( s57, s6 )
+ self.addLink( s58, s5 )
+ self.addLink( s58, s6 )
+ self.addLink( s59, s5 )
+ self.addLink( s59, s6 )
+ self.addLink( s60, s5 )
+ self.addLink( s60, s6 )
+ self.addLink( s61, s5 )
+ self.addLink( s61, s6 )
+ self.addLink( s62, s5 )
+ self.addLink( s62, s6 )
- #info( '*** Add Spine-4 links\n')
- self.addLink(s63, s7)
- self.addLink(s63, s8)
- self.addLink(s64, s7)
- self.addLink(s64, s8)
- self.addLink(s65, s7)
- self.addLink(s65, s8)
- self.addLink(s66, s7)
- self.addLink(s66, s8)
- self.addLink(s67, s7)
- self.addLink(s67, s8)
- self.addLink(s68, s7)
- self.addLink(s68, s8)
- self.addLink(s69, s7)
- self.addLink(s69, s8)
- self.addLink(s70, s7)
- self.addLink(s70, s8)
- self.addLink(s71, s7)
- self.addLink(s71, s8)
- self.addLink(s72, s7)
- self.addLink(s72, s8)
- self.addLink(s73, s7)
- self.addLink(s73, s8)
- self.addLink(s74, s7)
- self.addLink(s74, s8)
- self.addLink(s75, s7)
- self.addLink(s75, s8)
- self.addLink(s76, s7)
- self.addLink(s76, s8)
- self.addLink(s77, s7)
- self.addLink(s77, s8)
- self.addLink(s78, s7)
- self.addLink(s78, s8)
+ # info( '*** Add Spine-4 links\n' )
+ self.addLink( s63, s7 )
+ self.addLink( s63, s8 )
+ self.addLink( s64, s7 )
+ self.addLink( s64, s8 )
+ self.addLink( s65, s7 )
+ self.addLink( s65, s8 )
+ self.addLink( s66, s7 )
+ self.addLink( s66, s8 )
+ self.addLink( s67, s7 )
+ self.addLink( s67, s8 )
+ self.addLink( s68, s7 )
+ self.addLink( s68, s8 )
+ self.addLink( s69, s7 )
+ self.addLink( s69, s8 )
+ self.addLink( s70, s7 )
+ self.addLink( s70, s8 )
+ self.addLink( s71, s7 )
+ self.addLink( s71, s8 )
+ self.addLink( s72, s7 )
+ self.addLink( s72, s8 )
+ self.addLink( s73, s7 )
+ self.addLink( s73, s8 )
+ self.addLink( s74, s7 )
+ self.addLink( s74, s8 )
+ self.addLink( s75, s7 )
+ self.addLink( s75, s8 )
+ self.addLink( s76, s7 )
+ self.addLink( s76, s8 )
+ self.addLink( s77, s7 )
+ self.addLink( s77, s8 )
+ self.addLink( s78, s7 )
+ self.addLink( s78, s8 )
topos = { 'spine': ( lambda: spineTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = spineTopo()
- #if controller_ip == '':
- #controller_ip = '10.0.2.2';
+ # if controller_ip == '':
+ # controller_ip = '10.0.2.2';
# controller_ip = '127.0.0.1';
- network = Mininet(topo=topo, switch=OVSSwitch, link=TCLink, autoSetMacs = True, controller=None)
+ network = Mininet( topo=topo, switch=OVSSwitch, link=TCLink, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoSpineIpv6.py b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoSpineIpv6.py
old mode 100755
new mode 100644
index 5b99455..1b5163e
--- a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoSpineIpv6.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoSpineIpv6.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import Host, RemoteController
@@ -32,13 +31,16 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class dualStackHost( Host ):
+
def config( self, v6Addr='1000::1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class spineTopo( Topo ):
def __init__( self, **opts ):
@@ -129,7 +131,6 @@
s77 = self.addSwitch( 's77' )
s78 = self.addSwitch( 's78' )
-
# ... and now hosts
# s1_host = self.addHost( 'h1', ip='10.1.0.1/24', cls=dualStackHost, v6Addr='1000::1/64' )
# s2_host = self.addHost( 'h2', ip='10.1.0.2/24', cls=dualStackHost, v6Addr='1000::2/64' )
@@ -211,253 +212,254 @@
s78_host = self.addHost( 'h78', ip='10.1.0.78/24', cls=dualStackHost, v6Addr='1000::78/64' )
# add edges between switch and corresponding host
- #self.addLink( s1 , s1_host )
- #self.addLink( s2 , s2_host )
- #self.addLink( s3 , s3_host )
- #self.addLink( s4 , s4_host )
- #self.addLink( s5 , s5_host )
- #self.addLink( s6 , s6_host )
- #self.addLink( s7 , s7_host )
- #self.addLink( s8 , s8_host )
- #self.addLink( s9 , s9_host )
- #self.addLink( s10 , s10_host )
- self.addLink( s11 , s11_host )
- self.addLink( s12 , s12_host )
- self.addLink( s13 , s13_host )
- self.addLink( s14 , s14_host )
- self.addLink( s15 , s15_host )
- self.addLink( s16 , s16_host )
- self.addLink( s17 , s17_host )
- self.addLink( s18 , s18_host )
- self.addLink( s19 , s19_host )
- self.addLink( s20 , s20_host )
- self.addLink( s21 , s21_host )
- self.addLink( s22 , s22_host )
- self.addLink( s23 , s23_host )
- self.addLink( s24 , s24_host )
- self.addLink( s25 , s25_host )
- self.addLink( s26 , s26_host )
- self.addLink( s27 , s27_host )
- self.addLink( s28 , s28_host )
- self.addLink( s29 , s29_host )
- self.addLink( s30 , s30_host )
- self.addLink( s31 , s31_host )
- self.addLink( s32 , s32_host )
- self.addLink( s33 , s33_host )
- self.addLink( s34 , s34_host )
- self.addLink( s35 , s35_host )
- self.addLink( s36 , s36_host )
- self.addLink( s37 , s37_host )
- self.addLink( s38 , s38_host )
- self.addLink( s39 , s39_host )
- self.addLink( s40 , s40_host )
- self.addLink( s41 , s41_host )
- self.addLink( s42 , s42_host )
- self.addLink( s43 , s43_host )
- self.addLink( s44 , s44_host )
- self.addLink( s45 , s45_host )
- self.addLink( s46 , s46_host )
- self.addLink( s47 , s47_host )
- self.addLink( s48 , s48_host )
- self.addLink( s49 , s49_host )
- self.addLink( s50 , s50_host )
- self.addLink( s51 , s51_host )
- self.addLink( s52 , s52_host )
- self.addLink( s53 , s53_host )
- self.addLink( s54 , s54_host )
- self.addLink( s55 , s55_host )
- self.addLink( s56 , s56_host )
- self.addLink( s57 , s57_host )
- self.addLink( s58 , s58_host )
- self.addLink( s59 , s59_host )
- self.addLink( s60 , s60_host )
- self.addLink( s61 , s61_host )
- self.addLink( s62 , s62_host )
- self.addLink( s63 , s63_host )
- self.addLink( s64 , s64_host )
- self.addLink( s65 , s65_host )
- self.addLink( s66 , s66_host )
- self.addLink( s67 , s67_host )
- self.addLink( s68 , s68_host )
- self.addLink( s69 , s69_host )
- self.addLink( s70 , s70_host )
- self.addLink( s71 , s71_host )
- self.addLink( s72 , s72_host )
- self.addLink( s73 , s73_host )
- self.addLink( s74 , s74_host )
- self.addLink( s75 , s75_host )
- self.addLink( s76 , s76_host )
- self.addLink( s77 , s77_host )
- self.addLink( s78 , s78_host )
+ # self.addLink( s1 , s1_host )
+ # self.addLink( s2 , s2_host )
+ # self.addLink( s3 , s3_host )
+ # self.addLink( s4 , s4_host )
+ # self.addLink( s5 , s5_host )
+ # self.addLink( s6 , s6_host )
+ # self.addLink( s7 , s7_host )
+ # self.addLink( s8 , s8_host )
+ # self.addLink( s9 , s9_host )
+ # self.addLink( s10 , s10_host )
+ self.addLink( s11, s11_host )
+ self.addLink( s12, s12_host )
+ self.addLink( s13, s13_host )
+ self.addLink( s14, s14_host )
+ self.addLink( s15, s15_host )
+ self.addLink( s16, s16_host )
+ self.addLink( s17, s17_host )
+ self.addLink( s18, s18_host )
+ self.addLink( s19, s19_host )
+ self.addLink( s20, s20_host )
+ self.addLink( s21, s21_host )
+ self.addLink( s22, s22_host )
+ self.addLink( s23, s23_host )
+ self.addLink( s24, s24_host )
+ self.addLink( s25, s25_host )
+ self.addLink( s26, s26_host )
+ self.addLink( s27, s27_host )
+ self.addLink( s28, s28_host )
+ self.addLink( s29, s29_host )
+ self.addLink( s30, s30_host )
+ self.addLink( s31, s31_host )
+ self.addLink( s32, s32_host )
+ self.addLink( s33, s33_host )
+ self.addLink( s34, s34_host )
+ self.addLink( s35, s35_host )
+ self.addLink( s36, s36_host )
+ self.addLink( s37, s37_host )
+ self.addLink( s38, s38_host )
+ self.addLink( s39, s39_host )
+ self.addLink( s40, s40_host )
+ self.addLink( s41, s41_host )
+ self.addLink( s42, s42_host )
+ self.addLink( s43, s43_host )
+ self.addLink( s44, s44_host )
+ self.addLink( s45, s45_host )
+ self.addLink( s46, s46_host )
+ self.addLink( s47, s47_host )
+ self.addLink( s48, s48_host )
+ self.addLink( s49, s49_host )
+ self.addLink( s50, s50_host )
+ self.addLink( s51, s51_host )
+ self.addLink( s52, s52_host )
+ self.addLink( s53, s53_host )
+ self.addLink( s54, s54_host )
+ self.addLink( s55, s55_host )
+ self.addLink( s56, s56_host )
+ self.addLink( s57, s57_host )
+ self.addLink( s58, s58_host )
+ self.addLink( s59, s59_host )
+ self.addLink( s60, s60_host )
+ self.addLink( s61, s61_host )
+ self.addLink( s62, s62_host )
+ self.addLink( s63, s63_host )
+ self.addLink( s64, s64_host )
+ self.addLink( s65, s65_host )
+ self.addLink( s66, s66_host )
+ self.addLink( s67, s67_host )
+ self.addLink( s68, s68_host )
+ self.addLink( s69, s69_host )
+ self.addLink( s70, s70_host )
+ self.addLink( s71, s71_host )
+ self.addLink( s72, s72_host )
+ self.addLink( s73, s73_host )
+ self.addLink( s74, s74_host )
+ self.addLink( s75, s75_host )
+ self.addLink( s76, s76_host )
+ self.addLink( s77, s77_host )
+ self.addLink( s78, s78_host )
- #info( '*** Add Leaf links\n')
- self.addLink(s1, s9)
- self.addLink(s2, s10)
- self.addLink(s3, s9)
- self.addLink(s4, s10)
- self.addLink(s5, s9)
- self.addLink(s6, s10)
- self.addLink(s7, s9)
- self.addLink(s8, s10)
- self.addLink(s9, s11)
- self.addLink(s9, s12)
- self.addLink(s10, s13)
- self.addLink(s10, s14)
- self.addLink(s11, s12)
- self.addLink(s13, s14)
+ # info( '*** Add Leaf links\n' )
+ self.addLink( s1, s9 )
+ self.addLink( s2, s10 )
+ self.addLink( s3, s9 )
+ self.addLink( s4, s10 )
+ self.addLink( s5, s9 )
+ self.addLink( s6, s10 )
+ self.addLink( s7, s9 )
+ self.addLink( s8, s10 )
+ self.addLink( s9, s11 )
+ self.addLink( s9, s12 )
+ self.addLink( s10, s13 )
+ self.addLink( s10, s14 )
+ self.addLink( s11, s12 )
+ self.addLink( s13, s14 )
- #info( '*** Add Spine-1 links\n')
- self.addLink(s15, s1)
- self.addLink(s15, s2)
- self.addLink(s16, s1)
- self.addLink(s16, s2)
- self.addLink(s17, s1)
- self.addLink(s17, s2)
- self.addLink(s18, s1)
- self.addLink(s18, s2)
- self.addLink(s19, s1)
- self.addLink(s19, s2)
- self.addLink(s20, s1)
- self.addLink(s20, s2)
- self.addLink(s21, s1)
- self.addLink(s21, s2)
- self.addLink(s22, s1)
- self.addLink(s22, s2)
- self.addLink(s23, s1)
- self.addLink(s23, s2)
- self.addLink(s24, s1)
- self.addLink(s24, s2)
- self.addLink(s25, s1)
- self.addLink(s25, s2)
- self.addLink(s26, s1)
- self.addLink(s26, s2)
- self.addLink(s27, s1)
- self.addLink(s27, s2)
- self.addLink(s28, s1)
- self.addLink(s28, s2)
- self.addLink(s29, s1)
- self.addLink(s29, s2)
- self.addLink(s30, s1)
- self.addLink(s30, s2)
+ # info( '*** Add Spine-1 links\n' )
+ self.addLink( s15, s1 )
+ self.addLink( s15, s2 )
+ self.addLink( s16, s1 )
+ self.addLink( s16, s2 )
+ self.addLink( s17, s1 )
+ self.addLink( s17, s2 )
+ self.addLink( s18, s1 )
+ self.addLink( s18, s2 )
+ self.addLink( s19, s1 )
+ self.addLink( s19, s2 )
+ self.addLink( s20, s1 )
+ self.addLink( s20, s2 )
+ self.addLink( s21, s1 )
+ self.addLink( s21, s2 )
+ self.addLink( s22, s1 )
+ self.addLink( s22, s2 )
+ self.addLink( s23, s1 )
+ self.addLink( s23, s2 )
+ self.addLink( s24, s1 )
+ self.addLink( s24, s2 )
+ self.addLink( s25, s1 )
+ self.addLink( s25, s2 )
+ self.addLink( s26, s1 )
+ self.addLink( s26, s2 )
+ self.addLink( s27, s1 )
+ self.addLink( s27, s2 )
+ self.addLink( s28, s1 )
+ self.addLink( s28, s2 )
+ self.addLink( s29, s1 )
+ self.addLink( s29, s2 )
+ self.addLink( s30, s1 )
+ self.addLink( s30, s2 )
- #info( '*** Add Spine-2 links\n')
- self.addLink(s31, s3)
- self.addLink(s31, s4)
- self.addLink(s32, s3)
- self.addLink(s32, s4)
- self.addLink(s33, s3)
- self.addLink(s33, s4)
- self.addLink(s34, s3)
- self.addLink(s34, s4)
- self.addLink(s35, s3)
- self.addLink(s35, s4)
- self.addLink(s36, s3)
- self.addLink(s36, s4)
- self.addLink(s37, s3)
- self.addLink(s37, s4)
- self.addLink(s38, s3)
- self.addLink(s38, s4)
- self.addLink(s39, s3)
- self.addLink(s39, s4)
- self.addLink(s40, s3)
- self.addLink(s40, s4)
- self.addLink(s41, s3)
- self.addLink(s41, s4)
- self.addLink(s42, s3)
- self.addLink(s42, s4)
- self.addLink(s43, s3)
- self.addLink(s43, s4)
- self.addLink(s44, s3)
- self.addLink(s44, s4)
- self.addLink(s45, s3)
- self.addLink(s45, s4)
- self.addLink(s46, s3)
- self.addLink(s46, s4)
+ # info( '*** Add Spine-2 links\n' )
+ self.addLink( s31, s3 )
+ self.addLink( s31, s4 )
+ self.addLink( s32, s3 )
+ self.addLink( s32, s4 )
+ self.addLink( s33, s3 )
+ self.addLink( s33, s4 )
+ self.addLink( s34, s3 )
+ self.addLink( s34, s4 )
+ self.addLink( s35, s3 )
+ self.addLink( s35, s4 )
+ self.addLink( s36, s3 )
+ self.addLink( s36, s4 )
+ self.addLink( s37, s3 )
+ self.addLink( s37, s4 )
+ self.addLink( s38, s3 )
+ self.addLink( s38, s4 )
+ self.addLink( s39, s3 )
+ self.addLink( s39, s4 )
+ self.addLink( s40, s3 )
+ self.addLink( s40, s4 )
+ self.addLink( s41, s3 )
+ self.addLink( s41, s4 )
+ self.addLink( s42, s3 )
+ self.addLink( s42, s4 )
+ self.addLink( s43, s3 )
+ self.addLink( s43, s4 )
+ self.addLink( s44, s3 )
+ self.addLink( s44, s4 )
+ self.addLink( s45, s3 )
+ self.addLink( s45, s4 )
+ self.addLink( s46, s3 )
+ self.addLink( s46, s4 )
- #info( '*** Add Spine-3 links\n')
- self.addLink(s47, s5)
- self.addLink(s47, s6)
- self.addLink(s48, s5)
- self.addLink(s48, s6)
- self.addLink(s49, s5)
- self.addLink(s49, s6)
- self.addLink(s50, s5)
- self.addLink(s50, s6)
- self.addLink(s51, s5)
- self.addLink(s51, s6)
- self.addLink(s52, s5)
- self.addLink(s52, s6)
- self.addLink(s53, s5)
- self.addLink(s53, s6)
- self.addLink(s54, s5)
- self.addLink(s54, s6)
- self.addLink(s55, s5)
- self.addLink(s55, s6)
- self.addLink(s56, s5)
- self.addLink(s56, s6)
- self.addLink(s57, s5)
- self.addLink(s57, s6)
- self.addLink(s58, s5)
- self.addLink(s58, s6)
- self.addLink(s59, s5)
- self.addLink(s59, s6)
- self.addLink(s60, s5)
- self.addLink(s60, s6)
- self.addLink(s61, s5)
- self.addLink(s61, s6)
- self.addLink(s62, s5)
- self.addLink(s62, s6)
+ # info( '*** Add Spine-3 links\n' )
+ self.addLink( s47, s5 )
+ self.addLink( s47, s6 )
+ self.addLink( s48, s5 )
+ self.addLink( s48, s6 )
+ self.addLink( s49, s5 )
+ self.addLink( s49, s6 )
+ self.addLink( s50, s5 )
+ self.addLink( s50, s6 )
+ self.addLink( s51, s5 )
+ self.addLink( s51, s6 )
+ self.addLink( s52, s5 )
+ self.addLink( s52, s6 )
+ self.addLink( s53, s5 )
+ self.addLink( s53, s6 )
+ self.addLink( s54, s5 )
+ self.addLink( s54, s6 )
+ self.addLink( s55, s5 )
+ self.addLink( s55, s6 )
+ self.addLink( s56, s5 )
+ self.addLink( s56, s6 )
+ self.addLink( s57, s5 )
+ self.addLink( s57, s6 )
+ self.addLink( s58, s5 )
+ self.addLink( s58, s6 )
+ self.addLink( s59, s5 )
+ self.addLink( s59, s6 )
+ self.addLink( s60, s5 )
+ self.addLink( s60, s6 )
+ self.addLink( s61, s5 )
+ self.addLink( s61, s6 )
+ self.addLink( s62, s5 )
+ self.addLink( s62, s6 )
- #info( '*** Add Spine-4 links\n')
- self.addLink(s63, s7)
- self.addLink(s63, s8)
- self.addLink(s64, s7)
- self.addLink(s64, s8)
- self.addLink(s65, s7)
- self.addLink(s65, s8)
- self.addLink(s66, s7)
- self.addLink(s66, s8)
- self.addLink(s67, s7)
- self.addLink(s67, s8)
- self.addLink(s68, s7)
- self.addLink(s68, s8)
- self.addLink(s69, s7)
- self.addLink(s69, s8)
- self.addLink(s70, s7)
- self.addLink(s70, s8)
- self.addLink(s71, s7)
- self.addLink(s71, s8)
- self.addLink(s72, s7)
- self.addLink(s72, s8)
- self.addLink(s73, s7)
- self.addLink(s73, s8)
- self.addLink(s74, s7)
- self.addLink(s74, s8)
- self.addLink(s75, s7)
- self.addLink(s75, s8)
- self.addLink(s76, s7)
- self.addLink(s76, s8)
- self.addLink(s77, s7)
- self.addLink(s77, s8)
- self.addLink(s78, s7)
- self.addLink(s78, s8)
+ # info( '*** Add Spine-4 links\n' )
+ self.addLink( s63, s7 )
+ self.addLink( s63, s8 )
+ self.addLink( s64, s7 )
+ self.addLink( s64, s8 )
+ self.addLink( s65, s7 )
+ self.addLink( s65, s8 )
+ self.addLink( s66, s7 )
+ self.addLink( s66, s8 )
+ self.addLink( s67, s7 )
+ self.addLink( s67, s8 )
+ self.addLink( s68, s7 )
+ self.addLink( s68, s8 )
+ self.addLink( s69, s7 )
+ self.addLink( s69, s8 )
+ self.addLink( s70, s7 )
+ self.addLink( s70, s8 )
+ self.addLink( s71, s7 )
+ self.addLink( s71, s8 )
+ self.addLink( s72, s7 )
+ self.addLink( s72, s8 )
+ self.addLink( s73, s7 )
+ self.addLink( s73, s8 )
+ self.addLink( s74, s7 )
+ self.addLink( s74, s8 )
+ self.addLink( s75, s7 )
+ self.addLink( s75, s8 )
+ self.addLink( s76, s7 )
+ self.addLink( s76, s8 )
+ self.addLink( s77, s7 )
+ self.addLink( s77, s8 )
+ self.addLink( s78, s7 )
+ self.addLink( s78, s8 )
topos = { 'spine': ( lambda: spineTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = spineTopo()
- #if controller_ip == '':
- #controller_ip = '10.0.2.2';
+ # if controller_ip == '':
+ # controller_ip = '10.0.2.2';
# controller_ip = '127.0.0.1';
- network = Mininet(topo=topo, switch=OVSSwitch, link=TCLink, autoSetMacs = True, controller=None)
+ network = Mininet( topo=topo, switch=OVSSwitch, link=TCLink, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoTripleIpv6.py b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoTripleIpv6.py
old mode 100755
new mode 100644
index 9b83391..d74d444
--- a/TestON/tests/CHOTestMonkey/dependencies/topologies/topoTripleIpv6.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/topologies/topoTripleIpv6.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
from mininet.topo import Topo
from mininet.net import Mininet
from mininet.node import Host, RemoteController
@@ -32,13 +31,16 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class dualStackHost( Host ):
+
def config( self, v6Addr='1000::1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class tripleTopo( Topo ):
def __init__( self, **opts ):
@@ -57,29 +59,30 @@
s3_host = self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='1000::3/64' )
# add edges between switch and corresponding host
- self.addLink( s1 , s1_host )
- self.addLink( s2 , s2_host )
- self.addLink( s3 , s3_host )
- self.addLink(s1, s2)
- self.addLink(s1, s3)
- self.addLink(s2, s3)
+ self.addLink( s1, s1_host )
+ self.addLink( s2, s2_host )
+ self.addLink( s3, s3_host )
+ self.addLink( s1, s2 )
+ self.addLink( s1, s3 )
+ self.addLink( s2, s3 )
topos = { 'triple': ( lambda: tripleTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = tripleTopo()
- #if controller_ip == '':
- #controller_ip = '10.0.2.2';
+ # if controller_ip == '':
+ # controller_ip = '10.0.2.2';
# controller_ip = '127.0.0.1';
- network = Mininet(topo=topo, switch=OVSSwitch, autoSetMacs=True, controller=None)
+ network = Mininet( topo=topo, switch=OVSSwitch, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py b/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
index f89e57d..bd35266 100644
--- a/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
+++ b/TestON/tests/FUNC/FUNCbgpls/FUNCbgpls.py
@@ -1,6 +1,5 @@
"""
-
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -9,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -68,11 +67,11 @@
main.cleanAndExit()
main.testSetUp.envSetupDescription()
try:
- main.cellName = main.params['ENV']['cellName']
- main.ipList = os.getenv(main.params['CTRL']['ip1'])
- main.scapy_ip = os.getenv(main.params['SCAPY']['HOSTNAMES'])
+ main.cellName = main.params[ 'ENV' ][ 'cellName' ]
+ main.ipList = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
+ main.scapy_ip = os.getenv( main.params[ 'SCAPY' ][ 'HOSTNAMES' ] )
- main.apps = main.params['ENV']['cellApps']
+ main.apps = main.params[ 'ENV' ][ 'cellApps' ]
stepResult = main.testSetUp.envSetup()
except Exception as e:
main.testSetUp.envSetupException( e )
diff --git a/TestON/tests/FUNC/FUNCbgpls/dependencies/Nbdata.py b/TestON/tests/FUNC/FUNCbgpls/dependencies/Nbdata.py
index b1f44e1..17d4df8 100644
--- a/TestON/tests/FUNC/FUNCbgpls/dependencies/Nbdata.py
+++ b/TestON/tests/FUNC/FUNCbgpls/dependencies/Nbdata.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"**** Scripted by Antony Silvester ****** "
import json
from urllib import addbase
diff --git a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Deletion_Node.py b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Deletion_Node.py
old mode 100755
new mode 100644
index d747a5a..37adcf8
--- a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Deletion_Node.py
+++ b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Deletion_Node.py
@@ -1,5 +1,6 @@
+# !/usr/bin/python # This is server.py file
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +9,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,8 +19,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
-#!/usr/bin/python # This is server.py file
from scapy.all import *
import socket # Import socket module
import time # Import Time module
@@ -27,47 +26,46 @@
import os
path = os.getcwd()
-sys.path.append('OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies') #Setting the path for BgpLS
+sys.path.append( 'OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies' ) # Setting the path for BgpLS
from Nbdata import BgpLs
obj = BgpLs()
returnlist = obj.Constants()
-peerIp = returnlist[0][0]
+peerIp = returnlist[ 0 ][ 0 ]
-load_contrib('bgp')
+load_contrib( 'bgp' )
s = socket.socket() # Create a socket object
-host = peerIp # Get local machine name
+host = peerIp # Get local machine name
port = 179 # Reserve a port for your service.
-s.bind((host, port)) # Bind to the port
-pkts = rdpcap(path + "/OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls.pcap")
-time.sleep(15)
-pkts[759][BGPOpen].bgp_id = peerIp
+s.bind( ( host, port ) ) # Bind to the port
+pkts = rdpcap( path + "/OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls.pcap" )
+time.sleep( 15 )
+pkts[ 759 ][ BGPOpen ].bgp_id = peerIp
-s.listen(5) # Now wait for client connection.
+s.listen( 5 ) # Now wait for client connection.
-print("starting Connecting to ONOS peer")
+print( "starting Connecting to ONOS peer" )
c, addr = s.accept() # Establish connection with client.
print 'Got connection from ONOS :', addr
-c.send(str(pkts[759][BGPHeader])) # OPEN MESSAGE
-c.recv(4096)
-c.send(str(pkts[765][BGPHeader]))# KEEPALIVE MESSAGE
-c.recv(4096)
-c.send(str(pkts[768][BGPHeader])) # UPDATE MESSAGES
-c.send(str(pkts[771][BGPHeader]))
-c.send(str(pkts[773][BGPHeader]))
-c.send(str(pkts[775][BGPHeader]))
-c.send(str(pkts[778][BGPHeader]))
-c.send(str(pkts[765][BGPHeader]))
+c.send( str( pkts[ 759 ][ BGPHeader ] ) ) # OPEN MESSAGE
+c.recv( 4096 )
+c.send( str( pkts[ 765 ][ BGPHeader ] ) ) # KEEPALIVE MESSAGE
+c.recv( 4096 )
+c.send( str( pkts[ 768 ][ BGPHeader ] ) ) # UPDATE MESSAGES
+c.send( str( pkts[ 771 ][ BGPHeader ] ) )
+c.send( str( pkts[ 773 ][ BGPHeader ] ) )
+c.send( str( pkts[ 775 ][ BGPHeader ] ) )
+c.send( str( pkts[ 778 ][ BGPHeader ] ) )
+c.send( str( pkts[ 765 ][ BGPHeader ] ) )
-time.sleep(15)
-c.send(str(pkts[1168][BGPHeader]))
-c.send(str(pkts[1250][BGPHeader]))
-c.send(str(pkts[1354][BGPHeader]))
-print ("Node Delete msg sent")
+time.sleep( 15 )
+c.send( str( pkts[ 1168 ][ BGPHeader ] ) )
+c.send( str( pkts[ 1250 ][ BGPHeader ] ) )
+c.send( str( pkts[ 1354 ][ BGPHeader ] ) )
+print ( "Node Delete msg sent" )
while True:
- c.recv(4096)
- c.send(str(pkts[765][BGPHeader]))
-
- # c.close() # Close the connection
+ c.recv( 4096 )
+ c.send( str( pkts[ 765 ][ BGPHeader ] ) )
+ # c.close() # Close the connection
diff --git a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Link_Update_Node.py b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Link_Update_Node.py
old mode 100755
new mode 100644
index 15c5757..4bf1187
--- a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Link_Update_Node.py
+++ b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Link_Update_Node.py
@@ -1,5 +1,6 @@
+# !/usr/bin/python # This is server.py file
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +9,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,8 +19,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
-#!/usr/bin/python # This is server.py file
from scapy.all import *
import socket # Import socket module
import time # Import Time module
@@ -27,40 +26,39 @@
import os
path = os.getcwd()
-sys.path.append('OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies') #Setting the path for BgpLS
+sys.path.append( 'OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies' ) # Setting the path for BgpLS
from Nbdata import BgpLs
obj = BgpLs()
returnlist = obj.Constants()
-peerIp = returnlist[0][0]
+peerIp = returnlist[ 0 ][ 0 ]
-load_contrib('bgp')
+load_contrib( 'bgp' )
s = socket.socket() # Create a socket object
-host = peerIp # Get local machine name
+host = peerIp # Get local machine name
port = 179 # Reserve a port for your service.
-s.bind((host, port)) # Bind to the port
-pkts = rdpcap(path + "/OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls.pcap")
-time.sleep(15)
-pkts[759][BGPOpen].bgp_id = peerIp
+s.bind( ( host, port ) ) # Bind to the port
+pkts = rdpcap( path + "/OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls.pcap" )
+time.sleep( 15 )
+pkts[ 759 ][ BGPOpen ].bgp_id = peerIp
-s.listen(5) # Now wait for client connection.
+s.listen( 5 ) # Now wait for client connection.
-print("starting Connecting to ONOS peer")
+print( "starting Connecting to ONOS peer" )
c, addr = s.accept() # Establish connection with client.
print 'Got connection from ONOS :', addr
-c.send(str(pkts[759][BGPHeader])) # OPEN MESSAGE
-c.recv(4096)
-c.send(str(pkts[765][BGPHeader]))# KEEPALIVE MESSAGE
-c.recv(4096)
-c.send(str(pkts[768][BGPHeader])) # UPDATE MESSAGES
-c.send(str(pkts[771][BGPHeader]))
-c.send(str(pkts[773][BGPHeader]))
-c.send(str(pkts[775][BGPHeader]))
-c.send(str(pkts[778][BGPHeader]))
-c.send(str(pkts[765][BGPHeader]))
+c.send( str( pkts[ 759 ][ BGPHeader ] ) ) # OPEN MESSAGE
+c.recv( 4096 )
+c.send( str( pkts[ 765 ][ BGPHeader ] ) ) # KEEPALIVE MESSAGE
+c.recv( 4096 )
+c.send( str( pkts[ 768 ][ BGPHeader ] ) ) # UPDATE MESSAGES
+c.send( str( pkts[ 771 ][ BGPHeader ] ) )
+c.send( str( pkts[ 773 ][ BGPHeader ] ) )
+c.send( str( pkts[ 775 ][ BGPHeader ] ) )
+c.send( str( pkts[ 778 ][ BGPHeader ] ) )
+c.send( str( pkts[ 765 ][ BGPHeader ] ) )
while True:
- c.recv(4096)
- c.send(str(pkts[765][BGPHeader]))
-
- # c.close() # Close the connection
+ c.recv( 4096 )
+ c.send( str( pkts[ 765 ][ BGPHeader ] ) )
+ # c.close() # Close the connection
diff --git a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Topo_discovery.py b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Topo_discovery.py
old mode 100755
new mode 100644
index 332a0ef..183388f
--- a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Topo_discovery.py
+++ b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Topo_discovery.py
@@ -1,5 +1,6 @@
+#!/usr/bin/python # This is server.py file
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +9,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,8 +19,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
-#!/usr/bin/python # This is server.py file
from scapy.all import *
import socket # Import socket module
import time # Import Time module
@@ -27,36 +26,35 @@
import os
path = os.getcwd()
-sys.path.append('OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies') #Setting the path for BgpLS
+sys.path.append( 'OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies' ) # Setting the path for BgpLS
from Nbdata import BgpLs
obj = BgpLs()
returnlist = obj.Constants()
-peerIp = returnlist[0][0]
+peerIp = returnlist[ 0 ][ 0 ]
-load_contrib('bgp')
+load_contrib( 'bgp' )
s = socket.socket() # Create a socket object
-host = peerIp # Get local machine name
+host = peerIp # Get local machine name
port = 179 # Reserve a port for your service.
-s.bind((host, port)) # Bind to the port
-pkts = rdpcap(path + "/OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls_all.pcap")
-pkts[69][BGPOpen].bgp_id = peerIp
+s.bind( ( host, port ) ) # Bind to the port
+pkts = rdpcap( path + "/OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls_all.pcap" )
+pkts[ 69 ][ BGPOpen ].bgp_id = peerIp
-s.listen(5) # Now wait for client connection.
+s.listen( 5 ) # Now wait for client connection.
-print("starting Connecting to ONOS peer")
+print( "starting Connecting to ONOS peer" )
c, addr = s.accept() # Establish connection with client.
print 'Got connection from ONOS :', addr
-c.send(str(pkts[69][BGPHeader])) # OPEN MESSAGE
-c.recv(4096)
-c.send(str(pkts[71][BGPHeader]))# KEEPALIVE MESSAGE
-c.recv(4096)
-c.send(str(pkts[72][BGPHeader])) # UPDATE MESSAGES
-c.send(str(pkts[74][BGPHeader]))
-c.send(str(pkts[71][BGPHeader]))
+c.send( str( pkts[ 69 ][ BGPHeader ] ) ) # OPEN MESSAGE
+c.recv( 4096 )
+c.send( str( pkts[ 71 ][ BGPHeader ] ) ) # KEEPALIVE MESSAGE
+c.recv( 4096 )
+c.send( str( pkts[ 72 ][ BGPHeader ] ) ) # UPDATE MESSAGES
+c.send( str( pkts[ 74 ][ BGPHeader ] ) )
+c.send( str( pkts[ 71 ][ BGPHeader ] ) )
while True:
- c.recv(4096)
- c.send(str(pkts[71][BGPHeader]))
-
- # c.close() # Close the connection
+ c.recv( 4096 )
+ c.send( str( pkts[ 71 ][ BGPHeader ] ) )
+ # c.close() # Close the connection
diff --git a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Update_Node.py b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Update_Node.py
old mode 100755
new mode 100644
index 7feed1b..919898d
--- a/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Update_Node.py
+++ b/TestON/tests/FUNC/FUNCbgpls/dependencies/Scapyfiles/Update_Node.py
@@ -1,5 +1,6 @@
+#!/usr/bin/python # This is server.py file
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +9,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,8 +19,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
-#!/usr/bin/python # This is server.py file
from scapy.all import *
import socket # Import socket module
import time # Import Time module
@@ -27,43 +26,42 @@
import os
path = os.getcwd()
-sys.path.append('OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies') #Setting the path for BgpLS
+sys.path.append( 'OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies' ) # Setting the path for BgpLS
from Nbdata import BgpLs
obj = BgpLs()
returnlist = obj.Constants()
-peerIp = returnlist[0][0]
+peerIp = returnlist[ 0 ][ 0 ]
-load_contrib('bgp')
+load_contrib( 'bgp' )
s = socket.socket() # Create a socket object
-host = peerIp # Get local machine name
+host = peerIp # Get local machine name
port = 179 # Reserve a port for your service.
-s.bind((host, port)) # Bind to the port
-pkts = rdpcap(path + "/OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls_all.pcap")
-pkts[69][BGPOpen].bgp_id = peerIp
+s.bind( ( host, port ) ) # Bind to the port
+pkts = rdpcap( path + "/OnosSystemTest/TestON/tests/FUNC/FUNCbgpls/dependencies/Bgpls_packets/bgpls_all.pcap" )
+pkts[ 69 ][ BGPOpen ].bgp_id = peerIp
-s.listen(5) # Now wait for client connection.
+s.listen( 5 ) # Now wait for client connection.
-print("starting Connecting to ONOS peer")
+print( "starting Connecting to ONOS peer" )
c, addr = s.accept() # Establish connection with client.
print 'Got connection from ONOS :', addr
-c.send(str(pkts[69][BGPHeader])) # OPEN MESSAGE
-c.recv(4096)
-c.send(str(pkts[71][BGPHeader]))# KEEPALIVE MESSAGE
-c.recv(4096)
-c.send(str(pkts[72][BGPHeader])) # UPDATE MESSAGES
-c.send(str(pkts[74][BGPHeader]))
-c.send(str(pkts[71][BGPHeader]))
+c.send( str( pkts[ 69 ][ BGPHeader ] ) ) # OPEN MESSAGE
+c.recv( 4096 )
+c.send( str( pkts[ 71 ][ BGPHeader ] ) ) # KEEPALIVE MESSAGE
+c.recv( 4096 )
+c.send( str( pkts[ 72 ][ BGPHeader ] ) ) # UPDATE MESSAGES
+c.send( str( pkts[ 74 ][ BGPHeader ] ) )
+c.send( str( pkts[ 71 ][ BGPHeader ] ) )
-time.sleep(10) # Waiting for 120 seconds for update message.
+time.sleep( 10 ) # Waiting for 120 seconds for update message.
-c.send(str(pkts[298][BGPHeader]))
-c.send(str(pkts[860][BGPHeader])) # UPDATE MESSAGES with new node
-c.send(str(pkts[865][BGPHeader]))
-print ("New Node update msg sent")
+c.send( str( pkts[ 298 ][ BGPHeader ] ) )
+c.send( str( pkts[ 860 ][ BGPHeader ] ) ) # UPDATE MESSAGES with new node
+c.send( str( pkts[ 865 ][ BGPHeader ] ) )
+print ( "New Node update msg sent" )
while True:
- c.recv(4096)
- c.send(str(pkts[71][BGPHeader]))
-
- # c.close() # Close the connection
+ c.recv( 4096 )
+ c.send( str( pkts[ 71 ][ BGPHeader ] ) )
+ # c.close() # Close the connection
diff --git a/TestON/tests/FUNC/FUNCflow/FUNCflow.py b/TestON/tests/FUNC/FUNCflow/FUNCflow.py
index 9b504ba..e900648 100644
--- a/TestON/tests/FUNC/FUNCflow/FUNCflow.py
+++ b/TestON/tests/FUNC/FUNCflow/FUNCflow.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
class FUNCflow:
def __init__( self ):
@@ -42,7 +41,6 @@
- Checkout ONOS master branch
- Pull latest ONOS code
"""
-
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
@@ -71,7 +69,7 @@
main.checkingFlow = CheckingFlow()
except ImportError as e:
print e
- main.log.error("CheckingFlow not found exiting the test")
+ main.log.error( "CheckingFlow not found exiting the test" )
main.cleanAndExit()
copyResult = main.ONOSbench.scp( main.Mininet1,
main.dependencyPath + main.topology,
@@ -89,7 +87,6 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
-
def CASE2( self, main ):
"""
- Set up cell
@@ -788,7 +785,7 @@
udpDst = main.params[ 'TEST' ][ 'udpDst' ]
main.log.info( "Add a flow that connects host1 on port1 to host2 on port2" )
- stepResult =ctrl.REST.addFlow( deviceId=main.swDPID,
+ stepResult = ctrl.REST.addFlow( deviceId=main.swDPID,
egressPort=egress,
ingressPort=ingress,
ethType=ethType,
diff --git a/TestON/tests/FUNC/FUNCflow/dependencies/checkingFlow.py b/TestON/tests/FUNC/FUNCflow/dependencies/checkingFlow.py
index 4209947..37ae8b6 100644
--- a/TestON/tests/FUNC/FUNCflow/dependencies/checkingFlow.py
+++ b/TestON/tests/FUNC/FUNCflow/dependencies/checkingFlow.py
@@ -1,12 +1,14 @@
import json
import time
+
+
class CheckingFlow:
def __init__( self ):
self.default = ''
def checkFlow( self ):
- main.step("Check flow is in the ADDED state")
+ main.step( "Check flow is in the ADDED state" )
main.log.info( "Get the flows from ONOS" )
try:
flows = json.loads( main.Cluster.active( 0 ).REST.flows() )
diff --git a/TestON/tests/FUNC/FUNCflow/dependencies/mplsClass.py b/TestON/tests/FUNC/FUNCflow/dependencies/mplsClass.py
index 66d4664..ec9ebaa 100644
--- a/TestON/tests/FUNC/FUNCflow/dependencies/mplsClass.py
+++ b/TestON/tests/FUNC/FUNCflow/dependencies/mplsClass.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,14 +18,14 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
import scapy
-class MPLS(Packet):
- name = "MPLS"
- fields_desc = [
- BitField("label", 3, 20),
- BitField("experimental_bits", 0, 3),
- BitField("bottom_of_label_stack", 1, 1), # Now we're at the bottom
- ByteField("TTL", 255)
- ]
+
+class MPLS( Packet ):
+ name = "MPLS"
+ fields_desc = [
+ BitField( "label", 3, 20 ),
+ BitField( "experimental_bits", 0, 3 ),
+ BitField( "bottom_of_label_stack", 1, 1 ), # Now we're at the bottom
+ ByteField( "TTL", 255 )
+ ]
diff --git a/TestON/tests/FUNC/FUNCflow/dependencies/topo-flow.py b/TestON/tests/FUNC/FUNCflow/dependencies/topo-flow.py
old mode 100755
new mode 100644
index 8a5e402..0dbaa80
--- a/TestON/tests/FUNC/FUNCflow/dependencies/topo-flow.py
+++ b/TestON/tests/FUNC/FUNCflow/dependencies/topo-flow.py
@@ -1,5 +1,6 @@
+# !/usr/bin/python
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +9,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,8 +20,6 @@
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-#!/usr/bin/python
-
"""
Custom topology for Mininet
"""
@@ -35,19 +34,23 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class VLANHost( Host ):
+
def config( self, vlan=100, **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ifconfig %s inet 0' % intf )
self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params[ 'ip' ] ) )
newName = '%s.%d' % ( intf, vlan )
intf.name = newName
self.nameToIntf[ newName ] = intf
return r
+
class IPv6Host( Host ):
+
def config( self, v6Addr='1000:1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
@@ -55,45 +58,46 @@
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class MyTopo( Topo ):
def __init__( self, **opts ):
# Initialize topology
- Topo.__init__( self, **opts)
+ Topo.__init__( self, **opts )
# IPv4 hosts
- host1=self.addHost( 'h1', ip='10.0.0.1/24' )
- host2=self.addHost( 'h2', ip='10.0.0.2/24' )
+ host1 = self.addHost( 'h1', ip='10.0.0.1/24' )
+ host2 = self.addHost( 'h2', ip='10.0.0.2/24' )
# VLAN hosts
- host3=self.addHost( 'h3', ip='10.0.0.3/24', cls=VLANHost, vlan=10 )
- host4=self.addHost( 'h4', ip='10.0.0.4/24', cls=VLANHost, vlan=10 )
+ host3 = self.addHost( 'h3', ip='10.0.0.3/24', cls=VLANHost, vlan=10 )
+ host4 = self.addHost( 'h4', ip='10.0.0.4/24', cls=VLANHost, vlan=10 )
- #IPv6 hosts
- host5=self.addHost( 'h5', ip='10.0.0.5/24', cls=IPv6Host, v6Addr='1000::5/64')
- host6=self.addHost( 'h6', ip='10.0.0.6/24', cls=IPv6Host, v6Addr='1000::6/64')
+ # IPv6 hosts
+ host5 = self.addHost( 'h5', ip='10.0.0.5/24', cls=IPv6Host, v6Addr='1000::5/64' )
+ host6 = self.addHost( 'h6', ip='10.0.0.6/24', cls=IPv6Host, v6Addr='1000::6/64' )
s1 = self.addSwitch( 's1' )
- self.addLink(s1, host1)
- self.addLink(s1, host2)
- self.addLink(s1, host3)
- self.addLink(s1, host4)
- self.addLink(s1, host5)
- self.addLink(s1, host6)
-
+ self.addLink( s1, host1 )
+ self.addLink( s1, host2 )
+ self.addLink( s1, host3 )
+ self.addLink( s1, host4 )
+ self.addLink( s1, host5 )
+ self.addLink( s1, host6 )
topos = { 'mytopo': ( lambda: MyTopo() ) }
+
def setupNetwork():
"Create network"
topo = MyTopo()
- network = Mininet(topo=topo, autoSetMacs=True, autoStaticArp=True, controller=None)
+ network = Mininet( topo=topo, autoSetMacs=True, autoStaticArp=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/FUNC/FUNCgroup/FUNCgroup.py b/TestON/tests/FUNC/FUNCgroup/FUNCgroup.py
index de50155..8e06747 100644
--- a/TestON/tests/FUNC/FUNCgroup/FUNCgroup.py
+++ b/TestON/tests/FUNC/FUNCgroup/FUNCgroup.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
class FUNCgroup:
def __init__( self ):
@@ -47,51 +46,51 @@
try:
# Test variables
- main.cellName = main.params['ENV']['cellName']
- main.apps = main.params['ENV']['cellApps']
- main.ONOSport = main.params['CTRL']['port']
+ main.cellName = main.params[ 'ENV' ][ 'cellName' ]
+ main.apps = main.params[ 'ENV' ][ 'cellApps' ]
+ main.ONOSport = main.params[ 'CTRL' ][ 'port' ]
main.dependencyPath = main.testOnDirectory + \
- main.params['DEPENDENCY']['path']
- wrapperFile1 = main.params['DEPENDENCY']['wrapper1']
- wrapperFile2 = main.params['DEPENDENCY']['wrapper2']
- main.topology = main.params['DEPENDENCY']['topology']
- bucket = main.params['DEPENDENCY']['bucket']
- main.startUpSleep = int(main.params['SLEEP']['startup'])
- main.startMNSleep = int(main.params['SLEEP']['startMN'])
- main.addFlowSleep = int(main.params['SLEEP']['addFlow'])
- main.delFlowSleep = int(main.params['SLEEP']['delFlow'])
- main.addGroupSleep = int(main.params['SLEEP']['addGroup'])
- main.delGroupSleep = int(main.params['SLEEP']['delGroup'])
- main.debug = main.params['DEBUG']
- main.swDPID = main.params['TEST']['swDPID']
- egressPort1 = main.params['TEST']['egressPort1']
- egressPort2 = main.params['TEST']['egressPort2']
- egressPort3 = main.params['TEST']['egressPort3']
- ingressPort = main.params['TEST']['ingressPort']
- appCookie = main.params['TEST']['appCookie']
- type1 = main.params['TEST']['type1']
- type2 = main.params['TEST']['type2']
- groupId = main.params['TEST']['groupId']
- priority = main.params['TEST']['priority']
- deviceId = main.params['TEST']['swDPID']
+ main.params[ 'DEPENDENCY' ][ 'path' ]
+ wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
+ wrapperFile2 = main.params[ 'DEPENDENCY' ][ 'wrapper2' ]
+ main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
+ bucket = main.params[ 'DEPENDENCY' ][ 'bucket' ]
+ main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
+ main.startMNSleep = int( main.params[ 'SLEEP' ][ 'startMN' ] )
+ main.addFlowSleep = int( main.params[ 'SLEEP' ][ 'addFlow' ] )
+ main.delFlowSleep = int( main.params[ 'SLEEP' ][ 'delFlow' ] )
+ main.addGroupSleep = int( main.params[ 'SLEEP' ][ 'addGroup' ] )
+ main.delGroupSleep = int( main.params[ 'SLEEP' ][ 'delGroup' ] )
+ main.debug = main.params[ 'DEBUG' ]
+ main.swDPID = main.params[ 'TEST' ][ 'swDPID' ]
+ egressPort1 = main.params[ 'TEST' ][ 'egressPort1' ]
+ egressPort2 = main.params[ 'TEST' ][ 'egressPort2' ]
+ egressPort3 = main.params[ 'TEST' ][ 'egressPort3' ]
+ ingressPort = main.params[ 'TEST' ][ 'ingressPort' ]
+ appCookie = main.params[ 'TEST' ][ 'appCookie' ]
+ type1 = main.params[ 'TEST' ][ 'type1' ]
+ type2 = main.params[ 'TEST' ][ 'type2' ]
+ groupId = main.params[ 'TEST' ][ 'groupId' ]
+ priority = main.params[ 'TEST' ][ 'priority' ]
+ deviceId = main.params[ 'TEST' ][ 'swDPID' ]
main.debug = True if "on" in main.debug else False
# -- INIT SECTION, ONLY RUNS ONCE -- #
- main.buckets = imp.load_source(bucket,
- main.dependencyPath +
- bucket +
- ".py")
+ main.buckets = imp.load_source( bucket,
+ main.dependencyPath +
+ bucket +
+ ".py" )
- copyResult = main.ONOSbench.scp(main.Mininet1,
- main.dependencyPath + main.topology,
- main.Mininet1.home + '/custom/',
- direction="to")
+ copyResult = main.ONOSbench.scp( main.Mininet1,
+ main.dependencyPath + main.topology,
+ main.Mininet1.home + '/custom/',
+ direction="to" )
- utilities.assert_equals(expect=main.TRUE,
- actual=copyResult,
- onpass="Successfully copy " + "test variables ",
- onfail="Failed to copy test variables")
+ utilities.assert_equals( expect=main.TRUE,
+ actual=copyResult,
+ onpass="Successfully copy " + "test variables ",
+ onfail="Failed to copy test variables" )
stepResult = main.testSetUp.envSetup()
except Exception as e:
@@ -99,8 +98,6 @@
main.testSetUp.evnSetupConclusion( stepResult )
-
-
def CASE2( self, main ):
"""
- Set up cell
@@ -381,7 +378,7 @@
main.case( "Delete the Group and Flow added through Rest api " )
main.step( "Deleting Group and Flows" )
ctrl = main.Cluster.active( 0 )
- #Get Flow ID
+ # Get Flow ID
response = ctrl.REST.getFlows( deviceId=deviceId )
responsejson = json.loads( response )
for item in responsejson:
diff --git a/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py b/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py
index 7b8ded6..394d2df 100644
--- a/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py
+++ b/TestON/tests/FUNC/FUNCgroup/dependencies/group-bucket.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
def addBucket( main, egressPort="" ):
"""
Description:
diff --git a/TestON/tests/FUNC/FUNCgroup/dependencies/topo-group.py b/TestON/tests/FUNC/FUNCgroup/dependencies/topo-group.py
index 16a0a84..5e9f750 100644
--- a/TestON/tests/FUNC/FUNCgroup/dependencies/topo-group.py
+++ b/TestON/tests/FUNC/FUNCgroup/dependencies/topo-group.py
@@ -1,5 +1,6 @@
+# !/usr/bin/python
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +9,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,8 +20,6 @@
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-#!/usr/bin/python
-
"""
Custom topology for Mininet
"""
@@ -35,36 +34,38 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class MyTopo( Topo ):
def __init__( self, **opts ):
# Initialize topology
- Topo.__init__( self, **opts)
+ Topo.__init__( self, **opts )
# IPv4 hosts
- host1=self.addHost( 'h1', ip='10.0.0.1/24' )
- host2=self.addHost( 'h2', ip='10.0.0.2/24' )
- host3=self.addHost( 'h3', ip='10.0.0.3/24' )
- host4=self.addHost( 'h4', ip='10.0.0.4/24' )
+ host1 = self.addHost( 'h1', ip='10.0.0.1/24' )
+ host2 = self.addHost( 'h2', ip='10.0.0.2/24' )
+ host3 = self.addHost( 'h3', ip='10.0.0.3/24' )
+ host4 = self.addHost( 'h4', ip='10.0.0.4/24' )
s1 = self.addSwitch( 's1' )
- self.addLink(s1, host1)
- self.addLink(s1, host2)
- self.addLink(s1, host3)
- self.addLink(s1, host4)
+ self.addLink( s1, host1 )
+ self.addLink( s1, host2 )
+ self.addLink( s1, host3 )
+ self.addLink( s1, host4 )
topos = { 'mytopo': ( lambda: MyTopo() ) }
+
def setupNetwork():
"Create network"
topo = MyTopo()
- network = Mininet(topo=topo, autoSetMacs=True, autoStaticArp=True, controller=None)
+ network = Mininet( topo=topo, autoSetMacs=True, autoStaticArp=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/FUNC/FUNCintent/FUNCintent.py b/TestON/tests/FUNC/FUNCintent/FUNCintent.py
index c0374f8..24d2f75 100644
--- a/TestON/tests/FUNC/FUNCintent/FUNCintent.py
+++ b/TestON/tests/FUNC/FUNCintent/FUNCintent.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# Testing the basic intent functionality of ONOS
@@ -39,7 +38,6 @@
- Install ONOS package
- Build ONOS package
"""
-
try:
from tests.dependencies.ONOSSetup import ONOSSetup
main.testSetUp = ONOSSetup()
@@ -114,7 +112,6 @@
- Install ONOS cluster
- Connect to cli
"""
-
main.flowCompiler = "Flow Rules"
main.initialized = main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, True )
main.intents.report( main )
@@ -134,6 +131,7 @@
except ( NameError, AttributeError ):
main.topoRelated = Topology()
main.topoRelated.compareTopos( main.Mininet1, main.checkTopoAttempts )
+
def CASE10( self, main ):
"""
Start Mininet topology with OF 1.0 switches
@@ -372,10 +370,10 @@
cmd = "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator"
stepResult = main.Cluster.active( 0 ).CLI.setCfg( component=cmd,
- propName="useFlowObjectives", value="true" )
+ propName="useFlowObjectives", value="true" )
stepResult &= main.Cluster.active( 0 ).CLI.setCfg( component=cmd,
- propName="defaultFlowObjectiveCompiler",
- value='org.onosproject.net.intent.impl.compiler.LinkCollectionIntentObjectiveCompiler' )
+ propName="defaultFlowObjectiveCompiler",
+ value='org.onosproject.net.intent.impl.compiler.LinkCollectionIntentObjectiveCompiler' )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -438,6 +436,7 @@
except ( NameError, AttributeError ):
main.Utils = Utils()
main.Utils.copyKarafLog( "cycle" + str( main.cycle ) )
+
def CASE1000( self, main ):
"""
Add host intents between 2 host:
@@ -924,11 +923,11 @@
main.assertReturnString = "Assertion Result for SDNIP-ICMP IPV4 using TCP point intents\n"
senders = [
{ "name": "h1", "device": "of:0000000000000005/1", "mac": "00:00:00:00:00:01",
- "ip":( main.h1.hostIp + "/24" ) }
+ "ip": ( main.h1.hostIp + "/24" ) }
]
recipients = [
{ "name": "h9", "device": "of:0000000000000006/1", "mac": "00:00:00:00:00:09",
- "ip":( main.h9.hostIp + "/24" ) }
+ "ip": ( main.h9.hostIp + "/24" ) }
]
ipProto = main.params[ 'SDNIP' ][ 'ipPrototype' ]
# Uneccessary, not including this in the selectors
@@ -1820,48 +1819,49 @@
actual=testResult,
onpass=main.assertReturnString,
onfail=main.assertReturnString )
+ """
+ Testing MPLS would require kernel version of 4.1 or higher ( Current version is 3.13 )
+ main.step( "ENCAPSULATION: Add multi point to single point intents" )
+ main.assertReturnString = "Assertion results for MPLS Encapsulation multi to single point intent\n"
+ senders = [
+ { "name": "h16", "device": "of:0000000000000006/8" },
+ { "name": "h24", "device": "of:0000000000000007/8" }
+ ]
+ recipients = [
+ { "name": "h8", "device": "of:0000000000000005/8" }
+ ]
+ badSenders = [ { "name": "h17" } ] # Senders that are not in the intent
+ badRecipients = [ { "name": "h9" } ] # Recipients that are not in the intent
+ testResult = main.FALSE
+ installResult = main.intents.installMultiToSingleIntent(
+ main,
+ name="ENCAPSULATION",
+ senders=senders,
+ recipients=recipients,
+ sw1="s5",
+ sw2="s2",
+ encap="MPLS" )
- #Testing MPLS would require kernel version of 4.1 or higher ( Current version is 3.13 )
- #main.step( "ENCAPSULATION: Add multi point to single point intents" )
- #main.assertReturnString = "Assertion results for MPLS Encapsulation multi to single point intent\n"
- #senders = [
- # { "name": "h16", "device": "of:0000000000000006/8" },
- # { "name": "h24", "device": "of:0000000000000007/8" }
- # ]
- #recipients = [
- # { "name": "h8", "device": "of:0000000000000005/8" }
- # ]
- #badSenders = [ { "name": "h17" } ] # Senders that are not in the intent
- #badRecipients = [ { "name": "h9" } ] # Recipients that are not in the intent
- #testResult = main.FALSE
- #installResult = main.intents.installMultiToSingleIntent(
- # main,
- # name="ENCAPSULATION",
- # senders=senders,
- # recipients=recipients,
- # sw1="s5",
- # sw2="s2",
- # encap="MPLS" )
- #
- #if installResult:
- # testResult = main.intents.testPointIntent(
- # main,
- # intentId=installResult,
- # name="ENCAPSULATION",
- # senders=senders,
- # recipients=recipients,
- # badSenders=badSenders,
- # badRecipients=badRecipients,
- # sw1="s5",
- # sw2="s2",
- # expectedLink=18 )
- #else:
- # main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True )
- #
- #utilities.assert_equals( expect=main.TRUE,
- # actual=testResult,
- # onpass=main.assertReturnString,
- # onfail=main.assertReturnString )
+ if installResult:
+ testResult = main.intents.testPointIntent(
+ main,
+ intentId=installResult,
+ name="ENCAPSULATION",
+ senders=senders,
+ recipients=recipients,
+ badSenders=badSenders,
+ badRecipients=badRecipients,
+ sw1="s5",
+ sw2="s2",
+ expectedLink=18 )
+ else:
+ main.Cluster.active( 0 ).CLI.removeAllIntents( purge=True )
+
+ utilities.assert_equals( expect=main.TRUE,
+ actual=testResult,
+ onpass=main.assertReturnString,
+ onfail=main.assertReturnString )
+ """
main.intents.report( main )
diff --git a/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py b/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
index bdd0e74..1a7002b 100644
--- a/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
+++ b/TestON/tests/FUNC/FUNCintent/dependencies/FuncIntentFunction.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -2077,8 +2077,8 @@
"""
intentResult = main.TRUE
stateCheckResults = main.Cluster.command( "checkIntentState",
- kwargs={ "intentsId":intentsId },
- returnBool=True, specificDriver=2 )
+ kwargs={ "intentsId": intentsId },
+ returnBool=True, specificDriver=2 )
if stateCheckResults:
main.log.info( itemName + ": Intents state check passed" )
else:
@@ -2093,8 +2093,8 @@
Returns main.TRUE or main.FALSE
"""
stateCheckResults = main.Cluster.command( "compareBandwidthAllocations",
- args=[ bandwidth ],
- returnBool=True, specificDriver=2 )
+ args=[ bandwidth ],
+ returnBool=True, specificDriver=2 )
if stateCheckResults:
main.log.info( itemName + ": bandwidth check passed" )
bandwidthResult = main.TRUE
@@ -2396,7 +2396,7 @@
else failed
"""
- main.log.info( "Checking encapsulated intent for " + tag + ".")
+ main.log.info( "Checking encapsulated intent for " + tag + "." )
HostJson = []
Jflows = main.Cluster.active( 0 ).CLI.flows( noCore=True )
try:
@@ -2435,6 +2435,7 @@
main.log.error( "Total " + PopTag + str( pop ) )
return main.FALSE
+
def ProtectedIntentCheck( main ):
intent = main.Cluster.active( 0 ).CLI.intents( jsonFormat=False )
if "Protection" in intent:
diff --git a/TestON/tests/FUNC/FUNCintent/dependencies/newFuncTopo.py b/TestON/tests/FUNC/FUNCintent/dependencies/newFuncTopo.py
old mode 100755
new mode 100644
index 6170025..9897d9c
--- a/TestON/tests/FUNC/FUNCintent/dependencies/newFuncTopo.py
+++ b/TestON/tests/FUNC/FUNCintent/dependencies/newFuncTopo.py
@@ -1,5 +1,6 @@
+# !/usr/bin/python
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +9,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,8 +20,6 @@
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-#!/usr/bin/python
-
"""
Custom topology for Mininet
"""
@@ -35,20 +34,24 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class VLANHost( Host ):
+
def config( self, vlan=100, v6Addr='3000::1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ifconfig %s inet 0' % intf )
self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params[ 'ip' ] ) )
self.cmd( 'ip -6 addr add %s dev %s.%d' % ( v6Addr, intf, vlan ) )
newName = '%s.%d' % ( intf, vlan )
intf.name = newName
self.nameToIntf[ newName ] = intf
return r
+
class IPv6Host( Host ):
+
def config( self, v6Addr='1000::1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
@@ -56,13 +59,16 @@
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class dualStackHost( Host ):
+
def config( self, v6Addr='2000:1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class MyTopo( Topo ):
def __init__( self ):
@@ -70,51 +76,51 @@
Topo.__init__( self )
# Switch S5 Hosts
# IPv4 only Host
- host1=self.addHost( 'h1', ip='10.1.0.2/24' )
+ host1 = self.addHost( 'h1', ip='10.1.0.2/24' )
# IPv6 only Host
- host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
+ host2 = self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
# Dual Stack Host
- host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
+ host3 = self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
# VLAN hosts
- host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100, v6Addr='3000::2/64' )
- host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200, v6Addr='4000::2/64' )
+ host4 = self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100, v6Addr='3000::2/64' )
+ host5 = self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200, v6Addr='4000::2/64' )
# VPN-1 and VPN-2 Hosts
- host6=self.addHost( 'h6', ip='11.1.0.2/24' )
- host7=self.addHost( 'h7', ip='12.1.0.2/24' )
+ host6 = self.addHost( 'h6', ip='11.1.0.2/24' )
+ host7 = self.addHost( 'h7', ip='12.1.0.2/24' )
# Multicast Sender
- host8=self.addHost( 'h8', ip='10.1.0.4/24' )
+ host8 = self.addHost( 'h8', ip='10.1.0.4/24' )
# Switch S6 Hosts
# IPv4 only Host
- host9=self.addHost( 'h9', ip='10.1.0.5/24' )
+ host9 = self.addHost( 'h9', ip='10.1.0.5/24' )
# IPv6 only Host
- host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
+ host10 = self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
# Dual Stack Host
- host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
+ host11 = self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
# VLAN hosts
- host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100, v6Addr='3000::3/64' )
- host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200, v6Addr='4000::3/64' )
+ host12 = self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100, v6Addr='3000::3/64' )
+ host13 = self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200, v6Addr='4000::3/64' )
# VPN-1 and VPN-2 Hosts
- host14=self.addHost( 'h14', ip='11.1.0.3/24' )
- host15=self.addHost( 'h15', ip='12.1.0.3/24' )
+ host14 = self.addHost( 'h14', ip='11.1.0.3/24' )
+ host15 = self.addHost( 'h15', ip='12.1.0.3/24' )
# Multicast Receiver
- host16=self.addHost( 'h16', ip='10.1.0.7/24' )
+ host16 = self.addHost( 'h16', ip='10.1.0.7/24' )
# Switch S7 Hosts
# IPv4 only Host
- host17=self.addHost( 'h17', ip='10.1.0.8/24' )
+ host17 = self.addHost( 'h17', ip='10.1.0.8/24' )
# IPv6 only Host
- host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
+ host18 = self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
# Dual Stack Host
- host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
+ host19 = self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
# VLAN hosts
- host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100, v6Addr='3000::4/64' )
- host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200, v6Addr='4000::4/64' )
+ host20 = self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100, v6Addr='3000::4/64' )
+ host21 = self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200, v6Addr='4000::4/64' )
# VPN-1 and VPN-2 Hosts
- host22=self.addHost( 'h22', ip='11.1.0.4/24' )
- host23=self.addHost( 'h23', ip='12.1.0.4/24' )
+ host22 = self.addHost( 'h22', ip='11.1.0.4/24' )
+ host23 = self.addHost( 'h23', ip='12.1.0.4/24' )
# Multicast Receiver
- host24=self.addHost( 'h24', ip='10.1.0.10/24' )
+ host24 = self.addHost( 'h24', ip='10.1.0.10/24' )
s1 = self.addSwitch( 's1' )
s2 = self.addSwitch( 's2' )
@@ -124,56 +130,57 @@
s6 = self.addSwitch( 's6' )
s7 = self.addSwitch( 's7' )
- self.addLink(s5,host1)
- self.addLink(s5,host2)
- self.addLink(s5,host3)
- self.addLink(s5,host4)
- self.addLink(s5,host5)
- self.addLink(s5,host6)
- self.addLink(s5,host7)
- self.addLink(s5,host8)
+ self.addLink( s5, host1 )
+ self.addLink( s5, host2 )
+ self.addLink( s5, host3 )
+ self.addLink( s5, host4 )
+ self.addLink( s5, host5 )
+ self.addLink( s5, host6 )
+ self.addLink( s5, host7 )
+ self.addLink( s5, host8 )
- self.addLink(s6,host9)
- self.addLink(s6,host10)
- self.addLink(s6,host11)
- self.addLink(s6,host12)
- self.addLink(s6,host13)
- self.addLink(s6,host14)
- self.addLink(s6,host15)
- self.addLink(s6,host16)
+ self.addLink( s6, host9 )
+ self.addLink( s6, host10 )
+ self.addLink( s6, host11 )
+ self.addLink( s6, host12 )
+ self.addLink( s6, host13 )
+ self.addLink( s6, host14 )
+ self.addLink( s6, host15 )
+ self.addLink( s6, host16 )
- self.addLink(s7,host17)
- self.addLink(s7,host18)
- self.addLink(s7,host19)
- self.addLink(s7,host20)
- self.addLink(s7,host21)
- self.addLink(s7,host22)
- self.addLink(s7,host23)
- self.addLink(s7,host24)
+ self.addLink( s7, host17 )
+ self.addLink( s7, host18 )
+ self.addLink( s7, host19 )
+ self.addLink( s7, host20 )
+ self.addLink( s7, host21 )
+ self.addLink( s7, host22 )
+ self.addLink( s7, host23 )
+ self.addLink( s7, host24 )
- self.addLink(s1,s2)
- self.addLink(s1,s3)
- self.addLink(s1,s4)
- self.addLink(s1,s5)
- self.addLink(s2,s3)
- self.addLink(s2,s5)
- self.addLink(s2,s6)
- self.addLink(s3,s4)
- self.addLink(s3,s6)
- self.addLink(s4,s7)
+ self.addLink( s1, s2 )
+ self.addLink( s1, s3 )
+ self.addLink( s1, s4 )
+ self.addLink( s1, s5 )
+ self.addLink( s2, s3 )
+ self.addLink( s2, s5 )
+ self.addLink( s2, s6 )
+ self.addLink( s3, s4 )
+ self.addLink( s3, s6 )
+ self.addLink( s4, s7 )
topos = { 'mytopo': ( lambda: MyTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = MyTopo()
- network = Mininet(topo=topo, autoSetMacs=True, controller=None)
+ network = Mininet( topo=topo, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py b/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
index 1872846..cbf1fea 100644
--- a/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
+++ b/TestON/tests/FUNC/FUNCintentRest/FUNCintentRest.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# Testing the basic intent functionality of ONOS
# TODO: Replace the CLI calls with REST API equivalents as they become available.
# - May need to write functions in the onosrestdriver.py file to do this
@@ -97,7 +96,7 @@
direction="to" )
stepResult = main.testSetUp.envSetup()
except Exception as e:
- main.testSetUp.envSetupException(e)
+ main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
def CASE2( self, main ):
@@ -136,7 +135,7 @@
main.ONOSbench.logReport( main.Cluster.active( 0 ).ipAddress,
[ "INFO", "FOLLOWER", "WARN", "flow", "ERROR", "Except" ],
"s" )
- #main.ONOSbench.logReport( globalONOSip[ 1 ], [ "INFO" ], "d" )
+ # main.ONOSbench.logReport( globalONOSip[ 1 ], [ "INFO" ], "d" )
def CASE10( self, main ):
"""
@@ -381,10 +380,10 @@
cmd = "org.onosproject.net.intent.impl.compiler.IntentConfigurableRegistrator"
stepResult = main.Cluster.active( 0 ).CLI.setCfg( component=cmd,
- propName="useFlowObjectives", value="true" )
+ propName="useFlowObjectives", value="true" )
stepResult &= main.Cluster.active( 0 ).CLI.setCfg( component=cmd,
- propName="defaultFlowObjectiveCompiler",
- value='org.onosproject.net.intent.impl.compiler.LinkCollectionIntentObjectiveCompiler' )
+ propName="defaultFlowObjectiveCompiler",
+ value='org.onosproject.net.intent.impl.compiler.LinkCollectionIntentObjectiveCompiler' )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -448,6 +447,7 @@
except ( NameError, AttributeError ):
main.Utils = Utils()
main.Utils.copyKarafLog( "cycle" + str( main.cycle ) )
+
def CASE1000( self, main ):
"""
Add host intents between 2 host:
@@ -1246,7 +1246,7 @@
recipients=recipients,
sw1="s5",
sw2="s2" )
- #setVlan=100 )
+ # setVlan=100 )
if installResult:
testResult = main.intentFunction.testPointIntent(
diff --git a/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py b/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
index f4743ee..6b4346c 100644
--- a/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
+++ b/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -1047,7 +1047,7 @@
portEgressList=portEgressList,
ethType=ethType,
ethSrc=srcMac,
- #ethDst=dstMac, #Isn't working because of ONOS itself
+ # ethDst=dstMac, #Isn't working because of ONOS itself
bandwidth=bandwidth,
lambdaAlloc=lambdaAlloc,
ipProto=ipProto,
@@ -1159,15 +1159,15 @@
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 )
+ # 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 )
+ # print "len devices = ", len( devices )
+ # print "len ports = ", len( ports )
return main.FALSE
else:
main.log.info( "Device Ports are not specified" )
@@ -1183,11 +1183,11 @@
main.hostsData.get( host ).get( 'mac' )
ipDict[ main.hostsData.get( host ).get( 'location' ) ] = \
main.hostsData.get( host ).get( 'ipAddresses' )
- #print main.hostsData
+ # print main.hostsData
- #print 'host names = ', hostNames
- #print 'devices = ', devices
- #print "macsDict = ", macsDict
+ # print 'host names = ', hostNames
+ # print 'devices = ', devices
+ # print "macsDict = ", macsDict
pingResult = main.TRUE
intentResult = main.TRUE
@@ -1399,8 +1399,8 @@
main.log.info( itemName + ": Checking intents state" )
# First check of intents
stateCheckResults = main.Cluster.command( "checkIntentState",
- kwargs={ "intentsId":intentsId },
- returnBool=True, specificDriver=3 )
+ kwargs={ "intentsId": intentsId },
+ returnBool=True, specificDriver=3 )
expectedState = [ 'INSTALLED', 'INSTALLING' ]
@@ -1414,8 +1414,8 @@
# Second check of intents since some of the intents may be in
# INSTALLING state, they should be in INSTALLED at this time
stateCheckResults = main.Cluster.command( "checkIntentState",
- kwargs={ "intentsId":intentsId },
- returnBool=True, specificDriver=3 )
+ kwargs={ "intentsId": intentsId },
+ returnBool=True, specificDriver=3 )
if stateCheckResults:
main.log.info( itemName + ": Intents are installed correctly" )
intentResult = main.TRUE
@@ -1467,7 +1467,6 @@
for ctrl in main.Cluster.active():
flowsCount.append( len( json.loads( ctrl.REST.flows() ) ) )
-
if flowsCount:
if all( flows == flowsCount[ 0 ] for flows in flowsCount ):
main.log.info( itemName + ": There are " + str( flowsCount[ 0 ] ) +
diff --git a/TestON/tests/FUNC/FUNCintentRest/dependencies/newFuncTopo.py b/TestON/tests/FUNC/FUNCintentRest/dependencies/newFuncTopo.py
old mode 100755
new mode 100644
index 870bc32..951e15c
--- a/TestON/tests/FUNC/FUNCintentRest/dependencies/newFuncTopo.py
+++ b/TestON/tests/FUNC/FUNCintentRest/dependencies/newFuncTopo.py
@@ -1,5 +1,6 @@
+#!/usr/bin/python
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +9,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,8 +20,6 @@
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-#!/usr/bin/python
-
"""
Custom topology for Mininet
"""
@@ -35,19 +34,23 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class VLANHost( Host ):
+
def config( self, vlan=100, **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ifconfig %s inet 0' % intf )
self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params[ 'ip' ] ) )
newName = '%s.%d' % ( intf, vlan )
intf.name = newName
self.nameToIntf[ newName ] = intf
return r
+
class IPv6Host( Host ):
+
def config( self, v6Addr='1000:1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
@@ -55,56 +58,59 @@
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class dualStackHost( Host ):
+
def config( self, v6Addr='2000:1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class MyTopo( Topo ):
def __init__( self ):
# Initialize topology
Topo.__init__( self )
# Switch S5 Hosts
- host1=self.addHost( 'h1', ip='10.1.0.2/24' )
- host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
- host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
- #VLAN hosts
- host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
- host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host6=self.addHost( 'h6', ip='11.1.0.2/24' )
- host7=self.addHost( 'h7', ip='12.1.0.2/24' )
- #Multicast Sender
- host8=self.addHost( 'h8', ip='10.1.0.4/24' )
+ host1 = self.addHost( 'h1', ip='10.1.0.2/24' )
+ host2 = self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
+ host3 = self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
+ # VLAN hosts
+ host4 = self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
+ host5 = self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
+ # VPN-1 and VPN-2 Hosts
+ host6 = self.addHost( 'h6', ip='11.1.0.2/24' )
+ host7 = self.addHost( 'h7', ip='12.1.0.2/24' )
+ # Multicast Sender
+ host8 = self.addHost( 'h8', ip='10.1.0.4/24' )
# Switch S6 Hosts
- host9=self.addHost( 'h9', ip='10.1.0.5/24' )
- host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
- host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
- #VLAN hosts
- host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
- host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host14=self.addHost( 'h14', ip='11.1.0.3/24' )
- host15=self.addHost( 'h15', ip='12.1.0.3/24' )
- #Multicast Receiver
- host16=self.addHost( 'h16', ip='10.1.0.7/24' )
+ host9 = self.addHost( 'h9', ip='10.1.0.5/24' )
+ host10 = self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
+ host11 = self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
+ # VLAN hosts
+ host12 = self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
+ host13 = self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
+ # VPN-1 and VPN-2 Hosts
+ host14 = self.addHost( 'h14', ip='11.1.0.3/24' )
+ host15 = self.addHost( 'h15', ip='12.1.0.3/24' )
+ # Multicast Receiver
+ host16 = self.addHost( 'h16', ip='10.1.0.7/24' )
# Switch S7 Hosts
- host17=self.addHost( 'h17', ip='10.1.0.8/24' )
- host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
- host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
- #VLAN hosts
- host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
- host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host22=self.addHost( 'h22', ip='11.1.0.4/24' )
- host23=self.addHost( 'h23', ip='12.1.0.4/24' )
- #Multicast Receiver
- host24=self.addHost( 'h24', ip='10.1.0.10/24' )
+ host17 = self.addHost( 'h17', ip='10.1.0.8/24' )
+ host18 = self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
+ host19 = self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
+ # VLAN hosts
+ host20 = self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
+ host21 = self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
+ # VPN-1 and VPN-2 Hosts
+ host22 = self.addHost( 'h22', ip='11.1.0.4/24' )
+ host23 = self.addHost( 'h23', ip='12.1.0.4/24' )
+ # Multicast Receiver
+ host24 = self.addHost( 'h24', ip='10.1.0.10/24' )
s1 = self.addSwitch( 's1' )
s2 = self.addSwitch( 's2' )
@@ -114,56 +120,57 @@
s6 = self.addSwitch( 's6' )
s7 = self.addSwitch( 's7' )
- self.addLink(s5,host1)
- self.addLink(s5,host2)
- self.addLink(s5,host3)
- self.addLink(s5,host4)
- self.addLink(s5,host5)
- self.addLink(s5,host6)
- self.addLink(s5,host7)
- self.addLink(s5,host8)
+ self.addLink( s5, host1 )
+ self.addLink( s5, host2 )
+ self.addLink( s5, host3 )
+ self.addLink( s5, host4 )
+ self.addLink( s5, host5 )
+ self.addLink( s5, host6 )
+ self.addLink( s5, host7 )
+ self.addLink( s5, host8 )
- self.addLink(s6,host9)
- self.addLink(s6,host10)
- self.addLink(s6,host11)
- self.addLink(s6,host12)
- self.addLink(s6,host13)
- self.addLink(s6,host14)
- self.addLink(s6,host15)
- self.addLink(s6,host16)
+ self.addLink( s6, host9 )
+ self.addLink( s6, host10 )
+ self.addLink( s6, host11 )
+ self.addLink( s6, host12 )
+ self.addLink( s6, host13 )
+ self.addLink( s6, host14 )
+ self.addLink( s6, host15 )
+ self.addLink( s6, host16 )
- self.addLink(s7,host17)
- self.addLink(s7,host18)
- self.addLink(s7,host19)
- self.addLink(s7,host20)
- self.addLink(s7,host21)
- self.addLink(s7,host22)
- self.addLink(s7,host23)
- self.addLink(s7,host24)
+ self.addLink( s7, host17 )
+ self.addLink( s7, host18 )
+ self.addLink( s7, host19 )
+ self.addLink( s7, host20 )
+ self.addLink( s7, host21 )
+ self.addLink( s7, host22 )
+ self.addLink( s7, host23 )
+ self.addLink( s7, host24 )
- self.addLink(s1,s2)
- self.addLink(s1,s3)
- self.addLink(s1,s4)
- self.addLink(s1,s5)
- self.addLink(s2,s3)
- self.addLink(s2,s5)
- self.addLink(s2,s6)
- self.addLink(s3,s4)
- self.addLink(s3,s6)
- self.addLink(s4,s7)
+ self.addLink( s1, s2 )
+ self.addLink( s1, s3 )
+ self.addLink( s1, s4 )
+ self.addLink( s1, s5 )
+ self.addLink( s2, s3 )
+ self.addLink( s2, s5 )
+ self.addLink( s2, s6 )
+ self.addLink( s3, s4 )
+ self.addLink( s3, s6 )
+ self.addLink( s4, s7 )
topos = { 'mytopo': ( lambda: MyTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = MyTopo()
- network = Mininet(topo=topo, autoSetMacs=True, controller=None)
+ network = Mininet( topo=topo, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
index 2d0e86d..4488458 100644
--- a/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
+++ b/TestON/tests/FUNC/FUNCipv6Intent/FUNCipv6Intent.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# Testing the basic intent for ipv6 functionality of ONOS
@@ -103,9 +102,9 @@
main.step( "Checking that ONOS is ready" )
- ready = utilities.retry( main.Cluster.command,
+ ready = utilities.retry( main.Cluster.command,
False,
- kwargs={ "function":"summary", "contentCheck":True },
+ kwargs={ "function": "summary", "contentCheck": True },
sleep=30,
attempts=3 )
utilities.assert_equals( expect=True, actual=ready,
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
index b45704e..afe8829 100644
--- a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
+++ b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/FUNCIpv6IntentFunction.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -1884,7 +1884,7 @@
main.log.info( itemName + ": Checking intents state" )
# First check of intents
stateResult = main.Cluster.command( "checkIntentState",
- kwargs={ "intentsId":intentsId },
+ kwargs={ "intentsId": intentsId },
returnBool=True, specificDriver=2 )
expectedState = [ 'INSTALLED', 'INSTALLING' ]
@@ -1899,8 +1899,8 @@
# Second check of intents since some of the intents may be in
# INSTALLING state, they should be in INSTALLED at this time
stateResult = main.Cluster.command( "checkIntentState",
- kwargs={ "intentsId":intentsId },
- returnBool=True, specificDriver=2 )
+ kwargs={ "intentsId": intentsId },
+ returnBool=True, specificDriver=2 )
if stateResult:
main.log.info( itemName + ": Intents are installed correctly" )
intentResult = main.TRUE
diff --git a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/newFuncTopo.py b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/newFuncTopo.py
old mode 100755
new mode 100644
index 91b2fc5..03d2eae
--- a/TestON/tests/FUNC/FUNCipv6Intent/dependencies/newFuncTopo.py
+++ b/TestON/tests/FUNC/FUNCipv6Intent/dependencies/newFuncTopo.py
@@ -1,5 +1,6 @@
+# !/usr/bin/python
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +9,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,8 +20,6 @@
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-#!/usr/bin/python
-
"""
Custom topology for Mininet
"""
@@ -35,20 +34,24 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class VLANHost( Host ):
+
def config( self, vlan=100, v6Addr='3000::1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ifconfig %s inet 0' % intf )
self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params[ 'ip' ] ) )
self.cmd( 'ip -6 addr add %s dev %s.%d' % ( v6Addr, intf, vlan ) )
newName = '%s.%d' % ( intf, vlan )
intf.name = newName
self.nameToIntf[ newName ] = intf
return r
+
class IPv6Host( Host ):
+
def config( self, v6Addr='1000::1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
@@ -56,51 +59,54 @@
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class dualStackHost( Host ):
+
def config( self, v6Addr='2000:1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class MyTopo( Topo ):
def __init__( self ):
# Initialize topology
Topo.__init__( self )
# Switch S5 Hosts
- host1=self.addHost( 'h1', cls=IPv6Host, v6Addr='10:1:0::1/64' )
- host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
+ host1 = self.addHost( 'h1', cls=IPv6Host, v6Addr='10:1:0::1/64' )
+ host2 = self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
# Dual Stack Host
- host3=self.addHost( 'h3', cls=dualStackHost, v6Addr='2000::2/64' )
- host4=self.addHost( 'h4', cls=IPv6Host, v6Addr='3000::2/64' )
- #VLAN
- host5=self.addHost( 'h5', cls=VLANHost,v6Addr='4000::2/64' )
- host6=self.addHost( 'h6', cls=IPv6Host, v6Addr='11:1:0::2/64' )
- host7=self.addHost( 'h7', cls=IPv6Host, v6Addr='12:1:0::2/64' )
- host8=self.addHost( 'h8', cls=IPv6Host, v6Addr='10:1:0::4/64' )
+ host3 = self.addHost( 'h3', cls=dualStackHost, v6Addr='2000::2/64' )
+ host4 = self.addHost( 'h4', cls=IPv6Host, v6Addr='3000::2/64' )
+ # VLAN
+ host5 = self.addHost( 'h5', cls=VLANHost, v6Addr='4000::2/64' )
+ host6 = self.addHost( 'h6', cls=IPv6Host, v6Addr='11:1:0::2/64' )
+ host7 = self.addHost( 'h7', cls=IPv6Host, v6Addr='12:1:0::2/64' )
+ host8 = self.addHost( 'h8', cls=IPv6Host, v6Addr='10:1:0::4/64' )
# Switch S6 Hosts
- host9=self.addHost( 'h9', cls=IPv6Host, v6Addr='10:1:0::5/64' )
- host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
+ host9 = self.addHost( 'h9', cls=IPv6Host, v6Addr='10:1:0::5/64' )
+ host10 = self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
# Dual Stack Host
- host11=self.addHost( 'h11', cls=dualStackHost, v6Addr='2000::3/64' )
- host12=self.addHost( 'h12', cls=IPv6Host, v6Addr='3000::3/64' )
- host13=self.addHost( 'h13', cls=IPv6Host, v6Addr='4000::3/64' )
- host14=self.addHost( 'h14', cls=IPv6Host, v6Addr='11:1:0::3/64' )
- host15=self.addHost( 'h15', cls=IPv6Host, v6Addr='12:1:0::3/64' )
- host16=self.addHost( 'h16', cls=IPv6Host, v6Addr='10:1:0::7/64' )
+ host11 = self.addHost( 'h11', cls=dualStackHost, v6Addr='2000::3/64' )
+ host12 = self.addHost( 'h12', cls=IPv6Host, v6Addr='3000::3/64' )
+ host13 = self.addHost( 'h13', cls=IPv6Host, v6Addr='4000::3/64' )
+ host14 = self.addHost( 'h14', cls=IPv6Host, v6Addr='11:1:0::3/64' )
+ host15 = self.addHost( 'h15', cls=IPv6Host, v6Addr='12:1:0::3/64' )
+ host16 = self.addHost( 'h16', cls=IPv6Host, v6Addr='10:1:0::7/64' )
# Switch S7 Hosts
- host17=self.addHost( 'h17', cls=IPv6Host, v6Addr='10:1:0::8/64' )
- host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
- host19=self.addHost( 'h19', cls=IPv6Host, v6Addr='10:1:0::9/64' )
- host20=self.addHost( 'h20', cls=IPv6Host, v6Addr='100:1:0::4/64' )
- host21=self.addHost( 'h21', cls=IPv6Host, v6Addr='200:1:0::4/64' )
- host22=self.addHost( 'h22', cls=IPv6Host, v6Addr='11:1:0::4/64' )
- host23=self.addHost( 'h23', cls=IPv6Host, v6Addr='12:1:0::4/64' )
- # VLAN
- host24=self.addHost( 'h24', cls=VLANHost, v6Addr='4000::5/64' )
+ host17 = self.addHost( 'h17', cls=IPv6Host, v6Addr='10:1:0::8/64' )
+ host18 = self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
+ host19 = self.addHost( 'h19', cls=IPv6Host, v6Addr='10:1:0::9/64' )
+ host20 = self.addHost( 'h20', cls=IPv6Host, v6Addr='100:1:0::4/64' )
+ host21 = self.addHost( 'h21', cls=IPv6Host, v6Addr='200:1:0::4/64' )
+ host22 = self.addHost( 'h22', cls=IPv6Host, v6Addr='11:1:0::4/64' )
+ host23 = self.addHost( 'h23', cls=IPv6Host, v6Addr='12:1:0::4/64' )
+ # VLAN
+ host24 = self.addHost( 'h24', cls=VLANHost, v6Addr='4000::5/64' )
s1 = self.addSwitch( 's1' )
s2 = self.addSwitch( 's2' )
@@ -110,56 +116,57 @@
s6 = self.addSwitch( 's6' )
s7 = self.addSwitch( 's7' )
- self.addLink(s5,host1)
- self.addLink(s5,host2)
- self.addLink(s5,host3)
- self.addLink(s5,host4)
- self.addLink(s5,host5)
- self.addLink(s5,host6)
- self.addLink(s5,host7)
- self.addLink(s5,host8)
+ self.addLink( s5, host1 )
+ self.addLink( s5, host2 )
+ self.addLink( s5, host3 )
+ self.addLink( s5, host4 )
+ self.addLink( s5, host5 )
+ self.addLink( s5, host6 )
+ self.addLink( s5, host7 )
+ self.addLink( s5, host8 )
- self.addLink(s6,host9)
- self.addLink(s6,host10)
- self.addLink(s6,host11)
- self.addLink(s6,host12)
- self.addLink(s6,host13)
- self.addLink(s6,host14)
- self.addLink(s6,host15)
- self.addLink(s6,host16)
+ self.addLink( s6, host9 )
+ self.addLink( s6, host10 )
+ self.addLink( s6, host11 )
+ self.addLink( s6, host12 )
+ self.addLink( s6, host13 )
+ self.addLink( s6, host14 )
+ self.addLink( s6, host15 )
+ self.addLink( s6, host16 )
- self.addLink(s7,host17)
- self.addLink(s7,host18)
- self.addLink(s7,host19)
- self.addLink(s7,host20)
- self.addLink(s7,host21)
- self.addLink(s7,host22)
- self.addLink(s7,host23)
- self.addLink(s7,host24)
+ self.addLink( s7, host17 )
+ self.addLink( s7, host18 )
+ self.addLink( s7, host19 )
+ self.addLink( s7, host20 )
+ self.addLink( s7, host21 )
+ self.addLink( s7, host22 )
+ self.addLink( s7, host23 )
+ self.addLink( s7, host24 )
- self.addLink(s1,s2)
- self.addLink(s1,s3)
- self.addLink(s1,s4)
- self.addLink(s1,s5)
- self.addLink(s2,s3)
- self.addLink(s2,s5)
- self.addLink(s2,s6)
- self.addLink(s3,s4)
- self.addLink(s3,s6)
- self.addLink(s4,s7)
+ self.addLink( s1, s2 )
+ self.addLink( s1, s3 )
+ self.addLink( s1, s4 )
+ self.addLink( s1, s5 )
+ self.addLink( s2, s3 )
+ self.addLink( s2, s5 )
+ self.addLink( s2, s6 )
+ self.addLink( s3, s4 )
+ self.addLink( s3, s6 )
+ self.addLink( s4, s7 )
topos = { 'mytopo': ( lambda: MyTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = MyTopo()
- network = Mininet(topo=topo, autoSetMacs=True, controller=None)
+ network = Mininet( topo=topo, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
index ef5eb99..cb80126 100644
--- a/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
+++ b/TestON/tests/FUNC/FUNCnetCfg/FUNCnetCfg.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# Testing the basic intent functionality of ONOS
@@ -36,7 +35,6 @@
- Checkout ONOS master branch
- Pull latest ONOS code
"""
-
try:
from tests.dependencies.ONOSSetup import ONOSSetup
main.testSetUp = ONOSSetup()
@@ -222,7 +220,6 @@
" not discovered yet. One device is allowed" +\
", the other disallowed."
-
pprint = main.Cluster.active( 0 ).REST.pprint
main.step( "Add Net Cfg for switch1" )
@@ -241,14 +238,14 @@
subjectKey="of:0000000000000001",
configKey="basic" )
s1Result = False
- #Wait 5 secs after set up netCfg
+ # Wait 5 secs after set up netCfg
time.sleep( main.SetNetCfgSleep )
if setS1Allow:
getS1 = utilities.retry( f=main.Cluster.active( 0 ).REST.getNetCfg,
retValue=False,
- kwargs={"subjectClass":"devices",
- "subjectKey" : "of:0000000000000001",
- "configKey" : "basic"},
+ kwargs={ "subjectClass": "devices",
+ "subjectKey": "of:0000000000000001",
+ "configKey": "basic" },
attempts=main.retrytimes,
sleep=main.retrysleep )
onosCfg = pprint( getS1 )
@@ -290,9 +287,9 @@
# Check what we set is what is in ONOS
getS3 = utilities.retry( f=main.Cluster.active( 0 ).REST.getNetCfg,
retValue=False,
- kwargs={"subjectClass": "devices",
- "subjectKey": "of:0000000000000003",
- "configKey": "basic"},
+ kwargs={ "subjectClass": "devices",
+ "subjectKey": "of:0000000000000003",
+ "configKey": "basic" },
attempts=main.retrytimes,
sleep=main.retrysleep )
onosCfg = pprint( getS3 )
@@ -400,9 +397,9 @@
# Check what we set is what is in ONOS
getS2 = utilities.retry( f=main.Cluster.active( 1 ).REST.getNetCfg,
retValue=False,
- kwargs={"subjectClass": "devices",
- "subjectKey": "of:0000000000000002",
- "configKey": "basic"},
+ kwargs={ "subjectClass": "devices",
+ "subjectKey": "of:0000000000000002",
+ "configKey": "basic" },
attempts=main.retrytimes,
sleep=main.retrysleep )
onosCfg = pprint( getS2 )
@@ -432,17 +429,17 @@
main.log.info( "s4Json:" + str( s4Json ) )
main.s4Json = s4Json
setS4Disallow = main.Cluster.active( 2 ).REST.setNetCfg( s4Json,
- subjectClass="devices",
- subjectKey="of:0000000000000004",
- configKey="basic" )
+ subjectClass="devices",
+ subjectKey="of:0000000000000004",
+ configKey="basic" )
s4Result = False
if setS4Disallow:
# Check what we set is what is in ONOS
getS4 = utilities.retry( f=main.Cluster.active( 2 ).REST.getNetCfg,
retValue=False,
- kwargs={"subjectClass": "devices",
- "subjectKey": "of:0000000000000004",
- "configKey": "basic"},
+ kwargs={ "subjectClass": "devices",
+ "subjectKey": "of:0000000000000004",
+ "configKey": "basic" },
attempts=main.retrytimes,
sleep=main.retrysleep )
@@ -511,8 +508,6 @@
onpass="Configured devices' annotations are correct",
onfail="Incorrect annotations for configured devices." )
-
-
def CASE24( self, main ):
"""
Testing removal of configurations
@@ -616,8 +611,8 @@
main.step( "Assert the net config for devices is empty" )
get = utilities.retry( f=main.Cluster.active( 2 ).REST.getNetCfg,
- retValue = False,
- kwargs={"subjectClass":"devices"},
+ retValue=False,
+ kwargs={ "subjectClass": "devices" },
sleep=main.retrysleep,
attempts=main.retrytimes )
@@ -746,9 +741,9 @@
if setS6Disallow:
getS6 = utilities.retry( f=main.Cluster.active( 0 ).REST.getNetCfg,
retValue=False,
- kwargs={"subjectClass":"devices",
- "subjectKey" : "of:0000000000000006",
- "configKey" : "basic"},
+ kwargs={ "subjectClass": "devices",
+ "subjectKey": "of:0000000000000006",
+ "configKey": "basic" },
sleep=main.retrysleep,
attempts=main.retrytimes )
onosCfg = pprint( getS6 )
diff --git a/TestON/tests/FUNC/FUNCnetCfg/dependencies/netCfg.py b/TestON/tests/FUNC/FUNCnetCfg/dependencies/netCfg.py
index 0cc46e8..9523e81 100644
--- a/TestON/tests/FUNC/FUNCnetCfg/dependencies/netCfg.py
+++ b/TestON/tests/FUNC/FUNCnetCfg/dependencies/netCfg.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -35,19 +35,19 @@
responses = []
result = utilities.retry( f=checkNodeResponses,
retValue=False,
- kwargs={'main' : main,'responses' : responses},
- sleep = main.retrysleep,
- attempts = main.retrytimes )
+ kwargs={ 'main': main, 'responses': responses },
+ sleep=main.retrysleep,
+ attempts=main.retrytimes )
utilities.assert_equals( expect=True,
actual=result,
onpass="Net Cfg is the same on all nodes",
onfail="Check Net Cfg failed. Check above messages." )
-def checkNodeResponses ( main, responses ):
+def checkNodeResponses( main, responses ):
numberOfFailedNodes = 0 # Tracks the number of nodes that failed to get net configuration
for ctrl in main.Cluster.active():
- response = ctrl.REST.getNetCfg( )
+ response = ctrl.REST.getNetCfg()
responses.append( ctrl.REST.pprint( response ) )
if response == main.FALSE:
numberOfFailedNodes += 1
@@ -65,24 +65,25 @@
main.log.debug( i )
return False
+
def checkDeviceAnnotations( main, jsonObj, sw ):
id = str( sw.get( 'id' ) )
keys = [ 'name', 'owner', 'rackAddress' ]
correct = True
for k in keys:
- if str( sw.get( 'annotations', {} ).get( k ) ) != str( jsonObj[ k ] ) :
+ if str( sw.get( 'annotations', {} ).get( k ) ) != str( jsonObj[ k ] ):
correct = False
main.log.debug( "{} is wrong on switch: ".format( k ) + id )
if not correct:
- main.log.error( "Annotations for switch " + id + " are incorrect: {}".format( sw ) )
+ main.log.error( "Annotations for switch " + id + " are incorrect: {}".format( sw ) )
return correct
def checkAllDeviceAnnotations( main, json ):
- devices = main.Cluster.active( 0 ).REST.devices( )
+ devices = main.Cluster.active( 0 ).REST.devices()
id = "of:0000000000000001"
i = 1
- result = [ ]
+ result = []
try:
for sw in json.loads( devices ):
if id in sw.get( 'id' ):
diff --git a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
index d518c5a..ad2c4ba 100644
--- a/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
+++ b/TestON/tests/FUNC/FUNCnetconf/FUNCnetconf.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# Testing the NETCONF protocol within ONOS
@@ -94,7 +93,6 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
-
def CASE2( self, main ):
"""
- Set up cell
@@ -123,6 +121,7 @@
except ( NameError, AttributeError ):
main.Utils = Utils()
main.Utils.copyKarafLog( "cycle" + str( main.cycle ) )
+
def CASE100( self, main ):
"""
Start NETCONF app and OFC-Server or make sure that they are already running
diff --git a/TestON/tests/FUNC/FUNCnetconf/dependencies/netconf.py b/TestON/tests/FUNC/FUNCnetconf/dependencies/netconf.py
index ce8620a..b8e7054 100644
--- a/TestON/tests/FUNC/FUNCnetconf/dependencies/netconf.py
+++ b/TestON/tests/FUNC/FUNCnetconf/dependencies/netconf.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -66,6 +66,7 @@
main.log.error( self.name + ": " + self.handle.before )
main.cleanAndExit()
+
def createConfig( main ):
"""
This function writes a configuration file that can later be sent to the
diff --git a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
index 00d5cab..aa298ab 100644
--- a/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
+++ b/TestON/tests/FUNC/FUNCoptical/FUNCoptical.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# Testing the basic intent functionality of ONOS
@@ -90,16 +89,15 @@
"""
Start Mininet opticalTest Topology
"""
-
main.case( "Mininet with Linc-OE startup" )
main.step( "Push TopoDDriver.json to ONOS through onos-netcfg" )
topoResult = True
for ctrl in main.Cluster.active():
topoResult = topoResult and \
- main.ONOSbench.onosNetCfg(controllerIp=ctrl.ipAddress,
- path=main.dependencyPath,
- fileName="TopoDDriver.json")
- #Exit if topology did not load properly
+ main.ONOSbench.onosNetCfg( controllerIp=ctrl.ipAddress,
+ path=main.dependencyPath,
+ fileName="TopoDDriver.json" )
+ # Exit if topology did not load properly
if not topoResult:
main.cleanAndExit()
@@ -190,6 +188,7 @@
except ( NameError, AttributeError ):
main.Utils = Utils()
main.Utils.copyKarafLog( "cycle" + str( main.cycle ) )
+
def CASE21( self, main ):
"""
Run pingall to discover all hosts
@@ -219,7 +218,7 @@
arpingHostResults = main.TRUE
for host in hosts:
- if main.LincOE.arping( host, ethDevice=host+"-eth0" ):
+ if main.LincOE.arping( host, ethDevice=host + "-eth0" ):
main.log.info( "Successfully reached host {} with arping".format( host ) )
else:
main.log.error( "Could not reach host {} with arping".format( host ) )
@@ -371,7 +370,6 @@
onpass="ONOS correctly discovered the topology",
onfail="ONOS incorrectly discovered the topology" )
-
def CASE31( self, main ):
import time
"""
@@ -404,8 +402,8 @@
intentsId=main.pIntentsId )
time.sleep( 10 )
checkStateResult = utilities.retry( f=main.Cluster.active( 0 ).CLI.checkIntentState,
- retValue=main.FALSE, args=( main.pIntentsId, "INSTALLED" ),
- sleep=main.checkIntentSleep, attempts=10 )
+ retValue=main.FALSE, args=( main.pIntentsId, "INSTALLED" ),
+ sleep=main.checkIntentSleep, attempts=10 )
main.log.info( "Checking flows state" )
checkFlowResult = main.Cluster.active( 0 ).CLI.checkFlowsState()
# Sleep for 10 seconds to provide time for the intent state to change
@@ -453,11 +451,11 @@
time.sleep( 15 )
for ctrl in main.Cluster.active():
- if not any ( intent.get('state') == 'WITHDRAWING' for intent
- in json.loads( ctrl.CLI.intents() ) ):
- main.log.debug( json.loads( ctrl.CLI.intents() ) )
- removeResult = main.FALSE
- break
+ if not any( intent.get( 'state' ) == 'WITHDRAWING' for intent
+ in json.loads( ctrl.CLI.intents() ) ):
+ main.log.debug( json.loads( ctrl.CLI.intents() ) )
+ removeResult = main.FALSE
+ break
else:
removeResult = main.TRUE
except ( TypeError, ValueError ):
@@ -547,11 +545,11 @@
time.sleep( 15 )
for ctrl in main.Cluster.active():
- if not any ( intent.get('state') == 'WITHDRAWING' for intent
- in json.loads( ctrl.CLI.intents() ) ):
- main.log.debug( json.loads( ctrl.CLI.intents() ) )
- removeResult = main.FALSE
- break
+ if not any( intent.get( 'state' ) == 'WITHDRAWING' for intent
+ in json.loads( ctrl.CLI.intents() ) ):
+ main.log.debug( json.loads( ctrl.CLI.intents() ) )
+ removeResult = main.FALSE
+ break
else:
removeResult = main.TRUE
except ( TypeError, ValueError ):
diff --git a/TestON/tests/FUNC/FUNCoptical/dependencies/ectopo.py b/TestON/tests/FUNC/FUNCoptical/dependencies/ectopo.py
index 576eb51..9413c98 100644
--- a/TestON/tests/FUNC/FUNCoptical/dependencies/ectopo.py
+++ b/TestON/tests/FUNC/FUNCoptical/dependencies/ectopo.py
@@ -1,5 +1,6 @@
+# !/usr/bin/env python
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +9,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,8 +20,6 @@
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-#!/usr/bin/env python
-
from mininet.net import Mininet
from mininet.topo import Topo
from mininet.node import Host, RemoteController
@@ -29,9 +28,11 @@
from opticalUtils import LINCSwitch, LINCLink
+
class OpticalTopo( Topo ):
+
"""
- A simple optical topology of three LINC nodes(OE*), two OVS switches(ps*), and two hosts:
+ A simple optical topology of three LINC nodes( OE* ), two OVS switches( ps* ), and two hosts:
OE3
/\
@@ -51,19 +52,19 @@
# set up ROADMs, add them to oel[]
oel = []
an = { "durable": "true" }
- for i in range (1,4):
+ for i in range( 1, 4 ):
oean = { "optical.regens": 0 }
- oel.append( self.addSwitch('OE%s' % i, dpid='0000ffffffffff0%s' % i, annotations=oean, cls=LINCSwitch) )
+ oel.append( self.addSwitch( 'OE%s' % i, dpid='0000ffffffffff0%s' % i, annotations=oean, cls=LINCSwitch ) )
# ROADM port numbers are built as: OE1 <-> OE2 = 1200
# leaving port number up to 100 open for use by Och port
- self.addLink( oel[0], oel[1], port1=1200, port2=2100, annotations=an, cls=LINCLink )
- self.addLink( oel[1], oel[2], port1=2300, port2=3200, annotations=an, cls=LINCLink )
- self.addLink( oel[2], oel[0], port1=3100, port2=1300, annotations=an, cls=LINCLink )
+ self.addLink( oel[ 0 ], oel[ 1 ], port1=1200, port2=2100, annotations=an, cls=LINCLink )
+ self.addLink( oel[ 1 ], oel[ 2 ], port1=2300, port2=3200, annotations=an, cls=LINCLink )
+ self.addLink( oel[ 2 ], oel[ 0 ], port1=3100, port2=1300, annotations=an, cls=LINCLink )
# cross-connects between OVSes and LINCs
- self.addLink( s1, oel[0], port1=2, port2=1, annotations=an, cls=LINCLink )
- self.addLink( s2, oel[1], port1=2, port2=1, annotations=an, cls=LINCLink )
+ self.addLink( s1, oel[ 0 ], port1=2, port2=1, annotations=an, cls=LINCLink )
+ self.addLink( s2, oel[ 1 ], port1=2, port2=1, annotations=an, cls=LINCLink )
def setup( ctls ):
@@ -71,7 +72,7 @@
i = 1
for ctl in ctls:
net.addController( RemoteController( 'c%d' % i, ip=ctl ) )
- i+=1
+ i += 1
net.start()
LINCSwitch.bootOE( net )
@@ -80,11 +81,11 @@
LINCSwitch.shutdownOE()
-if __name__ == "__main__" :
+if __name__ == "__main__":
import sys
- if len( sys.argv ) >= 2 :
+ if len( sys.argv ) >= 2:
setLogLevel( 'info' )
ctls = sys.argv[ 1: ]
setup( ctls )
else:
- print('./ectopo.py [IP1] [IP2]...\n')
+ print( './ectopo.py [IP1] [IP2]...\n' )
diff --git a/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py b/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
index ad55a9a..6b6ad93 100644
--- a/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
+++ b/TestON/tests/FUNC/FUNCovsdbtest/FUNCovsdbtest.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Description: This test is to check onos set configuration and flows with ovsdb connection.
@@ -79,7 +78,6 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
-
cliResults = main.testSetUp.ONOSSetUp( main.OVSDB1, main.Cluster,
cellName=cellName, removeLog=True )
@@ -469,7 +467,7 @@
main.step( "Post Network Data via HTTP(Post port need post network)" )
Poststatus, result = main.Cluster.active( 0 ).REST.send( ctrlip, httpport, '', path + 'networks/',
- 'POST', None, networkpostdata )
+ 'POST', None, networkpostdata )
utilities.assert_equals(
expect='200',
actual=Poststatus,
@@ -478,7 +476,7 @@
main.step( "Post Subnet Data via HTTP(Post port need post subnet)" )
Poststatus, result = main.Cluster.active( 0 ).REST.send( ctrlip, httpport, '', path + 'subnets/',
- 'POST', None, subnetpostdata )
+ 'POST', None, subnetpostdata )
utilities.assert_equals(
expect='202',
actual=Poststatus,
@@ -487,7 +485,7 @@
main.step( "Post Port1 Data via HTTP" )
Poststatus, result = main.Cluster.active( 0 ).REST.send( ctrlip, httpport, '', path + 'ports/',
- 'POST', None, port1postdata )
+ 'POST', None, port1postdata )
utilities.assert_equals(
expect='200',
actual=Poststatus,
@@ -496,7 +494,7 @@
main.step( "Post Port2 Data via HTTP" )
Poststatus, result = main.Cluster.active( 0 ).REST.send( ctrlip, httpport, '', path + 'ports/',
- 'POST', None, port2postdata )
+ 'POST', None, port2postdata )
utilities.assert_equals(
expect='200',
actual=Poststatus,
diff --git a/TestON/tests/FUNC/FUNCovsdbtest/dependencies/Nbdata.py b/TestON/tests/FUNC/FUNCovsdbtest/dependencies/Nbdata.py
index d93756f..b00b183 100644
--- a/TestON/tests/FUNC/FUNCovsdbtest/dependencies/Nbdata.py
+++ b/TestON/tests/FUNC/FUNCovsdbtest/dependencies/Nbdata.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
This file provide the data
lanqinglong@huawei.com
diff --git a/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py b/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py
index 5d471ad..73e7f4a 100644
--- a/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py
+++ b/TestON/tests/FUNC/FUNCvirNetNB/FUNCvirNetNB.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -17,9 +17,7 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
-"""
-"""
Description: This test is to determine if North bound
can handle the request
@@ -78,8 +76,8 @@
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
- main.apps = main.params['ENV']['cellApps']
- cellName = main.params['ENV']['cellName']
+ main.apps = main.params[ 'ENV' ][ 'cellApps' ]
+ cellName = main.params[ 'ENV' ][ 'cellName' ]
main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
stepResult = main.testSetUp.envSetup()
except Exception as e:
@@ -126,8 +124,7 @@
main.log.info( "ONOS Network Post test Start" )
main.case( "Virtual Network NBI Test - Network" )
- main.caseExplanation = "Test Network Post NBI " +\
- "Verify Post Data same with Stored Data"
+ main.caseExplanation = "Test Network Post NBI Verify Post Data same with Stored Data"
ctrlip = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
port = main.params[ 'HTTP' ][ 'port' ]
@@ -198,8 +195,7 @@
main.log.info( "ONOS Network Update test Start" )
main.case( "Virtual Network NBI Test - Network" )
- main.caseExplanation = "Test Network Update NBI " +\
- "Verify Update Data same with Stored Data"
+ main.caseExplanation = "Test Network Update NBI Verify Update Data same with Stored Data"
ctrlip = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
port = main.params[ 'HTTP' ][ 'port' ]
@@ -449,10 +445,10 @@
networkpostdata = network.DictoJson()
subnetpostdata = subnet.DictoJson()
- #Change allocation_poolsdata scope
+ # Change allocation_poolsdata scope
subnet.start = "192.168.102.1"
subnet.end = "192.168.102.255"
- #end change
+ # end change
newsubnetpostdata = subnet.DictoJson()
ctrl = main.Cluster.active( 0 )
main.step( "Post Network Data via HTTP(Post Subnet need post network)" )
@@ -740,10 +736,10 @@
subnetpostdata = subnet.DictoJson()
portpostdata = port.DictoJson()
- #create update data
+ # create update data
port.name = "onos-new"
newportpostdata = port.DictoJson()
- #end
+ # end
ctrl = main.Cluster.active( 0 )
main.step( "Post Network Data via HTTP(Post port need post network)" )
Poststatus, result = ctrl.REST.send( ctrlip, httpport, '', path + 'networks/',
@@ -932,8 +928,7 @@
main.log.info( "ONOS Post Error Json Create Network test Start" )
main.case( "Virtual Network NBI Test - Network" )
- main.caseExplanation = "Test Network Post With Error json " +\
- "The wrong Json can't post network successfully"
+ main.caseExplanation = "Test Network Post With Error json The wrong Json can't post network successfully"
ctrlip = os.getenv( main.params[ 'CTRL' ][ 'ip1' ] )
port = main.params[ 'HTTP' ][ 'port' ]
@@ -943,11 +938,11 @@
network = NetworkData()
network.id = '030d6d3d-fa36-45bf-ae2b-4f4bc43a54dc'
network.tenant_id = '26cd996094344a0598b0a1af1d525cdc'
- #The network.admin_state_up should be True or False,when the admin_state_up is 'tttttttttt',the Json can't post.
+ # The network.admin_state_up should be True or False,when the admin_state_up is 'tttttttttt',the Json can't post.
network.admin_state_up = 'tttttttttt'
- #The network.routerExternal should be True or False,when the routerExternal is 'ffffffffffff',the Json can't post.
+ # The network.routerExternal should be True or False,when the routerExternal is 'ffffffffffff',the Json can't post.
network.routerExternal = 'ffffffffffff'
- #The network.shared should be True or False,when the shared is 'ffffffffffffff',the Json can't post.
+ # The network.shared should be True or False,when the shared is 'ffffffffffffff',the Json can't post.
network.shared = 'ffffffffffffff'
postdata = network.DictoJson()
@@ -990,9 +985,9 @@
network.tenant_id = '26cd996094344a0598b0a1af1d525cdc'
subnet = SubnetData()
subnet.id = "e44bd655-e22c-4aeb-b1e9-ea1606875178"
- #The subnet.enable_dhcp should be True or False,when the enable_dhcp is 'tttttttttttttt',the Json can't post.
+ # The subnet.enable_dhcp should be True or False,when the enable_dhcp is 'tttttttttttttt',the Json can't post.
subnet.enable_dhcp = 'tttttttttttttt'
- #The subnet.tenant_id should be True or False,when the tenant_id is ffffffffffffff',the Json can't post.
+ # The subnet.tenant_id should be True or False,when the tenant_id is ffffffffffffff',the Json can't post.
subnet.shared = 'ffffffffffffff'
subnet.tenant_id = network.tenant_id
subnet.network_id = network.id
@@ -1055,7 +1050,7 @@
port.subnet_id = subnet.id
port.tenant_id = network.tenant_id
port.network_id = network.id
- #The port.adminStateUp should be True or False,when the adminStateUp is 'tttttttttttt',the Json can't post.
+ # The port.adminStateUp should be True or False,when the adminStateUp is 'tttttttttttt',the Json can't post.
port.adminStateUp = 'tttttttttttt'
networkpostdata = network.DictoJson()
diff --git a/TestON/tests/FUNC/FUNCvirNetNB/dependencies/Nbdata.py b/TestON/tests/FUNC/FUNCvirNetNB/dependencies/Nbdata.py
index 067991a..55a661b 100644
--- a/TestON/tests/FUNC/FUNCvirNetNB/dependencies/Nbdata.py
+++ b/TestON/tests/FUNC/FUNCvirNetNB/dependencies/Nbdata.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/xoMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
This file provide the data
lanqinglong@huawei.com
diff --git a/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py b/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py
index 08e437b..2712c3f 100644
--- a/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py
+++ b/TestON/tests/HA/HAclusterRestart/HAclusterRestart.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,9 +18,7 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
-
Description: This test is to determine if ONOS can handle
all of it's nodes restarting
@@ -110,11 +108,12 @@
Assign mastership to controllers
"""
main.HA.assignMastership( main )
+
def CASE3( self, main ):
"""
Assign intents
"""
- main.HA.assignIntents(main)
+ main.HA.assignIntents( main )
def CASE4( self, main ):
"""
@@ -167,7 +166,7 @@
ready = utilities.retry( main.Cluster.command,
False,
- kwargs={ "function":"summary", "contentCheck":True },
+ kwargs={ "function": "summary", "contentCheck": True },
sleep=30,
attempts=10 )
utilities.assert_equals( expect=True, actual=ready,
diff --git a/TestON/tests/HA/HAcontinuousStopNodes/HAcontinuousStopNodes.py b/TestON/tests/HA/HAcontinuousStopNodes/HAcontinuousStopNodes.py
index 026be2d..811e04f 100644
--- a/TestON/tests/HA/HAcontinuousStopNodes/HAcontinuousStopNodes.py
+++ b/TestON/tests/HA/HAcontinuousStopNodes/HAcontinuousStopNodes.py
@@ -1,5 +1,5 @@
"""
-Copyright 2017 Open Networking Foundation (ONF)
+Copyright 2017 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Description: This test is to determine if ONOS can handle
a minority of it's nodes restarting
@@ -103,7 +102,6 @@
extraClean=main.HA.cleanUpGenPartition )
main.HA.initialSetUp()
-
def CASE2( self, main ):
"""
Assign devices to controllers
@@ -255,8 +253,6 @@
"""
main.HA.compareTopo( main )
-
-
def CASE9( self, main ):
"""
Link s3-s28 down
diff --git a/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py b/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
index c3a2038..cf7fe73 100644
--- a/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
+++ b/TestON/tests/HA/HAfullNetPartition/HAfullNetPartition.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Description: This test is to determine if ONOS can handle
a full network partion
@@ -102,7 +101,6 @@
extraClean=main.HA.cleanUpGenPartition )
main.HA.initialSetUp()
-
def CASE2( self, main ):
"""
Assign devices to controllers
@@ -165,9 +163,9 @@
this = iCtrl.Bench.sshToNode( iCtrl.ipAddress )
if i not in main.partition:
for j in main.partition:
- foe = main.Cluster.runningNodes[ j ]
+ foe = main.Cluster.runningNodes[ j ]
main.log.warn( "Setting IP Tables rule from {} to {}. ".format( iCtrl.ipAddress, foe.ipAddress ) )
- #CMD HERE
+ # CMD HERE
try:
cmdStr = "sudo iptables -A {} -d {} -s {} -j DROP".format( "INPUT", iCtrl.ipAddress, foe.ipAddress )
this.sendline( cmdStr )
@@ -185,7 +183,7 @@
if j not in main.partition:
foe = main.Cluster.runningNodes[ j ]
main.log.warn( "Setting IP Tables rule from {} to {}. ".format( iCtrl.ipAddress, foe.ipAddress ) )
- #CMD HERE
+ # CMD HERE
cmdStr = "sudo iptables -A {} -d {} -s {} -j DROP".format( "INPUT", iCtrl.ipAddress, foe.ipAddress )
try:
this.sendline( cmdStr )
@@ -235,7 +233,7 @@
for node in main.partition:
main.Cluster.runningNodes[ node ].active = True
- '''
+ """
# NOTE : Not sure if this can be removed
main.activeNodes.sort()
try:
@@ -244,8 +242,7 @@
except AssertionError:
main.log.exception( "" )
main.cleanAndExit()
- '''
-
+ """
main.step( "Checking ONOS nodes" )
nodeResults = utilities.retry( main.HA.nodesCheck,
False,
@@ -269,7 +266,6 @@
"""
Check state after ONOS failure
"""
-
main.HA.checkStateAfterEvent( main, afterWhich=0 )
main.step( "Leadership Election is still functional" )
diff --git a/TestON/tests/HA/HAkillNodes/HAkillNodes.py b/TestON/tests/HA/HAkillNodes/HAkillNodes.py
index 4a95206..01ebe38 100644
--- a/TestON/tests/HA/HAkillNodes/HAkillNodes.py
+++ b/TestON/tests/HA/HAkillNodes/HAkillNodes.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Description: This test is to determine if ONOS can handle
a minority of it's nodes restarting
@@ -95,7 +94,7 @@
main.HA.customizeOnosGenPartitions,
main.HA.copyBackupConfig,
main.ONOSbench.preventAutoRespawn ],
- extraClean= main.HA.cleanUpGenPartition )
+ extraClean=main.HA.cleanUpGenPartition )
main.HA.initialSetUp( serviceClean=True )
@@ -149,7 +148,7 @@
main.kill.append( main.Cluster.runningNodes[ p - 1 ] )
# NOTE: This only works for cluster sizes of 3,5, or 7.
- #NOTE: This is to fix an issue with wiki formating
+ # NOTE: This is to fix an issue with wiki formating
nodeNames = [ node.name for node in main.kill ]
main.step( "Killing nodes: " + str( nodeNames ) )
killResults = main.TRUE
diff --git a/TestON/tests/HA/HAsanity/HAsanity.py b/TestON/tests/HA/HAsanity/HAsanity.py
index 82eeac5..baff818 100644
--- a/TestON/tests/HA/HAsanity/HAsanity.py
+++ b/TestON/tests/HA/HAsanity/HAsanity.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Description: This test is to determine if the HA test setup is
working correctly. There are no failures so this test should
diff --git a/TestON/tests/HA/HAscaling/HAscaling.py b/TestON/tests/HA/HAscaling/HAscaling.py
index f986cc2..63aa1e5 100644
--- a/TestON/tests/HA/HAscaling/HAscaling.py
+++ b/TestON/tests/HA/HAscaling/HAscaling.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Description: This test is to determine if ONOS can handle
dynamic scaling of the cluster size.
@@ -246,7 +245,6 @@
"""
Check state after ONOS scaling
"""
-
main.HA.checkStateAfterEvent( main, afterWhich=1 )
main.step( "Leadership Election is still functional" )
diff --git a/TestON/tests/HA/HAscaling/dependencies/Server.py b/TestON/tests/HA/HAscaling/dependencies/Server.py
index 1a4b550..dbb1247 100644
--- a/TestON/tests/HA/HAscaling/dependencies/Server.py
+++ b/TestON/tests/HA/HAscaling/dependencies/Server.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,10 +18,10 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"Functions for using the SimpleHTTPServer python module"
import re
+
class Server():
def __init__( self ):
@@ -65,7 +65,7 @@
if logDir:
cmd += " &> {}".format( logDir ) # pipe all output to a file
else:
- cmd += "&> {dev/null}" # Throw away all output
+ cmd += "&> {dev/null}" # Throw away all output
cmd += " &"
handle.sendline( cmd )
handle.expect( "\$" )
@@ -79,7 +79,7 @@
main.log.debug( handle.before )
retValue = main.FALSE
# capture PID for later use
- # EX: [1] 67987
+ # EX: [ 1 ] 67987
match = re.search( "\[\d\] (?P<PID>\d+)", response )
if match:
self.PID = match.group( "PID" )
diff --git a/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py b/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py
index eeb4310..584232a 100644
--- a/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py
+++ b/TestON/tests/HA/HAsingleInstanceRestart/HAsingleInstanceRestart.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Description: This test is to determine if a single
instance ONOS 'cluster' can handle a restart
@@ -409,7 +408,7 @@
mastershipCheck = mastershipCheck and main.TRUE
else:
main.log.warn( "Mastership of switch %s changed; old: %s, new: %s" % ( switchDPID,
- old, current ) )
+ old, current ) )
mastershipCheck = main.FALSE
utilities.assert_equals(
expect=main.TRUE,
@@ -446,57 +445,6 @@
# 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
- try:
- intentState
- except NameError:
- main.log.warn( "No previous intent state was saved" )
- else:
- 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
diff --git a/TestON/tests/HA/HAstopNodes/HAstopNodes.py b/TestON/tests/HA/HAstopNodes/HAstopNodes.py
index e7bdcd4..7b57730 100644
--- a/TestON/tests/HA/HAstopNodes/HAstopNodes.py
+++ b/TestON/tests/HA/HAstopNodes/HAstopNodes.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Description: This test is to determine if ONOS can handle
a minority of it's nodes restarting
@@ -94,7 +93,7 @@
extraApply=[ main.HA.startingMininet,
main.HA.customizeOnosGenPartitions,
main.HA.copyBackupConfig ],
- extraClean= main.HA.cleanUpGenPartition )
+ extraClean=main.HA.cleanUpGenPartition )
main.HA.initialSetUp( serviceClean=True )
@@ -148,7 +147,7 @@
main.kill.append( main.Cluster.runningNodes[ p - 1 ] )
# NOTE: This only works for cluster sizes of 3,5, or 7.
- #NOTE: This is to fix an issue with wiki formating
+ # NOTE: This is to fix an issue with wiki formating
nodeNames = [ node.name for node in main.kill ]
main.step( "Stopping nodes: " + str( nodeNames ) )
killResults = main.TRUE
diff --git a/TestON/tests/HA/HAswapNodes/HAswapNodes.py b/TestON/tests/HA/HAswapNodes/HAswapNodes.py
index 1fa8106..e0751f6 100644
--- a/TestON/tests/HA/HAswapNodes/HAswapNodes.py
+++ b/TestON/tests/HA/HAswapNodes/HAswapNodes.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Description: This test is to determine if ONOS can handle
dynamic swapping of cluster nodes.
@@ -96,15 +95,14 @@
main.testSetUp.evnSetupConclusion( stepResult )
main.HA.generateGraph( "HAswapNodes" )
-
main.testSetUp.ONOSSetUp( main.Mininet1, main.Cluster, cellName=cellName, removeLog=True,
- extraApply=[ main.HA.setServerForCluster,
- main.HA.swapNodeMetadata,
- main.HA.startingMininet,
- main.HA.copyBackupConfig,
- main.HA.setMetadataUrl ],
- extraClean=main.HA.cleanUpOnosService,
- installMax=True )
+ extraApply=[ main.HA.setServerForCluster,
+ main.HA.swapNodeMetadata,
+ main.HA.startingMininet,
+ main.HA.copyBackupConfig,
+ main.HA.setMetadataUrl ],
+ extraClean=main.HA.cleanUpOnosService,
+ installMax=True )
main.HA.initialSetUp()
def CASE2( self, main ):
@@ -211,9 +209,9 @@
onpass="Nodes check successful",
onfail="Nodes check NOT successful" )
- ready = utilities.retry( main.Cluster.command,
+ ready = utilities.retry( main.Cluster.command,
False,
- kwargs={ "function":"summary", "contentCheck":True },
+ kwargs={ "function": "summary", "contentCheck": True },
sleep=30,
attempts=10 )
utilities.assert_equals( expect=True, actual=ready,
@@ -235,23 +233,10 @@
main.HA.commonChecks()
- """
- # Note: Do we really want this? It will revert the changes we have made from this test case.
-
- main.step( "Reapplying cell variable to environment" )
- cellName = main.params[ 'ENV' ][ 'cellName' ]
- cellResult = main.ONOSbench.setCell( cellName )
- utilities.assert_equals( expect=main.TRUE, actual=cellResult,
- onpass="Set cell successfull",
- onfail="Failled to set cell" )
- """
-
-
def CASE7( self, main ):
"""
Check state after ONOS scaling
"""
-
main.HA.checkStateAfterEvent( main, afterWhich=1 )
main.step( "Leadership Election is still functional" )
diff --git a/TestON/tests/HA/HAswapNodes/dependencies/Server.py b/TestON/tests/HA/HAswapNodes/dependencies/Server.py
index 1a4b550..dbb1247 100644
--- a/TestON/tests/HA/HAswapNodes/dependencies/Server.py
+++ b/TestON/tests/HA/HAswapNodes/dependencies/Server.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,10 +18,10 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"Functions for using the SimpleHTTPServer python module"
import re
+
class Server():
def __init__( self ):
@@ -65,7 +65,7 @@
if logDir:
cmd += " &> {}".format( logDir ) # pipe all output to a file
else:
- cmd += "&> {dev/null}" # Throw away all output
+ cmd += "&> {dev/null}" # Throw away all output
cmd += " &"
handle.sendline( cmd )
handle.expect( "\$" )
@@ -79,7 +79,7 @@
main.log.debug( handle.before )
retValue = main.FALSE
# capture PID for later use
- # EX: [1] 67987
+ # EX: [ 1 ] 67987
match = re.search( "\[\d\] (?P<PID>\d+)", response )
if match:
self.PID = match.group( "PID" )
diff --git a/TestON/tests/HA/dependencies/HA.py b/TestON/tests/HA/dependencies/HA.py
index 48b64c6..2227146 100644
--- a/TestON/tests/HA/dependencies/HA.py
+++ b/TestON/tests/HA/dependencies/HA.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
import json
import time
@@ -2795,7 +2794,7 @@
main.ONOSbench.createCellFile( main.ONOSbench.ip_address, cellName,
main.Mininet1.ip_address,
- cellAppString, ipList , main.ONOScli1.karafUser )
+ cellAppString, ipList, main.ONOScli1.karafUser )
main.step( "Applying cell variable to environment" )
cellResult = main.ONOSbench.setCell( cellName )
verifyResult = main.ONOSbench.verifyCell()
@@ -2814,7 +2813,7 @@
assert utilities.assert_equals, "utilities.assert_equals not defined"
main.case( "Running ONOS Constant State Tests" )
- OnosAfterWhich = [ "failure" , "scaliing" ]
+ OnosAfterWhich = [ "failure", "scaliing" ]
# Assert that each device has a master
self.checkRoleNotNull()
@@ -2981,7 +2980,7 @@
utilities.assert_equals(
expect=main.TRUE,
actual=sameIntents,
- onpass="Intents are consistent with before " + OnosAfterWhich[ afterWhich ] ,
+ onpass="Intents are consistent with before " + OnosAfterWhich[ afterWhich ],
onfail="The Intents changed during " + OnosAfterWhich[ afterWhich ] )
intentCheck = intentCheck and sameIntents
@@ -3032,7 +3031,6 @@
# we expect loss in dataplane connectivity
LossInPings = main.FALSE
"""
-
def compareTopo( self, main ):
"""
Compare topo
@@ -3086,7 +3084,7 @@
"Error with host ipAddresses on controller" +
controllerStr + ": " + str( host ) )
ipResult = main.FALSE
- ports = main.topoRelated.getAll( "ports" , True,
+ ports = main.topoRelated.getAll( "ports", True,
kwargs={ 'sleep': 5, 'attempts': 5,
'randomTime': True } )
links = main.topoRelated.getAll( "links", True,
diff --git a/TestON/tests/HA/dependencies/obelisk.py b/TestON/tests/HA/dependencies/obelisk.py
old mode 100755
new mode 100644
index 40cc242..c43941c
--- a/TestON/tests/HA/dependencies/obelisk.py
+++ b/TestON/tests/HA/dependencies/obelisk.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,63 +20,65 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
from mininet.topo import Topo
+
class ObeliskTopo( Topo ):
+
def __init__( self ):
Topo.__init__( self )
- topSwitch = self.addSwitch('s1',dpid='1000'.zfill(16))
- leftTopSwitch = self.addSwitch('s2',dpid='2000'.zfill(16))
- rightTopSwitch = self.addSwitch('s5',dpid='5000'.zfill(16))
- leftBotSwitch = self.addSwitch('s3',dpid='3000'.zfill(16))
- rightBotSwitch = self.addSwitch('s6',dpid='6000'.zfill(16))
- midBotSwitch = self.addSwitch('s28',dpid='2800'.zfill(16))
+ topSwitch = self.addSwitch( 's1', dpid='1000'.zfill( 16 ) )
+ leftTopSwitch = self.addSwitch( 's2', dpid='2000'.zfill( 16 ) )
+ rightTopSwitch = self.addSwitch( 's5', dpid='5000'.zfill( 16 ) )
+ leftBotSwitch = self.addSwitch( 's3', dpid='3000'.zfill( 16 ) )
+ rightBotSwitch = self.addSwitch( 's6', dpid='6000'.zfill( 16 ) )
+ midBotSwitch = self.addSwitch( 's28', dpid='2800'.zfill( 16 ) )
topHost = self.addHost( 'h1' )
- leftTopHost = self.addHost('h2')
- rightTopHost = self.addHost('h5')
- leftBotHost = self.addHost('h3')
- rightBotHost = self.addHost('h6')
- midBotHost = self.addHost('h28')
- self.addLink(topSwitch,topHost)
- self.addLink(leftTopSwitch,leftTopHost)
- self.addLink(rightTopSwitch,rightTopHost)
- self.addLink(leftBotSwitch,leftBotHost)
- self.addLink(rightBotSwitch,rightBotHost)
- self.addLink(midBotSwitch,midBotHost)
- self.addLink(leftTopSwitch,rightTopSwitch)
- self.addLink(topSwitch,leftTopSwitch)
- self.addLink(topSwitch,rightTopSwitch)
- self.addLink(leftTopSwitch,leftBotSwitch)
- self.addLink(rightTopSwitch,rightBotSwitch)
- self.addLink(leftBotSwitch,midBotSwitch)
- self.addLink(midBotSwitch,rightBotSwitch)
+ leftTopHost = self.addHost( 'h2' )
+ rightTopHost = self.addHost( 'h5' )
+ leftBotHost = self.addHost( 'h3' )
+ rightBotHost = self.addHost( 'h6' )
+ midBotHost = self.addHost( 'h28' )
+ self.addLink( topSwitch, topHost )
+ self.addLink( leftTopSwitch, leftTopHost )
+ self.addLink( rightTopSwitch, rightTopHost )
+ self.addLink( leftBotSwitch, leftBotHost )
+ self.addLink( rightBotSwitch, rightBotHost )
+ self.addLink( midBotSwitch, midBotHost )
+ self.addLink( leftTopSwitch, rightTopSwitch )
+ self.addLink( topSwitch, leftTopSwitch )
+ self.addLink( topSwitch, rightTopSwitch )
+ self.addLink( leftTopSwitch, leftBotSwitch )
+ self.addLink( rightTopSwitch, rightBotSwitch )
+ self.addLink( leftBotSwitch, midBotSwitch )
+ self.addLink( midBotSwitch, rightBotSwitch )
- agg1Switch = self.addSwitch('s4',dpid = '3004'.zfill(16))
- agg2Switch = self.addSwitch('s7',dpid = '6007'.zfill(16))
- agg1Host = self.addHost('h4')
- agg2Host = self.addHost('h7')
- self.addLink(agg1Switch,agg1Host)
- self.addLink(agg2Switch,agg2Host)
- self.addLink(agg1Switch, leftBotSwitch)
- self.addLink(agg2Switch, rightBotSwitch)
+ agg1Switch = self.addSwitch( 's4', dpid='3004'.zfill( 16 ) )
+ agg2Switch = self.addSwitch( 's7', dpid='6007'.zfill( 16 ) )
+ agg1Host = self.addHost( 'h4' )
+ agg2Host = self.addHost( 'h7' )
+ self.addLink( agg1Switch, agg1Host )
+ self.addLink( agg2Switch, agg2Host )
+ self.addLink( agg1Switch, leftBotSwitch )
+ self.addLink( agg2Switch, rightBotSwitch )
- for i in range(10):
- num = str(i+8)
- switch = self.addSwitch('s'+num,dpid = ('30'+num.zfill(2)).zfill(16))
- host = self.addHost('h'+num)
- self.addLink(switch, host)
- self.addLink(switch, agg1Switch)
+ for i in range( 10 ):
+ num = str( i + 8 )
+ switch = self.addSwitch( 's' + num, dpid=( '30' + num.zfill( 2 ) ).zfill( 16 ) )
+ host = self.addHost( 'h' + num )
+ self.addLink( switch, host )
+ self.addLink( switch, agg1Switch )
- for i in range(10):
- num = str(i+18)
- switch = self.addSwitch('s'+num,dpid = ('60'+num.zfill(2)).zfill(16))
- host = self.addHost('h'+num)
- self.addLink(switch, host)
- self.addLink(switch, agg2Switch)
+ for i in range( 10 ):
+ num = str( i + 18 )
+ switch = self.addSwitch( 's' + num, dpid=( '60' + num.zfill( 2 ) ).zfill( 16 ) )
+ host = self.addHost( 'h' + num )
+ self.addLink( switch, host )
+ self.addLink( switch, agg2Switch )
-topos = { 'obelisk': (lambda: ObeliskTopo() ) }
+topos = { 'obelisk': ( lambda: ObeliskTopo() ) }
+
def run():
topo = ObeliskTopo()
diff --git a/TestON/tests/MISC/SCPFbatchFlowResp/SCPFbatchFlowResp.py b/TestON/tests/MISC/SCPFbatchFlowResp/SCPFbatchFlowResp.py
index c27bd47..1ad81ad 100644
--- a/TestON/tests/MISC/SCPFbatchFlowResp/SCPFbatchFlowResp.py
+++ b/TestON/tests/MISC/SCPFbatchFlowResp/SCPFbatchFlowResp.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
class SCPFbatchFlowResp:
"""
@@ -75,7 +74,6 @@
main.testSetUp.evnSetupConclusion( stepResult )
main.commit = main.commit.split( " " )[ 1 ]
-
def CASE2( self, main ):
"""
- Set up cell
@@ -113,7 +111,7 @@
main.step( "Configure AdaptiveFlowSampling " )
stepResult = main.Cluster.active( 0 ).CLI.setCfg( component=main.params[ 'CASE10' ][ 'cfg' ],
- propName="adaptiveFlowSampling ", value=main.params[ 'CASE10' ][ 'adaptiveFlowenabled' ] )
+ propName="adaptiveFlowSampling ", value=main.params[ 'CASE10' ][ 'adaptiveFlowenabled' ] )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass="App Configuration Succeeded! ",
@@ -215,12 +213,12 @@
main.log.info( "Creating batch: " + str( index ) )
flowJsonBatch = main.Cluster.active( 0 ).REST.createFlowBatch( numSw=main.numSw,
- swIndex=ind,
- batchSize=main.batchSize,
- batchIndex=index,
- deviceIdpreFix=main.deviceIdPrefix,
- ingressPort=2,
- egressPort=3 )
+ swIndex=ind,
+ batchSize=main.batchSize,
+ batchIndex=index,
+ deviceIdpreFix=main.deviceIdPrefix,
+ ingressPort=2,
+ egressPort=3 )
main.flowJsonBatchList.append( flowJsonBatch )
startSw += 1
@@ -247,11 +245,11 @@
def postWorker( id ):
while True:
item = q.get()
- #print json.dumps( item )
+ # print json.dumps( item )
status, response = main.Cluster.active( 0 ).REST.sendFlowBatch( batch=item )
if status == main.TRUE:
main.log.info( "Thread {} is working on posting. ".format( id ) )
- #print json.dumps( response )
+ # print json.dumps( response )
main.addedBatchList.append( response[ 1 ] )
else:
main.log.error( "Thread {} failed to post.".format( id ) )
@@ -275,7 +273,7 @@
main.cleanAndExit()
main.step( "Check to ensure all flows are in added state." )
- #pprint( main.addedBatchList )
+ # pprint( main.addedBatchList )
resp = main.FALSE
while resp != main.TRUE and ( tAllAdded - tLastPostEnd < int( main.params[ 'CASE2100' ][ 'chkFlowTO' ] ) ):
if main.params[ 'CASE2100' ][ 'RESTchkFlow' ] == 'main.TRUE':
@@ -347,7 +345,7 @@
main.log.info( "Number of flow batches at end of remove: " + str( len( main.addedBatchList ) ) )
main.step( "Check to ensure all flows are in added state." )
- #pprint( main.addedBatchList )
+ # pprint( main.addedBatchList )
resp = main.FALSE
while resp != main.TRUE and ( tAllRemoved - tLastDeleteEnd < int( main.params[ 'CASE3100' ][ 'chkFlowTO' ] ) ):
if main.params[ 'CASE3100' ][ 'RESTchkFlow' ] == 'main.TRUE':
@@ -381,7 +379,7 @@
main.case( "Check to ensure onos flows." )
resp = main.Cluster.active( 0 ).REST.checkFlowsState()
- #pprint( resp )
+ # pprint( resp )
def CASE210( self, main ):
main.case( "Log test results to a data file" )
@@ -427,5 +425,4 @@
"ERROR",
"Except" ],
"s" )
- #main.stop()
-
+ # main.stop()
diff --git a/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py b/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py
old mode 100755
new mode 100644
index 9cbe929..dba226c
--- a/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py
+++ b/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,22 +18,22 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# This is a basic platform test suite.
# Additional platform test cases can be added on this test suite where appropriate.
+
class PLATdockertest:
+
"""
This testsuite performs the following tests:
- 1) checkout onos docker image;
- 2) test image start up in single and clustered mode;
- 3) test onos app activation and deactivation;
+ 1 ) checkout onos docker image;
+ 2 ) test image start up in single and clustered mode;
+ 3 ) test onos app activation and deactivation;
Prerequisites:
- 1) docker-engine installed on test station (localhost);
- 2) python docker client (docker-py) installed on test station
+ 1 ) docker-engine installed on test station ( localhost );
+ 2 ) python docker client ( docker-py ) installed on test station
"""
-
def __init__( self ):
self.default = ''
global DOCKERREPO, DOCKERTAG, INITDOCKERTAG
@@ -60,73 +60,74 @@
main.step( "Check for duplicate Tags for a given image" )
if not duplicateTagDetected:
stepResult = main.TRUE
- utilities.assert_equals( expect = main.TRUE, actual = stepResult,
- onpass = "no duplicate image tags",
- onfail = "duplicate image tags detected!!" )
+ utilities.assert_equals( expect=main.TRUE, actual=stepResult,
+ onpass="no duplicate image tags",
+ onfail="duplicate image tags detected!!" )
main.step( "Get a list of image tags" )
stepResult = main.FALSE
if imageTagList is not []:
- main.log.info( "The Image tag list is: " + str(imageTagList) )
+ main.log.info( "The Image tag list is: " + str( imageTagList ) )
stepResult = main.TRUE
- utilities.assert_equals( expect = main.TRUE, actual = stepResult,
- onpass = "image tag list pulled successfully",
- onfail = "image tag list not pulled" )
+ utilities.assert_equals( expect=main.TRUE, actual=stepResult,
+ onpass="image tag list pulled successfully",
+ onfail="image tag list not pulled" )
def CASE1( self, main ):
"""
- 1) set up test params;
+ 1 ) set up test params;
"""
import re
import time
import subprocess
if imageTagCounter < len( imageTagList ):
- DOCKERTAG = imageTagList[imageTagCounter]
+ DOCKERTAG = imageTagList[ imageTagCounter ]
if not imageTagCounter:
INITDOCKERTAG = DOCKERTAG
imageTagCounter += 1
- main.case("Set case test params for onos image {}".format( DOCKERTAG ))
- main.step("Initialize test params")
- NODElist = main.params["SCALE"]["nodelist"].split(',')
- main.log.info("onos container names are: " + ",".join(NODElist) )
+ main.case( "Set case test params for onos image {}".format( DOCKERTAG ) )
+ main.step( "Initialize test params" )
+ NODElist = main.params[ "SCALE" ][ "nodelist" ].split( ',' )
+ main.log.info( "onos container names are: " + ",".join( NODElist ) )
IPlist = list()
main.testOnDirectory = re.sub( "(/tests)$", "", main.testDir )
CTIDlist = list()
- main.log.info("Check docker status, it not running, try restart it")
+ main.log.info( "Check docker status, it not running, try restart it" )
iter = 0
stepResult = main.TRUE
- while subprocess.call("sudo service docker status", shell=True) and iter <= 3:
- subprocess.call("sudo service docker restart", shell=True)
- time.sleep(5)
+ while subprocess.call( "sudo service docker status", shell=True ) and iter <= 3:
+ subprocess.call( "sudo service docker restart", shell=True )
+ time.sleep( 5 )
iter += 1
- if iter == 3: stepResult = main.FALSE
+ if iter == 3:
+ stepResult = main.FALSE
- utilities.assert_equals( expect = main.TRUE, actual = stepResult,
- onpass = "docker is running",
- onfail = "docker is not running")
+ utilities.assert_equals( expect=main.TRUE, actual=stepResult,
+ onpass="docker is running",
+ onfail="docker is not running" )
if stepResult == main.FALSE:
- main.log.warn("docker is not running - exiting test")
+ main.log.warn( "docker is not running - exiting test" )
main.cleanAndExit()
if imageTagCounter > len( imageTagList ):
- main.log.info("All images have been tested")
+ main.log.info( "All images have been tested" )
main.cleanAndExit()
- def CASE5(self, main):
+ def CASE5( self, main ):
"""
Pull the specified image
"""
-
main.case( "Pull onos docker image {} from {} - \
it may take sometime if this is a first time pulling.".format( DOCKERTAG, DOCKERREPO ) )
stepResult = main.FALSE
main.step( "pull image {} from {}".format( DOCKERTAG, DOCKERREPO ) )
- stepResult = main.ONOSbenchDocker.dockerPull( onosRepo = DOCKERREPO, onosTag = DOCKERTAG )
- utilities.assert_equals( expect = main.TRUE, actual = stepResult,
- onpass = "Succeeded in pulling " + DOCKERREPO + ":" + DOCKERTAG,
- onfail = "Failed to pull " + DOCKERREPO + ":" + DOCKERTAG )
- if stepResult == main.FALSE: main.skipCase()
+ stepResult = main.ONOSbenchDocker.dockerPull( onosRepo=DOCKERREPO, onosTag=DOCKERTAG )
+ utilities.assert_equals( expect=main.TRUE, actual=stepResult,
+ onpass="Succeeded in pulling " + DOCKERREPO + ":" + DOCKERTAG,
+ onfail="Failed to pull " + DOCKERREPO + ":" + DOCKERTAG )
+ if stepResult == main.FALSE:
+ main.skipCase()
def CASE10( self, main ):
"""
@@ -135,46 +136,47 @@
import re
createResult = main.TRUE
startResult = main.TRUE
- main.case( "Start onos container(s) for onos image {}".format( DOCKERTAG ))
+ main.case( "Start onos container(s) for onos image {}".format( DOCKERTAG ) )
image = DOCKERREPO + ":" + DOCKERTAG
- main.step( "Create and (re)start docker container(s) for onos image {} if not already exist".format( DOCKERTAG ))
- #stepResult = main.FALSE
+ main.step( "Create and (re)start docker container(s) for onos image {} if not already exist".format( DOCKERTAG ) )
+ # stepResult = main.FALSE
- for ct in xrange(0, len(NODElist)):
- if not main.ONOSbenchDocker.dockerCheckCTName( ctName = NODElist[ct] ):
- main.log.info( "Create new container for onos" + str(ct + 1) )
- createResult, ctid = main.ONOSbenchDocker.dockerCreateCT( onosImage = image, onosNode = NODElist[ct])
- CTIDlist.append(ctid)
- startResult = main.ONOSbenchDocker.dockerStartCT( ctID = ctid )
+ for ct in xrange( 0, len( NODElist ) ):
+ if not main.ONOSbenchDocker.dockerCheckCTName( ctName=NODElist[ ct ] ):
+ main.log.info( "Create new container for onos" + str( ct + 1 ) )
+ createResult, ctid = main.ONOSbenchDocker.dockerCreateCT( onosImage=image, onosNode=NODElist[ ct ] )
+ CTIDlist.append( ctid )
+ startResult = main.ONOSbenchDocker.dockerStartCT( ctID=ctid )
else:
- main.log.info("Container exists for node onos" + str(ct + 1) + "; restart container with {} image".format( DOCKERTAG ) )
- startResult = main.ONOSbenchDocker.dockerRestartCT( ctName = NODElist[ct ] )
+ main.log.info( "Container exists for node onos" + str( ct + 1 ) + "; restart container with {} image".format( DOCKERTAG ) )
+ startResult = main.ONOSbenchDocker.dockerRestartCT( ctName=NODElist[ ct ] )
- utilities.assert_equals( expect = main.TRUE, actual = createResult and startResult,
- onpass = "Container successfully created",
- onfail = "Failed to create the container" )
+ utilities.assert_equals( expect=main.TRUE, actual=createResult and startResult,
+ onpass="Container successfully created",
+ onfail="Failed to create the container" )
main.step( "Get IP address on onos containers" )
stepResult = main.FALSE
- for ct in xrange(0,len(NODElist)):
- IPlist.append(main.ONOSbenchDocker.dockerIP( ctName = NODElist[ct] ))
- main.log.info("Container IPs are: " + ', '.join( IPlist ))
+ for ct in xrange( 0, len( NODElist ) ):
+ IPlist.append( main.ONOSbenchDocker.dockerIP( ctName=NODElist[ ct ] ) )
+ main.log.info( "Container IPs are: " + ', '.join( IPlist ) )
- if IPlist is not []:stepResult = main.TRUE
- utilities.assert_equals( expect = main.TRUE, actual = stepResult,
- onpass = "Container successfully started",
- onfail = "Failed to start the container" )
+ if IPlist is not []:
+ stepResult = main.TRUE
+ utilities.assert_equals( expect=main.TRUE, actual=stepResult,
+ onpass="Container successfully started",
+ onfail="Failed to start the container" )
- def CASE110(self,main):
+ def CASE110( self, main ):
"""
Steps:
- 1) check default startup standalone onos applications status;
- 2) form onos cluster with all nodes;
- 3) check onos applications status;
- 4) activate apps per params and check app status;
- 5) deactivate apps and check app status
+ 1 ) check default startup standalone onos applications status;
+ 2 ) form onos cluster with all nodes;
+ 3 ) check onos applications status;
+ 4 ) activate apps per params and check app status;
+ 5 ) deactivate apps and check app status
"""
import time
@@ -182,112 +184,118 @@
main.case( "Form onos cluster and check status of onos apps for onos image {}".format( DOCKERTAG ) )
- startupSleep = int(main.params["SLEEP"]["startup"])
+ startupSleep = int( main.params[ "SLEEP" ][ "startup" ] )
- appToAct = main.params["CASE110"]["apps"]
+ appToAct = main.params[ "CASE110" ][ "apps" ]
stepResult = main.FALSE
- main.log.info( "Wait for startup, sleep (sec): " + str(startupSleep))
- time.sleep(startupSleep)
+ main.log.info( "Wait for startup, sleep (sec): " + str( startupSleep ) )
+ time.sleep( startupSleep )
- main.step( "Check initial app states from onos1 for onos image {}".format( DOCKERTAG ))
+ main.step( "Check initial app states from onos1 for onos image {}".format( DOCKERTAG ) )
stepResult = main.TRUE
- response = main.ONOSbenchRest.apps( ip=IPlist[0], port = 8181 )
- main.log.debug("Rest call response is: " + response)
+ response = main.ONOSbenchRest.apps( ip=IPlist[ 0 ], port=8181 )
+ main.log.debug( "Rest call response is: " + response )
if response is not main.FALSE:
- for item in json.loads(response):
- if item["state"] not in ["ACTIVE", "INSTALLED"]:
- main.log.info("Some bundles are not in correct state. ")
- main.log.info("App states are: " + response)
+ for item in json.loads( response ):
+ if item[ "state" ] not in [ "ACTIVE", "INSTALLED" ]:
+ main.log.info( "Some bundles are not in correct state. " )
+ main.log.info( "App states are: " + response )
stepResult = main.FALSE
- break;
- if (item["description"] == "Builtin device drivers") and (item["state"] != "ACTIVE"):
- main.log.info("Driver app is not in 'ACTIVE' state, but in: " + item["state"])
+ break
+ if ( item[ "description" ] == "Builtin device drivers" ) and ( item[ "state" ] != "ACTIVE" ):
+ main.log.info( "Driver app is not in 'ACTIVE' state, but in: " + item[ "state" ] )
stepResult = main.FALSE
- break;
- utilities.assert_equals( expect = main.TRUE, actual = stepResult,
- onpass = "ONOS successfully started",
- onfail = "Failed to start ONOS correctly" )
- if stepResult is main.FALSE: main.skipCase()
+ break
+ utilities.assert_equals( expect=main.TRUE, actual=stepResult,
+ onpass="ONOS successfully started",
+ onfail="Failed to start ONOS correctly" )
+ if stepResult is main.FALSE:
+ main.skipCase()
- main.step( "Form onos cluster using 'dependencies/onos-form-cluster' util")
+ main.step( "Form onos cluster using 'dependencies/onos-form-cluster' util" )
stepResult = main.FALSE
- clcmdpath = main.params["CASE110"]["clustercmdpath"]
- main.log.info("onos-form-cluster cmd path is: " + clcmdpath)
- dkruser = main.params["DOCKER"]["user"]
- dkrpasswd = main.params["DOCKER"]["password"]
- main.ONOSbenchDocker.onosFormCluster(cmdPath = clcmdpath, onosIPs=IPlist, user=dkruser, passwd = dkrpasswd)
- main.log.info("Wait for cluster to form with sleep time of " + str(startupSleep))
- time.sleep(startupSleep)
- status, response = main.ONOSbenchRest.send(ip=IPlist[0], port=8181, url="/cluster")
- main.log.debug("Rest call response: " + str(status) + " - " + response)
+ clcmdpath = main.params[ "CASE110" ][ "clustercmdpath" ]
+ main.log.info( "onos-form-cluster cmd path is: " + clcmdpath )
+ dkruser = main.params[ "DOCKER" ][ "user" ]
+ dkrpasswd = main.params[ "DOCKER" ][ "password" ]
+ main.ONOSbenchDocker.onosFormCluster( cmdPath=clcmdpath, onosIPs=IPlist, user=dkruser, passwd=dkrpasswd )
+ main.log.info( "Wait for cluster to form with sleep time of " + str( startupSleep ) )
+ time.sleep( startupSleep )
+ status, response = main.ONOSbenchRest.send( ip=IPlist[ 0 ], port=8181, url="/cluster" )
+ main.log.debug( "Rest call response: " + str( status ) + " - " + response )
if status == 200:
- jrsp = json.loads(response)
+ jrsp = json.loads( response )
if DOCKERTAG == "1.2" or DOCKERTAG == "1.3" or DOCKERTAG == "1.4" or DOCKERTAG == "1.5":
- clusterIP = [item["ip"]for item in jrsp["nodes"] if item["status"]== "ACTIVE"]
+ clusterIP = [ item[ "ip" ]for item in jrsp[ "nodes" ] if item[ "status" ] == "ACTIVE" ]
else:
- clusterIP = [item["ip"]for item in jrsp["nodes"] if item["status"]== "READY"]
- main.log.debug(" IPlist is:" + ",".join(IPlist))
- main.log.debug(" cluster IP is" + ",".join(clusterIP))
- if set(IPlist) == set(clusterIP): stepResult = main.TRUE
+ clusterIP = [ item[ "ip" ]for item in jrsp[ "nodes" ] if item[ "status" ] == "READY" ]
+ main.log.debug( " IPlist is:" + ",".join( IPlist ) )
+ main.log.debug( " cluster IP is" + ",".join( clusterIP ) )
+ if set( IPlist ) == set( clusterIP ):
+ stepResult = main.TRUE
- utilities.assert_equals( expect = main.TRUE, actual = stepResult,
- onpass = "ONOS successfully started",
- onfail = "Failed to start ONOS correctly" )
- if stepResult is main.FALSE: main.skipCase()
+ utilities.assert_equals( expect=main.TRUE, actual=stepResult,
+ onpass="ONOS successfully started",
+ onfail="Failed to start ONOS correctly" )
+ if stepResult is main.FALSE:
+ main.skipCase()
- main.step( "Check cluster app status")
+ main.step( "Check cluster app status" )
stepResult = main.TRUE
- response = main.ONOSbenchRest.apps( ip=IPlist[0], port = 8181 )
+ response = main.ONOSbenchRest.apps( ip=IPlist[ 0 ], port=8181 )
if response is not main.FALSE:
- for item in json.loads(response):
- if item["state"] not in ["ACTIVE", "INSTALLED"]:
- main.log.info("Some bundles are not in correct state. ")
- main.log.info("App states are: " + response)
+ for item in json.loads( response ):
+ if item[ "state" ] not in [ "ACTIVE", "INSTALLED" ]:
+ main.log.info( "Some bundles are not in correct state. " )
+ main.log.info( "App states are: " + response )
stepResult = main.FALSE
break
- if (item["description"] == "Builtin device drivers") and (item["state"] != "ACTIVE"):
- main.log.info("Driver app is not in 'ACTIVE' state, but in: " + item["state"])
+ if ( item[ "description" ] == "Builtin device drivers" ) and ( item[ "state" ] != "ACTIVE" ):
+ main.log.info( "Driver app is not in 'ACTIVE' state, but in: " + item[ "state" ] )
stepResult = main.FALSE
break
- utilities.assert_equals( expect = main.TRUE, actual = stepResult,
- onpass = "ONOS successfully started",
- onfail = "Failed to start ONOS correctly" )
- if stepResult is main.FALSE: main.skipCase()
+ utilities.assert_equals( expect=main.TRUE, actual=stepResult,
+ onpass="ONOS successfully started",
+ onfail="Failed to start ONOS correctly" )
+ if stepResult is main.FALSE:
+ main.skipCase()
- main.step(" Activate an APP from REST and check APP status")
+ main.step( " Activate an APP from REST and check APP status" )
appResults = list()
stepResult = main.TRUE
- applist = main.params["CASE110"]["apps"].split(",")
- main.log.info("List of apps to activate: " + str(applist) )
+ applist = main.params[ "CASE110" ][ "apps" ].split( "," )
+ main.log.info( "List of apps to activate: " + str( applist ) )
for app in applist:
- appRslt = main.ONOSbenchRest.activateApp(appName=app, ip=IPlist[0], port=8181, check=True)
- time.sleep(5)
- appResults.append(appRslt)
+ appRslt = main.ONOSbenchRest.activateApp( appName=app, ip=IPlist[ 0 ], port=8181, check=True )
+ time.sleep( 5 )
+ appResults.append( appRslt )
stepResult = stepResult and appRslt
- main.log.debug("Apps activation result for " + ",".join(applist) + ": " + str(appResults) )
- utilities.assert_equals( expect = main.TRUE, actual = stepResult,
- onpass = "Successfully activated apps",
- onfail = "Failed to activated apps correctly" )
- if stepResult is main.FALSE: main.skipCase()
+ main.log.debug( "Apps activation result for " + ",".join( applist ) + ": " + str( appResults ) )
+ utilities.assert_equals( expect=main.TRUE, actual=stepResult,
+ onpass="Successfully activated apps",
+ onfail="Failed to activated apps correctly" )
+ if stepResult is main.FALSE:
+ main.skipCase()
- main.step(" Deactivate an APP from REST and check APP status")
+ main.step( " Deactivate an APP from REST and check APP status" )
appResults = list()
stepResult = main.TRUE
- applist = main.params["CASE110"]["apps"].split(",")
- main.log.info("Apps to deactivate: " + str(applist) )
+ applist = main.params[ "CASE110" ][ "apps" ].split( "," )
+ main.log.info( "Apps to deactivate: " + str( applist ) )
for app in applist:
- time.sleep(5)
- appRslt = main.ONOSbenchRest.deactivateApp(appName=app, ip=IPlist[0], port=8181, check=True)
- appResults.append(appRslt)
+ time.sleep( 5 )
+ appRslt = main.ONOSbenchRest.deactivateApp( appName=app, ip=IPlist[ 0 ], port=8181, check=True )
+ appResults.append( appRslt )
stepResult = stepResult and appRslt
- main.log.debug("Apps deactivation result for " + ",".join(applist) + ": " + str(appResults) )
- utilities.assert_equals( expect = main.TRUE, actual = stepResult,
- onpass = "Successfully deactivated apps",
- onfail = "Failed to deactivated apps correctly" )
- if stepResult is main.FALSE: main.skipCase()
+ main.log.debug( "Apps deactivation result for " + ",".join( applist ) + ": " + str( appResults ) )
+ utilities.assert_equals( expect=main.TRUE, actual=stepResult,
+ onpass="Successfully deactivated apps",
+ onfail="Failed to deactivated apps correctly" )
+ if stepResult is main.FALSE:
+ main.skipCase()
- def CASE900(self,main):
+ def CASE900( self, main ):
"""
Check onos logs for exceptions after tests
"""
@@ -297,78 +305,75 @@
logResult = main.TRUE
- user = main.params["DOCKER"]["user"]
- pwd = main.params["DOCKER"]["password"]
+ user = main.params[ "DOCKER" ][ "user" ]
+ pwd = main.params[ "DOCKER" ][ "password" ]
- main.case("onos Exceptions check with onos image {}".format( DOCKERTAG ))
- main.step("check onos for any exceptions")
+ main.case( "onos Exceptions check with onos image {}".format( DOCKERTAG ) )
+ main.step( "check onos for any exceptions" )
for ip in IPlist:
spawncmd = "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 8101 " + user + "@" + ip
- main.log.info("log on node using cmd: " + spawncmd)
+ main.log.info( "log on node using cmd: " + spawncmd )
try:
- handle = pexpect.spawn(spawncmd)
- #handle.expect("yes/no")
- #handle.sendline("yes")
- #print("yes is sent")
- #this extra statement is sent to get around some
- #pexpect issue of not seeing the next expected string
- handle.expect("Password:")
- handle.sendline(pwd)
- time.sleep(5)
- handle.expect("onos>")
- handle.sendline("log:exception-display")
- handle.expect("onos>")
+ handle = pexpect.spawn( spawncmd )
+ # handle.expect( "yes/no" )
+ # handle.sendline( "yes" )
+ # print( "yes is sent" )
+ # this extra statement is sent to get around some
+ # pexpect issue of not seeing the next expected string
+ handle.expect( "Password:" )
+ handle.sendline( pwd )
+ time.sleep( 5 )
+ handle.expect( "onos>" )
+ handle.sendline( "log:exception-display" )
+ handle.expect( "onos>" )
result = handle.before
- if re.search("Exception", result):
- main.log.info("onos: " + ip + " Exceptions:" + result)
+ if re.search( "Exception", result ):
+ main.log.info( "onos: " + ip + " Exceptions:" + result )
logResult = logResult and main.FALSE
else:
- main.log.info("onos: " + ip + " Exceptions: None")
+ main.log.info( "onos: " + ip + " Exceptions: None" )
logResult = logResult and main.TRUE
except Exception:
- main.log.exception("Uncaught exception when getting log from onos:" + ip)
+ main.log.exception( "Uncaught exception when getting log from onos:" + ip )
logResult = logResult and main.FALSE
- utilities.assert_equals( expect = main.TRUE, actual = logResult,
- onpass = "onos exception check passed",
- onfail = "onos exeption check failed" )
+ utilities.assert_equals( expect=main.TRUE, actual=logResult,
+ onpass="onos exception check passed",
+ onfail="onos exeption check failed" )
def CASE1000( self, main ):
-
"""
Cleanup after tests - stop and delete the containers created; delete the image
"""
import time
- main.case("Clean up images (ex. none:none tagged) and containers")
- main.step("Stop onos containers")
+ main.case( "Clean up images (ex. none:none tagged) and containers" )
+ main.step( "Stop onos containers" )
stepResult = main.TRUE
for ctname in NODElist:
if main.ONOSbenchDocker.dockerCheckCTName( ctName="/" + ctname ):
main.log.info( "stopping docker container: /" + ctname )
stopResult = main.ONOSbenchDocker.dockerStopCT( ctName="/" + ctname )
- time.sleep(10)
+ time.sleep( 10 )
rmResult = main.ONOSbenchDocker.dockerRemoveCT( ctName="/" + ctname )
stepResult = stepResult and stopResult and rmResult
- utilities.assert_equals( expect = main.TRUE, actual = stepResult,
- onpass = "Container successfully stopped",
- onfail = "Failed to stopped the container" )
+ utilities.assert_equals( expect=main.TRUE, actual=stepResult,
+ onpass="Container successfully stopped",
+ onfail="Failed to stopped the container" )
- #main.step( "remove exiting onosproject/onos images")
- #stepResult = main.ONOSbenchDocker.dockerRemoveImage( image = DOCKERREPO + ":" + DOCKERTAG )
- main.step( "remove dangling 'none:none' images")
+ # main.step( "remove exiting onosproject/onos images" )
+ # stepResult = main.ONOSbenchDocker.dockerRemoveImage( image=DOCKERREPO + ":" + DOCKERTAG )
+ main.step( "remove dangling 'none:none' images" )
stepResult = main.ONOSbenchDocker.dockerRemoveImage()
- utilities.assert_equals( expect = main.TRUE, actual = stepResult,
- onpass = "Succeeded in cleaning up images",
- onfail = "Failed in cleaning up images" )
+ utilities.assert_equals( expect=main.TRUE, actual=stepResult,
+ onpass="Succeeded in cleaning up images",
+ onfail="Failed in cleaning up images" )
def CASE1001( self, main ):
-
"""
Create a file for publishing results on wiki in tabular form
"""
-
main.case( "Create a file for publishing on wiki in tabular form" )
import re
imageTagCounter = 0
@@ -379,26 +384,26 @@
totalNumOfTestCases = 6
try:
main.tableFileName = main.logdir + "/" + main.TEST + "TableWiki.txt"
- main.wikiTableFile = open(main.tableFileName, "a+")
- main.wikiFileHandle = open(main.WikiFileName, "r")
+ main.wikiTableFile = open( main.tableFileName, "a+" )
+ main.wikiFileHandle = open( main.WikiFileName, "r" )
for imageTag in imageTagList:
resultDictionary[ imageTag ] = []
for line in main.wikiFileHandle:
- matchObj = re.search("(?!.*Case 0).*<h3>(.+?)<\/h3>", line)
+ matchObj = re.search( "(?!.*Case 0).*<h3>(.+?)<\/h3>", line )
if testCaseCounter < totalNumOfTestCases:
if matchObj:
- wordsToRemove = re.compile("latest|- PASS|- FAIL|- No Result")
- testCaseName = wordsToRemove.sub("", matchObj.group(1))
- testCaseName = testCaseName.replace( INITDOCKERTAG,'' )
- testCaseList.append(testCaseName)
+ wordsToRemove = re.compile( "latest|- PASS|- FAIL|- No Result" )
+ testCaseName = wordsToRemove.sub( "", matchObj.group( 1 ) )
+ testCaseName = testCaseName.replace( INITDOCKERTAG, '' )
+ testCaseList.append( testCaseName )
testCaseCounter += 1
if matchObj:
if "- PASS" in line:
- resultDictionary[ imageTagList[ imageTagCounter ] ].append("PASS")
+ resultDictionary[ imageTagList[ imageTagCounter ] ].append( "PASS" )
if "- FAIL" in line:
- resultDictionary[ imageTagList[ imageTagCounter ] ].append("FAIL")
+ resultDictionary[ imageTagList[ imageTagCounter ] ].append( "FAIL" )
if "- No Result" in line:
- resultDictionary[ imageTagList[ imageTagCounter ] ].append("No Result")
+ resultDictionary[ imageTagList[ imageTagCounter ] ].append( "No Result" )
resultCounter += 1
if resultCounter == totalNumOfTestCases:
imageTagCounter += 1
@@ -428,6 +433,6 @@
except Exception:
main.log.exception( "Exception while writing to the table file" )
logResult = main.FALSE
- utilities.assert_equals( expect = main.TRUE, actual = logResult,
- onpass = "onos exception check passed",
- onfail = "onos exception check failed" )
+ utilities.assert_equals( expect=main.TRUE, actual=logResult,
+ onpass="onos exception check passed",
+ onfail="onos exception check failed" )
diff --git a/TestON/tests/SAMP/SAMPstartTemplate_1node/Dependency/newFuncTopo.py b/TestON/tests/SAMP/SAMPstartTemplate_1node/Dependency/newFuncTopo.py
old mode 100755
new mode 100644
index d2aefda..e3e10ab
--- a/TestON/tests/SAMP/SAMPstartTemplate_1node/Dependency/newFuncTopo.py
+++ b/TestON/tests/SAMP/SAMPstartTemplate_1node/Dependency/newFuncTopo.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Custom topology for Mininet
"""
@@ -35,19 +34,23 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class VLANHost( Host ):
+
def config( self, vlan=100, **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ifconfig %s inet 0' % intf )
self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params[ 'ip' ] ) )
newName = '%s.%d' % ( intf, vlan )
intf.name = newName
self.nameToIntf[ newName ] = intf
return r
+
class IPv6Host( Host ):
+
def config( self, v6Addr='1000:1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
@@ -55,13 +58,16 @@
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class dualStackHost( Host ):
+
def config( self, v6Addr='2000:1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class MyTopo( Topo ):
def __init__( self ):
@@ -69,43 +75,43 @@
Topo.__init__( self )
# Switch S5 Hosts
- host1=self.addHost( 'h1', ip='10.1.0.2/24' )
- host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
- host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
- #VLAN hosts
- host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
- host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host6=self.addHost( 'h6', ip='11.1.0.2/24' )
- host7=self.addHost( 'h7', ip='12.1.0.2/24' )
- #Multicast Sender
- host8=self.addHost( 'h8', ip='10.1.0.4/24' )
+ host1 = self.addHost( 'h1', ip='10.1.0.2/24' )
+ host2 = self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
+ host3 = self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
+ # VLAN hosts
+ host4 = self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
+ host5 = self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
+ # VPN-1 and VPN-2 Hosts
+ host6 = self.addHost( 'h6', ip='11.1.0.2/24' )
+ host7 = self.addHost( 'h7', ip='12.1.0.2/24' )
+ # Multicast Sender
+ host8 = self.addHost( 'h8', ip='10.1.0.4/24' )
# Switch S6 Hosts
- host9=self.addHost( 'h9', ip='10.1.0.5/24' )
- host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
- host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
- #VLAN hosts
- host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
- host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host14=self.addHost( 'h14', ip='11.1.0.3/24' )
- host15=self.addHost( 'h15', ip='12.1.0.3/24' )
- #Multicast Receiver
- host16=self.addHost( 'h16', ip='10.1.0.7/24' )
+ host9 = self.addHost( 'h9', ip='10.1.0.5/24' )
+ host10 = self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
+ host11 = self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
+ # VLAN hosts
+ host12 = self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
+ host13 = self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
+ # VPN-1 and VPN-2 Hosts
+ host14 = self.addHost( 'h14', ip='11.1.0.3/24' )
+ host15 = self.addHost( 'h15', ip='12.1.0.3/24' )
+ # Multicast Receiver
+ host16 = self.addHost( 'h16', ip='10.1.0.7/24' )
# Switch S7 Hosts
- host17=self.addHost( 'h17', ip='10.1.0.8/24' )
- host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
- host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
- #VLAN hosts
- host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
- host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host22=self.addHost( 'h22', ip='11.1.0.4/24' )
- host23=self.addHost( 'h23', ip='12.1.0.4/24' )
- #Multicast Receiver
- host24=self.addHost( 'h24', ip='10.1.0.10/24' )
+ host17 = self.addHost( 'h17', ip='10.1.0.8/24' )
+ host18 = self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
+ host19 = self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
+ # VLAN hosts
+ host20 = self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
+ host21 = self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
+ # VPN-1 and VPN-2 Hosts
+ host22 = self.addHost( 'h22', ip='11.1.0.4/24' )
+ host23 = self.addHost( 'h23', ip='12.1.0.4/24' )
+ # Multicast Receiver
+ host24 = self.addHost( 'h24', ip='10.1.0.10/24' )
s1 = self.addSwitch( 's1' )
s2 = self.addSwitch( 's2' )
@@ -115,59 +121,60 @@
s6 = self.addSwitch( 's6' )
s7 = self.addSwitch( 's7' )
- self.addLink(s5,host1)
- self.addLink(s5,host2)
- self.addLink(s5,host3)
- self.addLink(s5,host4)
- self.addLink(s5,host5)
- self.addLink(s5,host6)
- self.addLink(s5,host7)
- self.addLink(s5,host8)
+ self.addLink( s5, host1 )
+ self.addLink( s5, host2 )
+ self.addLink( s5, host3 )
+ self.addLink( s5, host4 )
+ self.addLink( s5, host5 )
+ self.addLink( s5, host6 )
+ self.addLink( s5, host7 )
+ self.addLink( s5, host8 )
- self.addLink(s6,host9)
- self.addLink(s6,host10)
- self.addLink(s6,host11)
- self.addLink(s6,host12)
- self.addLink(s6,host13)
- self.addLink(s6,host14)
- self.addLink(s6,host15)
- self.addLink(s6,host16)
+ self.addLink( s6, host9 )
+ self.addLink( s6, host10 )
+ self.addLink( s6, host11 )
+ self.addLink( s6, host12 )
+ self.addLink( s6, host13 )
+ self.addLink( s6, host14 )
+ self.addLink( s6, host15 )
+ self.addLink( s6, host16 )
- self.addLink(s7,host17)
- self.addLink(s7,host18)
- self.addLink(s7,host19)
- self.addLink(s7,host20)
- self.addLink(s7,host21)
- self.addLink(s7,host22)
- self.addLink(s7,host23)
- self.addLink(s7,host24)
+ self.addLink( s7, host17 )
+ self.addLink( s7, host18 )
+ self.addLink( s7, host19 )
+ self.addLink( s7, host20 )
+ self.addLink( s7, host21 )
+ self.addLink( s7, host22 )
+ self.addLink( s7, host23 )
+ self.addLink( s7, host24 )
- self.addLink(s1,s2)
- self.addLink(s1,s3)
- self.addLink(s1,s4)
- self.addLink(s1,s5)
+ self.addLink( s1, s2 )
+ self.addLink( s1, s3 )
+ self.addLink( s1, s4 )
+ self.addLink( s1, s5 )
- self.addLink(s2,s3)
- self.addLink(s2,s5)
- self.addLink(s2,s6)
+ self.addLink( s2, s3 )
+ self.addLink( s2, s5 )
+ self.addLink( s2, s6 )
- self.addLink(s3,s4)
- self.addLink(s3,s6)
+ self.addLink( s3, s4 )
+ self.addLink( s3, s6 )
- self.addLink(s4,s7)
+ self.addLink( s4, s7 )
topos = { 'mytopo': ( lambda: MyTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = MyTopo()
- network = Mininet(topo=topo, autoSetMacs=True, controller=None)
+ network = Mininet( topo=topo, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/SAMP/SAMPstartTemplate_1node/SAMPstartTemplate_1node.py b/TestON/tests/SAMP/SAMPstartTemplate_1node/SAMPstartTemplate_1node.py
index 7da7e54..37020b3 100644
--- a/TestON/tests/SAMP/SAMPstartTemplate_1node/SAMPstartTemplate_1node.py
+++ b/TestON/tests/SAMP/SAMPstartTemplate_1node/SAMPstartTemplate_1node.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,23 +18,22 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# This is a sample template that starts up ONOS cluster, this template
# can be use as a base script for ONOS System Testing.
+
class SAMPstartTemplate_1node:
def __init__( self ):
self.default = ''
-
- def CASE0(self, main):
- '''
+ def CASE0( self, main ):
+ """
Pull specific ONOS branch, then Build ONOS on ONOS Bench.
This step is usually skipped. Because in a Jenkins driven automated
test env. We want Jenkins jobs to pull&build for flexibility to handle
different versions of ONOS.
- '''
+ """
try:
from tests.dependencies.ONOSSetup import ONOSSetup
except ImportError:
@@ -47,11 +46,11 @@
main.testSetUp.gitPulling()
def CASE1( self, main ):
- '''
+ """
Set up global test variables;
Uninstall all running cells in test env defined in .topo file
- '''
+ """
try:
from tests.dependencies.ONOSSetup import ONOSSetup
except ImportError:
@@ -65,22 +64,20 @@
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
- main.onosStartupSleep = float( main.params['CASE1']['SleepTimers']['onosStartup'] )
- main.onosCfgSleep = float( main.params['CASE1']['SleepTimers']['onosCfg'] )
- main.mnStartupSleep = float( main.params['CASE1']['SleepTimers']['mnStartup'] )
- main.mnCfgSleep = float( main.params['CASE1']['SleepTimers']['mnCfg'] )
+ main.onosStartupSleep = float( main.params[ 'CASE1' ][ 'SleepTimers' ][ 'onosStartup' ] )
+ main.onosCfgSleep = float( main.params[ 'CASE1' ][ 'SleepTimers' ][ 'onosCfg' ] )
+ main.mnStartupSleep = float( main.params[ 'CASE1' ][ 'SleepTimers' ][ 'mnStartup' ] )
+ main.mnCfgSleep = float( main.params[ 'CASE1' ][ 'SleepTimers' ][ 'mnCfg' ] )
stepResult = main.testSetUp.envSetup( includeGitPull=False )
except Exception as e:
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
-
-
def CASE2( self, main ):
- '''
+ """
Report errors/warnings/exceptions
- '''
- main.log.info("Error report: \n" )
+ """
+ main.log.info( "Error report: \n" )
main.ONOSbench.logReport( main.Cluster.active( 0 ).ipAddress,
[ "INFO",
"FOLLOWER",
@@ -92,12 +89,11 @@
def CASE10( self, main ):
"""
- Start ONOS cluster (1 node in this example) in three steps:
- 1) start a basic cluster with drivers app via ONOSDriver;
- 2) activate apps via ONOSCliDriver;
- 3) configure onos via ONOSCliDriver;
+ Start ONOS cluster ( 1 node in this example ) in three steps:
+ 1 ) start a basic cluster with drivers app via ONOSDriver;
+ 2 ) activate apps via ONOSCliDriver;
+ 3 ) configure onos via ONOSCliDriver;
"""
-
import time
try:
from tests.dependencies.ONOSSetup import ONOSSetup
@@ -108,8 +104,8 @@
main.testSetUp
except ( NameError, AttributeError ):
main.testSetUp = ONOSSetup()
- main.case( "Start up " + str( main.Cluster.numCtrls ) + "-node onos cluster.")
- main.step( "Start ONOS cluster with basic (drivers) app.")
+ main.case( "Start up " + str( main.Cluster.numCtrls ) + "-node onos cluster." )
+ main.step( "Start ONOS cluster with basic (drivers) app." )
stepResult = main.ONOSbench.startBasicONOS( nodeList=main.Cluster.getIps(),
opSleep=200,
onosUser=main.ONOScell.karafUser )
@@ -120,12 +116,12 @@
main.testSetUp.startOnosClis( main.Cluster )
- main.step( "Activate onos apps.")
- main.apps = main.params['CASE10'].get( 'Apps' )
+ main.step( "Activate onos apps." )
+ main.apps = main.params[ 'CASE10' ].get( 'Apps' )
if main.apps:
main.log.info( "Apps to activate: " + main.apps )
activateResult = main.TRUE
- for a in main.apps.split(","):
+ for a in main.apps.split( "," ):
activateResult = activateResult & main.Cluster.active( 0 ).CLI.activateApp( a )
# TODO: check this worked
time.sleep( main.onosCfgSleep ) # wait for apps to activate
@@ -137,13 +133,13 @@
onfail="Failed to set config" )
main.step( "Set ONOS configurations" )
- config = main.params['CASE10'].get( 'ONOS_Configuration' )
+ config = main.params[ 'CASE10' ].get( 'ONOS_Configuration' )
if config:
main.log.debug( config )
checkResult = main.TRUE
for component in config:
- for setting in config[component]:
- value = config[component][setting]
+ for setting in config[ component ]:
+ value = config[ component ][ setting ]
check = main.Cluster.active( 0 ).CLI.setCfg( component, setting, value )
main.log.info( "Value was changed? {}".format( main.TRUE == check ) )
checkResult = check and checkResult
@@ -160,7 +156,7 @@
"""
import time
- topology = main.params['CASE11']['topo']
+ topology = main.params[ 'CASE11' ][ 'topo' ]
main.log.report( "Start Mininet topology" )
main.case( "Start Mininet topology" )
@@ -175,36 +171,33 @@
if not topoResult:
main.cleanAndExit()
- main.step( "Assign switches to controllers.")
+ main.step( "Assign switches to controllers." )
assignResult = main.TRUE
- for i in range(1, 8):
+ for i in range( 1, 8 ):
assignResult = assignResult & \
main.Mininet1.assignSwController( sw="s" + str( i ),
ip=main.Cluster.getIps(),
port='6653' )
- time.sleep(main.mnCfgSleep)
+ time.sleep( main.mnCfgSleep )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass="Successfully assign switches to controllers",
onfail="Failed to assign switches to controllers" )
-
def CASE12( self, main ):
"""
Tests using through ONOS CLI handles
"""
-
- main.case( "Test some onos commands through CLI. ")
- main.log.debug( main.Cluster.active( 0 ).CLI.sendline("summary") )
- main.log.debug( main.Cluster.active( 0 ).CLI.sendline("devices") )
+ main.case( "Test some onos commands through CLI. " )
+ main.log.debug( main.Cluster.active( 0 ).CLI.sendline( "summary" ) )
+ main.log.debug( main.Cluster.active( 0 ).CLI.sendline( "devices" ) )
def CASE22( self, main ):
"""
Tests using ONOS REST API handles
"""
-
- main.case( " Sample tests using ONOS REST API handles. ")
- main.log.debug( main.Cluster.active( 0 ).REST.send("/devices") )
+ main.case( " Sample tests using ONOS REST API handles. " )
+ main.log.debug( main.Cluster.active( 0 ).REST.send( "/devices" ) )
main.log.debug( main.Cluster.active( 0 ).REST.apps() )
def CASE32( self, main ):
@@ -219,17 +212,17 @@
installResults = main.Cluster.active( 0 ).CLI.activateApp( "org.onosproject.fwd" )
utilities.assert_equals( expect=main.TRUE,
actual=installResults,
- onpass = "Configure fwd successful",
+ onpass="Configure fwd successful",
onfail="Configure fwd failed" )
main.step( "Run pingall to check connectivity. " )
pingResult = main.FALSE
passMsg = "Reactive Pingall test passed"
pingResult = main.Mininet1.pingall()
if not pingResult:
- main.log.warn( "First pingall failed. Trying again..." )
- pingResult = main.Mininet1.pingall()
- passMsg += "on the second try"
+ main.log.warn( "First pingall failed. Trying again..." )
+ pingResult = main.Mininet1.pingall()
+ passMsg += "on the second try"
utilities.assert_equals( expect=main.TRUE,
actual=pingResult,
onpass=passMsg,
- onfail= "Reactive Pingall failed, " + "one or more ping pairs failed." )
+ onfail="Reactive Pingall failed, " + "one or more ping pairs failed." )
diff --git a/TestON/tests/SAMP/SAMPstartTemplate_3node/Dependency/newFuncTopo.py b/TestON/tests/SAMP/SAMPstartTemplate_3node/Dependency/newFuncTopo.py
old mode 100755
new mode 100644
index 0d72770..ad99198
--- a/TestON/tests/SAMP/SAMPstartTemplate_3node/Dependency/newFuncTopo.py
+++ b/TestON/tests/SAMP/SAMPstartTemplate_3node/Dependency/newFuncTopo.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Custom topology for Mininet
"""
@@ -35,19 +34,23 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class VLANHost( Host ):
+
def config( self, vlan=100, **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ifconfig %s inet 0' % intf )
self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params[ 'ip' ] ) )
newName = '%s.%d' % ( intf, vlan )
intf.name = newName
self.nameToIntf[ newName ] = intf
return r
+
class IPv6Host( Host ):
+
def config( self, v6Addr='1000:1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
@@ -55,13 +58,16 @@
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class dualStackHost( Host ):
+
def config( self, v6Addr='2000:1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class MyTopo( Topo ):
def __init__( self ):
@@ -69,43 +75,43 @@
Topo.__init__( self )
# Switch S5 Hosts
- host1=self.addHost( 'h1', ip='10.1.0.2/24' )
- host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
- host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
- #VLAN hosts
- host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
- host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host6=self.addHost( 'h6', ip='11.1.0.2/24' )
- host7=self.addHost( 'h7', ip='12.1.0.2/24' )
- #Multicast Sender
- host8=self.addHost( 'h8', ip='10.1.0.4/24' )
+ host1 = self.addHost( 'h1', ip='10.1.0.2/24' )
+ host2 = self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
+ host3 = self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
+ # VLAN hosts
+ host4 = self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
+ host5 = self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
+ # VPN-1 and VPN-2 Hosts
+ host6 = self.addHost( 'h6', ip='11.1.0.2/24' )
+ host7 = self.addHost( 'h7', ip='12.1.0.2/24' )
+ # Multicast Sender
+ host8 = self.addHost( 'h8', ip='10.1.0.4/24' )
# Switch S6 Hosts
- host9=self.addHost( 'h9', ip='10.1.0.5/24' )
- host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
- host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
- #VLAN hosts
- host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
- host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host14=self.addHost( 'h14', ip='11.1.0.3/24' )
- host15=self.addHost( 'h15', ip='12.1.0.3/24' )
- #Multicast Receiver
- host16=self.addHost( 'h16', ip='10.1.0.7/24' )
+ host9 = self.addHost( 'h9', ip='10.1.0.5/24' )
+ host10 = self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
+ host11 = self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
+ # VLAN hosts
+ host12 = self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
+ host13 = self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
+ # VPN-1 and VPN-2 Hosts
+ host14 = self.addHost( 'h14', ip='11.1.0.3/24' )
+ host15 = self.addHost( 'h15', ip='12.1.0.3/24' )
+ # Multicast Receiver
+ host16 = self.addHost( 'h16', ip='10.1.0.7/24' )
# Switch S7 Hosts
- host17=self.addHost( 'h17', ip='10.1.0.8/24' )
- host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
- host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
- #VLAN hosts
- host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
- host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host22=self.addHost( 'h22', ip='11.1.0.4/24' )
- host23=self.addHost( 'h23', ip='12.1.0.4/24' )
- #Multicast Receiver
- host24=self.addHost( 'h24', ip='10.1.0.10/24' )
+ host17 = self.addHost( 'h17', ip='10.1.0.8/24' )
+ host18 = self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
+ host19 = self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
+ # VLAN hosts
+ host20 = self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
+ host21 = self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
+ # VPN-1 and VPN-2 Hosts
+ host22 = self.addHost( 'h22', ip='11.1.0.4/24' )
+ host23 = self.addHost( 'h23', ip='12.1.0.4/24' )
+ # Multicast Receiver
+ host24 = self.addHost( 'h24', ip='10.1.0.10/24' )
s1 = self.addSwitch( 's1' )
s2 = self.addSwitch( 's2' )
@@ -115,59 +121,60 @@
s6 = self.addSwitch( 's6' )
s7 = self.addSwitch( 's7' )
- self.addLink(s5,host1)
- self.addLink(s5,host2)
- self.addLink(s5,host3)
- self.addLink(s5,host4)
- self.addLink(s5,host5)
- self.addLink(s5,host6)
- self.addLink(s5,host7)
- self.addLink(s5,host8)
+ self.addLink( s5, host1 )
+ self.addLink( s5, host2 )
+ self.addLink( s5, host3 )
+ self.addLink( s5, host4 )
+ self.addLink( s5, host5 )
+ self.addLink( s5, host6 )
+ self.addLink( s5, host7 )
+ self.addLink( s5, host8 )
- self.addLink(s6,host9)
- self.addLink(s6,host10)
- self.addLink(s6,host11)
- self.addLink(s6,host12)
- self.addLink(s6,host13)
- self.addLink(s6,host14)
- self.addLink(s6,host15)
- self.addLink(s6,host16)
+ self.addLink( s6, host9 )
+ self.addLink( s6, host10 )
+ self.addLink( s6, host11 )
+ self.addLink( s6, host12 )
+ self.addLink( s6, host13 )
+ self.addLink( s6, host14 )
+ self.addLink( s6, host15 )
+ self.addLink( s6, host16 )
- self.addLink(s7,host17)
- self.addLink(s7,host18)
- self.addLink(s7,host19)
- self.addLink(s7,host20)
- self.addLink(s7,host21)
- self.addLink(s7,host22)
- self.addLink(s7,host23)
- self.addLink(s7,host24)
+ self.addLink( s7, host17 )
+ self.addLink( s7, host18 )
+ self.addLink( s7, host19 )
+ self.addLink( s7, host20 )
+ self.addLink( s7, host21 )
+ self.addLink( s7, host22 )
+ self.addLink( s7, host23 )
+ self.addLink( s7, host24 )
- self.addLink(s1,s2)
- self.addLink(s1,s3)
- self.addLink(s1,s4)
- self.addLink(s1,s5)
+ self.addLink( s1, s2 )
+ self.addLink( s1, s3 )
+ self.addLink( s1, s4 )
+ self.addLink( s1, s5 )
- self.addLink(s2,s3)
- self.addLink(s2,s5)
- self.addLink(s2,s6)
+ self.addLink( s2, s3 )
+ self.addLink( s2, s5 )
+ self.addLink( s2, s6 )
- self.addLink(s3,s4)
- self.addLink(s3,s6)
+ self.addLink( s3, s4 )
+ self.addLink( s3, s6 )
- self.addLink(s4,s7)
+ self.addLink( s4, s7 )
topos = { 'mytopo': ( lambda: MyTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = MyTopo()
- network = Mininet(topo=topo, autoSetMacs=True, controller=None)
+ network = Mininet( topo=topo, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/SAMP/SAMPstartTemplate_3node/SAMPstartTemplate_3node.py b/TestON/tests/SAMP/SAMPstartTemplate_3node/SAMPstartTemplate_3node.py
index 553fa8e..cb5019c 100644
--- a/TestON/tests/SAMP/SAMPstartTemplate_3node/SAMPstartTemplate_3node.py
+++ b/TestON/tests/SAMP/SAMPstartTemplate_3node/SAMPstartTemplate_3node.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,23 +18,22 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# This is a sample template that starts up ONOS cluster, this template
# can be use as a base script for ONOS System Testing.
+
class SAMPstartTemplate_3node:
def __init__( self ):
self.default = ''
-
- def CASE0(self, main):
- '''
+ def CASE0( self, main ):
+ """
Pull specific ONOS branch, then Build ONOS on ONOS Bench.
This step is usually skipped. Because in a Jenkins driven automated
test env. We want Jenkins jobs to pull&build for flexibility to handle
different versions of ONOS.
- '''
+ """
try:
from tests.dependencies.ONOSSetup import ONOSSetup
except ImportError:
@@ -47,13 +46,12 @@
main.testSetUp.gitPulling()
-
def CASE1( self, main ):
- '''
+ """
Set up global test variables;
Uninstall all running cells in test env defined in .topo file
- '''
+ """
try:
from tests.dependencies.ONOSSetup import ONOSSetup
except ImportError:
@@ -67,23 +65,21 @@
main.testSetUp.envSetupDescription()
stepResult = main.FALSE
try:
- main.onosStartupSleep = float(main.params['CASE1']['SleepTimers']['onosStartup'])
- main.onosCfgSleep = float(main.params['CASE1']['SleepTimers']['onosCfg'])
- main.mnStartupSleep = float(main.params['CASE1']['SleepTimers']['mnStartup'])
- main.mnCfgSleep = float(main.params['CASE1']['SleepTimers']['mnCfg'])
+ main.onosStartupSleep = float( main.params[ 'CASE1' ][ 'SleepTimers' ][ 'onosStartup' ] )
+ main.onosCfgSleep = float( main.params[ 'CASE1' ][ 'SleepTimers' ][ 'onosCfg' ] )
+ main.mnStartupSleep = float( main.params[ 'CASE1' ][ 'SleepTimers' ][ 'mnStartup' ] )
+ main.mnCfgSleep = float( main.params[ 'CASE1' ][ 'SleepTimers' ][ 'mnCfg' ] )
stepResult = main.testSetUp.envSetup( includeGitPull=False )
except Exception as e:
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
-
-
def CASE2( self, main ):
- '''
+ """
Report errors/warnings/exceptions
- '''
- main.log.info("Error report: \n" )
- main.ONOSbench.logReport( main.Cluster.runningNodes[0].ipAddress,
+ """
+ main.log.info( "Error report: \n" )
+ main.ONOSbench.logReport( main.Cluster.runningNodes[ 0 ].ipAddress,
[ "INFO",
"FOLLOWER",
"WARN",
@@ -94,10 +90,10 @@
def CASE10( self, main ):
"""
- Start ONOS cluster (3 nodes in this example) in three steps:
- 1) start a basic cluster with drivers app via ONOSDriver;
- 2) activate apps via ONOSCliDriver;
- 3) configure onos via ONOSCliDriver;
+ Start ONOS cluster ( 3 nodes in this example ) in three steps:
+ 1 ) start a basic cluster with drivers app via ONOSDriver;
+ 2 ) activate apps via ONOSCliDriver;
+ 3 ) configure onos via ONOSCliDriver;
"""
try:
from tests.dependencies.ONOSSetup import ONOSSetup
@@ -113,9 +109,9 @@
main.case( "Start up " + str( main.Cluster.numCtrls ) + "-node onos cluster." )
- main.step( "Start ONOS cluster with basic (drivers) app.")
+ main.step( "Start ONOS cluster with basic (drivers) app." )
stepResult = main.ONOSbench.startBasicONOS( nodeList=main.Cluster.getIps(), opSleep=200,
- onosUser=main.ONOScell.karafUser )
+ onosUser=main.ONOScell.karafUser )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass="Successfully started basic ONOS cluster ",
@@ -123,13 +119,13 @@
main.testSetUp.startOnosClis()
- main.step( "Activate onos apps.")
- main.apps = main.params['CASE10'].get( 'Apps' )
+ main.step( "Activate onos apps." )
+ main.apps = main.params[ 'CASE10' ].get( 'Apps' )
if main.apps:
main.log.info( "Apps to activate: " + main.apps )
activateResult = main.TRUE
- for a in main.apps.split(","):
- activateResult = activateResult & main.Cluster.active( 0 ).CLI.activateApp(a)
+ for a in main.apps.split( "," ):
+ activateResult = activateResult & main.Cluster.active( 0 ).CLI.activateApp( a )
# TODO: check this worked
time.sleep( main.onosCfgSleep ) # wait for apps to activate
else:
@@ -140,14 +136,14 @@
onfail="Failed to set config" )
main.step( "Set ONOS configurations" )
- config = main.params['CASE10'].get( 'ONOS_Configuration' )
+ config = main.params[ 'CASE10' ].get( 'ONOS_Configuration' )
if config:
main.log.debug( config )
checkResult = main.TRUE
for component in config:
- for setting in config[component]:
- value = config[component][setting]
- check = main.Cluster.runningNodes[0].setCfg( component, setting, value )
+ for setting in config[ component ]:
+ value = config[ component ][ setting ]
+ check = main.Cluster.runningNodes[ 0 ].setCfg( component, setting, value )
main.log.info( "Value was changed? {}".format( main.TRUE == check ) )
checkResult = check and checkResult
utilities.assert_equals( expect=main.TRUE,
@@ -163,12 +159,12 @@
"""
import time
- topology = main.params['CASE11']['topo']
+ topology = main.params[ 'CASE11' ][ 'topo' ]
main.log.report( "Start Mininet topology" )
main.case( "Start Mininet topology" )
main.step( "Starting Mininet Topology" )
- topoResult = main.Mininet1.startNet(mnCmd=topology )
+ topoResult = main.Mininet1.startNet( mnCmd=topology )
stepResult = topoResult
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -178,25 +174,23 @@
if not topoResult:
main.cleanAndExit()
- main.step( "Assign switches to controllers.")
+ main.step( "Assign switches to controllers." )
assignResult = main.TRUE
- for i in range(1, 8):
+ for i in range( 1, 8 ):
assignResult = assignResult & main.Mininet1.assignSwController( sw="s" + str( i ),
ip=main.Cluster.getIps(),
port='6653' )
- time.sleep(main.mnCfgSleep)
+ time.sleep( main.mnCfgSleep )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass="Successfully assign switches to controllers",
onfail="Failed to assign switches to controllers" )
-
def CASE12( self, main ):
"""
Tests using through ONOS CLI handles
"""
-
- main.case( "Test some onos commands through CLI. ")
+ main.case( "Test some onos commands through CLI. " )
main.log.debug( main.Cluster.active( 0 ).CLI.sendline( "summary" ) )
main.log.debug( main.Cluster.active( 1 ).CLI.sendline( "devices" ) )
@@ -204,8 +198,7 @@
"""
Tests using ONOS REST API handles
"""
-
- main.case( " Sample tests using ONOS REST API handles. ")
+ main.case( " Sample tests using ONOS REST API handles. " )
main.log.debug( main.Cluster.active( 0 ).REST.send( "/devices" ) )
main.log.debug( main.Cluster.active( 2 ).REST.apps() )
@@ -221,17 +214,17 @@
installResults = main.Cluster.active( 0 ).CLI.activateApp( "org.onosproject.fwd" )
utilities.assert_equals( expect=main.TRUE,
actual=installResults,
- onpass= "Configure fwd successful",
- onfail= "Configure fwd failed" )
+ onpass="Configure fwd successful",
+ onfail="Configure fwd failed" )
main.step( "Run pingall to check connectivity. " )
pingResult = main.FALSE
passMsg = "Reactive Pingall test passed"
pingResult = main.Mininet1.pingall()
if not pingResult:
- main.log.warn("First pingall failed. Trying again...")
- pingResult = main.Mininet1.pingall()
- passMsg += "on the second try"
+ main.log.warn( "First pingall failed. Trying again..." )
+ pingResult = main.Mininet1.pingall()
+ passMsg += "on the second try"
utilities.assert_equals( expect=main.TRUE,
actual=pingResult,
onpass=passMsg,
- onfail= "Reactive Pingall failed, " + "one or more ping pairs failed" )
+ onfail="Reactive Pingall failed, " + "one or more ping pairs failed" )
diff --git a/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py b/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py
index 0bafefb..c139d48 100644
--- a/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py
+++ b/TestON/tests/SCPF/SCPFcbench/SCPFcbench.py
@@ -22,13 +22,13 @@
main.case( "pre-condition for cbench test." )
try:
- if type( init ) is not bool:
+ if not isinstance( init, bool ):
init = False
except NameError:
init = False
# -- INIT SECTION, ONLY RUNS ONCE -- #
- if init == False:
+ if not init:
init = True
try:
from tests.dependencies.ONOSSetup import ONOSSetup
@@ -80,7 +80,6 @@
onpass="Successfully configure onos for cbench test ",
onfail="Failed to configure onos for cbench test" )
-
def CASE2( self, main ):
main.case( "Running Cbench" )
main.step( "Issuing cbench commands and grab returned results" )
@@ -119,7 +118,7 @@
main.log.info( "Standard Deviation: \t" + stdev )
try:
- dbFileName="/tmp/CbenchDB"
+ dbFileName = "/tmp/CbenchDB"
dbfile = open( dbFileName, "w+" )
temp = "'" + main.commit + "',"
temp += "'" + mode + "',"
@@ -133,7 +132,7 @@
stepResult = main.TRUE
break
- if ( validFlag == False ):
+ if not validFlag:
main.log.warn( "Cbench Test produced no valid results!!!!" )
stepResult = main.FALSE
@@ -141,4 +140,3 @@
actual=stepResult,
onpass="Successfully tested onos for cbench. ",
onfail="Failed to obtain valid onos cbench result!" )
-
diff --git a/TestON/tests/SCPF/SCPFflowTp1g/SCPFflowTp1g.py b/TestON/tests/SCPF/SCPFflowTp1g/SCPFflowTp1g.py
index 41b09aa..c86ecac 100644
--- a/TestON/tests/SCPF/SCPFflowTp1g/SCPFflowTp1g.py
+++ b/TestON/tests/SCPF/SCPFflowTp1g/SCPFflowTp1g.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# ScaleOutTemplate -> flowTP
#
# CASE1 starts number of nodes specified in param file
@@ -40,24 +39,24 @@
from tests.dependencies.ONOSSetup import ONOSSetup
main.testSetUp = ONOSSetup()
except ImportError:
- main.log.error("ONOSSetup not found. exiting the test")
+ main.log.error( "ONOSSetup not found. exiting the test" )
main.cleanAndExit()
main.testSetUp.envSetupDescription()
try:
- #Load values from params file
+ # Load values from params file
cellName = main.params[ 'ENV' ][ 'cellName' ]
main.apps = main.params[ 'ENV' ][ 'cellApps' ]
BENCHUser = main.params[ 'BENCH' ][ 'user' ]
BENCHIp = main.params[ 'BENCH' ][ 'ip1' ]
- main.scale = ( main.params[ 'SCALE' ] ).split( "," )
+ main.scale = ( main.params[ 'SCALE' ] ).split( "," )
main.flowRuleCfg = main.params[ 'CFG' ][ 'flowRule' ]
main.neighbor = ( main.params[ 'TEST' ][ 'neighbors' ] ).split( "," )
main.nullProviderCfg = main.params[ 'CFG' ][ 'nullProvider' ]
isFlowObj = main.params[ 'TEST' ][ 'flowObj' ] == "True"
if isFlowObj:
- resultFile = main.params[ 'TEST' ][ 'flowObjResultFile' ]
+ resultFile = main.params[ 'TEST' ][ 'flowObjResultFile' ]
else:
- resultFile = main.params[ 'TEST' ][ 'flowResultFile' ]
+ resultFile = main.params[ 'TEST' ][ 'flowResultFile' ]
stepResult = main.testSetUp.envSetup()
resultsDB = open( str( resultFile ), "w+" )
resultsDB.close()
@@ -110,13 +109,13 @@
main.step( "\tNEIGHBORS:\t" + neighbors )
main.log.info( "=============================================================" )
main.log.info( "=============================================================" )
- #write file to configure nil link
+ # write file to configure nil link
ipCSV = ""
- for i in range ( main.Cluster.maxCtrls ):
+ for i in range( main.Cluster.maxCtrls ):
tempstr = "ip" + str( i + 1 )
ipCSV += main.params[ 'CTRL' ][ tempstr ]
if i + 1 < main.Cluster.maxCtrls:
- ipCSV +=","
+ ipCSV += ","
main.ONOSbench.onosCfgSet( main.Cluster.active( 0 ).ipAddress,
main.flowRuleCfg,
@@ -142,51 +141,51 @@
main.ONOSbench.handle.expect( ":~" )
time.sleep( 5 )
main.ONOSbench.handle.sendline( "onos $OC1 roles " )
- main.ONOSbench.handle.expect ( ":~" )
+ main.ONOSbench.handle.expect( ":~" )
main.log.info( "switch masterships:" + str( main.ONOSbench.handle.before ) )
break
time.sleep( 5 )
- #divide flows/flowObjectives
+ # divide flows/flowObjectives
if isFlowObj:
- toInstall = "FlowObjectives"
- installCount = int( main.params[ 'TEST' ][ 'flowObjectives' ] )
- ifFailed = "FLOW_OBJ_TESTER.PY FAILURE"
- resultFile = main.params[ 'TEST' ][ 'flowObjResultFile' ]
+ toInstall = "FlowObjectives"
+ installCount = int( main.params[ 'TEST' ][ 'flowObjectives' ] )
+ ifFailed = "FLOW_OBJ_TESTER.PY FAILURE"
+ resultFile = main.params[ 'TEST' ][ 'flowObjResultFile' ]
else:
- toInstall = "Flows"
- installCount = int( main.params[ 'TEST' ][ 'flows' ] )
- ifFailed = "FLOW_TESTER.PY FAILURE"
- resultFile = main.params[ 'TEST' ][ 'flowResultFile' ]
+ toInstall = "Flows"
+ installCount = int( main.params[ 'TEST' ][ 'flows' ] )
+ ifFailed = "FLOW_TESTER.PY FAILURE"
+ resultFile = main.params[ 'TEST' ][ 'flowResultFile' ]
main.log.info( toInstall + " Target = " + str( installCount ) )
- installCountPerSwitch = ( installCount *max( int ( neighbors ) + 1, int( servers ) ) )/( ( int( neighbors ) + 1 )*int( servers )*( switches ) )
+ installCountPerSwitch = ( installCount * max( int( neighbors ) + 1, int( servers ) ) ) / ( ( int( neighbors ) + 1 ) * int( servers ) * ( switches ) )
main.log.info( toInstall + " per switch = " + str( installCountPerSwitch ) )
- #build list of servers in "$OC1, $OC2...." format
+ # build list of servers in "$OC1, $OC2...." format
serverEnvVars = ""
for i in range( int( servers ) ):
serverEnvVars += ( "-s " + main.Cluster.active( i ).ipAddress + " " )
- data = [ [ "" ]*int( servers ) ]*int( sampleSize )
- maxes = [ "" ]*int( sampleSize )
+ data = [ [ "" ] * int( servers ) ] * int( sampleSize )
+ maxes = [ "" ] * int( sampleSize )
flowCMD = "python3 " + homeDir + "/onos/tools/test/bin/"
if isFlowObj:
- flowCMD += testCMD[ 2 ] + " " + str( installCountPerSwitch ) + " " + testCMD[ 1 ]
- flowCMD += " " + neighbors + " " + testCMD[ 3 ] + " " + str( flowObjType ) + " " + str( serverEnvVars ) + "-j"
+ flowCMD += testCMD[ 2 ] + " " + str( installCountPerSwitch ) + " " + testCMD[ 1 ]
+ flowCMD += " " + neighbors + " " + testCMD[ 3 ] + " " + str( flowObjType ) + " " + str( serverEnvVars ) + "-j"
else:
- flowCMD += testCMD[ 0 ] + " " + str( installCountPerSwitch ) + " " + testCMD[ 1 ]
- flowCMD += " " + neighbors + " " + str( serverEnvVars ) + "-j"
+ flowCMD += testCMD[ 0 ] + " " + str( installCountPerSwitch ) + " " + testCMD[ 1 ]
+ flowCMD += " " + neighbors + " " + str( serverEnvVars ) + "-j"
main.log.info( flowCMD )
- #time.sleep( 60 )
+ # 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.log.info( "====== Test run: " + str( test - warmUp + 1 ) + " ======" )
main.ONOSbench.handle.sendline( flowCMD )
main.ONOSbench.handle.expect( ":~" )
@@ -205,17 +204,17 @@
main.log.info( main.ONOSbench.handle.before )
break
- result = [ "" ]*( main.Cluster.numCtrls )
+ result = [ "" ] * ( main.Cluster.numCtrls )
rawResult = rawResult.splitlines()
for node in range( main.Cluster.numCtrls ):
for line in rawResult:
- #print( "line: " + line )
+ # print( "line: " + line )
if main.Cluster.active( node ).ipAddress in line and "server" in line:
temp = line.split( " " )
for word in temp:
- #print ( "word: " + word )
+ # print ( "word: " + word )
if "elapsed" in repr( word ):
index = temp.index( word ) + 1
myParsed = ( temp[ index ] ).replace( ",", "" )
@@ -231,11 +230,11 @@
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)" )
+ 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
+ data[ test - warmUp ] = result
# wait for flows = 0
for checkCount in range( 0, 5 ):
@@ -257,7 +256,6 @@
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)" )
@@ -285,7 +283,7 @@
main.log.info( "Standard Deviation of max values: " + str( stdOfMaxes ) )
print( "\n\n" )
- avgTP = int( installCount ) / avgOfMaxes #result in kflows/second
+ avgTP = int( installCount ) / avgOfMaxes # result in kflows/second
tp = []
for i in maxes:
@@ -308,4 +306,4 @@
main.log.report( "Result line to file: " + resultString )
- main.ONOSbench.logReport( main.Cluster.active( 0 ).ipAddress, [ "ERROR", "WARNING", "EXCEPT" ], outputMode="d" )
\ No newline at end of file
+ main.ONOSbench.logReport( main.Cluster.active( 0 ).ipAddress, [ "ERROR", "WARNING", "EXCEPT" ], outputMode="d" )
diff --git a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
index 4298c3d..b742960 100644
--- a/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
+++ b/TestON/tests/SCPF/SCPFhostLat/SCPFhostLat.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
SCPFhostLat
This test will test the host found latency.
@@ -213,7 +212,7 @@
caseResult = main.FALSE
resultFile.close()
# Compare the timestemps, and get the lowest one.
- temp = 0;
+ temp = 0
# Get host event timestamps from each nodes
for ctrl in main.Cluster.active():
metricsResult = json.loads( ctrl.CLI.topologyEventsMetrics() )
@@ -229,7 +228,7 @@
# gethost to remove
gethost = main.Cluster.active( 0 ).REST.hosts()
HosttoRemove = []
- HosttoRemove.append( json.loads( gethost[ 1:len( gethost )-1 ] ).get( 'id' ) )
+ HosttoRemove.append( json.loads( gethost[ 1:len( gethost ) - 1 ] ).get( 'id' ) )
main.Cluster.active( 0 ).CLI.removeHost( HosttoRemove )
main.log.info( "Result List: {}".format( addingHostTime ) )
@@ -260,7 +259,7 @@
assertion = main.TRUE
utilities.assert_equals( expect=main.TRUE, actual=assertion,
- onpass='Host latency test successful',
- onfail='Host latency test failed' )
+ onpass='Host latency test successful',
+ onfail='Host latency test failed' )
main.Utils.mininetCleanup( main.Mininet1 )
diff --git a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
index 97f6039..7be0cc3 100644
--- a/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
+++ b/TestON/tests/SCPF/SCPFintentEventTp/SCPFintentEventTp.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,25 +18,24 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
-'''
+"""
SCPFintentEventTp
- Use intentperf app to generate a lot of intent install and withdraw events
- Test will run with 1,3,5,7 nodes, and with all neighbors
- Test will run 400 seconds and grep the overall rate from intent-perf summary
yunpeng@onlab.us
-'''
-
+"""
import time
class SCPFintentEventTp:
+
def __init__( self ):
self.default = ''
def CASE0( self, main ):
- '''
+ """
- GIT
- BUILDING ONOS
Pull specific ONOS branch, then Build ONOS ono ONOS Bench.
@@ -44,7 +43,7 @@
test env. We want Jenkins jobs to pull&build for flexibility to handle
different versions of ONOS.
- Construct tests variables
- '''
+ """
try:
from tests.dependencies.ONOSSetup import ONOSSetup
main.testSetUp = ONOSSetup()
@@ -120,6 +119,7 @@
# balanceMasters
main.Cluster.active( 0 ).CLI.balanceMasters()
time.sleep( main.startUpSleep )
+
def CASE2( self, main ):
import numpy
@@ -158,7 +158,7 @@
resultString = "'" + main.commit + "',"
resultString += "'1gig',"
resultString += str( main.Cluster.numCtrls ) + ","
- resultString += "'baremetal" + str( nodes + 1 ) + "',"
+ resultString += "'baremetal" + str(nodes + 1) + "',"
resultString += neighbors + ","
resultString += result[ main.Cluster.active( nodes ).ipAddress ] + ","
resultString += str( 0 ) + "\n" # no stddev
diff --git a/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py b/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
index 78a2b34..44e0b6e 100644
--- a/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
+++ b/TestON/tests/SCPF/SCPFintentInstallWithdrawLat/SCPFintentInstallWithdrawLat.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,23 +18,23 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
SCPFintentInstallWithdrawLat:
- Test the latency of intent installed and withdrawn
- Use Push-test-intents command to push intents
- Use Null provider with 7 devices and linear topology
- Always push intents between 1/6 and 7/5
- - The batch size is defined in parm file. ( default 1,100,1000)
+ - The batch size is defined in parm file. ( default 1,100,1000 )
yunpeng@onlab.us
"""
class SCPFintentInstallWithdrawLat:
+
def __init__( self ):
self.default = ''
def CASE0( self, main ):
- '''
+ """
- GIT
- BUILDING ONOS
Pull specific ONOS branch, then Build ONOS ono ONOS Bench.
@@ -42,8 +42,7 @@
test env. We want Jenkins jobs to pull&build for flexibility to handle
different versions of ONOS.
- Construct tests variables
- '''
-
+ """
try:
from tests.dependencies.ONOSSetup import ONOSSetup
main.testSetUp = ONOSSetup()
@@ -97,6 +96,7 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
main.commit = main.commit.split( " " )[ 1 ]
+
def CASE1( self, main ):
# Clean up test environment and set up
import time
@@ -156,7 +156,7 @@
options="-i",
timeout=main.timeout,
getResponse=True )
- if type( installResult ) is str:
+ if isinstance( installResult, str ):
if "Failure" in installResult:
main.log.error( "Install Intents failure, ignore this iteration." )
if validrun < main.warmUp:
@@ -195,7 +195,7 @@
timeout=main.timeout,
getResponse=True )
- if type( withdrawResult ) is str:
+ if isinstance( withdrawResult, str ):
if "Failure" in withdrawResult:
main.log.error( "withdraw Intents failure, ignore this iteration." )
if validrun < main.warmUp:
@@ -238,8 +238,8 @@
main.log.report( "Install average: {} std: {}".format( installave, installstd ) )
main.log.report( "Withdraw average: {} std: {}".format( withdrawave, withdrawstd ) )
# write result to database file
- if not ( numpy.isnan( installave ) or numpy.isnan( installstd ) or\
- numpy.isnan( withdrawstd ) or numpy.isnan( withdrawave ) ):
+ if not ( numpy.isnan( installave ) or numpy.isnan( installstd ) or
+ numpy.isnan( withdrawstd ) or numpy.isnan( withdrawave ) ):
databaseString = "'" + main.commit + "',"
databaseString += str( main.Cluster.numCtrls ) + ","
databaseString += str( batchSize ) + ","
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
index 285e12d..41a3408 100644
--- a/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
+++ b/TestON/tests/SCPF/SCPFintentRerouteLat/SCPFintentRerouteLat.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# SCPFintentRerouteLat
"""
SCPFintentRerouteLat
@@ -26,24 +25,23 @@
- Test Algorithm:
1. Start Null Provider reroute Topology
2. Using Push-test-intents to push batch size intents from switch 1 to switch 7
- 3. Cut the link between switch 3 and switch 4 (the path will reroute to switch 8)
+ 3. Cut the link between switch 3 and switch 4 ( the path will reroute to switch 8 )
4. Get the topology time stamp
- 5. Get Intent reroute(Installed) time stamp from each nodes
+ 5. Get Intent reroute( Installed ) time stamp from each nodes
6. Use the latest intent time stamp subtract topology time stamp
- This test will run 5 warm up by default, warm up iteration can be setup in Param file
- The intent batch size will default set to 1, 100, and 1000, also can be set in Param file
- The unit of the latency result is milliseconds
"""
-
-
class SCPFintentRerouteLat:
+
def __init__( self ):
self.default = ''
def CASE0( self, main ):
import imp
import os
- '''
+ """
- GIT
- BUILDING ONOS
Pull specific ONOS branch, then Build ONOS ono ONOS Bench.
@@ -51,7 +49,7 @@
test env. We want Jenkins jobs to pull&build for flexibility to handle
different versions of ONOS.
- Construct tests variables
- '''
+ """
try:
from tests.dependencies.ONOSSetup import ONOSSetup
main.testSetUp = ONOSSetup()
@@ -115,11 +113,10 @@
main.testSetUp.evnSetupConclusion( stepResult )
main.commit = main.commit.split( " " )[ 1 ]
-
def CASE1( self, main ):
- '''
+ """
clean up test environment and set up
- '''
+ """
import time
main.maxNumBatch = 0
@@ -239,7 +236,8 @@
main.startLine[ i ] = timestamp
main.log.info( "Timestamp of last LINK_REMOVED event on node {} is {}".format( i + 1,
main.startLine[ i ] ) )
- if skip: continue
+ if skip:
+ continue
# calculate values
topologyTimestamps = main.intentRerouteLatFuncs.getTopologyTimestamps( main )
diff --git a/TestON/tests/SCPF/SCPFintentRerouteLat/dependencies/intentRerouteLatFuncs.py b/TestON/tests/SCPF/SCPFintentRerouteLat/dependencies/intentRerouteLatFuncs.py
index d9d0271..d91f09e 100644
--- a/TestON/tests/SCPF/SCPFintentRerouteLat/dependencies/intentRerouteLatFuncs.py
+++ b/TestON/tests/SCPF/SCPFintentRerouteLat/dependencies/intentRerouteLatFuncs.py
@@ -1,37 +1,39 @@
-'''
+"""
The functions for intentRerouteLat
-'''
+"""
import numpy
import time
import json
+
def _init_( self ):
self.default = ''
+
def sanityCheck( main, linkNumExpected, flowNumExpected, intentNumExpected ):
- '''
+ """
Sanity check on numbers of links, flows and intents in ONOS
- '''
+ """
attemps = 0
main.verify = main.FALSE
linkNum = 0
flowNum = 0
intentNum = 0
while attemps <= main.verifyAttempts:
- time.sleep(main.verifySleep)
+ time.sleep( main.verifySleep )
summary = json.loads( main.Cluster.active( 0 ).CLI.summary( timeout=main.timeout ) )
- linkNum = summary.get("links")
- flowNum = summary.get("flows")
- intentNum = summary.get("intents")
+ linkNum = summary.get( "links" )
+ flowNum = summary.get( "flows" )
+ intentNum = summary.get( "intents" )
if linkNum == linkNumExpected and flowNum == flowNumExpected and intentNum == intentNumExpected:
- main.log.info("links: {}, flows: {}, intents: {}".format(linkNum, flowNum, intentNum))
+ main.log.info( "links: {}, flows: {}, intents: {}".format( linkNum, flowNum, intentNum ) )
main.verify = main.TRUE
break
attemps += 1
if not main.verify:
- main.log.warn("Links or flows or intents number not as expected")
- main.log.warn("links: {}, flows: {}, intents: {}".format(linkNum, flowNum, intentNum))
+ main.log.warn( "Links or flows or intents number not as expected" )
+ main.log.warn( "links: {}, flows: {}, intents: {}".format( linkNum, flowNum, intentNum ) )
# bring back topology
bringBackTopology( main )
if main.validRun >= main.warmUp:
@@ -39,6 +41,7 @@
else:
main.validRun += 1
+
def bringBackTopology( main ):
main.log.info( "Bring back topology " )
main.Cluster.active( 0 ).CLI.pushTestIntents( main.ingress,
@@ -46,20 +49,20 @@
main.batchSize,
offset=1,
options="-w",
- timeout=main.timeout)
+ timeout=main.timeout )
main.Cluster.active( 0 ).CLI.purgeWithdrawnIntents()
main.Cluster.active( 0 ).CLI.setCfg( main.nullProviderCfg,
"deviceCount",
- value=0)
+ value=0 )
main.Cluster.active( 0 ).CLI.setCfg( main.nullProviderCfg,
"enabled",
- value="false")
+ value="false" )
main.Cluster.active( 0 ).CLI.setCfg( main.nullProviderCfg,
"deviceCount",
- value=main.deviceCount)
+ value=main.deviceCount )
main.Cluster.active( 0 ).CLI.setCfg( main.nullProviderCfg,
"enabled",
- value="true")
+ value="true" )
main.Cluster.active( 0 ).CLI.balanceMasters()
time.sleep( main.setMasterSleep )
if main.Cluster.numCtrls > 1:
@@ -69,10 +72,11 @@
main.Cluster.active( 0 ).ipAddress )
time.sleep( main.setMasterSleep )
+
def getLogNum( main, nodeId ):
- '''
+ """
Return the number of karaf log files
- '''
+ """
try:
logNameList = main.ONOSbench.listLog( main.Cluster.active( nodeId ).ipAddress )
assert logNameList is not None
@@ -81,13 +85,14 @@
return 2
return 1
except AssertionError:
- main.log.error("There is no karaf log")
+ main.log.error( "There is no karaf log" )
return -1
+
def getTopologyTimestamps( main ):
- '''
+ """
Get timestamps for the last topology events on all cluster nodes
- '''
+ """
timestamps = []
for i in range( main.Cluster.numCtrls ):
# Search for last topology event in karaf log
@@ -99,7 +104,7 @@
main.log.error( "Error when trying to get topology event timestamp" )
return main.ERROR
try:
- timestampField = lines[0].split( "creationTime=" )
+ timestampField = lines[ 0 ].split( "creationTime=" )
timestamp = timestampField[ 1 ].split( "," )
timestamp = int( timestamp[ 0 ] )
timestamps.append( timestamp )
@@ -108,10 +113,11 @@
return main.ERROR
return timestamps
+
def getIntentTimestamps( main ):
- '''
+ """
Get timestamps for all intent keys on all cluster nodes
- '''
+ """
timestamps = {}
for i in range( main.Cluster.numCtrls ):
# Search for intent INSTALLED event in karaf log
@@ -128,7 +134,7 @@
keyField = line.split( "key=" )
key = keyField[ 1 ].split( "," )
key = key[ 0 ]
- if not key in timestamps.keys():
+ if key not in timestamps.keys():
timestamps[ key ] = []
# Get timestamp
timestampField = line.split( "time = " )
@@ -140,10 +146,11 @@
return main.ERROR
return timestamps
+
def calculateLatency( main, topologyTimestamps, intentTimestamps ):
- '''
+ """
Calculate reroute latency values using timestamps
- '''
+ """
topologyTimestamp = numpy.min( topologyTimestamps )
firstInstalledLatency = {}
lastInstalledLatency = {}
diff --git a/TestON/tests/SCPF/SCPFmastershipFailoverLat/SCPFmastershipFailoverLat.py b/TestON/tests/SCPF/SCPFmastershipFailoverLat/SCPFmastershipFailoverLat.py
index ecbf5cd..0a99c41 100644
--- a/TestON/tests/SCPF/SCPFmastershipFailoverLat/SCPFmastershipFailoverLat.py
+++ b/TestON/tests/SCPF/SCPFmastershipFailoverLat/SCPFmastershipFailoverLat.py
@@ -1,5 +1,5 @@
"""
-Copyright 2017 Open Networking Foundation (ONF)
+Copyright 2017 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,15 +18,15 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
class SCPFmastershipFailoverLat:
+
def __init__( self ):
self.default = ''
def CASE0( self, main ):
import os
import imp
- '''
+ """
- GIT
- BUILDING ONOS
Pull specific ONOS branch, then Build ONOS ono ONOS Bench.
@@ -34,7 +34,7 @@
test env. We want Jenkins jobs to pull&build for flexibility to handle
different versions of ONOS.
- Construct tests variables
- '''
+ """
try:
from tests.dependencies.ONOSSetup import ONOSSetup
main.testSetUp = ONOSSetup()
@@ -79,8 +79,6 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
-
-
def CASE1( self, main ):
# Clean up test environment and set up
import time
@@ -110,11 +108,10 @@
onpass="Mininet was set up correctly.",
onfail="Mininet was NOT set up correctly." )
-
def CASE2( self, main ):
"""
Kill ONOS node, and measure the latency for INSTANCE_DEACTIVATED, MASTER_CHANGED, and role request
- (tshark time), then bring the node back up.
+ ( tshark time ), then bring the node back up.
"""
import time
import datetime
@@ -123,14 +120,17 @@
main.HA = HA()
- main.latencyData = { 'kill_to_deactivation' : [],
- 'deactivation_to_role_request' : [] }
+ main.latencyData = { 'kill_to_deactivation': [],
+ 'deactivation_to_role_request': [] }
main.failCounter = 0
passingResult = True
criticalError = False
- main.step( "Gathering data starting with " + str( main.warmUp ) + " warm ups and a sample size of " + str( main.sampleSize ) )
+ main.step( "Gathering data starting with "
+ + str( main.warmUp )
+ + " warm ups and a sample size of "
+ + str( main.sampleSize ) )
for iteration in range( 0, main.sampleSize + main.warmUp ):
@@ -185,10 +185,12 @@
eventOutput = main.Cluster.active( CLInum ).CLI.events( args='-a' ).split( "\r\n" )
for line in reversed( eventOutput ):
if "INSTANCE_DEACTIVATED" in line and len( instanceDeactivatedLats ) == CLInum:
- deactivateTime = float( datetime.datetime.strptime( line.split()[ 0 ], "%Y-%m-%dT%H:%M:%S.%f" ).strftime( '%s.%f' ) ) * 1000.0
+ deactivateTime = float( datetime.datetime.strptime(
+ line.split()[ 0 ], "%Y-%m-%dT%H:%M:%S.%f" ).strftime( '%s.%f' ) ) * 1000.0
instanceDeactivatedLats.append( deactivateTime - time1 )
elif "MASTER_CHANGED" in line and len( masterChangedLats ) == CLInum:
- changedTime = float( datetime.datetime.strptime( line.split()[ 0 ], "%Y-%m-%dT%H:%M:%S.%f" ).strftime( '%s.%f' ) ) * 1000.0
+ changedTime = float( datetime.datetime.strptime(
+ line.split()[ 0 ], "%Y-%m-%dT%H:%M:%S.%f" ).strftime( '%s.%f' ) ) * 1000.0
masterChangedLats.append( changedTime - time1 )
if len( instanceDeactivatedLats ) > CLInum and len( masterChangedLats ) > CLInum:
break
@@ -228,9 +230,10 @@
if eventLatCheck and tsharkLatCheck and validDataCheck:
main.log.info( "Saving data..." )
- main.latencyData[ 'kill_to_deactivation' ].append( instanceDeactivated )
- main.latencyData[ 'deactivation_to_role_request' ].append( roleRequestLat - instanceDeactivated )
-
+ main.latencyData[ 'kill_to_deactivation' ]\
+ .append( instanceDeactivated )
+ main.latencyData[ 'deactivation_to_role_request' ]\
+ .append( roleRequestLat - instanceDeactivated )
# Restart ONOS node
main.log.info( "Restart ONOS node " + strNodeNumToKill + " and checking status of restart." )
@@ -279,24 +282,28 @@
main.failCounter += 1
main.log.warn( "Iteration failed. Failure count: " + str( main.failCounter ) )
if float( main.failCounter ) / float( main.sampleSize ) >= main.failPercent or criticalError:
- main.log.error( str( main.failPercent * 100 ) + "% or more of data is invalid, or a critical error has occurred." )
+ main.log.error( str( main.failPercent * 100 )
+ + "% or more of data is invalid, or a critical error has occurred." )
passingResult = False
break
utilities.assert_equals( expect=True, actual=passingResult,
- onpass="Node scaling " + str( main.Cluster.numCtrls ) + " data gathering was successful.",
- onfail="Node scaling " + str( main.Cluster.numCtrls ) + " data gathering FAILED. Stopping test.")
+ onpass="Node scaling "
+ + str( main.Cluster.numCtrls )
+ + " data gathering was successful.",
+ onfail="Node scaling "
+ + str( main.Cluster.numCtrls )
+ + " data gathering FAILED. Stopping test." )
if not passingResult:
main.cleanAndExit()
-
def CASE3( self, main ):
"""
Write results to database file.
Omit this case if you don't want to write to database.
"""
import numpy
- result = { 'avg' : {}, 'stddev' : {} }
+ result = { 'avg': {}, 'stddev': {} }
for i in main.latencyData:
result[ 'avg' ][ i ] = numpy.average( main.latencyData[ i ] )
@@ -305,7 +312,7 @@
main.log.info( "result: " + str( result ) )
with open( main.dbFileName, "a" ) as dbFile:
strToWrite = str( main.Cluster.numCtrls ) + ",'baremetal1'"
- strToWrite += ",'" + main.commit.split()[ 1 ] + "'"
+ strToWrite += ",'" + main.commit.split()[1] + "'"
for i in result:
for j in result[ i ]:
strToWrite += "," + str( result[ i ][ j ] )
diff --git a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
index 0c18564..180d860 100644
--- a/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
+++ b/TestON/tests/SCPF/SCPFportLat/SCPFportLat.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,23 +18,23 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
-'''
+"""
SCPFportLat test
Test latency for port status change
Up & Down:
PortStatus --- Device --- Link --- Graph
yunpeng@onlab.us
-'''
+"""
class SCPFportLat:
+
def __init__( self ):
self.default = ''
def CASE0( self, main ):
import os
import imp
- '''
+ """
- GIT
- BUILDING ONOS
Pull specific ONOS branch, then Build ONOS ono ONOS Bench.
@@ -42,7 +42,7 @@
test env. We want Jenkins jobs to pull&build for flexibility to handle
different versions of ONOS.
- Construct tests variables
- '''
+ """
try:
from tests.dependencies.ONOSSetup import ONOSSetup
main.testSetUp = ONOSSetup()
@@ -87,9 +87,9 @@
resultsDB.close()
main.portFunc = imp.load_source( main.dependencyFunc,
- main.dependencyPath +
- main.dependencyFunc +
- ".py" )
+ main.dependencyPath +
+ main.dependencyFunc +
+ ".py" )
except Exception as e:
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
@@ -111,9 +111,9 @@
time.sleep( 1 )
main.log.info( "Copy topology file to Mininet" )
main.ONOSbench.copyMininetFile( main.topoName,
- main.dependencyPath,
- main.Mininet1.user_name,
- main.Mininet1.ip_address )
+ main.dependencyPath,
+ main.Mininet1.user_name,
+ main.Mininet1.ip_address )
try:
from tests.dependencies.utils import Utils
except ImportError:
@@ -140,7 +140,7 @@
import time
import numpy
# dictionary for each node and each timestamps
- resultDict = { 'up' : {}, 'down' : {} }
+ resultDict = { 'up': {}, 'down': {} }
for d in resultDict:
for i in range( 1, main.Cluster.numCtrls + 1 ):
resultDict[ d ][ 'node' + str( i ) ] = {}
@@ -152,7 +152,7 @@
resultDict[ d ][ 'node' + str( i ) ][ 'LtoG' ] = []
for i in range( 0, main.sampleSize + main.warmUp ):
main.log.info( "==========================================" )
- main.log.info( "================iteration:{}==============".format( str ( i + 1 ) ) )
+ main.log.info( "================iteration:{}==============".format( str( i + 1 ) ) )
if i >= main.warmUp:
# Portdown iteration
main.portFunc.capturePortStatusPack( main,
@@ -185,7 +185,7 @@
True )
# Dictionary for result
- maxDict = {}
+ maxDict = {}
maxDict[ 'down' ] = {}
maxDict[ 'up' ] = {}
maxDict[ 'down' ][ 'max' ] = 0
diff --git a/TestON/tests/SCPF/SCPFportLat/dependencies/portFunc.py b/TestON/tests/SCPF/SCPFportLat/dependencies/portFunc.py
index f773da3..4c94193 100644
--- a/TestON/tests/SCPF/SCPFportLat/dependencies/portFunc.py
+++ b/TestON/tests/SCPF/SCPFportLat/dependencies/portFunc.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,15 +18,13 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
import time
import json
-'''
+"""
Warp function for SCPFportLat test
-'''
-
+"""
def capturePortStatusPack( main, deviceName, interface, portStatus, resultDict, warmup ):
- '''
+ """
Change device port status and use tshark to capture openflow port package
Args:
main: TestON class
@@ -36,10 +34,10 @@
resultDict: put result to dictionary
warmup: if warmup, ignore results
- '''
+ """
main.log.info( "Clean up tshark" )
with open( main.tsharkResultPath, "w" ) as tshark:
- tshark.write("")
+ tshark.write( "" )
main.log.info( "Starting tshark capture" )
main.ONOSbench.tsharkGrep( main.ofportStatus, main.tsharkResultPath )
time.sleep( main.measurementSleep )
@@ -55,7 +53,7 @@
main.log.info( "Capture result:" + resultText )
resultText = resultText.split( " " )
if len( resultText ) > 1:
- tsharkResultTime = int( float( resultText[1] ) * 1000.0 )
+ tsharkResultTime = int( float( resultText[ 1 ] ) * 1000.0 )
resultFile.close()
for i in range( 1, main.Cluster.numCtrls + 1 ):
main.log.info( "================================================" )
@@ -92,9 +90,9 @@
else:
# put result to dictionary
if not warmup:
- resultDict[ portStatus ][ 'node' + str(i) ]['EtoE'].append( EtoE )
- resultDict[ portStatus ][ 'node' + str(i) ]['PtoD'].append( PtoD )
- resultDict[ portStatus ][ 'node' + str(i) ]['DtoL'].append( DtoL )
- resultDict[ portStatus ][ 'node' + str(i) ]['LtoG'].append( LtoG )
+ resultDict[ portStatus ][ 'node' + str( i ) ][ 'EtoE' ].append( EtoE )
+ resultDict[ portStatus ][ 'node' + str( i ) ][ 'PtoD' ].append( PtoD )
+ resultDict[ portStatus ][ 'node' + str( i ) ][ 'DtoL' ].append( DtoL )
+ resultDict[ portStatus ][ 'node' + str( i ) ][ 'LtoG' ].append( LtoG )
else:
main.log.error( "Unexpected tshark output file" )
diff --git a/TestON/tests/SCPF/SCPFportLat/dependencies/topo-perf-2sw.py b/TestON/tests/SCPF/SCPFportLat/dependencies/topo-perf-2sw.py
index 828e44a..7efed0c 100644
--- a/TestON/tests/SCPF/SCPFportLat/dependencies/topo-perf-2sw.py
+++ b/TestON/tests/SCPF/SCPFportLat/dependencies/topo-perf-2sw.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,18 +18,18 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
-'''
+"""
Simple 2 switch topology for topologoy performance test
-'''
-
+"""
from mininet.topo import Topo
+
class MyTopo( Topo ):
- def __init__(self):
- Topo.__init__(self)
- s1 = self.addSwitch( "s1", dpid="0000000000000001")
- s2 = self.addSwitch( "s2", dpid="0000000000000002")
+
+ def __init__( self ):
+ Topo.__init__( self )
+ s1 = self.addSwitch( "s1", dpid="0000000000000001" )
+ s2 = self.addSwitch( "s2", dpid="0000000000000002" )
h1 = self.addHost( "h1" )
h2 = self.addHost( "h2" )
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
index 0ecee0b..d4740f4 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/SCPFscaleTopo.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,10 +18,10 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# Testing network scalability, this test suite scales up a network topology
# using mininet and verifies ONOS stability
+
class SCPFscaleTopo:
def __init__( self ):
@@ -81,19 +81,18 @@
main.homeDir = os.path.expanduser( '~' )
main.hostsData = {}
-
stepResult = main.testSetUp.envSetup()
- main.allinfo = {} # The dictionary to record all the data from karaf.log
+ main.allinfo = {} # The dictionary to record all the data from karaf.log
for i in range( 2 ):
- main.allinfo[ i ]={}
- for w in range ( 3 ):
+ main.allinfo[ i ] = {}
+ for w in range( 3 ):
# Totaltime: the time from the new switchConnection to its end
# swConnection: the time from the first new switchConnection to the last new switchConnection
# lastSwToLastRr: the time from the last new switchConnection to the last role request
# lastRrToLastTopology: the time form the last role request to the last topology
# disconnectRate: the rate that shows how many switch disconnect after connection
- main.allinfo[ i ][ 'info' + str( w ) ]= { 'totalTime': 0, 'swConnection': 0, 'lastSwToLastRr': 0, 'lastRrToLastTopology': 0, 'disconnectRate': 0 }
+ main.allinfo[ i ][ 'info' + str( w ) ] = { 'totalTime': 0, 'swConnection': 0, 'lastSwToLastRr': 0, 'lastRrToLastTopology': 0, 'disconnectRate': 0 }
main.dbFilePath = main.params[ 'DATABASE' ][ 'dbPath' ]
main.log.info( "Create Database file " + main.dbFilePath )
@@ -149,20 +148,20 @@
"""
Starting up torus topology
"""
-
main.case( "Starting up Mininet and verifying topology" )
main.caseExplanation = "Starting Mininet with a scalling topology and " +\
"comparing topology elements between Mininet and ONOS"
if main.topoScale:
main.currScale = main.topoScale.pop( 0 )
- else: main.log.error( "topology scale is empty" )
+ else:
+ main.log.error( "topology scale is empty" )
main.step( "Starting up TORUS %sx%s topology" % ( main.currScale, main.currScale ) )
main.log.info( "Constructing Mininet command" )
mnCmd = " mn --custom " + main.Mininet1.home + main.multiovs + \
" --switch ovsm --topo " + main.topoName + "," + main.currScale + "," + main.currScale
for ctrl in main.Cluster.runningNodes:
- mnCmd += " --controller remote,ip=" + ctrl.ipAddress
+ mnCmd += " --controller remote,ip=" + ctrl.ipAddress
stepResult = main.Mininet1.startNet( mnCmd=mnCmd )
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
@@ -226,7 +225,7 @@
main.step( "Comparing MN topology to ONOS topology" )
compareRetry = 0
while compareRetry < 3:
- #While loop for retry
+ # While loop for retry
devices = main.topoRelated.getAll( "devices" )
ports = main.topoRelated.getAll( "ports" )
links = main.topoRelated.getAll( "links" )
@@ -240,8 +239,8 @@
devices, ports )
currentLinksResult = main.topoRelated.compareBase( links, controller,
- main.Mininet1.compareLinks,
- [ mnSwitches, mnLinks ] )
+ main.Mininet1.compareLinks,
+ [ mnSwitches, mnLinks ] )
stepResult = stepResult and currentDevicesResult and currentLinksResult
if stepResult:
@@ -250,24 +249,24 @@
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass=" Topology match Mininet",
- onfail="ONOS Topology doesn't match Mininet")
+ onfail="ONOS Topology doesn't match Mininet" )
if stepResult:
if main.hostDiscover:
hostList = []
for i in range( 1, int( main.currScale ) + 1 ):
- for j in range( 1, int( main.currScale ) + 1) :
+ for j in range( 1, int( main.currScale ) + 1 ):
# Generate host list
- hoststr = "h" + str(i) + "x" + str(j)
- hostList.append(hoststr)
- for i in range( len(hostList) ):
- totalHost = main.topo.sendArpPackage( main, hostList[i] )
+ hoststr = "h" + str( i ) + "x" + str( j )
+ hostList.append( hoststr )
+ for i in range( len( hostList ) ):
+ totalHost = main.topo.sendArpPackage( main, hostList[ i ] )
time.sleep( main.hostDiscoverSleep )
if totalHost < 0:
# if totalHost less than 0 which means dependence function has exception.
main.log.info( "Error when discover host!" )
break
- if totalHost == int( main.currScale ) * int( main.currScale ):
+ if totalHost == int( main.currScale ) * int( main.currScale ):
main.log.info( "Discovered all hosts" )
stepResult = stepResult and main.TRUE
else:
@@ -276,18 +275,17 @@
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass=" Topology match Mininet",
- onfail="ONOS Topology doesn't match Mininet")
+ onfail="ONOS Topology doesn't match Mininet" )
main.log.info( "Finished this iteration, continue to scale next topology." )
else:
main.log.info( "Clean up and exit TestON. Finished this test." )
main.cleanAndExit()
def CASE100( self, main ):
- '''
+ """
Bring Down node 3
- '''
-
- main.case("Bring ONOS node 3 down: TORUS %sx%s" % (main.currScale, main.currScale))
+ """
+ main.case( "Bring ONOS node 3 down: TORUS %sx%s" % ( main.currScale, main.currScale ) )
main.caseExplanation = "Balance masters to make sure " +\
"each controller has some devices and " +\
"stop ONOS node 3 service. "
@@ -309,11 +307,10 @@
onfail="Failed to bring down node 3" )
def CASE200( self, main ):
- '''
+ """
Bring up onos node
- '''
-
- main.case("Bring ONOS node 3 up: TORUS %sx%s" % (main.currScale, main.currScale))
+ """
+ main.case( "Bring ONOS node 3 up: TORUS %sx%s" % ( main.currScale, main.currScale ) )
main.caseExplanation = "Bring node 3 back up and balance the masters"
ctrl = main.Cluster.runningNodes[ main.deadNode ]
node = main.deadNode + 1
@@ -330,15 +327,13 @@
onpass="Successfully brought up onos node %s" % node,
onfail="Failed to bring up onos node %s" % node )
-
- time.sleep(main.nodeSleep)
+ time.sleep( main.nodeSleep )
def CASE300( self, main ):
- '''
-
+ """
Balancing Masters
- '''
- time.sleep(main.balanceSleep)
+ """
+ time.sleep( main.balanceSleep )
main.step( "Balancing Masters" )
stepResult = main.FALSE
@@ -353,56 +348,56 @@
utilities.assert_equals( expect=main.TRUE,
actual=stepResult,
onpass="Balance masters was successfull",
- onfail="Failed to balance masters")
+ onfail="Failed to balance masters" )
time.sleep( main.balanceSleep )
def CASE1000( self, main ):
- '''
+ """
Report errors/warnings/exceptions
- '''
+ """
# Compare the slowest Node through total time of each node
slowestNode = 0
slowestTotalTime = 0
# Second capture
for i in range( 3 ):
# Calculate total time
- main.allinfo[ 1 ][ 'info' + str( i )][ 'totalTime' ] = main.scaleTopoFunction.getInfoFromLog( main,
- main.searchTerm[ 'start' ],
- 'first',
- main.searchTerm[ 'end' ],
- 'last',
- index=i,
- funcMode='TD' )
+ main.allinfo[ 1 ][ 'info' + str( i ) ][ 'totalTime' ] = main.scaleTopoFunction.getInfoFromLog( main,
+ main.searchTerm[ 'start' ],
+ 'first',
+ main.searchTerm[ 'end' ],
+ 'last',
+ index=i,
+ funcMode='TD' )
# Compare the total time
if main.allinfo[ 1 ][ 'info' + str( i ) ][ 'totalTime' ] > slowestTotalTime:
slowestTotalTime = main.allinfo[ 1 ][ 'info' + str( i ) ][ 'totalTime' ]
slowestNode = i
# Calculate switch connection time
- main.allinfo[ 1 ][ 'info' + str( i )][ 'swConnection' ] = main.scaleTopoFunction.getInfoFromLog( main,
- main.searchTerm[ 'start' ],
- 'first',
- main.searchTerm[ 'start' ],
- 'last',
- index=i,
- funcMode='TD' )
+ main.allinfo[ 1 ][ 'info' + str( i ) ][ 'swConnection' ] = main.scaleTopoFunction.getInfoFromLog( main,
+ main.searchTerm[ 'start' ],
+ 'first',
+ main.searchTerm[ 'start' ],
+ 'last',
+ index=i,
+ funcMode='TD' )
# Calculate the time from last switch connection to the last role request
- main.allinfo[ 1 ][ 'info' + str( i )][ 'lastSwToLastRr' ] = main.scaleTopoFunction.compareTimeDiffWithRoleRequest( main,
- main.searchTerm[ 'start' ],
- 'last',
- index=i )
+ main.allinfo[ 1 ][ 'info' + str( i ) ][ 'lastSwToLastRr' ] = main.scaleTopoFunction.compareTimeDiffWithRoleRequest( main,
+ main.searchTerm[ 'start' ],
+ 'last',
+ index=i )
# Calculate the time from the last role request to the last topology
- main.allinfo[ 1 ][ 'info' + str( i )][ 'lastRrToLastTopology' ] = main.scaleTopoFunction.compareTimeDiffWithRoleRequest( main,
- main.searchTerm[ 'end' ],
- 'last',
- index=i )
+ main.allinfo[ 1 ][ 'info' + str( i ) ][ 'lastRrToLastTopology' ] = main.scaleTopoFunction.compareTimeDiffWithRoleRequest( main,
+ main.searchTerm[ 'end' ],
+ 'last',
+ index=i )
# Calculate the disconnecti rate
- main.allinfo[ 1 ][ 'info' + str( i )][ 'disconnectRate' ] = main.scaleTopoFunction.getInfoFromLog( main,
- main.searchTerm[ 'Disconnect' ],
- 'num',
- main.searchTerm[ 'start' ],
- 'num',
- index=i,
- funcMode='DR' )
+ main.allinfo[ 1 ][ 'info' + str( i ) ][ 'disconnectRate' ] = main.scaleTopoFunction.getInfoFromLog( main,
+ main.searchTerm[ 'Disconnect' ],
+ 'num',
+ main.searchTerm[ 'start' ],
+ 'num',
+ index=i,
+ funcMode='DR' )
if ( main.allinfo[ 0 ] != main.allinfo[ 1 ] ):
main.log.error( "The results of two capture are different!" )
@@ -414,11 +409,11 @@
temp = str( main.currScale )
temp += ",'baremetal1'"
# put result from second capture into data base
- temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode )][ 'totalTime' ] )
- temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode )][ 'swConnection' ] )
- temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode )][ 'lastSwToLastRr' ] )
- temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode )][ 'lastRrToLastTopology' ] )
- temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode )][ 'disconnectRate' ] )
+ temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'totalTime' ] )
+ temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'swConnection' ] )
+ temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'lastSwToLastRr' ] )
+ temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'lastRrToLastTopology' ] )
+ temp += "," + str( "%.2f" % main.allinfo[ 1 ][ 'info' + str( slowestNode ) ][ 'disconnectRate' ] )
temp += "\n"
dbFile.write( temp )
else:
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/multiovs.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/multiovs.py
old mode 100755
new mode 100644
index 9849069..e15fe72
--- a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/multiovs.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/multiovs.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Multiple ovsdb OVS!!
@@ -32,7 +31,6 @@
delegated to the ovsdb instance.
"""
-
from mininet.net import Mininet
from mininet.node import Node, OVSSwitch
from mininet.node import OVSBridge
@@ -46,7 +44,9 @@
from itertools import groupby
from operator import attrgetter
+
class OVSDB( Node ):
+
"Namespace for an OVSDB instance"
privateDirs = [ '/etc/openvswitch',
@@ -70,7 +70,7 @@
info( '### Adding NAT for control and data networks'
' (use --nat flush=0 for data network)\n' )
cls.cnet = cnet
- cls.nat = cnet.addNAT( 'ovsdbnat0')
+ cls.nat = cnet.addNAT( 'ovsdbnat0' )
cnet.start()
info( '### Control network started\n' )
return cnet
@@ -155,6 +155,7 @@
class OVSSwitchNS( OVSSwitch ):
+
"OVS Switch in shared OVSNS namespace"
isSetup = False
@@ -162,7 +163,7 @@
@classmethod
def batchStartup( cls, switches ):
result = []
- for ovsdb, switchGroup in groupby( switches, attrgetter( 'ovsdb') ):
+ for ovsdb, switchGroup in groupby( switches, attrgetter( 'ovsdb' ) ):
switchGroup = list( switchGroup )
info( '(%s)' % ovsdb )
result += OVSSwitch.batchStartup( switchGroup, run=ovsdb.cmd )
@@ -171,7 +172,7 @@
@classmethod
def batchShutdown( cls, switches ):
result = []
- for ovsdb, switchGroup in groupby( switches, attrgetter( 'ovsdb') ):
+ for ovsdb, switchGroup in groupby( switches, attrgetter( 'ovsdb' ) ):
switchGroup = list( switchGroup )
info( '(%s)' % ovsdb )
for switch in switches:
@@ -214,7 +215,7 @@
# Delegate methods and initialize local vars
attrs = ( 'cmd', 'cmdPrint', 'sendCmd', 'waitOutput',
'monitor', 'write', 'read',
- 'pid', 'shell', 'stdout',)
+ 'pid', 'shell', 'stdout', )
for attr in attrs:
setattr( self, attr, getattr( ovsdb, attr ) )
self.defaultIntf().updateIP()
@@ -246,14 +247,14 @@
super( OVSSwitchNS, self ).terminate( *args, **kwargs )
else:
self.pid = None
- self.shell= None
+ self.shell = None
def defaultIntf( self ):
return self.ovsdb.defaultIntf()
def __init__( self, *args, **kwargs ):
"""n: number of OVS instances per OVSDB
- shell: run private shell/bash process? (False)
+ shell: run private shell/bash process? ( False )
If shell is shared/not private, cmd() and popen() are
delegated to the OVSDB instance, which is different than
regular OVSSwitch semantics!!"""
@@ -261,7 +262,9 @@
self.privateShell = kwargs.pop( 'shell', False )
super( OVSSwitchNS, self ).__init__( *args, **kwargs )
+
class OVSLinkNS( Link ):
+
"OVSLink that supports OVSSwitchNS"
def __init__( self, node1, node2, **kwargs ):
@@ -279,6 +282,7 @@
links = { 'ovs': OVSLinkNS }
+
def test():
"Test OVSNS switch"
setLogLevel( 'info' )
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/newFuncTopo.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/newFuncTopo.py
old mode 100755
new mode 100644
index 1f1c487..596ff2c
--- a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/newFuncTopo.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/newFuncTopo.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Custom topology for Mininet
"""
@@ -35,19 +34,23 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class VLANHost( Host ):
+
def config( self, vlan=100, **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ifconfig %s inet 0' % intf )
self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params[ 'ip' ] ) )
newName = '%s.%d' % ( intf, vlan )
intf.name = newName
self.nameToIntf[ newName ] = intf
return r
+
class IPv6Host( Host ):
+
def config( self, v6Addr='1000:1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
@@ -55,56 +58,59 @@
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class dualStackHost( Host ):
+
def config( self, v6Addr='2000:1/64', **params ):
r = super( Host, self ).config( **params )
intf = self.defaultIntf()
self.cmd( 'ip -6 addr add %s dev %s' % ( v6Addr, intf ) )
return r
+
class MyTopo( Topo ):
def __init__( self ):
# Initialize topology
Topo.__init__( self )
# Switch S5 Hosts
- host1=self.addHost( 'h1', ip='10.1.0.2/24' )
- host2=self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
- host3=self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
- #VLAN hosts
- host4=self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
- host5=self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host6=self.addHost( 'h6', ip='11.1.0.2/24' )
- host7=self.addHost( 'h7', ip='12.1.0.2/24' )
- #Multicast Sender
- host8=self.addHost( 'h8', ip='10.1.0.4/24' )
+ host1 = self.addHost( 'h1', ip='10.1.0.2/24' )
+ host2 = self.addHost( 'h2', cls=IPv6Host, v6Addr='1000::2/64' )
+ host3 = self.addHost( 'h3', ip='10.1.0.3/24', cls=dualStackHost, v6Addr='2000::2/64' )
+ # VLAN hosts
+ host4 = self.addHost( 'h4', ip='100.1.0.2/24', cls=VLANHost, vlan=100 )
+ host5 = self.addHost( 'h5', ip='200.1.0.2/24', cls=VLANHost, vlan=200 )
+ # VPN-1 and VPN-2 Hosts
+ host6 = self.addHost( 'h6', ip='11.1.0.2/24' )
+ host7 = self.addHost( 'h7', ip='12.1.0.2/24' )
+ # Multicast Sender
+ host8 = self.addHost( 'h8', ip='10.1.0.4/24' )
# Switch S6 Hosts
- host9=self.addHost( 'h9', ip='10.1.0.5/24' )
- host10=self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
- host11=self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
- #VLAN hosts
- host12=self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
- host13=self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host14=self.addHost( 'h14', ip='11.1.0.3/24' )
- host15=self.addHost( 'h15', ip='12.1.0.3/24' )
- #Multicast Receiver
- host16=self.addHost( 'h16', ip='10.1.0.7/24' )
+ host9 = self.addHost( 'h9', ip='10.1.0.5/24' )
+ host10 = self.addHost( 'h10', cls=IPv6Host, v6Addr='1000::3/64' )
+ host11 = self.addHost( 'h11', ip='10.1.0.6/24', cls=dualStackHost, v6Addr='2000::3/64' )
+ # VLAN hosts
+ host12 = self.addHost( 'h12', ip='100.1.0.3/24', cls=VLANHost, vlan=100 )
+ host13 = self.addHost( 'h13', ip='200.1.0.3/24', cls=VLANHost, vlan=200 )
+ # VPN-1 and VPN-2 Hosts
+ host14 = self.addHost( 'h14', ip='11.1.0.3/24' )
+ host15 = self.addHost( 'h15', ip='12.1.0.3/24' )
+ # Multicast Receiver
+ host16 = self.addHost( 'h16', ip='10.1.0.7/24' )
# Switch S7 Hosts
- host17=self.addHost( 'h17', ip='10.1.0.8/24' )
- host18=self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
- host19=self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
- #VLAN hosts
- host20=self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
- host21=self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
- #VPN-1 and VPN-2 Hosts
- host22=self.addHost( 'h22', ip='11.1.0.4/24' )
- host23=self.addHost( 'h23', ip='12.1.0.4/24' )
- #Multicast Receiver
- host24=self.addHost( 'h24', ip='10.1.0.10/24' )
+ host17 = self.addHost( 'h17', ip='10.1.0.8/24' )
+ host18 = self.addHost( 'h18', cls=IPv6Host, v6Addr='1000::4/64' )
+ host19 = self.addHost( 'h19', ip='10.1.0.9/24', cls=dualStackHost, v6Addr='2000::4/64' )
+ # VLAN hosts
+ host20 = self.addHost( 'h20', ip='100.1.0.4/24', cls=VLANHost, vlan=100 )
+ host21 = self.addHost( 'h21', ip='200.1.0.4/24', cls=VLANHost, vlan=200 )
+ # VPN-1 and VPN-2 Hosts
+ host22 = self.addHost( 'h22', ip='11.1.0.4/24' )
+ host23 = self.addHost( 'h23', ip='12.1.0.4/24' )
+ # Multicast Receiver
+ host24 = self.addHost( 'h24', ip='10.1.0.10/24' )
s1 = self.addSwitch( 's1' )
s2 = self.addSwitch( 's2' )
@@ -114,56 +120,57 @@
s6 = self.addSwitch( 's6' )
s7 = self.addSwitch( 's7' )
- self.addLink(s5,host1)
- self.addLink(s5,host2)
- self.addLink(s5,host3)
- self.addLink(s5,host4)
- self.addLink(s5,host5)
- self.addLink(s5,host6)
- self.addLink(s5,host7)
- self.addLink(s5,host8)
+ self.addLink( s5, host1 )
+ self.addLink( s5, host2 )
+ self.addLink( s5, host3 )
+ self.addLink( s5, host4 )
+ self.addLink( s5, host5 )
+ self.addLink( s5, host6 )
+ self.addLink( s5, host7 )
+ self.addLink( s5, host8 )
- self.addLink(s6,host9)
- self.addLink(s6,host10)
- self.addLink(s6,host11)
- self.addLink(s6,host12)
- self.addLink(s6,host13)
- self.addLink(s6,host14)
- self.addLink(s6,host15)
- self.addLink(s6,host16)
+ self.addLink( s6, host9 )
+ self.addLink( s6, host10 )
+ self.addLink( s6, host11 )
+ self.addLink( s6, host12 )
+ self.addLink( s6, host13 )
+ self.addLink( s6, host14 )
+ self.addLink( s6, host15 )
+ self.addLink( s6, host16 )
- self.addLink(s7,host17)
- self.addLink(s7,host18)
- self.addLink(s7,host19)
- self.addLink(s7,host20)
- self.addLink(s7,host21)
- self.addLink(s7,host22)
- self.addLink(s7,host23)
- self.addLink(s7,host24)
+ self.addLink( s7, host17 )
+ self.addLink( s7, host18 )
+ self.addLink( s7, host19 )
+ self.addLink( s7, host20 )
+ self.addLink( s7, host21 )
+ self.addLink( s7, host22 )
+ self.addLink( s7, host23 )
+ self.addLink( s7, host24 )
- self.addLink(s1,s2)
- self.addLink(s1,s3)
- self.addLink(s1,s4)
- self.addLink(s1,s5)
- self.addLink(s2,s3)
- self.addLink(s2,s5)
- self.addLink(s2,s6)
- self.addLink(s3,s4)
- self.addLink(s3,s6)
- self.addLink(s4,s7)
+ self.addLink( s1, s2 )
+ self.addLink( s1, s3 )
+ self.addLink( s1, s4 )
+ self.addLink( s1, s5 )
+ self.addLink( s2, s3 )
+ self.addLink( s2, s5 )
+ self.addLink( s2, s6 )
+ self.addLink( s3, s4 )
+ self.addLink( s3, s6 )
+ self.addLink( s4, s7 )
topos = { 'mytopo': ( lambda: MyTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = MyTopo()
- network = Mininet(topo=topo, autoSetMacs=True, controller=None)
+ network = Mininet( topo=topo, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/scaleTopoFunction.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/scaleTopoFunction.py
index ae30723..7620354 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/scaleTopoFunction.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/scaleTopoFunction.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Wrapper function for FuncTopo
Includes onosclidriver and mininetclidriver functions
@@ -27,13 +26,15 @@
import json
import re
+
def __init__( self ):
self.default = ''
+
def getTimestampFromString( main, targetString ):
- #Get time string from the target string
+ # Get time string from the target string
try:
- assert type( targetString ) is str
+ assert isinstance( targetString, str )
timeString = targetString.split( ' | ' )
timeString = timeString[ 0 ]
from datetime import datetime
@@ -53,10 +54,11 @@
main.log.error( "Got wrong string from log" )
return -1
+
def getRoleRequestTimeFromTshark( main ):
try:
main.log.info( "Get role request time" )
- with open(main.tsharkResultPath, "r" ) as resultFile:
+ with open( main.tsharkResultPath, "r" ) as resultFile:
resultText = resultFile.readlines()
# select the last role request string
roleRequestString = resultText[ len( resultText ) - 1 ]
@@ -64,18 +66,19 @@
# get timestamp from role request string
roleRequestTime = roleRequestString.split( " " )
resultFile.close()
- return float(roleRequestTime[1])
+ return float( roleRequestTime[ 1 ] )
except IndexError:
- main.log.error("Got wrong role request string from Tshark file")
+ main.log.error( "Got wrong role request string from Tshark file" )
return -1
-def compareTimeDiffWithRoleRequest(main, term, Mode, index=0 ):
- '''
+
+def compareTimeDiffWithRoleRequest( main, term, Mode, index=0 ):
+ """
Description:
Compare the time difference between the time of target term and the time of role request
Inclides onosclidriver functions
- '''
+ """
try:
termInfo = main.Cluster.active( index ).CLI.logSearch( mode=Mode, searchTerm=term )
termTime = getTimestampFromString( main, termInfo[ 0 ] )
@@ -91,37 +94,38 @@
main.writeData = -1
return -1
+
def getInfoFromLog( main, term1, mode1, term2, mode2, index=0, funcMode='TD' ):
- '''
+ """
Description:
Get needed informations of the search term from karaf.log
Includes onosclidriver functions
Function mode:
- TD (time difference):
+ TD ( time difference ):
Get time difference between start and end
Term1: startTerm
Term2: endTerm
- DR (disconnect rate):
+ DR ( disconnect rate ):
Get switch disconnect rate
Term1: disconnectTerm
Term2: connectTerm
- '''
+ """
try:
termInfo1 = main.Cluster.active( index ).CLI.logSearch( mode=mode1, searchTerm=term1 )
termInfo2 = main.Cluster.active( index ).CLI.logSearch( mode=mode2, searchTerm=term2 )
if funcMode == 'TD':
- startTime = getTimestampFromString( main, termInfo1[0] )
- endTime = getTimestampFromString ( main, termInfo2[0] )
+ startTime = getTimestampFromString( main, termInfo1[ 0 ] )
+ endTime = getTimestampFromString( main, termInfo2[ 0 ] )
if startTime == -1 or endTime == -1:
main.log.error( "Wrong Time!" )
main.writeData = -1
return -1
return endTime - startTime
if funcMode == 'DR':
- #In this mode, termInfo1 means the total number of switch disconnection and
- #termInfo2 means the total number of new switch connection
- #termInfo2 - termInfo1 means the actual real number of switch connection.
+ # In this mode, termInfo1 means the total number of switch disconnection and
+ # termInfo2 means the total number of new switch connection
+ # termInfo2 - termInfo1 means the actual real number of switch connection.
disconnection = int( termInfo1 ) * 1.0
expectConnection = int( main.currScale ) ** 2
realConnection = int( termInfo2 ) - int( termInfo1 )
@@ -136,6 +140,7 @@
main.writeData = -1
return -1
+
def testTopology( main, topoFile='', args='', mnCmd='', timeout=300, clean=True ):
"""
Description:
@@ -173,16 +178,16 @@
# Starts topology
startResult = startNewTopology( main, topoFile, args, mnCmd, timeout=timeout )
# onos needs time to see the links
- time.sleep(15)
+ time.sleep( 15 )
# Gets list of switches in mininet
- #assignSwitch( main )
+ # assignSwitch( main )
testTopoResult = startResult and topoObjectResult
-
return testTopoResult
+
def startNewTopology( main, topoFile='', args='', mnCmd='', timeout=900 ):
"""
Description:
@@ -215,14 +220,14 @@
main.log.info( main.topoName + ": Starting topology with '" +
mnCmd + "' Mininet command" )
-
result = main.Mininet1.startNet( topoFile=topoFile,
args=args,
mnCmd=mnCmd,
- timeout=timeout)
+ timeout=timeout )
return result
+
def stopMininet( main ):
"""
Stops current topology and execute mn -c basically triggers
@@ -235,9 +240,10 @@
stopResult = main.Mininet1.stopNet()
time.sleep( 30 )
if not stopResult:
- main.log.info( main.topoName + ": Did not stop Mininet topology" )
+ main.log.info( main.topoName + ": Did not stop Mininet topology" )
return stopResult
+
def compareTopo( main ):
"""
Compare topology( devices, links, ports, hosts ) between ONOS and
@@ -254,13 +260,14 @@
main.topoRelated = Topology()
return main.topoRelated.compareTopos( main.Mininet1 )
+
def assignSwitch( main ):
"""
Returns switch list using getSwitch in Mininet driver
"""
switchList = []
assignResult = main.TRUE
- switchList = main.Mininet1.getSwitch()
+ switchList = main.Mininet1.getSwitch()
assignResult = main.Mininet1.assignSwController( sw=switchList,
ip=main.Cluster.active( 0 ).ipAddress,
port=6633 )
@@ -274,6 +281,7 @@
return switchList
+
def connectivity( main, timeout=900, shortCircuit=True, acceptableFailed=20 ):
"""
Use fwd app and pingall to discover all the hosts
@@ -309,6 +317,7 @@
return pingResult
+
def getHostsData( main ):
"""
Use fwd app and pingall to discover all the hosts
@@ -369,6 +378,7 @@
return getDataResult
+
def reinstallOnos( main ):
"""
Description:
@@ -422,8 +432,4 @@
if cliResult != main.TRUE:
restartResult = main.FALSE
-
return restartResult
-
-
-
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/spine.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/spine.py
index 973385a..32c8419 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/spine.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/spine.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Custom topology for Mininet
Author: kelvin@onlab.us
@@ -45,7 +44,9 @@
totalSwitches = 0
totalEndSwitches = 0
totalHosts = 0
-endSwitchCount = 0 # total count of end switch in each row in gui
+endSwitchCount = 0 # total count of end switch in each row in gui
+
+
class spineTopo( Topo ):
def __init__( self, **opts ):
@@ -71,8 +72,8 @@
global endSwitchCount
endSwitchCount = e
- print "Creating topology with", s,"spine", l,"leaf", c,"core",\
- e,"end switches and",h,"host for each end switches"
+ print "Creating topology with", s, "spine", l, "leaf", c, "core",\
+ e, "end switches and", h, "host for each end switches"
self.addCore( c )
self.addSpine( s )
@@ -89,7 +90,6 @@
deviceData = self.createSwitchDict()
self.genCfgJson( deviceData )
-
def addCore( self, numSwitch ):
global totalSwitches
global coreSwitches
@@ -134,7 +134,6 @@
return host
-
def linkHosts( self, numHosts ):
global endSwitches
switches = sorted( endSwitches.values() )
@@ -143,7 +142,6 @@
for i in xrange( numHosts ):
self.addLink( sw, self.addEndHosts() )
-
def linkLayer( self, topLayer, botLayer ):
"""
Description:
@@ -156,7 +154,6 @@
layer below
botLater - Layer that is below the upper layer to be linked at
"""
-
topSwitches = sorted( topLayer.keys() )
botSwitches = sorted( botLayer.keys() )
@@ -164,7 +161,6 @@
for botSw in botSwitches:
self.addLink( topLayer.get( topSw ), botLayer.get( botSw ) )
-
def linkEndSwitch( self, numSwitch, leafLayer ):
global totalSwitches
global totalEndSwitches
@@ -182,7 +178,7 @@
self.addLink( leaf[ i ], endSw )
self.addLink( leaf[ i + 1 ], endSw )
break
- if i == ( len( leafSwitches ) - 1 ) and len( leafSwitches )%2:
+ if i == ( len( leafSwitches ) - 1 ) and len( leafSwitches ) % 2:
for j in xrange( numSwitch ):
self.addLink( leaf[ i ], self.addEnd() )
break
@@ -194,7 +190,7 @@
continue
if i == 1:
continue
- if i%2 == 0:
+ if i % 2 == 0:
for j in xrange( numSwitch ):
endSw = self.addEnd()
self.addLink( leaf[ i ], endSw )
@@ -206,11 +202,9 @@
configJson[ "devices" ] = deviceData
with open( 'spine.json', 'w+' ) as outfile:
json.dump( configJson, outfile )
- #cfgFile = open( "spine.json" , 'w+' )
- #cfgFile.write( configJson )
- #cfgFile.close()
-
-
+ # cfgFile = open( "spine.json" , 'w+' )
+ # cfgFile.write( configJson )
+ # cfgFile.close()
def createSwitchDict( self ):
global allSwitches
@@ -222,18 +216,18 @@
spineLong = -80
leafLong = -90
endLat = 30
- rowCount = 0 # count of end switches or rows
- colOffSet = 0 # off set for end switches; longitude
+ rowCount = 0 # count of end switches or rows
+ colOffSet = 0 # off set for end switches; longitude
- #for i in xrange( len( allSwitches ) ):
+ # for i in xrange( len( allSwitches ) ):
deviceList = []
deviceDict = {}
for sw in allSwitches:
tempSw = allSwitches.get( sw )
- uri = str( "{0:0>16}".format( str( hex( int( tempSw[ 1: ] ) )\
- ).split( "x" )[ 1 ] ) )
- mac = str( "{0:0>12}".format( str( hex( int( tempSw[ 1: ] ) )\
- ).split( "x" )[ 1 ] ) )
+ uri = str( "{0:0>16}".format( str( hex( int( tempSw[ 1: ] ) )
+ ).split( "x" )[ 1 ] ) )
+ mac = str( "{0:0>12}".format( str( hex( int( tempSw[ 1: ] ) )
+ ).split( "x" )[ 1 ] ) )
if "core" in sw:
latitude = 45
@@ -259,7 +253,7 @@
endLat -= 1
rowCount += 1
- tempItem = { "alias": allSwitches.get( sw ) ,
+ tempItem = { "alias": allSwitches.get( sw ),
"uri": "of:" + uri,
"mac": mac,
"annotations": { "name": sw,
@@ -269,21 +263,22 @@
deviceList.append( tempItem )
return deviceList
- #def createHostsJson( hostDict ):
+ # def createHostsJson( hostDict ):
topos = { 'spine': ( lambda s=2, l=3, c=1, e=5, h=1: spineTopo( s=s,
l=l,
c=c,
e=e,
- h=h) ) }
+ h=h ) ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = spineTopo()
- #if controller_ip == '':
- #controller_ip = '10.0.2.2';
+ # if controller_ip == '':
+ # controller_ip = '10.0.2.2';
# controller_ip = '127.0.0.1';
network = Mininet( topo=topo,
autoSetMacs=True,
@@ -294,5 +289,5 @@
if __name__ == '__main__':
setLogLevel( 'info' )
- #setLogLevel('debug')
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py
index c5c1f88..373ed2b 100644
--- a/TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py
+++ b/TestON/tests/SCPF/SCPFscaleTopo/dependencies/topo.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,15 +18,14 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
These functions can be used for topology comparisons
"""
-
import time
import os
import json
+
def sendArpPackage( main, hostList ):
import json
import time
@@ -35,10 +34,10 @@
return the total hosts number from Onos
"""
main.log.info( "Sending Arping package..." )
- if isinstance(hostList, list):
+ if isinstance( hostList, list ):
for h in hostList:
main.Mininet1.arping( srcHost=h, dstHost="10.0.0.1", output=main.FALSE, noResult=True )
- time.sleep(0.5)
+ time.sleep( 0.5 )
else:
main.Mininet1.arping( srcHost=hostList, dstHost="10.0.0.1", output=main.FALSE, noResult=True )
try:
@@ -46,8 +45,8 @@
summaryStr = json.loads( main.Cluster.active( 0 ).CLI.summary().encode() )
hostNum = summaryStr.get( 'hosts' )
- except (TypeError, ValueError):
- main.log.exception( " Object not as expected: {!r}".format( summaryStr) )
+ except ( TypeError, ValueError ):
+ main.log.exception( " Object not as expected: {!r}".format( summaryStr ) )
return -1
except Exception:
main.log.exception( self.name + ": Uncaught exception!" )
diff --git a/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py b/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
index 9ee512c..1633c44 100644
--- a/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
+++ b/TestON/tests/SCPF/SCPFscalingMaxIntents/SCPFscalingMaxIntents.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,12 +18,11 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
import sys
import json
import time
import os
-'''
+"""
SCPFscalingMaxIntents
Push test Intents to onos
CASE10: set up Null Provider
@@ -31,8 +30,9 @@
Check flows number, if flows number is not as except, finished this test iteration
Scale up when reach the Limited
Start from 1 nodes, 8 devices. Then Scale up to 3,5,7 nodes
-'''
+"""
class SCPFscalingMaxIntents:
+
def __init__( self ):
self.default = ''
@@ -63,7 +63,7 @@
main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
main.installSleep = int( main.params[ 'SLEEP' ][ 'install' ] )
main.verifySleep = int( main.params[ 'SLEEP' ][ 'verify' ] )
- main.rerouteSleep = int ( main.params[ 'SLEEP' ][ 'reroute' ] )
+ main.rerouteSleep = int( main.params[ 'SLEEP' ][ 'reroute' ] )
main.intentConfigRegiCfg = main.params[ 'CFG' ][ 'intentConfigRegi' ]
main.nullProviderCfg = main.params[ 'CFG' ][ 'nullProvider' ]
main.linkCollectionIntentCfg = main.params[ 'CFG' ][ 'linkCollectionIntent' ]
@@ -97,6 +97,7 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
main.commit = main.commit.split( " " )[ 1 ]
+
def CASE1( self ):
copyResult = main.ONOSbench.copyMininetFile( main.topology,
main.dependencyPath,
@@ -133,25 +134,24 @@
# Setup the null-provider
main.step( "Configuring null-provider" )
cfgStatus = utilities.retry( main.ONOSbench.onosCfgSet,
- main.FALSE,
- [ main.Cluster.active( 0 ).ipAddress,
- main.nullProviderCfg, 'deviceCount 8' ],
- sleep=main.verifySleep,
- attempts = main.verifyAttempts )
+ main.FALSE,
+ [ main.Cluster.active( 0 ).ipAddress,
+ main.nullProviderCfg, 'deviceCount 8' ],
+ sleep=main.verifySleep,
+ attempts=main.verifyAttempts )
cfgStatus = cfgStatus and utilities.retry( main.ONOSbench.onosCfgSet,
main.FALSE,
[ main.Cluster.active( 0 ).ipAddress,
main.nullProviderCfg, 'topoShape reroute' ],
sleep=main.verifySleep,
- attempts = main.verifyAttempts )
+ attempts=main.verifyAttempts )
cfgStatus = cfgStatus and utilities.retry( main.ONOSbench.onosCfgSet,
main.FALSE,
[ main.Cluster.active( 0 ).ipAddress,
main.nullProviderCfg, 'enabled true' ],
sleep=main.verifySleep,
- attempts = main.verifyAttempts )
-
+ attempts=main.verifyAttempts )
utilities.assert_equals( expect=main.TRUE,
actual=cfgStatus,
@@ -197,9 +197,9 @@
main.setupSkipped = True
def CASE11( self, main ):
- '''
+ """
Setting up mininet
- '''
+ """
import json
import time
devices = []
@@ -210,10 +210,10 @@
time.sleep( main.startUpSleep )
if main.flowObj:
main.Cluster.active( 0 ).CLI.setCfg( main.intentConfigRegiCfg,
- "useFlowObjectives", value="true" )
+ "useFlowObjectives", value="true" )
main.Cluster.active( 0 ).CLI.setCfg( main.intentConfigRegiCfg,
- "defaultFlowObjectiveCompiler",
- value=main.linkCollectionIntentCfg )
+ "defaultFlowObjectiveCompiler",
+ value=main.linkCollectionIntentCfg )
main.step( 'Starting mininet topology' )
mnStatus = main.Mininet1.startNet( topoFile='~/mininet/custom/rerouteTopo.py' )
utilities.assert_equals( expect=main.TRUE,
@@ -277,8 +277,6 @@
if not caseResult:
main.setupSkipped = True
-
-
def CASE20( self, main ):
try:
from tests.dependencies.utils import Utils
@@ -330,9 +328,9 @@
# make sure the checkInterval divisible batchSize
main.checkInterval = int( int( main.checkInterval / main.batchSize ) * main.batchSize )
- flowTemp=0
+ flowTemp = 0
intentVerifyTemp = 0
- totalFlows=0
+ totalFlows = 0
for i in range( limit ):
# Threads pool
@@ -352,8 +350,8 @@
kwargs={ "offset": offtmp,
"options": "-i",
"timeout": main.timeout,
- "background":False,
- "noExit":True } )
+ "background": False,
+ "noExit": True } )
pool.append( t )
t.start()
main.threadID = main.threadID + 1
@@ -420,10 +418,10 @@
main.log.info( "Total Intents: {}".format( verifyTotalIntents ) )
break
- utilities.assert_equals( expect = main.TRUE,
- actual = intentsState,
- onpass = "Successfully pushed and verified intents",
- onfail = "Failed to push and verify intents" )
+ utilities.assert_equals( expect=main.TRUE,
+ actual=intentsState,
+ onpass="Successfully pushed and verified intents",
+ onfail="Failed to push and verify intents" )
main.log.info( "Total Intents Installed before crash: {}".format( totalIntents ) )
main.log.info( "Total Flows ADDED before crash: {}".format( totalFlows ) )
diff --git a/TestON/tests/SCPF/SCPFscalingMaxIntents/dependencies/rerouteTopo.py b/TestON/tests/SCPF/SCPFscalingMaxIntents/dependencies/rerouteTopo.py
old mode 100755
new mode 100644
index dace730..a5336f0
--- a/TestON/tests/SCPF/SCPFscalingMaxIntents/dependencies/rerouteTopo.py
+++ b/TestON/tests/SCPF/SCPFscalingMaxIntents/dependencies/rerouteTopo.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Custom topology for Mininet
"""
@@ -34,19 +33,20 @@
from mininet.util import dumpNodeConnections
from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
+
class MyTopo( Topo ):
def __init__( self ):
# Initialize topology
Topo.__init__( self )
- host1 = self.addHost('h1', ip='10.1.0.1/24')
- host2 = self.addHost('h2', ip='10.1.0.2/24')
- host3 = self.addHost('h3', ip='10.1.0.3/24')
- host4 = self.addHost('h4', ip='10.1.0.4/24')
- host5 = self.addHost('h5', ip='10.1.0.5/24')
- host6 = self.addHost('h6', ip='10.1.0.6/24')
- host7 = self.addHost('h7', ip='10.1.0.7/24')
+ host1 = self.addHost( 'h1', ip='10.1.0.1/24' )
+ host2 = self.addHost( 'h2', ip='10.1.0.2/24' )
+ host3 = self.addHost( 'h3', ip='10.1.0.3/24' )
+ host4 = self.addHost( 'h4', ip='10.1.0.4/24' )
+ host5 = self.addHost( 'h5', ip='10.1.0.5/24' )
+ host6 = self.addHost( 'h6', ip='10.1.0.6/24' )
+ host7 = self.addHost( 'h7', ip='10.1.0.7/24' )
s1 = self.addSwitch( 's1' )
s2 = self.addSwitch( 's2' )
@@ -57,39 +57,37 @@
s7 = self.addSwitch( 's7' )
s8 = self.addSwitch( 's8' )
+ self.addLink( s1, host1 )
+ self.addLink( s2, host2 )
+ self.addLink( s3, host3 )
+ self.addLink( s4, host4 )
+ self.addLink( s5, host5 )
+ self.addLink( s6, host6 )
+ self.addLink( s7, host7 )
- self.addLink(s1, host1)
- self.addLink(s2, host2)
- self.addLink(s3, host3)
- self.addLink(s4, host4)
- self.addLink(s5, host5)
- self.addLink(s6, host6)
- self.addLink(s7, host7)
-
-
-
- self.addLink(s1,s2)
- self.addLink(s2,s3)
- self.addLink(s3,s4)
- self.addLink(s4,s5)
- self.addLink(s5,s6)
- self.addLink(s6,s7)
- self.addLink(s4,s8)
- self.addLink(s8,s5)
+ self.addLink( s1, s2 )
+ self.addLink( s2, s3 )
+ self.addLink( s3, s4 )
+ self.addLink( s4, s5 )
+ self.addLink( s5, s6 )
+ self.addLink( s6, s7 )
+ self.addLink( s4, s8 )
+ self.addLink( s8, s5 )
topos = { 'mytopo': ( lambda: MyTopo() ) }
# HERE THE CODE DEFINITION OF THE TOPOLOGY ENDS
+
def setupNetwork():
"Create network"
topo = MyTopo()
- network = Mininet(topo=topo, autoSetMacs=True, controller=None)
+ network = Mininet( topo=topo, autoSetMacs=True, controller=None )
network.start()
CLI( network )
network.stop()
if __name__ == '__main__':
- setLogLevel('info')
- #setLogLevel('debug')
+ setLogLevel( 'info' )
+ # setLogLevel( 'debug' )
setupNetwork()
diff --git a/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py b/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
index 66b3dc0..fa168f6 100644
--- a/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
+++ b/TestON/tests/SCPF/SCPFswitchLat/SCPFswitchLat.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,8 +18,7 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
-'''
+"""
SCPFswitchLat
Test Switch add/remove latency
calculate package latency between switch and ONOS
@@ -27,8 +26,7 @@
TCP -- Feature Reply -- Role Request -- Role Reply -- Device -- Graph
Siwtch Down:
Openflow FIN/ACK -- ACK -- Device -- Graph
-'''
-
+"""
class SCPFswitchLat:
def __init__( self ):
@@ -37,7 +35,7 @@
def CASE0( self, main ):
import os
import imp
- '''
+ """
- GIT
- BUILDING ONOS
Pull specific ONOS branch, then Build ONOS ono ONOS Bench.
@@ -45,7 +43,7 @@
test env. We want Jenkins jobs to pull&build for flexibility to handle
different versions of ONOS.
- Construct tests variables
- '''
+ """
try:
from tests.dependencies.ONOSSetup import ONOSSetup
main.testSetUp = ONOSSetup()
@@ -56,10 +54,10 @@
stepResult = main.FALSE
try:
# The dictionary to record different type of wrongs
- main.wrong = { 'totalWrong': 0, 'skipDown' : 0, 'TsharkValueIncorrect': 0,
- 'TypeError' : 0, 'decodeJasonError': 0,
- 'checkResultIncorrect': 0 }
- main.maxWrong = int( main.params[ 'TEST' ] [ 'MaxWrong' ] )
+ main.wrong = { 'totalWrong': 0, 'skipDown': 0, 'TsharkValueIncorrect': 0,
+ 'TypeError': 0, 'decodeJasonError': 0,
+ 'checkResultIncorrect': 0 }
+ main.maxWrong = int( main.params[ 'TEST' ][ 'MaxWrong' ] )
main.resultRange = main.params[ 'TEST' ][ 'ResultRange' ]
main.searchTerm = main.params[ 'TEST' ][ 'SearchTerm' ]
main.MN1Ip = main.params[ 'MN' ][ 'ip1' ]
@@ -72,7 +70,7 @@
main.scale = ( main.params[ 'SCALE' ] ).split( "," )
main.ofPackage = main.params[ 'TSHARK' ]
- main.defaultTopoCfg = main.params [ 'CFG' ][ 'defaultTopo' ]
+ main.defaultTopoCfg = main.params[ 'CFG' ][ 'defaultTopo' ]
main.tsharkResultPath = main.params[ 'TEST' ][ 'tsharkResultPath' ]
main.sampleSize = int( main.params[ 'TEST' ][ 'sampleSize' ] )
main.warmUp = int( main.params[ 'TEST' ][ 'warmUp' ] )
@@ -90,9 +88,9 @@
resultsDB.close()
main.switchFunc = imp.load_source( main.dependencyFunc,
- main.dependencyPath +
- main.dependencyFunc +
- ".py" )
+ main.dependencyPath +
+ main.dependencyFunc +
+ ".py" )
except Exception as e:
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
@@ -144,26 +142,26 @@
import json
import numpy
- resultDict = { 'up' : {}, 'down' : {} }
+ resultDict = { 'up': {}, 'down': {} }
for i in range( 1, main.Cluster.numCtrls + 1 ):
resultDict[ 'up' ][ 'node' + str( i ) ] = {}
resultDict[ 'up' ][ 'node' + str( i ) ][ 'Ave' ] = {}
resultDict[ 'up' ][ 'node' + str( i ) ][ 'Std' ] = {}
- resultDict[ 'up' ][ 'node' + str( i ) ][ 'T_F' ] = []#TCP to Feature
- resultDict[ 'up' ][ 'node' + str( i ) ][ 'F_R' ] = []#Feature to Role
- resultDict[ 'up' ][ 'node' + str( i ) ][ 'RQ_RR' ] = []#role request to role reply
- resultDict[ 'up' ][ 'node' + str( i ) ][ 'RR_D' ] = []#role reply to Device
- resultDict[ 'up' ][ 'node' + str( i ) ][ 'D_G' ] = []#Device to Graph
- resultDict[ 'up' ][ 'node' + str( i ) ][ 'E_E' ] = []#TCP to Graph
+ resultDict[ 'up' ][ 'node' + str( i ) ][ 'T_F' ] = [] # TCP to Feature
+ resultDict[ 'up' ][ 'node' + str( i ) ][ 'F_R' ] = [] # Feature to Role
+ resultDict[ 'up' ][ 'node' + str( i ) ][ 'RQ_RR' ] = [] # role request to role reply
+ resultDict[ 'up' ][ 'node' + str( i ) ][ 'RR_D' ] = [] # role reply to Device
+ resultDict[ 'up' ][ 'node' + str( i ) ][ 'D_G' ] = [] # Device to Graph
+ resultDict[ 'up' ][ 'node' + str( i ) ][ 'E_E' ] = [] # TCP to Graph
for i in range( 1, main.Cluster.numCtrls + 1 ):
resultDict[ 'down' ][ 'node' + str( i ) ] = {}
resultDict[ 'down' ][ 'node' + str( i ) ][ 'Ave' ] = {}
resultDict[ 'down' ][ 'node' + str( i ) ][ 'Std' ] = {}
- resultDict[ 'down' ][ 'node' + str( i ) ][ 'FA_A' ] = []#Fin_ack to ACK
- resultDict[ 'down' ][ 'node' + str( i ) ][ 'A_D' ] = []#Ack to Device
- resultDict[ 'down' ][ 'node' + str( i ) ][ 'D_G' ] = []#Device to Graph
- resultDict[ 'down' ][ 'node' + str( i ) ][ 'E_E' ] = []#fin_ack to Graph
+ resultDict[ 'down' ][ 'node' + str( i ) ][ 'FA_A' ] = [] # Fin_ack to ACK
+ resultDict[ 'down' ][ 'node' + str( i ) ][ 'A_D' ] = [] # Ack to Device
+ resultDict[ 'down' ][ 'node' + str( i ) ][ 'D_G' ] = [] # Device to Graph
+ resultDict[ 'down' ][ 'node' + str( i ) ][ 'E_E' ] = [] # fin_ack to Graph
for i in range( 0, main.sampleSize + main.warmUp ):
main.log.info( "************************************************************" )
main.log.info( "************************ Iteration: {} **********************" .format( str( i + 1 ) ) )
@@ -176,12 +174,12 @@
else:
main.switchFunc.captureOfPack( main, main.device, main.ofPackage,
"up", resultDict, False )
- main.switchFunc.captureOfPack ( main, main.device, main.ofPackage,
- "down", resultDict, False )
+ main.switchFunc.captureOfPack( main, main.device, main.ofPackage,
+ "down", resultDict, False )
main.Cluster.active( 0 ).CLI.removeDevice( "of:0000000000000001" )
# Dictionary for result
- maxDict = {}
+ maxDict = {}
maxDict[ 'down' ] = {}
maxDict[ 'up' ] = {}
maxDict[ 'down' ][ 'max' ] = 0
diff --git a/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py b/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
index cde275e..7a159ba 100644
--- a/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
+++ b/TestON/tests/SCPF/SCPFswitchLat/dependencies/switchFunc.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,29 +18,29 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
-'''
+"""
Wrapper function for SCPFswitchLat test
Assign switch and capture openflow package
remove switch and caputer openflow package
calculate latency
-'''
+"""
import time
import json
+
def getTimestampFromLog( index, searchTerm ):
- '''
+ """
Get timestamp value of the search term from log.
Args:
index: the index of cli
searchTerm: the key term of timestamp
- '''
+ """
lines = main.Cluster.active( index ).CLI.logSearch( mode='last', searchTerm=searchTerm )
try:
- assert lines != None
- logString = lines[ len ( lines ) - 1 ]
- #get the target value
+ assert lines is not None
+ logString = lines[ len( lines ) - 1 ]
+ # get the target value
line = logString.split( "time = " )
key = line[ 1 ].split( " " )
return int( key[ 0 ] )
@@ -51,13 +51,14 @@
main.log.warn( "Search Term Not Found" )
return 0
+
def processPackage( package ):
- '''
+ """
split package information to dictionary
Args:
package: Package String
- '''
+ """
pacakge = package.split( " " )
dic = {}
for s in pacakge:
@@ -68,28 +69,30 @@
continue
return dic
+
def findSeqBySeqAck( seq, packageList ):
- '''
+ """
Find specific Seq of package in packageList
Args:
seq: seq from last TCP package
packageList: find package in packageList
- '''
+ """
for l in packageList:
temp = processPackage( l )
tA = temp[ 'Ack' ]
if int( seq ) + 1 == int( tA ):
return temp[ 'Seq' ]
+
def arrangeTsharkFile( switchStatus, keyTerm ):
- '''
+ """
Arrange different tshark messeage from overall file to different specific files
Args:
switchStatus: switch up or down
keyTerm: A dictionary that store the path name as value and the searchTerm as key
- '''
+ """
with open( main.tsharkResultPath[ switchStatus ][ 'ALL' ], 'r' ) as resultFile:
resultText = resultFile.readlines()
resultFile.close()
@@ -102,13 +105,14 @@
outputfile.write( line )
outputfile.close()
+
def checkResult( result1, result2, result3 ):
- '''
+ """
Check if the inputs meet the requirement
Returns:
1 means the results are right, 0 means the results are wrong
- '''
+ """
result = check( result1 ) + check( result2 ) + check( result3 )
if result < 3:
# if any result is wrong, increase the main wrong number
@@ -118,32 +122,34 @@
return 0
return 1
+
def check( result ):
- '''
+ """
Check the single input.
Returns:
1 means the input is good, 0 means the input is wrong
- '''
+ """
if result < int( main.resultRange[ 'Min' ] ) or result > int( main.resultRange[ 'Max' ] ):
main.log.debug( str( result ) + " is not meet the requirement" )
return 0
return 1
+
def checkTotalWrongNum():
- '''
+ """
Check if the total wrong number is bigger than the max wrong number. If it is, then exit the
test.
- '''
+ """
# if there are too many wrongs in this test, then exit
- if main.wrong['totalWrong'] > main.maxWrong:
+ if main.wrong[ 'totalWrong' ] > main.maxWrong:
main.log.error( "The total wrong number exceeds %d, test terminated" % main.maxWrong )
main.cleanAndExit()
-def captureOfPack( main, deviceName, ofPack, switchStatus, resultDict, warmup ):
- '''
+def captureOfPack( main, deviceName, ofPack, switchStatus, resultDict, warmup ):
+ """
Args:
main: TestON class
deviceName: device name
@@ -152,7 +158,7 @@
resultDict: dictionary to contain result
warmup: warm up boolean
- '''
+ """
main.log.debug( "TOTAL WRONG: " + str( main.wrong ) )
for d in ofPack[ switchStatus ]:
main.log.info( "Clean up Tshark" )
@@ -168,14 +174,14 @@
cleanTerm = ofPack[ switchStatus ][ d ].replace( '\\', '' )
keyTerm[ cleanTerm ] = d
# Delete the last '|'
- grepString = grepString[:-1]
+ grepString = grepString[ :-1 ]
# open tshark
main.log.info( "starting tshark capture" )
main.ONOSbench.tsharkGrep( grepString, main.tsharkResultPath[ switchStatus ][ 'ALL' ], grepOptions='-E' )
if switchStatus == 'up':
# if up, assign switch to controller
time.sleep( main.measurementSleep )
- main.log.info( 'Assigning {} to controller'.format( deviceName ))
+ main.log.info( 'Assigning {} to controller'.format( deviceName ) )
main.Mininet1.assignSwController( sw=deviceName, ip=main.Cluster.active( 0 ).ipAddress )
time.sleep( main.measurementSleep )
if switchStatus == 'down':
@@ -208,8 +214,8 @@
main.log.info( "Capture result:" + resultText )
resultText = resultText.strip()
resultText = resultText.split( " " )
- if len(resultText) > 1:
- tempResultDict[d]= int( ( float( resultText[ 1 ] ) * 1000 ) )
+ if len( resultText ) > 1:
+ tempResultDict[ d ] = int( ( float( resultText[ 1 ] ) * 1000 ) )
resultFile.close()
elif switchStatus == 'down':
# if state is down, we should capture Fin/Ack and ACK package
@@ -220,7 +226,7 @@
resultFile.close()
FinAckSeq = processPackage( FinAckText )[ 'Seq' ]
FinAckOFseq = findSeqBySeqAck( FinAckSeq, resultText )
- if FinAckOFseq == None:
+ if FinAckOFseq is None:
main.log.warn( "Tshark Result was incorrect!" )
main.log.warn( resultText )
main.wrong[ 'TsharkValueIncorrect' ] += 1
@@ -269,7 +275,7 @@
return
if not warmup:
resultDict[ switchStatus ][ d ][ 'T_F' ].append( T_Ftemp )
- resultDict[ switchStatus ][ d ][ 'F_R' ].append( F_Rtemp )
+ resultDict[ switchStatus ][ d ][ 'F_R' ].append( F_Rtemp )
resultDict[ switchStatus ][ d ][ 'RQ_RR' ].append( RQ_RRtemp )
main.log.info( "{} TCP to Feature: {}".format( d, str( T_Ftemp ) ) )
@@ -284,7 +290,7 @@
# get onos metrics timestamps
try:
response = json.loads( main.Cluster.active( i - 1 ).CLI.topologyEventsMetrics() )
- DeviceTime = getTimestampFromLog( i - 1, searchTerm=main.searchTerm[switchStatus] )
+ DeviceTime = getTimestampFromLog( i - 1, searchTerm=main.searchTerm[ switchStatus ] )
main.log.info( "ONOS{} device Event timestamp: {}".format( i, "%.2f" % DeviceTime ) )
GraphTime = int( response.get( "topologyGraphEventTimestamp" ).get( "value" ) )
main.log.info( "ONOS{} Graph Event timestamp: {}".format( i, GraphTime ) )
@@ -331,14 +337,14 @@
checkTotalWrongNum()
break
if not warmup and check == 1:
- resultDict[ switchStatus ][ 'node' + str( i )][ 'RR_D' ].append( RR_Dtemp )
- resultDict[ switchStatus ][ 'node' + str( i )][ 'D_G' ].append( D_Gtemp )
- resultDict[ switchStatus ][ 'node' + str( i )][ 'E_E' ].append( E_Etemp )
+ resultDict[ switchStatus ][ 'node' + str( i ) ][ 'RR_D' ].append( RR_Dtemp )
+ resultDict[ switchStatus ][ 'node' + str( i ) ][ 'D_G' ].append( D_Gtemp )
+ resultDict[ switchStatus ][ 'node' + str( i ) ][ 'E_E' ].append( E_Etemp )
else:
- main.wrong['checkResultIncorrect'] += 1
+ main.wrong[ 'checkResultIncorrect' ] += 1
main.wrong[ 'totalWrong' ] += 1
checkTotalWrongNum()
- main.log.debug("Skip this iteration due to the None Devicetime")
+ main.log.debug( "Skip this iteration due to the None Devicetime" )
if switchStatus == "down":
# down Latency
@@ -389,7 +395,7 @@
check = checkResult( A_Dtemp, D_Gtemp, E_Etemp )
if check == 1:
main.log.info( "ACK to device: {}".format( A_Dtemp ) )
- main.log.info( "Device to Graph: {}".format( D_Gtemp ) )
+ main.log.info( "Device to Graph: {}".format( D_Gtemp ) )
main.log.info( "End to End: {}".format( E_Etemp ) )
main.log.info( "================================================" )
except KeyError:
@@ -417,8 +423,7 @@
resultDict[ switchStatus ][ 'node' + str( i ) ][ 'E_E' ].append( E_Etemp )
else:
- main.wrong['checkResultIncorrect'] += 1
- main.wrong['totalWrong'] += 1
+ main.wrong[ 'checkResultIncorrect' ] += 1
+ main.wrong[ 'totalWrong' ] += 1
checkTotalWrongNum()
- main.log.debug("Skip this iteration due to the None Devicetime")
-
+ main.log.debug( "Skip this iteration due to the None Devicetime" )
diff --git a/TestON/tests/SCPF/SCPFswitchLat/dependencies/topo-perf-1sw.py b/TestON/tests/SCPF/SCPFswitchLat/dependencies/topo-perf-1sw.py
index 1793e2b..3652c82 100644
--- a/TestON/tests/SCPF/SCPFswitchLat/dependencies/topo-perf-1sw.py
+++ b/TestON/tests/SCPF/SCPFswitchLat/dependencies/topo-perf-1sw.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,17 +18,17 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
-'''
+"""
Simple 1 switch topology for topologoy performance test
-'''
-
+"""
from mininet.topo import Topo
-class MyTopo( Topo ):
- def __init__(self):
- Topo.__init__(self)
- s3 = self.addSwitch( "s3", dpid="0000000000000001")
+class MyTopo( Topo ):
+
+ def __init__( self ):
+ Topo.__init__( self )
+
+ s3 = self.addSwitch( "s3", dpid="0000000000000001" )
topos = { 'mytopo': ( lambda: MyTopo() ) }
diff --git a/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.py b/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.py
old mode 100755
new mode 100644
index 5735c9d..ce3020c
--- a/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRClusterRestart/SRClusterRestart.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,12 +18,13 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# CASE1: 2x2 topo + 3-node ONOS CLUSTER + IP connectivity test + CLUSTER restart
# CASE2: 4x4 topo + 3-node ONOS CLUSTER + IP connectivity test + CLUSTER restart
# CASE3: Single switch + 3-node ONOS CLUSTER + IP connectivity test + CLUSTER restart
+
class SRClusterRestart:
+
def __init__( self ):
self.default = ''
diff --git a/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.py b/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.py
old mode 100755
new mode 100644
index 44f704e..1af681c
--- a/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRDynamic/SRDynamic.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# CASE1: 2x2 Leaf-Spine topo and test IP connectivity
# CASE2: 4x4 topo + IP connectivity test
# CASE3: Single switch topo + IP connectivity test
@@ -26,7 +25,9 @@
# CASE5: 4x4 topo + 3-node ONOS CLUSTER + IP connectivity test
# CASE6: Single switch + 3-node ONOS CLUSTER + IP connectivity test
+
class SRDynamic:
+
def __init__( self ):
self.default = ''
diff --git a/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.py b/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.py
index ba0242d..f84b39c 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRHighAvailability/SRHighAvailability.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,17 +18,15 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# In this test we perform several failures and then test for connectivity
# CASE1: 2x2 topo + 3 ONOS + | ONOS failure + IP connectivity test | x failures
-# CASE2: 2x2 topo + 3 ONOS + | ONOS (random instance) failure + IP connectivity test | x failures
+# CASE2: 2x2 topo + 3 ONOS + | ONOS ( random instance ) failure + IP connectivity test | x failures
# CASE3: 4x4 topo + 3 ONOS + | ONOS failure + IP connectivity test | x failures
-# CASE4: 4x4 topo + 3 ONOS + | ONOS (random instance) failure + IP connectivity test | x failures
+# CASE4: 4x4 topo + 3 ONOS + | ONOS ( random instance ) failure + IP connectivity test | x failures
# CASE5: 2x2 topo + 3 ONOS + | ONOS failure + Spine failure + IP connectivity test | x failures
-# CASE6: 2x2 topo + 3 ONOS + | ONOS (random instance) failure + Spine (random switch) failure + IP connectivity test | x failures
+# CASE6: 2x2 topo + 3 ONOS + | ONOS ( random instance ) failure + Spine ( random switch ) failure + IP connectivity test | x failures
# CASE7: 4x4 topo + 3 ONOS + | ONOS failure + Spine failure + IP connectivity test | x failures
-# CASE8: 4x4 topo + 3 ONOS + | ONOS (random instance) failure + Spine (random switch) failure + IP connectivity test | x failures
-
+# CASE8: 4x4 topo + 3 ONOS + | ONOS ( random instance ) failure + Spine ( random switch ) failure + IP connectivity test | x failures
class SRHighAvailability:
@@ -38,12 +36,12 @@
def CASE1( self, main ):
"""
- 1) Sets up 3-nodes Onos-cluster
- 2) Start 2x2 Leaf-Spine topology
- 3) Pingall
- 4) Cause sequential ONOS failure
- 5) Pingall
- 6) Repeat 3), 4), 5) 'failures' times
+ 1 ) Sets up 3-nodes Onos-cluster
+ 2 ) Start 2x2 Leaf-Spine topology
+ 3 ) Pingall
+ 4 ) Cause sequential ONOS failure
+ 5 ) Pingall
+ 6 ) Repeat 3 ), 4 ), 5 ) 'failures' times
"""
from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
Testcaselib as run
@@ -52,29 +50,29 @@
description = "High Availability tests - ONOS failures with 2x2 Leaf-spine "
main.case( description )
- run.config(main, '2x2')
+ run.config( main, '2x2' )
run.installOnos( main )
run.startMininet( main, 'cord_fabric.py' )
# pre-configured routing and bridging test
run.checkFlows( main, minFlowCount=116 )
run.pingAll( main )
- for i in range(0, main.failures):
+ for i in range( 0, main.failures ):
toKill = i % main.Cluster.numCtrls
run.killOnos( main, [ toKill ], '4', '8', '2' )
- run.pingAll( main, 'CASE1_Failure%d' % (i+1) )
+ run.pingAll( main, 'CASE1_Failure%d' % ( i + 1 ) )
run.recoverOnos( main, [ toKill ], '4', '8', '3' )
run.checkFlows( main, minFlowCount=116 )
- run.pingAll( main, 'CASE1_Recovery%d' % (i+1) )
+ run.pingAll( main, 'CASE1_Recovery%d' % ( i + 1 ) )
run.cleanup( main )
def CASE2( self, main ):
"""
- 1) Sets up 3-nodes Onos-cluster
- 2) Start 2x2 Leaf-Spine topology
- 3) Pingall
- 4) Cause random ONOS failure
- 5) Pingall
- 6) Repeat 3), 4), 5) 'failures' times
+ 1 ) Sets up 3-nodes Onos-cluster
+ 2 ) Start 2x2 Leaf-Spine topology
+ 3 ) Pingall
+ 4 ) Cause random ONOS failure
+ 5 ) Pingall
+ 6 ) Repeat 3 ), 4 ), 5 ) 'failures' times
"""
from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
Testcaselib as run
@@ -86,30 +84,30 @@
description = "High Availability tests - ONOS random failures with 2x2 Leaf-spine "
main.case( description )
- run.config(main, '2x2')
+ run.config( main, '2x2' )
run.installOnos( main )
run.startMininet( main, 'cord_fabric.py' )
# pre-configured routing and bridging test
run.checkFlows( main, minFlowCount=116 )
run.pingAll( main )
- random.seed(datetime.now())
- for i in range(0, main.failures):
+ random.seed( datetime.now() )
+ for i in range( 0, main.failures ):
toKill = randint( 0, ( main.Cluster.numCtrls - 1 ) )
run.killOnos( main, [ toKill ], '4', '8', '2' )
- run.pingAll( main, 'CASE2_Failure%d' % (i+1) )
+ run.pingAll( main, 'CASE2_Failure%d' % ( i + 1 ) )
run.recoverOnos( main, [ toKill ], '4', '8', '3' )
run.checkFlows( main, minFlowCount=116 )
- run.pingAll( main, 'CASE2_Recovery%d' % (i+1) )
+ run.pingAll( main, 'CASE2_Recovery%d' % ( i + 1 ) )
run.cleanup( main )
def CASE3( self, main ):
"""
- 1) Sets up 3-nodes Onos-cluster
- 2) Start 4x4 Leaf-Spine topology
- 3) Pingall
- 4) Cause sequential ONOS failure
- 5) Pingall
- 6) Repeat 3), 4), 5) 'failures' times
+ 1 ) Sets up 3-nodes Onos-cluster
+ 2 ) Start 4x4 Leaf-Spine topology
+ 3 ) Pingall
+ 4 ) Cause sequential ONOS failure
+ 5 ) Pingall
+ 6 ) Repeat 3 ), 4 ), 5 ) 'failures' times
"""
from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
Testcaselib as run
@@ -118,29 +116,29 @@
description = "High Availability tests - ONOS failures with 4x4 Leaf-spine "
main.case( description )
- run.config(main, '4x4')
+ run.config( main, '4x4' )
run.installOnos( main )
run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
# pre-configured routing and bridging test
run.checkFlows( main, minFlowCount=350 )
run.pingAll( main )
- for i in range(0, main.failures):
+ for i in range( 0, main.failures ):
toKill = i % main.Cluster.numCtrls
run.killOnos( main, [ toKill ], '8', '32', '2' )
- run.pingAll( main, 'CASE3_Failure%d' % (i+1) )
+ run.pingAll( main, 'CASE3_Failure%d' % ( i + 1 ) )
run.recoverOnos( main, [ toKill ], '8', '32', '3' )
run.checkFlows( main, minFlowCount=350 )
- run.pingAll( main, 'CASE3_Recovery%d' % (i+1) )
+ run.pingAll( main, 'CASE3_Recovery%d' % ( i + 1 ) )
run.cleanup( main )
def CASE4( self, main ):
"""
- 1) Sets up 3-nodes Onos-cluster
- 2) Start 4x4 Leaf-Spine topology
- 3) Pingall
- 4) Cause random ONOS failure
- 5) Pingall
- 6) Repeat 3), 4), 5) 'failures' times
+ 1 ) Sets up 3-nodes Onos-cluster
+ 2 ) Start 4x4 Leaf-Spine topology
+ 3 ) Pingall
+ 4 ) Cause random ONOS failure
+ 5 ) Pingall
+ 6 ) Repeat 3 ), 4 ), 5 ) 'failures' times
"""
from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
Testcaselib as run
@@ -152,32 +150,32 @@
description = "High Availability tests - ONOS random failures with 4x4 Leaf-spine "
main.case( description )
- run.config(main, '4x4')
+ run.config( main, '4x4' )
run.installOnos( main )
run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
# pre-configured routing and bridging test
run.checkFlows( main, minFlowCount=350 )
run.pingAll( main )
- random.seed(datetime.now())
- for i in range(0, main.failures):
+ random.seed( datetime.now() )
+ for i in range( 0, main.failures ):
toKill = randint( 0, ( main.Cluster.numCtrls - 1 ) )
run.killOnos( main, [ toKill ], '8', '32', '2' )
- run.pingAll( main, 'CASE4_Failure%d' % (i+1) )
+ run.pingAll( main, 'CASE4_Failure%d' % ( i + 1 ) )
run.recoverOnos( main, [ toKill ], '8', '32', '3' )
run.checkFlows( main, minFlowCount=350 )
- run.pingAll( main, 'CASE4_Recovery%d' % (i+1) )
+ run.pingAll( main, 'CASE4_Recovery%d' % ( i + 1 ) )
run.cleanup( main )
def CASE5( self, main ):
"""
- 1) Sets up 3-nodes Onos-cluster
- 2) Start 2x2 Leaf-Spine topology
- 3) Pingall
- 4) Cause sequential ONOS failure
- 5) Pingall
- 6) Cause sequential Spine failure
- 7) Pingall
- 8) Repeat 3), 4), 5), 6), 7), 'failures' times
+ 1 ) Sets up 3-nodes Onos-cluster
+ 2 ) Start 2x2 Leaf-Spine topology
+ 3 ) Pingall
+ 4 ) Cause sequential ONOS failure
+ 5 ) Pingall
+ 6 ) Cause sequential Spine failure
+ 7 ) Pingall
+ 8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ), 'failures' times
"""
from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
Testcaselib as run
@@ -187,38 +185,38 @@
description = "High Availability tests - ONOS failures and Switch failures with 2x2 Leaf-spine "
main.case( description )
- run.config(main, '2x2')
+ run.config( main, '2x2' )
run.installOnos( main )
run.startMininet( main, 'cord_fabric.py' )
# pre-configured routing and bridging test
run.checkFlows( main, minFlowCount=116 )
run.pingAll( main )
- for i in range(0, main.failures):
+ for i in range( 0, main.failures ):
onosToKill = i % main.Cluster.numCtrls
- switchToKill = i % len(main.spines)
+ switchToKill = i % len( main.spines )
run.killOnos( main, [ onosToKill ], '4', '8', '2' )
- run.pingAll( main, 'CASE5_ONOS_Failure%d' % (i+1) )
- run.killSwitch( main, main.spines[switchToKill]['name'], switches='3', links='4' )
+ run.pingAll( main, 'CASE5_ONOS_Failure%d' % ( i + 1 ) )
+ run.killSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='3', links='4' )
time.sleep( main.switchSleep )
- run.pingAll( main, "CASE5_SWITCH_Failure%d" % (i+1) )
- run.recoverSwitch( main, main.spines[switchToKill]['name'], switches='4', links='8' )
+ run.pingAll( main, "CASE5_SWITCH_Failure%d" % ( i + 1 ) )
+ run.recoverSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='4', links='8' )
run.checkFlows( main, minFlowCount=116 )
- run.pingAll( main, "CASE5_SWITCH_Recovery%d" % (i+1) )
+ run.pingAll( main, "CASE5_SWITCH_Recovery%d" % ( i + 1 ) )
run.recoverOnos( main, [ onosToKill ], '4', '8', '3' )
run.checkFlows( main, minFlowCount=116 )
- run.pingAll( main, 'CASE5_ONOS_Recovery%d' % (i+1) )
+ run.pingAll( main, 'CASE5_ONOS_Recovery%d' % ( i + 1 ) )
run.cleanup( main )
def CASE6( self, main ):
"""
- 1) Sets up 3-nodes Onos-cluster
- 2) Start 2x2 Leaf-Spine topology
- 3) Pingall
- 4) Cause random ONOS failure
- 5) Pingall
- 6) Cause random Spine failure
- 7) Pingall
- 8) Repeat 3), 4), 5), 6), 7) 'failures' times
+ 1 ) Sets up 3-nodes Onos-cluster
+ 2 ) Start 2x2 Leaf-Spine topology
+ 3 ) Pingall
+ 4 ) Cause random ONOS failure
+ 5 ) Pingall
+ 6 ) Cause random Spine failure
+ 7 ) Pingall
+ 8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ) 'failures' times
"""
from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
Testcaselib as run
@@ -231,38 +229,38 @@
description = "High Availability tests - ONOS random failures and Switch random failures with 2x2 Leaf-spine "
main.case( description )
- run.config(main, '2x2')
+ run.config( main, '2x2' )
run.installOnos( main )
run.startMininet( main, 'cord_fabric.py' )
# pre-configured routing and bridging test
run.checkFlows( main, minFlowCount=116 )
run.pingAll( main )
- for i in range(0, main.failures):
+ for i in range( 0, main.failures ):
onosToKill = randint( 0, ( main.Cluster.numCtrls - 1 ) )
- switchToKill = randint(0, 1)
+ switchToKill = randint( 0, 1 )
run.killOnos( main, [ onosToKill ], '4', '8', '2' )
- run.pingAll( main, 'CASE6_ONOS_Failure%d' % (i+1) )
- run.killSwitch( main, main.spines[switchToKill]['name'], switches='3', links='4' )
+ run.pingAll( main, 'CASE6_ONOS_Failure%d' % ( i + 1 ) )
+ run.killSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='3', links='4' )
time.sleep( main.switchSleep )
- run.pingAll( main, "CASE6_SWITCH_Failure%d" % (i+1) )
- run.recoverSwitch( main, main.spines[switchToKill]['name'], switches='4', links='8' )
+ run.pingAll( main, "CASE6_SWITCH_Failure%d" % ( i + 1 ) )
+ run.recoverSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='4', links='8' )
run.checkFlows( main, minFlowCount=116 )
- run.pingAll( main, "CASE6_SWITCH_Recovery%d" % (i+1) )
+ run.pingAll( main, "CASE6_SWITCH_Recovery%d" % ( i + 1 ) )
run.recoverOnos( main, [ onosToKill ], '4', '8', '3' )
run.checkFlows( main, minFlowCount=116 )
- run.pingAll( main, 'CASE6_ONOS_Recovery%d' % (i+1) )
+ run.pingAll( main, 'CASE6_ONOS_Recovery%d' % ( i + 1 ) )
run.cleanup( main )
def CASE7( self, main ):
"""
- 1) Sets up 3-nodes Onos-cluster
- 2) Start 4x4 Leaf-Spine topology
- 3) Pingall
- 4) Cause sequential ONOS failure
- 5) Pingall
- 6) Cause sequential Spine failure
- 7) Pingall
- 8) Repeat 3), 4), 5), 6), 7), 'failures' times
+ 1 ) Sets up 3-nodes Onos-cluster
+ 2 ) Start 4x4 Leaf-Spine topology
+ 3 ) Pingall
+ 4 ) Cause sequential ONOS failure
+ 5 ) Pingall
+ 6 ) Cause sequential Spine failure
+ 7 ) Pingall
+ 8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ), 'failures' times
"""
from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
Testcaselib as run
@@ -272,38 +270,38 @@
description = "High Availability tests - ONOS failures and Switch failures with 4x4 Leaf-spine "
main.case( description )
- run.config(main, '4x4')
+ run.config( main, '4x4' )
run.installOnos( main )
run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
# pre-configured routing and bridging test
run.checkFlows( main, minFlowCount=350 )
run.pingAll( main )
- for i in range(0, main.failures):
+ for i in range( 0, main.failures ):
onosToKill = i % main.Cluster.numCtrls
- switchToKill = i % len(main.spines)
+ switchToKill = i % len( main.spines )
run.killOnos( main, [ onosToKill ], '8', '32', '2' )
- run.pingAll( main, 'CASE7_ONOS_Failure%d' % (i+1) )
- run.killSwitch( main, main.spines[switchToKill]['name'], switches='7', links='24' )
+ run.pingAll( main, 'CASE7_ONOS_Failure%d' % ( i + 1 ) )
+ run.killSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='7', links='24' )
time.sleep( main.switchSleep )
- run.pingAll( main, "CASE7_SWITCH_Failure%d" % (i+1) )
- run.recoverSwitch( main, main.spines[switchToKill]['name'], switches='8', links='32' )
+ run.pingAll( main, "CASE7_SWITCH_Failure%d" % ( i + 1 ) )
+ run.recoverSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='8', links='32' )
run.checkFlows( main, minFlowCount=350 )
- run.pingAll( main, "CASE7_SWITCH_Recovery%d" % (i+1) )
+ run.pingAll( main, "CASE7_SWITCH_Recovery%d" % ( i + 1 ) )
run.recoverOnos( main, [ onosToKill ], '8', '32', '3' )
run.checkFlows( main, minFlowCount=350 )
- run.pingAll( main, 'CASE7_ONOS_Recovery%d' % (i+1) )
+ run.pingAll( main, 'CASE7_ONOS_Recovery%d' % ( i + 1 ) )
run.cleanup( main )
def CASE8( self, main ):
"""
- 1) Sets up 3-nodes Onos-cluster
- 2) Start 4x4 Leaf-Spine topology
- 3) Pingall
- 4) Cause random ONOS failure
- 5) Pingall
- 6) Cause random Spine failure
- 7) Pingall
- 8) Repeat 3), 4), 5), 6), 7), 'failures' times
+ 1 ) Sets up 3-nodes Onos-cluster
+ 2 ) Start 4x4 Leaf-Spine topology
+ 3 ) Pingall
+ 4 ) Cause random ONOS failure
+ 5 ) Pingall
+ 6 ) Cause random Spine failure
+ 7 ) Pingall
+ 8 ) Repeat 3 ), 4 ), 5 ), 6 ), 7 ), 'failures' times
"""
from tests.USECASE.SegmentRouting.dependencies.Testcaselib import \
Testcaselib as run
@@ -316,24 +314,24 @@
description = "High Availability tests - ONOS random failures and Switch random failures with 4x4 Leaf-spine "
main.case( description )
- run.config(main, '4x4')
+ run.config( main, '4x4' )
run.installOnos( main )
run.startMininet( main, 'cord_fabric.py', args="--leaf=4 --spine=4" )
# pre-configured routing and bridging test
run.checkFlows( main, minFlowCount=350 )
run.pingAll( main )
- for i in range(0, main.failures):
+ for i in range( 0, main.failures ):
onosToKill = randint( 0, ( main.Cluster.numCtrls - 1 ) )
- switchToKill = randint(0, 3)
+ switchToKill = randint( 0, 3 )
run.killOnos( main, [ onosToKill ], '8', '32', '2' )
- run.pingAll( main, 'CASE8_ONOS_Failure%d' % (i+1) )
- run.killSwitch( main, main.spines[switchToKill]['name'], switches='7', links='24' )
+ run.pingAll( main, 'CASE8_ONOS_Failure%d' % ( i + 1 ) )
+ run.killSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='7', links='24' )
time.sleep( main.switchSleep )
- run.pingAll( main, "CASE8_SWITCH_Failure%d" % (i+1) )
- run.recoverSwitch( main, main.spines[switchToKill]['name'], switches='8', links='32' )
+ run.pingAll( main, "CASE8_SWITCH_Failure%d" % ( i + 1 ) )
+ run.recoverSwitch( main, main.spines[ switchToKill ][ 'name' ], switches='8', links='32' )
run.checkFlows( main, minFlowCount=350 )
- run.pingAll( main, "CASE8_SWITCH_Recovery%d" % (i+1) )
+ run.pingAll( main, "CASE8_SWITCH_Recovery%d" % ( i + 1 ) )
run.recoverOnos( main, [ onosToKill ], '8', '32', '3' )
run.checkFlows( main, minFlowCount=350 )
- run.pingAll( main, 'CASE8_ONOS_Recovery%d' % (i+1) )
+ run.pingAll( main, 'CASE8_ONOS_Recovery%d' % ( i + 1 ) )
run.cleanup( main )
diff --git a/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.py b/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.py
old mode 100755
new mode 100644
index cb95b18..e8b6cf7
--- a/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRLinkFailure/SRLinkFailure.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,14 +18,15 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# In this test we perform a link failure and then test for connectivity
# CASE1: 2x2 topo + link failure + IP connectivity test
# CASE2: 4x4 topo + link failure + IP connectivity test
# CASE4: 2x2 topo + 3-node ONOS CLUSTER + link failure + IP connectivity test
# CASE5: 4x4 topo + 3-node ONOS CLUSTER + link failure + IP connectivity test
+
class SRLinkFailure:
+
def __init__( self ):
self.default = ''
diff --git a/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.py b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.py
old mode 100755
new mode 100644
index f0383ae..6c972b2
--- a/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.py
+++ b/TestON/tests/USECASE/SegmentRouting/SROnosFailure/SROnosFailure.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,12 +18,13 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# CASE1: 2x2 topo + 3-node ONOS CLUSTER + IP connectivity test + Control plane resilience
# CASE2: 4x4 topo + 3-node ONOS CLUSTER + IP connectivity test + Control plane resilience
# CASE3: Single switch + 3-node ONOS CLUSTER + IP connectivity test + Control plane resilience
+
class SROnosFailure:
+
def __init__( self ):
self.default = ''
diff --git a/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.py b/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.py
old mode 100755
new mode 100644
index 435683e..2919500
--- a/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRSanity/SRSanity.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# CASE1: 2x2 Leaf-Spine topo and test IP connectivity
# CASE2: 4x4 topo + IP connectivity test
# CASE3: Single switch topo + IP connectivity test
@@ -26,7 +25,9 @@
# CASE5: 4x4 topo + 3-node ONOS CLUSTER + IP connectivity test
# CASE6: Single switch + 3-node ONOS CLUSTER + IP connectivity test
+
class SRSanity:
+
def __init__( self ):
self.default = ''
diff --git a/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.py b/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.py
old mode 100755
new mode 100644
index 1b0968c..d0d79c8
--- a/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRSwitchFailure/SRSwitchFailure.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,14 +18,15 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# In this test we perform a switch failure and then test for connectivity
# CASE1: 2x2 topo + swtich failure + IP connectivity test
# CASE2: 4x4 topo + switch failure + IP connectivity test
# CASE4: 2x2 topo + 3-node ONOS CLUSTER + switch failure + IP connectivity test
# CASE5: 4x4 topo + 3-node ONOS CLUSTER + switch failure + IP connectivity test
+
class SRSwitchFailure:
+
def __init__( self ):
self.default = ''
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
old mode 100755
new mode 100644
index d83585a..f542554
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
import os
import imp
import time
@@ -29,7 +28,7 @@
class Testcaselib:
- useSSH=True
+ useSSH = True
@staticmethod
def initTest( main ):
@@ -60,7 +59,7 @@
main.dependencyPath = main.path + "/../dependencies/"
main.topology = main.params[ 'DEPENDENCY' ][ 'topology' ]
wrapperFile1 = main.params[ 'DEPENDENCY' ][ 'wrapper1' ]
- main.scale = (main.params[ 'SCALE' ][ 'size' ]).split( "," )
+ main.scale = ( main.params[ 'SCALE' ][ 'size' ] ).split( "," )
main.maxNodes = int( main.params[ 'SCALE' ][ 'max' ] )
# main.ONOSport = main.params[ 'CTRL' ][ 'port' ]
main.startUpSleep = int( main.params[ 'SLEEP' ][ 'startup' ] )
@@ -76,8 +75,6 @@
main.testSetUp.envSetupException( e )
main.testSetUp.evnSetupConclusion( stepResult )
-
-
@staticmethod
def installOnos( main, vlanCfg=True ):
"""
@@ -119,7 +116,7 @@
cliResult = main.TRUE
main.step( "Checking if ONOS CLI is ready" )
for ctrl in main.Cluster.runningNodes:
- ctrl.CLI.startCellCli( )
+ ctrl.CLI.startCellCli()
cliResult = cliResult and ctrl.CLI.startOnosCli( ctrl.ipAddress,
commandlineTimeout=60,
onosStartTimeout=100 )
@@ -139,10 +136,10 @@
onfail="ONOS summary command failed" )
with open( "%s/json/%s.json" % (
- main.dependencyPath, main.cfgName) ) as cfg:
+ main.dependencyPath, main.cfgName ) ) as cfg:
main.Cluster.active( 0 ).REST.setNetCfg( json.load( cfg ) )
with open( "%s/json/%s.chart" % (
- main.dependencyPath, main.cfgName) ) as chart:
+ main.dependencyPath, main.cfgName ) ) as chart:
main.pingChart = json.load( chart )
if not ready:
main.log.error( "ONOS startup failed!" )
@@ -157,7 +154,7 @@
@staticmethod
def startMininet( main, topology, args="" ):
main.step( "Starting Mininet Topology" )
- arg = "--onos %d %s" % (main.Cluster.numCtrls, args)
+ arg = "--onos %d %s" % ( main.Cluster.numCtrls, args )
main.topology = topology
topoResult = main.Mininet1.startNet(
topoFile=main.Mininet1.home + main.topology, args=arg )
@@ -172,44 +169,44 @@
@staticmethod
def config( main, cfgName ):
- main.spines = []
+ main.spines = []
- main.failures = int(main.params[ 'failures' ])
- main.cfgName = cfgName
+ main.failures = int( main.params[ 'failures' ] )
+ main.cfgName = cfgName
- if main.cfgName == '2x2' :
- spine = {}
- spine[ 'name' ] = main.params['switches'][ 'spine1' ]
- spine[ 'dpid' ] = main.params['switches'][ 'spinedpid1' ]
- main.spines.append(spine)
+ if main.cfgName == '2x2':
+ spine = {}
+ spine[ 'name' ] = main.params[ 'switches' ][ 'spine1' ]
+ spine[ 'dpid' ] = main.params[ 'switches' ][ 'spinedpid1' ]
+ main.spines.append( spine )
- spine = {}
- spine[ 'name' ] = main.params['switches'][ 'spine2' ]
- spine[ 'dpid' ] = main.params['switches'][ 'spinedpid2' ]
- main.spines.append(spine)
+ spine = {}
+ spine[ 'name' ] = main.params[ 'switches' ][ 'spine2' ]
+ spine[ 'dpid' ] = main.params[ 'switches' ][ 'spinedpid2' ]
+ main.spines.append( spine )
- elif main.cfgName == '4x4' :
- spine = {}
- spine[ 'name' ] = main.params['switches'][ 'spine1' ]
- spine[ 'dpid' ] = main.params['switches'][ 'spinedpid1' ]
- main.spines.append(spine)
+ elif main.cfgName == '4x4':
+ spine = {}
+ spine[ 'name' ] = main.params[ 'switches' ][ 'spine1' ]
+ spine[ 'dpid' ] = main.params[ 'switches' ][ 'spinedpid1' ]
+ main.spines.append( spine )
- spine = {}
- spine[ 'name' ] = main.params['switches'][ 'spine2' ]
- spine[ 'dpid' ] = main.params['switches'][ 'spinedpid2' ]
- main.spines.append(spine)
+ spine = {}
+ spine[ 'name' ] = main.params[ 'switches' ][ 'spine2' ]
+ spine[ 'dpid' ] = main.params[ 'switches' ][ 'spinedpid2' ]
+ main.spines.append( spine )
- spine = {}
- spine[ 'name' ] = main.params['switches'][ 'spine3' ]
- spine[ 'dpid' ] = main.params['switches'][ 'spinedpid3' ]
- main.spines.append(spine)
+ spine = {}
+ spine[ 'name' ] = main.params[ 'switches' ][ 'spine3' ]
+ spine[ 'dpid' ] = main.params[ 'switches' ][ 'spinedpid3' ]
+ main.spines.append( spine )
- spine = {}
- spine[ 'name' ] = main.params['switches'][ 'spine4' ]
- spine[ 'dpid' ] = main.params['switches'][ 'spinedpid4' ]
- main.spines.append(spine)
+ spine = {}
+ spine[ 'name' ] = main.params[ 'switches' ][ 'spine4' ]
+ spine[ 'dpid' ] = main.params[ 'switches' ][ 'spinedpid4' ]
+ main.spines.append( spine )
- else :
+ else:
main.log.error( "Configuration failed!" )
main.cleanAndExit()
@@ -222,9 +219,9 @@
kwargs={ 'min': minFlowCount },
attempts=10,
sleep=10 )
- utilities.assertEquals( \
+ utilities.assertEquals(
expect=True,
- actual=(count > 0),
+ actual=( count > 0 ),
onpass="Flow count looks correct: " + str( count ),
onfail="Flow count looks wrong: " + str( count ) )
@@ -234,7 +231,7 @@
kwargs={ 'isPENDING': False },
attempts=2,
sleep=10 )
- utilities.assertEquals( \
+ utilities.assertEquals(
expect=main.TRUE,
actual=flowCheck,
onpass="Flow status is correct!",
@@ -253,11 +250,11 @@
def pingAll( main, tag="", dumpflows=True ):
main.log.report( "Check full connectivity" )
print main.pingChart
- for entry in main.pingChart.itervalues( ):
+ for entry in main.pingChart.itervalues():
print entry
hosts, expect = entry[ 'hosts' ], entry[ 'expect' ]
expect = main.TRUE if expect else main.FALSE
- main.step( "Connectivity for %s %s" % (str( hosts ), tag) )
+ main.step( "Connectivity for %s %s" % ( str( hosts ), tag ) )
pa = main.Mininet1.pingallHosts( hosts )
utilities.assert_equals( expect=expect, actual=pa,
onpass="IP connectivity successfully tested",
@@ -280,7 +277,7 @@
Kill a link and verify ONOS can see the proper link change
"""
main.linkSleep = float( main.params[ 'timers' ][ 'LinkDiscovery' ] )
- main.step( "Kill link between %s and %s" % (end1, end2) )
+ main.step( "Kill link between %s and %s" % ( end1, end2 ) )
LinkDown = main.Mininet1.link( END1=end1, END2=end2, OPTION="down" )
LinkDown = main.Mininet1.link( END2=end1, END1=end2, OPTION="down" )
main.log.info(
@@ -308,7 +305,7 @@
switches, links: number of expected switches and links after linkDown, ex.: '4', '6'
Kill a link and verify ONOS can see the proper link change
"""
- main.step( "Restore link between %s and %s" % (end1, end2) )
+ main.step( "Restore link between %s and %s" % ( end1, end2 ) )
result = False
count = 0
while True:
@@ -319,7 +316,7 @@
"Waiting %s seconds for link up to be discovered" % main.linkSleep )
time.sleep( main.linkSleep )
- for i in range(0, main.Cluster.numCtrls):
+ for i in range( 0, main.Cluster.numCtrls ):
ctrl = main.Cluster.runningNodes[ i ]
onosIsUp = main.ONOSbench.isup( ctrl.ipAddress )
if onosIsUp == main.TRUE:
@@ -347,7 +344,7 @@
main.Mininet1.switch( SW=switch, OPTION="stop" )
# todo make this repeatable
main.log.info( "Waiting %s seconds for switch down to be discovered" % (
- main.switchSleep) )
+ main.switchSleep ) )
time.sleep( main.switchSleep )
topology = utilities.retry( main.Cluster.active( 0 ).CLI.checkStatus,
main.FALSE,
@@ -370,7 +367,7 @@
main.log.info( "Starting" + switch )
main.Mininet1.switch( SW=switch, OPTION="start" )
main.log.info( "Waiting %s seconds for switch up to be discovered" % (
- main.switchSleep) )
+ main.switchSleep ) )
time.sleep( main.switchSleep )
topology = utilities.retry( main.Cluster.active( 0 ).CLI.checkStatus,
main.FALSE,
@@ -413,7 +410,6 @@
switches, links, nodes: number of expected switches, links and nodes after KillOnos, ex.: '4', '6'
Completely Kill an ONOS instance and verify the ONOS cluster can see the proper change
"""
-
main.step( "Killing ONOS instance" )
for i in nodes:
@@ -484,7 +480,7 @@
main.step( "Checking ONOS nodes" )
nodeResults = utilities.retry( Testcaselib.nodesCheck,
False,
- args=[nodes],
+ args=[ nodes ],
attempts=5,
sleep=10 )
utilities.assert_equals( expect=True, actual=nodeResults,
@@ -527,15 +523,15 @@
def addHostCfg( main ):
"""
Adds Host Configuration to ONOS
- Updates expected state of the network (pingChart)
+ Updates expected state of the network ( pingChart )
"""
import json
- hostCfg = { }
+ hostCfg = {}
with open( main.dependencyPath + "/json/extra.json" ) as template:
hostCfg = json.load( template )
main.pingChart[ 'ip' ][ 'hosts' ] += [ 'in1' ]
main.step( "Pushing new configuration" )
- mac, cfg = hostCfg[ 'hosts' ].popitem( )
+ mac, cfg = hostCfg[ 'hosts' ].popitem()
main.Cluster.active( 0 ).REST.setNetCfg( cfg[ 'basic' ],
subjectClass="hosts",
subjectKey=urllib.quote( mac,
@@ -543,17 +539,17 @@
configKey="basic" )
main.pingChart[ 'ip' ][ 'hosts' ] += [ 'out1' ]
main.step( "Pushing new configuration" )
- mac, cfg = hostCfg[ 'hosts' ].popitem( )
+ mac, cfg = hostCfg[ 'hosts' ].popitem()
main.Cluster.active( 0 ).REST.setNetCfg( cfg[ 'basic' ],
subjectClass="hosts",
subjectKey=urllib.quote( mac,
safe='' ),
- configKey="basic" )
+ configKey="basic" )
main.pingChart.update( { 'vlan1': { "expect": "True",
"hosts": [ "olt1", "vsg1" ] } } )
main.pingChart[ 'vlan5' ][ 'expect' ] = 0
main.pingChart[ 'vlan10' ][ 'expect' ] = 0
- ports = "[%s,%s]" % (5, 6)
+ ports = "[%s,%s]" % ( 5, 6 )
cfg = '{"of:0000000000000001":[{"vlan":1,"ports":%s,"name":"OLT 1"}]}' % ports
main.Cluster.active( 0 ).REST.setNetCfg( json.loads( cfg ),
subjectClass="apps",
@@ -564,15 +560,15 @@
def delHostCfg( main ):
"""
Removest Host Configuration from ONOS
- Updates expected state of the network (pingChart)
+ Updates expected state of the network ( pingChart )
"""
import json
- hostCfg = { }
+ hostCfg = {}
with open( main.dependencyPath + "/json/extra.json" ) as template:
hostCfg = json.load( template )
main.step( "Removing host configuration" )
main.pingChart[ 'ip' ][ 'expect' ] = 0
- mac, cfg = hostCfg[ 'hosts' ].popitem( )
+ mac, cfg = hostCfg[ 'hosts' ].popitem()
main.Cluster.active( 0 ).REST.removeNetCfg( subjectClass="hosts",
subjectKey=urllib.quote(
mac,
@@ -580,7 +576,7 @@
configKey="basic" )
main.step( "Removing configuration" )
main.pingChart[ 'ip' ][ 'expect' ] = 0
- mac, cfg = hostCfg[ 'hosts' ].popitem( )
+ mac, cfg = hostCfg[ 'hosts' ].popitem()
main.Cluster.active( 0 ).REST.removeNetCfg( subjectClass="hosts",
subjectKey=urllib.quote(
mac,
@@ -591,20 +587,20 @@
main.Cluster.active( 0 ).REST.removeNetCfg( subjectClass="apps",
subjectKey="org.onosproject.segmentrouting",
configKey="xconnect" )
+
@staticmethod
def nodesCheck( nodes ):
results = True
nodesOutput = main.Cluster.command( "nodes", specificDriver=2 )
- ips = main.Cluster.getIps( activeOnly=True )
- ips.sort()
+ ips = sorted( main.Cluster.getIps( activeOnly=True ) )
for i in nodesOutput:
try:
current = json.loads( i )
activeIps = []
currentResult = False
for node in current:
- if node['state'] == 'READY':
- activeIps.append( node['ip'] )
+ if node[ 'state' ] == 'READY':
+ activeIps.append( node[ 'ip' ] )
currentResult = True
for ip in ips:
if ip not in activeIps:
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/cord_fabric.py b/TestON/tests/USECASE/SegmentRouting/dependencies/cord_fabric.py
old mode 100755
new mode 100644
index 1c7e258..1012fef
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/cord_fabric.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/cord_fabric.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,7 +20,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
import os
import re
import math
@@ -35,9 +34,9 @@
# Parse command line options and dump results
-def parseOptions( ):
- """Parse command line options"""
- parser = OptionParser( )
+def parseOptions():
+ "Parse command line options"
+ parser = OptionParser()
parser.add_option( '--spine', dest='spine', type='int', default=2,
help='number of spine switches, default=2' )
parser.add_option( '--leaf', dest='leaf', type='int', default=2,
@@ -50,52 +49,54 @@
help='vid of cross connect, default=-1, -1 means utilize default value' )
parser.add_option( '--ipv6', action="store_true", dest='ipv6',
help='hosts are capable to use also ipv6' )
- (options, args) = parser.parse_args( )
+ ( options, args ) = parser.parse_args()
return options, args
-opts, args = parseOptions( )
+opts, args = parseOptions()
IP6_SUBNET_CLASS = 120
IP4_SUBNET_CLASS = 24
+
class LeafAndSpine6( Topo ):
+
"""
Create Leaf and Spine Topology for IPv4/IPv6 tests.
"""
def __init__( self, spine=2, leaf=2, fanout=2, **opts ):
Topo.__init__( self, **opts )
- spines = {}
- leafs = {}
+ spines = {}
+ leafs = {}
"""
We calculate the offset from /120 and from /24 in order to have
a number of /120 and /24 subnets == leaf
"""
- offset = int(math.ceil(math.sqrt( leaf )))
+ offset = int( math.ceil( math.sqrt( leaf ) ) )
"""
We calculate the subnets to use and set options
"""
- ipv6SubnetClass = unicode('2000::/%s' % (IP6_SUBNET_CLASS - offset))
- ipv6Subnets = list(IPv6Network(ipv6SubnetClass).subnets( new_prefix = IP6_SUBNET_CLASS ))
- ipv4SubnetClass = unicode('10.0.0.0/%s' % (IP4_SUBNET_CLASS - offset))
- ipv4Subnets = list(IPv4Network(ipv4SubnetClass).subnets( new_prefix = IP4_SUBNET_CLASS ))
- linkopts = dict( bw=100 )
+ ipv6SubnetClass = unicode( '2000::/%s' % ( IP6_SUBNET_CLASS - offset ) )
+ ipv6Subnets = list( IPv6Network( ipv6SubnetClass ).subnets( new_prefix=IP6_SUBNET_CLASS ) )
+ ipv4SubnetClass = unicode( '10.0.0.0/%s' % ( IP4_SUBNET_CLASS - offset ) )
+ ipv4Subnets = list( IPv4Network( ipv4SubnetClass ).subnets( new_prefix=IP4_SUBNET_CLASS ) )
+ linkopts = dict( bw=100 )
"""
We create the spine switches
"""
for s in range( spine ):
- spines[ s ] = self.addSwitch( 'spine10%s' % (s + 1),
- dpid="00000000010%s" % (s + 1) )
+ spines[ s ] = self.addSwitch( 'spine10%s' % ( s + 1 ),
+ dpid="00000000010%s" % ( s + 1 ) )
"""
We create the leaf switches
"""
for ls in range( leaf ):
- leafs[ ls ] = self.addSwitch( 'leaf%s' % (ls + 1),
- dpid="00000000000%s" % (1 + ls) )
- ipv6Subnet = ipv6Subnets[ ls ]
- ipv6Hosts = list(ipv6Subnet.hosts())
- ipv4Subnet = ipv4Subnets[ ls ]
- ipv4Hosts = list(ipv4Subnet.hosts())
+ leafs[ ls ] = self.addSwitch( 'leaf%s' % ( ls + 1 ),
+ dpid="00000000000%s" % ( 1 + ls ) )
+ ipv6Subnet = ipv6Subnets[ ls ]
+ ipv6Hosts = list( ipv6Subnet.hosts() )
+ ipv4Subnet = ipv4Subnets[ ls ]
+ ipv4Hosts = list( ipv4Subnet.hosts() )
"""
We add the hosts
"""
@@ -105,13 +106,13 @@
ipv4 = ipv4Hosts[ f ]
ipv4Gateway = ipv4Hosts[ len( ipv4Hosts ) - 1 ]
host = self.addHost(
- name='h%s' % (ls * fanout + f + 1),
+ name='h%s' % ( ls * fanout + f + 1 ),
cls=Ipv6Host,
- ip="%s/%s" %(ipv4, IP4_SUBNET_CLASS),
+ ip="%s/%s" % ( ipv4, IP4_SUBNET_CLASS ),
gateway='%s' % ipv4Gateway,
- ipv6="%s/%s" %(ipv6, IP6_SUBNET_CLASS),
+ ipv6="%s/%s" % ( ipv6, IP6_SUBNET_CLASS ),
ipv6Gateway="%s" % ipv6Gateway
- )
+ )
self.addLink( host, leafs[ ls ], **linkopts )
"""
Connect leaf to all spines
@@ -120,45 +121,45 @@
switch = spines[ s ]
self.addLink( leafs[ ls ], switch, **linkopts )
+
class LeafAndSpine( Topo ):
+
def __init__( self, spine=2, leaf=2, fanout=2, **opts ):
"Create Leaf and Spine Topo."
Topo.__init__( self, **opts )
# Add spine switches
- spines = { }
- leafs = { }
+ spines = {}
+ leafs = {}
for s in range( spine ):
- spines[ s ] = self.addSwitch( 'spine10%s' % (s + 1),
- dpid="00000000010%s" % (s + 1) )
+ spines[ s ] = self.addSwitch( 'spine10%s' % ( s + 1 ),
+ dpid="00000000010%s" % ( s + 1 ) )
# Set link speeds to 100Mb/s
linkopts = dict( bw=100 )
# Add Leaf switches
for ls in range( leaf ):
- leafs[ ls ] = self.addSwitch( 'leaf%s' % (ls + 1),
- dpid="00000000000%s" % (1 + ls) )
+ leafs[ ls ] = self.addSwitch( 'leaf%s' % ( ls + 1 ),
+ dpid="00000000000%s" % ( 1 + ls ) )
# Add hosts under a leaf, fanout hosts per leaf switch
for f in range( fanout ):
- host = self.addHost( 'h%s' % (ls * fanout + f + 1),
+ host = self.addHost( 'h%s' % ( ls * fanout + f + 1 ),
cls=IpHost,
- ip='10.0.%s.%s/24' % ((ls + 1), (f + 1)),
- gateway='10.0.%s.254' % (ls + 1) )
+ ip='10.0.%s.%s/24' % ( ( ls + 1 ), ( f + 1 ) ),
+ gateway='10.0.%s.254' % ( ls + 1 ) )
self.addLink( host, leafs[ ls ], **linkopts )
# Add Xconnect simulation
if ls is 0:
in1 = self.addHost( 'in1', cls=IpHost, ip='10.0.1.9/24', mac="00:00:00:00:00:09" )
- self.addLink( in1, leafs[0], **linkopts )
+ self.addLink( in1, leafs[ 0 ], **linkopts )
out1 = self.addHost( 'out1', cls=IpHost, ip='10.0.9.1/24', mac="00:00:00:00:09:01" )
- self.addLink( out1, leafs[0], **linkopts )
+ self.addLink( out1, leafs[ 0 ], **linkopts )
br1 = self.addSwitch( 'br1', cls=OVSBridge )
self.addLink( br1, leafs[ 0 ], **linkopts )
vlans = [ 1, 5, 10 ]
for vid in vlans:
olt = self.addHost( 'olt%s' % vid, cls=VLANHost, vlan=vid,
- ip="10.%s.0.1/24" % vid
- , mac="00:00:%02d:00:00:01" % vid )
+ ip="10.%s.0.1/24" % vid, mac="00:00:%02d:00:00:01" % vid )
vsg = self.addHost( 'vsg%s' % vid, cls=VLANHost, vlan=vid,
- ip="10.%s.0.2/24" % vid
- , mac="00:00:%02d:00:00:02" % vid )
+ ip="10.%s.0.2/24" % vid, mac="00:00:%02d:00:00:02" % vid )
self.addLink( olt, leafs[ 0 ], **linkopts )
self.addLink( vsg, br1, **linkopts )
# Connect leaf to all spines
@@ -166,12 +167,14 @@
switch = spines[ s ]
self.addLink( leafs[ ls ], switch, **linkopts )
+
class IpHost( Host ):
+
def __init__( self, name, *args, **kwargs ):
super( IpHost, self ).__init__( name, *args, **kwargs )
- gateway = re.split('\.|/', kwargs['ip'])
- gateway[3] = '254'
- self.gateway = '.'.join(gateway[0:4])
+ gateway = re.split( '\.|/', kwargs[ 'ip' ] )
+ gateway[ 3 ] = '254'
+ self.gateway = '.'.join( gateway[ 0:4 ] )
def config( self, **kwargs ):
Host.config( self, **kwargs )
@@ -179,77 +182,84 @@
self.cmd( mtu )
self.cmd( 'ip route add default via %s' % self.gateway )
+
class Ipv6Host( IpHost ):
+
"""
Abstraction to model an augmented host with a ipv6
functionalities as well
"""
def __init__( self, name, *args, **kwargs ):
- IpHost.__init__(self, name, *args, **kwargs)
+ IpHost.__init__( self, name, *args, **kwargs )
def config( self, **kwargs ):
IpHost.config( self, **kwargs )
- ipv6Cmd = 'ifconfig %s-eth0 inet6 add %s' % (self.name, kwargs['ipv6'])
- ipv6GatewayCmd = 'ip -6 route add default via %s' % kwargs['ipv6Gateway']
- ipv6MtuCmd = 'ifconfig %s-eth0 inet6 mtu 1490' % (self.name)
+ ipv6Cmd = 'ifconfig %s-eth0 inet6 add %s' % ( self.name, kwargs[ 'ipv6' ] )
+ ipv6GatewayCmd = 'ip -6 route add default via %s' % kwargs[ 'ipv6Gateway' ]
+ ipv6MtuCmd = 'ifconfig %s-eth0 inet6 mtu 1490' % ( self.name )
self.cmd( ipv6Cmd )
self.cmd( ipv6GatewayCmd )
self.cmd( ipv6MtuCmd )
+
class VLANHost( Host ):
+
"Host connected to VLAN interface"
def config( self, vlan=100, **params ):
- """Configure VLANHost according to (optional) parameters:
+ """Configure VLANHost according to ( optional ) parameters:
vlan: VLAN ID for default interface"""
r = super( VLANHost, self ).config( **params )
- intf = self.defaultIntf( )
+ intf = self.defaultIntf()
# remove IP from default, "physical" interface
self.cmd( 'ifconfig %s inet 0' % intf )
- intf = self.defaultIntf( )
+ intf = self.defaultIntf()
# create VLAN interface
- self.cmd( 'vconfig add %s %d' % (intf, vlan) )
- self.cmd( 'ifconfig %s.%d %s' % (intf, vlan, params[ 'ip' ]) )
+ self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
+ self.cmd( 'ifconfig %s.%d %s' % ( intf, vlan, params[ 'ip' ] ) )
# update the intf name and host's intf map
- self.cmd( 'ifconfig %s.%d mtu 1480' % (intf, vlan) )
- newName = '%s.%d' % (intf, vlan)
- # update the (Mininet) interface to refer to VLAN interface name
+ self.cmd( 'ifconfig %s.%d mtu 1480' % ( intf, vlan ) )
+ newName = '%s.%d' % ( intf, vlan )
+ # update the ( Mininet ) interface to refer to VLAN interface name
intf.name = newName
# add VLAN interface to host's name to intf map
self.nameToIntf[ newName ] = intf
+
class ExtendedCLI( CLI ):
+
"""
Extends mininet CLI with the following commands:
addvlanhost
addiphost
"""
def do_addhost( self, line ):
- #Parsing args from CLI
- args = line.split( )
- if len( args ) < 3 or len( args ) :
+ # Parsing args from CLI
+ args = line.split()
+ if len( args ) < 3 or len( args ):
"usage: addhost hostname switch **params"
- hostname, switch = args[0], args[1]
- params = eval(line.split( ' ', 3 )[2])
+ hostname, switch = args[ 0 ], args[ 1 ]
+ params = eval( line.split( ' ', 3 )[ 2 ] )
if 'cls' in params:
- params['cls'] = eval( params[ 'cls' ] )
+ params[ 'cls' ] = eval( params[ 'cls' ] )
if hostname in self.mn:
- #error( '%s already exists!\n' % hostname )
+ # error( '%s already exists!\n' % hostname )
return
if switch not in self.mn:
- #error( '%s does not exist!\n' % switch )
+ # error( '%s does not exist!\n' % switch )
return
print params
host = self.mn.addHostCfg( hostname, **params )
- #switch.attach( link.intf2 )
- #host.config()
+ # switch.attach( link.intf2 )
+ # host.config()
link = self.mn.addLink( host, switch )
- host.config(**params)
+ host.config( **params )
def do_pingall6( self, line ):
"Ping6 between all hosts."
self.mn.pingAll6( line )
+
def config( opts ):
spine = opts.spine
leaf = opts.leaf
@@ -257,7 +267,7 @@
vlan = opts.vlan
ipv6 = opts.ipv6
controllers = [ os.environ[ 'OC%s' % i ] for i in
- range( 1, opts.onos + 1 ) ] if (opts.onos) else [
+ range( 1, opts.onos + 1 ) ] if ( opts.onos ) else [
'127.0.0.1' ]
if not ipv6:
topo = LeafAndSpine(
@@ -265,7 +275,7 @@
leaf=leaf,
fanout=fanout,
vlan=vlan,
- )
+ )
else:
topo = LeafAndSpine6(
spine=spine,
@@ -273,20 +283,20 @@
fanout=fanout,
vlan=vlan,
ipv6=ipv6
- )
+ )
net = Mininet( topo=topo, link=TCLink, build=False,
switch=UserSwitch, controller=None, autoSetMacs=True )
i = 0
for ip in controllers:
- net.addController( "c%s" % (i), controller=RemoteController, ip=ip )
- i += 1;
- net.build( )
- net.start( )
+ net.addController( "c%s" % ( i ), controller=RemoteController, ip=ip )
+ i += 1
+ net.build()
+ net.start()
if not ipv6:
out1 = net.get( 'out1' )
- out1.cmd( "arp -s 10.0.9.254 10:00:00:00:00:01 -i %s " % (out1.intf()) )
- ExtendedCLI(net)
- net.stop( )
+ out1.cmd( "arp -s 10.0.9.254 10:00:00:00:00:01 -i %s " % ( out1.intf() ) )
+ ExtendedCLI( net )
+ net.stop()
if __name__ == '__main__':
setLogLevel( 'info' )
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py b/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py
index 93f0735..a45bdef 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunction/USECASE_SdnipFunction.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,8 +18,9 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# Testing the functionality of SDN-IP with single ONOS instance
+
+
class USECASE_SdnipFunction:
def __init__( self ):
@@ -50,7 +51,7 @@
# connect all switches to controller
swResult = main.TRUE
- for i in range ( 1, int( main.params['config']['switchNum'] ) + 1 ):
+ for i in range( 1, int( main.params[ 'config' ][ 'switchNum' ] ) + 1 ):
sw = "sw%s" % ( i )
swResult = swResult and \
main.Mininet.assignSwController( sw, main.Cluster.active( 0 ).ipAddress )
@@ -73,7 +74,7 @@
actual=( "PasswordAuthentication" in tunnelResult ),
onpass="Created tunnel succeeded",
onfail="Create tunnel failed" )
- if ("PasswordAuthentication" not in tunnelResult) :
+ if ( "PasswordAuthentication" not in tunnelResult ):
main.cleanAndExit()
def CASE101( self, main ):
@@ -106,7 +107,7 @@
main.case( "Activate sdn-ip application" )
main.log.info( "waiting link discovery......" )
- time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
+ time.sleep( int( main.params[ 'timers' ][ 'TopoDiscovery' ] ) )
main.log.info( "Get links in the network" )
summaryResult = main.Cluster.active( 0 ).CLI.summary()
@@ -115,7 +116,7 @@
main.log.info( listResult )
if linkNum < 100:
main.log.error( "Link number is wrong!" )
- time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
+ time.sleep( int( main.params[ 'timers' ][ 'TopoDiscovery' ] ) )
listResult = main.Cluster.active( 0 ).CLI.links( jsonFormat=False )
main.log.info( listResult )
main.cleanAndExit()
@@ -130,7 +131,6 @@
main.log.info( "Activate SDN-IP failed!" )
main.cleanAndExit()
-
main.log.info( "Wait SDN-IP to finish installing connectivity intents \
and the BGP paths in data plane are ready..." )
time.sleep( int( main.params[ 'timers' ][ 'SdnIpSetup' ] ) )
@@ -139,11 +139,10 @@
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
time.sleep( int( main.params[ 'timers' ][ 'PathAvailable' ] ) )
-
def CASE102( self, main ):
- '''
+ """
This test case is to load the methods from other Python files.
- '''
+ """
import imp
main.case( "Loading methods from other Python file" )
@@ -154,12 +153,10 @@
wrapperFile +
".py" )
-
def CASE1( self, main ):
- '''
+ """
ping test from 7 bgp peers to BGP speaker
- '''
-
+ """
main.case( "Ping tests between BGP peers and speakers" )
main.Functions.pingSpeakerToPeer( main, speakers=[ "spk1" ],
peers=[ "p64514", "p64515", "p64516" ],
@@ -174,16 +171,15 @@
expectAllSuccess=True )
def CASE2( self, main ):
- '''
+ """
point-to-point intents test for each BGP peer and BGP speaker pair
- '''
+ """
main.sdnBase.pToPIntentTest( 6 )
-
def CASE3( self, main ):
- '''
+ """
routes and intents check to all BGP peers
- '''
+ """
main.case( "Check routes and M2S intents to all BGP peers" )
allRoutesExpected = []
@@ -197,17 +193,16 @@
main.sdnBase.routeAndIntentCheck( allRoutesExpected, 7 )
-
def CASE4( self, main ):
- '''
+ """
Ping test in data plane for each route
- '''
+ """
main.case( "Ping test for each route, all hosts behind BGP peers" )
- #No vlan
+ # No vlan
main.Functions.pingHostToHost( main,
hosts=[ "h64514", "h64515", "h64516" ],
expectAllSuccess=True )
- #vlan 10
+ # vlan 10
main.Functions.pingHostToHost( main,
hosts=[ "h64519", "h64520" ],
expectAllSuccess=True )
@@ -218,28 +213,27 @@
expectAllSuccess=True )
def CASE5( self, main ):
- '''
+ """
Cut links to peers one by one, check routes/intents
- '''
+ """
main.sdnBase.linkUpDownCheck( "p64514", "p64515", "p64516",
6, 6, 5, 5, 4, 4,
"spk1", [ "h64514", "h64515", "h64516" ],
"down" )
-
def CASE6( self, main ):
- '''
+ """
Recover links to peers one by one, check routes/intents
- '''
+ """
main.sdnBase.linkUpDownCheck( "p64514", "p64515", "p64516",
5, 5, 6, 6, 7, 7,
"spk1", [ "h64514", "h64515", "h64516" ],
"up" )
def CASE7( self, main ):
- '''
+ """
Shut down a edge switch, check P-2-P and M-2-S intents, ping test
- '''
+ """
import time
main.case( "Stop edge sw32,check P-2-P and M-2-S intents, ping test" )
main.step( "Stop sw32" )
@@ -250,9 +244,9 @@
if result == main.TRUE:
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
- main.Functions.checkRouteNum( main, 6 ) #stop one sw, which bring one link between peer and sw down.
+ main.Functions.checkRouteNum( main, 6 ) # stop one sw, which bring one link between peer and sw down.
main.Functions.checkM2SintentNum( main, 6 )
- main.Functions.checkP2PintentNum( main, 36 ) #6 intents from sw to speakers x 6 intents to sw x 2 intents between them
+ main.Functions.checkP2PintentNum( main, 36 ) # 6 intents from sw to speakers x 6 intents to sw x 2 intents between them
else:
main.log.error( "Stopping switch failed!" )
main.cleanAndExit()
@@ -268,7 +262,7 @@
onpass="Ping test result is correct",
onfail="Ping test result is wrong" )
- if pingResult1 == False:
+ if not pingResult1:
main.cleanAndExit()
main.step( "Check ping between BGP peers and speakers" )
@@ -282,38 +276,37 @@
onpass="Speaker1 ping peers successful",
onfail="Speaker1 ping peers NOT successful" )
- if pingResult2 == False:
+ if not pingResult2:
main.cleanAndExit()
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
main.FALSE,
- kwargs={'isPENDING':False},
+ kwargs={ 'isPENDING': False },
attempts=10 )
- utilities.assertEquals( \
+ utilities.assertEquals(
expect=main.TRUE,
actual=flowCheck,
onpass="Flow status is correct!",
onfail="Flow status is wrong!" )
-
def CASE8( self, main ):
- '''
- Bring up the edge switch (sw32) which was shut down in CASE7,
+ """
+ Bring up the edge switch ( sw32 ) which was shut down in CASE7,
check P-2-P and M-2-S intents, ping test
- '''
+ """
import time
main.case( "Start the edge sw32, check P-2-P and M-2-S intents, ping test" )
main.step( "Start sw32" )
result1 = main.Mininet.switch( SW="sw32", OPTION="start" )
- utilities.assertEquals( \
+ utilities.assertEquals(
expect=main.TRUE,
actual=result1,
onpass="Starting switch succeeded!",
onfail="Starting switch failed!" )
result2 = main.Mininet.assignSwController( "sw32", main.Cluster.active( 0 ).ipAddress )
- utilities.assertEquals( \
+ utilities.assertEquals(
expect=main.TRUE,
actual=result2,
onpass="Connect switch to ONOS succeeded!",
@@ -331,28 +324,27 @@
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
main.FALSE,
- kwargs={'isPENDING':False},
+ kwargs={ 'isPENDING': False },
attempts=10 )
- utilities.assertEquals( \
+ utilities.assertEquals(
expect=main.TRUE,
actual=flowCheck,
onpass="Flow status is correct!",
onfail="Flow status is wrong!" )
# Ping test
- main.Functions.pingSpeakerToPeer( main, speakers=["spk1"],
- peers=["p64514", "p64515", "p64516"],
- expectAllSuccess=True )
+ main.Functions.pingSpeakerToPeer( main, speakers=[ "spk1" ],
+ peers=[ "p64514", "p64515", "p64516" ],
+ expectAllSuccess=True )
main.Functions.pingHostToHost( main,
- hosts=["h64514", "h64515", "h64516"],
- expectAllSuccess=True )
-
+ hosts=[ "h64514", "h64515", "h64516" ],
+ expectAllSuccess=True )
def CASE9( self, main ):
- '''
+ """
Bring down a switch in best path, check:
route number, P2P intent number, M2S intent number, ping test
- '''
+ """
main.case( "Stop sw11 located in best path, \
check route number, P2P intent number, M2S intent number, ping test" )
@@ -382,27 +374,26 @@
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
main.FALSE,
- kwargs={'isPENDING':False},
+ kwargs={ 'isPENDING': False },
attempts=10 )
- utilities.assertEquals( \
+ utilities.assertEquals(
expect=main.TRUE,
actual=flowCheck,
onpass="Flow status is correct!",
onfail="Flow status is wrong!" )
# Ping test
- main.Functions.pingSpeakerToPeer( main, speakers=["spk1"],
- peers=["p64514", "p64515", "p64516"],
- expectAllSuccess=True )
+ main.Functions.pingSpeakerToPeer( main, speakers=[ "spk1" ],
+ peers=[ "p64514", "p64515", "p64516" ],
+ expectAllSuccess=True )
main.Functions.pingHostToHost( main,
- hosts=["h64514", "h64515", "h64516"],
- expectAllSuccess=True )
-
+ hosts=[ "h64514", "h64515", "h64516" ],
+ expectAllSuccess=True )
def CASE10( self, main ):
- '''
+ """
Bring up the switch which was stopped in CASE9, check:
route number, P2P intent number, M2S intent number, ping test
- '''
+ """
main.case( "Start sw11 which was stopped in CASE9, \
check route number, P2P intent number, M2S intent number, ping test" )
@@ -437,17 +428,17 @@
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
main.FALSE,
- kwargs={'isPENDING':False},
+ kwargs={ 'isPENDING': False },
attempts=10 )
- utilities.assertEquals( \
+ utilities.assertEquals(
expect=main.TRUE,
actual=flowCheck,
onpass="Flow status is correct!",
onfail="Flow status is wrong!" )
# Ping test
- main.Functions.pingSpeakerToPeer( main, speakers=["spk1"],
- peers=["p64514", "p64515", "p64516"],
- expectAllSuccess=True )
+ main.Functions.pingSpeakerToPeer( main, speakers=[ "spk1" ],
+ peers=[ "p64514", "p64515", "p64516" ],
+ expectAllSuccess=True )
main.Functions.pingHostToHost( main,
- hosts=["h64514", "h64515", "h64516"],
- expectAllSuccess=True )
+ hosts=[ "h64514", "h64515", "h64516" ],
+ expectAllSuccess=True )
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunction/dependencies/Functions.py b/TestON/tests/USECASE/USECASE_SdnipFunction/dependencies/Functions.py
index a284213..81d2d96 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunction/dependencies/Functions.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunction/dependencies/Functions.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,11 +18,10 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
def checkRouteNum( main, routeNumExpected ):
import time
main.step( "Check routes installed" )
- wait = int( main.params['timers']['PathAvailable'] )
+ wait = int( main.params[ 'timers' ][ 'PathAvailable' ] )
main.log.info( "Route number expected:" )
main.log.info( routeNumExpected )
main.log.info( "Route number from ONOS CLI:" )
@@ -32,85 +31,88 @@
time.sleep( wait )
routeNumActual = main.Cluster.active( 0 ).CLI.ipv4RouteNumber()
main.log.info( routeNumActual )
- utilities.assertEquals( \
- expect = routeNumExpected, actual = routeNumActual,
- onpass = "Route number is correct!",
- onfail = "Route number is wrong!" )
+ utilities.assertEquals(
+ expect=routeNumExpected, actual=routeNumActual,
+ onpass="Route number is correct!",
+ onfail="Route number is wrong!" )
+
def checkM2SintentNum( main, intentNumExpected ):
import time
main.step( "Check M2S intents installed" )
- wait = int( main.params['timers']['PathAvailable'] )
- jsonResult = main.Cluster.active( 0 ).CLI.intents( jsonFormat = True, summary = True,
- TYPE = "multiPointToSinglePoint" )
+ wait = int( main.params[ 'timers' ][ 'PathAvailable' ] )
+ jsonResult = main.Cluster.active( 0 ).CLI.intents( jsonFormat=True, summary=True,
+ TYPE="multiPointToSinglePoint" )
try:
- intentNumActual = jsonResult['installed']
+ intentNumActual = jsonResult[ 'installed' ]
except TypeError as e:
intentNumActual = -1
main.log.error( e )
if intentNumActual != intentNumExpected:
time.sleep( wait )
- jsonResult = main.Cluster.active( 0 ).CLI.intents( jsonFormat = True, summary = True,
- TYPE = "multiPointToSinglePoint" )
+ jsonResult = main.Cluster.active( 0 ).CLI.intents( jsonFormat=True, summary=True,
+ TYPE="multiPointToSinglePoint" )
try:
- intentNumActual = jsonResult['installed']
+ intentNumActual = jsonResult[ 'installed' ]
except TypeError as e:
intentNumActual = -1
main.log.error( e )
main.log.info( "Intent number expected: {}".format( intentNumExpected ) )
main.log.info( "Intent number from ONOS CLI: {}".format( intentNumActual ) )
- utilities.assertEquals( \
- expect = intentNumExpected, actual = intentNumActual,
- onpass = "M2S intent number is correct!",
- onfail = "M2S intent number is wrong!" )
+ utilities.assertEquals(
+ expect=intentNumExpected, actual=intentNumActual,
+ onpass="M2S intent number is correct!",
+ onfail="M2S intent number is wrong!" )
+
def checkP2PintentNum( main, intentNumExpected ):
import time
main.step( "Check P2P intents installed" )
- wait = int( main.params['timers']['PathAvailable'] )
- jsonResult = main.Cluster.active( 0 ).CLI.intents( jsonFormat = True, summary = True,
- TYPE = "pointToPoint" )
+ wait = int( main.params[ 'timers' ][ 'PathAvailable' ] )
+ jsonResult = main.Cluster.active( 0 ).CLI.intents( jsonFormat=True, summary=True,
+ TYPE="pointToPoint" )
try:
- intentNumActual = jsonResult['installed']
+ intentNumActual = jsonResult[ 'installed' ]
except TypeError as e:
intentNumActual = -1
main.log.error( e )
if intentNumActual != intentNumExpected:
time.sleep( wait )
- jsonResult = main.Cluster.active( 0 ).CLI.intents( jsonFormat = True, summary = True,
- TYPE = "pointToPoint" )
+ jsonResult = main.Cluster.active( 0 ).CLI.intents( jsonFormat=True, summary=True,
+ TYPE="pointToPoint" )
try:
- intentNumActual = jsonResult['installed']
+ intentNumActual = jsonResult[ 'installed' ]
except TypeError as e:
intentNumActual = -1
main.log.error( e )
main.log.info( "Intent number expected: {}".format( intentNumExpected ) )
main.log.info( "Intent number from ONOS CLI: {}".format( intentNumActual ) )
- utilities.assertEquals( \
- expect = intentNumExpected, actual = intentNumActual,
- onpass = "P2P intent number is correct!",
- onfail = "P2P intent number is wrong!" )
+ utilities.assertEquals(
+ expect=intentNumExpected, actual=intentNumActual,
+ onpass="P2P intent number is correct!",
+ onfail="P2P intent number is wrong!" )
+
def checkFlowNum( main, switch, flowNumExpected ):
import time
main.step( "Check flow entry number in " + switch )
- wait = int( main.params['timers']['PathAvailable'] )
+ wait = int( main.params[ 'timers' ][ 'PathAvailable' ] )
main.log.info( "Flow number expected: {}".format( flowNumExpected ) )
flowNumActual = main.Mininet.getSwitchFlowCount( switch )
- if flowNumActual != flowNumExpected :
+ if flowNumActual != flowNumExpected:
time.sleep( wait )
flowNumActual = main.Mininet.getSwitchFlowCount( switch )
main.log.info( "Flow number actual: {}".format( flowNumActual ) )
- utilities.assertEquals( \
- expect = flowNumExpected, actual = flowNumActual,
- onpass = "Flow number in " + switch + " is correct!",
- onfail = "Flow number in " + switch + " is wrong!" )
+ utilities.assertEquals(
+ expect=flowNumExpected, actual=flowNumActual,
+ onpass="Flow number in " + switch + " is correct!",
+ onfail="Flow number in " + switch + " is wrong!" )
-def pingSpeakerToPeer( main, speakers = [ "spk1" ],
- peers = [ "peer64514", "peer64515", "peer64516" ],
- expectAllSuccess = True ):
+def pingSpeakerToPeer( main, speakers=[ "spk1" ],
+ peers=[ "peer64514", "peer64515", "peer64516" ],
+ expectAllSuccess=True ):
"""
Carry out ping test between each BGP speaker and peer pair
Optional argument:
@@ -135,26 +137,26 @@
if expectAllSuccess:
for speaker in speakers:
for peer in peers:
- tmpResult = main.Mininet.pingHost( src = speaker,
- target = peer )
+ tmpResult = main.Mininet.pingHost( src=speaker,
+ target=peer )
result = result and ( tmpResult == main.TRUE )
else:
for speaker in speakers:
for peer in peers:
- tmpResult = main.Mininet.pingHost( src = speaker,
- target = peer )
+ tmpResult = main.Mininet.pingHost( src=speaker,
+ target=peer )
- utilities.assert_equals( expect = True, actual = result,
- onpass = "Ping test results are expected",
- onfail = "Ping test results are Not expected" )
+ utilities.assert_equals( expect=True, actual=result,
+ onpass="Ping test results are expected",
+ onfail="Ping test results are Not expected" )
- if result == False:
+ if not result:
main.cleanAndExit()
def pingHostToHost( main,
- hosts = [ "h64514", "h64515", "h64516" ],
- expectAllSuccess = True ):
+ hosts=[ "h64514", "h64515", "h64516" ],
+ expectAllSuccess=True ):
"""
Carry out ping test between each BGP host pair
Optional argument:
@@ -173,23 +175,22 @@
for srcHost in hosts:
for targetHost in hosts:
if srcHost != targetHost:
- tmpResult = main.Mininet.pingHost( src = srcHost,
- target = targetHost )
+ tmpResult = main.Mininet.pingHost( src=srcHost,
+ target=targetHost )
result = result and ( tmpResult == main.TRUE )
else:
for srcHost in hosts:
for targetHost in hosts:
if srcHost != targetHost:
- tmpResult = main.Mininet.pingHost( src = srcHost,
- target = targetHost )
+ tmpResult = main.Mininet.pingHost( src=srcHost,
+ target=targetHost )
result = result and ( tmpResult == main.FALSE )
- utilities.assert_equals( expect = True, actual = result,
- onpass = "Ping test results are expected",
- onfail = "Ping test results are Not expected" )
+ utilities.assert_equals( expect=True, actual=result,
+ onpass="Ping test results are expected",
+ onfail="Ping test results are Not expected" )
- '''
+ """
if result == False:
main.cleanAndExit()
- '''
-
+ """
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunction/dependencies/USECASE_SdnipI2MN.py b/TestON/tests/USECASE/USECASE_SdnipFunction/dependencies/USECASE_SdnipI2MN.py
old mode 100755
new mode 100644
index deced6b..23607ad
--- a/TestON/tests/USECASE/USECASE_SdnipFunction/dependencies/USECASE_SdnipI2MN.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunction/dependencies/USECASE_SdnipI2MN.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,18 +20,15 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Set up the SDN-IP topology as same as it on Internet2
"""
-
"""
-AS 64513, (SDN AS)
+AS 64513, ( SDN AS )
AS 64514, reachable by 10.0.4.1
AS 64515, reachable by 10.0.5.1
AS 64516, reachable by 10.0.6.1
"""
-
from mininet.net import Mininet
from mininet.log import setLogLevel, info
from mininet.cli import CLI
@@ -45,13 +42,15 @@
# onos1IP = '10.254.1.201'
numSw = 39
+
class VLANHost( Host ):
+
def config( self, vlan=100, intfName=None, **params ):
r = super( Host, self ).config( **params )
intf = self.intf( intfName )
self.cmd( 'ifconfig %s inet 0' % intf )
self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params[ 'ip' ] ) )
newName = '%s.%d' % ( intf, vlan )
intf.name = newName
self.nameToIntf[ newName ] = intf
@@ -59,6 +58,7 @@
class SDNTopo( Topo ):
+
"SDN Topology"
def __init__( self, *args, **kwargs ):
@@ -75,107 +75,105 @@
p64519 = self.addHost( 'p64519', cls=VLANHost, vlan=10 )
p64520 = self.addHost( 'p64520', cls=VLANHost, vlan=10 )
- '''
- sw1 = self.addSwitch( 'SEAT', dpid = '00000000000000a1' )
- sw2 = self.addSwitch( 'PORT', dpid = '00000000000000a2' )
- sw3 = self.addSwitch( 'SUNN', dpid = '00000000000000a3' )
- sw4 = self.addSwitch( 'RENO', dpid = '00000000000000a4' )
- sw5 = self.addSwitch( 'LOSA', dpid = '00000000000000a5' )
- sw6 = self.addSwitch( 'MISS', dpid = '00000000000000a6' )
- sw7 = self.addSwitch( 'LASV', dpid = '00000000000000a7' )
- sw8 = self.addSwitch( 'SALT', dpid = '00000000000000a8' )
- sw9 = self.addSwitch( 'PHOE', dpid = '00000000000000a9' )
- sw10 = self.addSwitch( 'TUCS', dpid = '0000000000000a10' )
- sw11 = self.addSwitch( 'DENV', dpid = '0000000000000a11' )
- sw12 = self.addSwitch( 'ELPA', dpid = '0000000000000a12' )
- sw13 = self.addSwitch( 'MINN', dpid = '0000000000000a13' )
- sw14 = self.addSwitch( 'KANS', dpid = '0000000000000a14' )
- sw15 = self.addSwitch( 'TULS', dpid = '0000000000000a15' )
- sw16 = self.addSwitch( 'DALL', dpid = '0000000000000a16' )
- sw17 = self.addSwitch( 'HOUH', dpid = '0000000000000a17' )
- sw18 = self.addSwitch( 'COLU', dpid = '0000000000000a18' )
- sw19 = self.addSwitch( 'JCSN', dpid = '0000000000000a19' )
- sw20 = self.addSwitch( 'BATO', dpid = '0000000000000a20' )
- sw21 = self.addSwitch( 'EQCH', dpid = '0000000000000a21' )
- sw22 = self.addSwitch( 'STAR', dpid = '0000000000000a22' )
- sw23 = self.addSwitch( 'CHIC', dpid = '0000000000000a23' )
- sw24 = self.addSwitch( 'INDI', dpid = '0000000000000a24' )
- sw25 = self.addSwitch( 'CINC', dpid = '0000000000000a25' )
- sw26 = self.addSwitch( 'LOUI', dpid = '0000000000000a26' )
- sw27 = self.addSwitch( 'ATLA', dpid = '0000000000000a27' )
- sw28 = self.addSwitch( 'JACK', dpid = '0000000000000a28' )
- sw29 = self.addSwitch( 'CLEV', dpid = '0000000000000a29' )
- sw30 = self.addSwitch( 'PITT', dpid = '0000000000000a30' )
- sw31 = self.addSwitch( 'ASHB', dpid = '0000000000000a31' )
- sw32 = self.addSwitch( 'WASH', dpid = '0000000000000a32' )
- sw33 = self.addSwitch( 'RALE', dpid = '0000000000000a33' )
- sw34 = self.addSwitch( 'CHAR', dpid = '0000000000000a34' )
- sw35 = self.addSwitch( 'ALBA', dpid = '0000000000000a35' )
- sw36 = self.addSwitch( 'BOST', dpid = '0000000000000a36' )
- sw37 = self.addSwitch( 'HART', dpid = '0000000000000a37' )
- sw38 = self.addSwitch( 'NEWY', dpid = '0000000000000a38' )
- sw39 = self.addSwitch( 'PHIL', dpid = '0000000000000a39' )
- '''
- 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' )
- sw7 = self.addSwitch( 'sw7', dpid = '00000000000000a7' )
- sw8 = self.addSwitch( 'sw8', dpid = '00000000000000a8' )
- sw9 = self.addSwitch( 'sw9', dpid = '00000000000000a9' )
- sw10 = self.addSwitch( 'sw10', dpid = '0000000000000a10' )
- sw11 = self.addSwitch( 'sw11', dpid = '0000000000000a11' )
- sw12 = self.addSwitch( 'sw12', dpid = '0000000000000a12' )
- sw13 = self.addSwitch( 'sw13', dpid = '0000000000000a13' )
- sw14 = self.addSwitch( 'sw14', dpid = '0000000000000a14' )
- sw15 = self.addSwitch( 'sw15', dpid = '0000000000000a15' )
- sw16 = self.addSwitch( 'sw16', dpid = '0000000000000a16' )
- sw17 = self.addSwitch( 'sw17', dpid = '0000000000000a17' )
- sw18 = self.addSwitch( 'sw18', dpid = '0000000000000a18' )
- sw19 = self.addSwitch( 'sw19', dpid = '0000000000000a19' )
- sw20 = self.addSwitch( 'sw20', dpid = '0000000000000a20' )
- sw21 = self.addSwitch( 'sw21', dpid = '0000000000000a21' )
- sw22 = self.addSwitch( 'sw22', dpid = '0000000000000a22' )
- sw23 = self.addSwitch( 'sw23', dpid = '0000000000000a23' )
- sw24 = self.addSwitch( 'sw24', dpid = '0000000000000a24' )
- sw25 = self.addSwitch( 'sw25', dpid = '0000000000000a25' )
- sw26 = self.addSwitch( 'sw26', dpid = '0000000000000a26' )
- sw27 = self.addSwitch( 'sw27', dpid = '0000000000000a27' )
- sw28 = self.addSwitch( 'sw28', dpid = '0000000000000a28' )
- sw29 = self.addSwitch( 'sw29', dpid = '0000000000000a29' )
- sw30 = self.addSwitch( 'sw30', dpid = '0000000000000a30' )
- sw31 = self.addSwitch( 'sw31', dpid = '0000000000000a31' )
- sw32 = self.addSwitch( 'sw32', dpid = '0000000000000a32' )
- sw33 = self.addSwitch( 'sw33', dpid = '0000000000000a33' )
- sw34 = self.addSwitch( 'sw34', dpid = '0000000000000a34' )
- sw35 = self.addSwitch( 'sw35', dpid = '0000000000000a35' )
- sw36 = self.addSwitch( 'sw36', dpid = '0000000000000a36' )
- sw37 = self.addSwitch( 'sw37', dpid = '0000000000000a37' )
- sw38 = self.addSwitch( 'sw38', dpid = '0000000000000a38' )
- sw39 = self.addSwitch( 'sw39', dpid = '0000000000000a39' )
-
+ """
+ sw1 = self.addSwitch( 'SEAT', dpid='00000000000000a1' )
+ sw2 = self.addSwitch( 'PORT', dpid='00000000000000a2' )
+ sw3 = self.addSwitch( 'SUNN', dpid='00000000000000a3' )
+ sw4 = self.addSwitch( 'RENO', dpid='00000000000000a4' )
+ sw5 = self.addSwitch( 'LOSA', dpid='00000000000000a5' )
+ sw6 = self.addSwitch( 'MISS', dpid='00000000000000a6' )
+ sw7 = self.addSwitch( 'LASV', dpid='00000000000000a7' )
+ sw8 = self.addSwitch( 'SALT', dpid='00000000000000a8' )
+ sw9 = self.addSwitch( 'PHOE', dpid='00000000000000a9' )
+ sw10 = self.addSwitch( 'TUCS', dpid='0000000000000a10' )
+ sw11 = self.addSwitch( 'DENV', dpid='0000000000000a11' )
+ sw12 = self.addSwitch( 'ELPA', dpid='0000000000000a12' )
+ sw13 = self.addSwitch( 'MINN', dpid='0000000000000a13' )
+ sw14 = self.addSwitch( 'KANS', dpid='0000000000000a14' )
+ sw15 = self.addSwitch( 'TULS', dpid='0000000000000a15' )
+ sw16 = self.addSwitch( 'DALL', dpid='0000000000000a16' )
+ sw17 = self.addSwitch( 'HOUH', dpid='0000000000000a17' )
+ sw18 = self.addSwitch( 'COLU', dpid='0000000000000a18' )
+ sw19 = self.addSwitch( 'JCSN', dpid='0000000000000a19' )
+ sw20 = self.addSwitch( 'BATO', dpid='0000000000000a20' )
+ sw21 = self.addSwitch( 'EQCH', dpid='0000000000000a21' )
+ sw22 = self.addSwitch( 'STAR', dpid='0000000000000a22' )
+ sw23 = self.addSwitch( 'CHIC', dpid='0000000000000a23' )
+ sw24 = self.addSwitch( 'INDI', dpid='0000000000000a24' )
+ sw25 = self.addSwitch( 'CINC', dpid='0000000000000a25' )
+ sw26 = self.addSwitch( 'LOUI', dpid='0000000000000a26' )
+ sw27 = self.addSwitch( 'ATLA', dpid='0000000000000a27' )
+ sw28 = self.addSwitch( 'JACK', dpid='0000000000000a28' )
+ sw29 = self.addSwitch( 'CLEV', dpid='0000000000000a29' )
+ sw30 = self.addSwitch( 'PITT', dpid='0000000000000a30' )
+ sw31 = self.addSwitch( 'ASHB', dpid='0000000000000a31' )
+ sw32 = self.addSwitch( 'WASH', dpid='0000000000000a32' )
+ sw33 = self.addSwitch( 'RALE', dpid='0000000000000a33' )
+ sw34 = self.addSwitch( 'CHAR', dpid='0000000000000a34' )
+ sw35 = self.addSwitch( 'ALBA', dpid='0000000000000a35' )
+ sw36 = self.addSwitch( 'BOST', dpid='0000000000000a36' )
+ sw37 = self.addSwitch( 'HART', dpid='0000000000000a37' )
+ sw38 = self.addSwitch( 'NEWY', dpid='0000000000000a38' )
+ sw39 = self.addSwitch( 'PHIL', dpid='0000000000000a39' )
+ """
+ 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' )
+ sw7 = self.addSwitch( 'sw7', dpid='00000000000000a7' )
+ sw8 = self.addSwitch( 'sw8', dpid='00000000000000a8' )
+ sw9 = self.addSwitch( 'sw9', dpid='00000000000000a9' )
+ sw10 = self.addSwitch( 'sw10', dpid='0000000000000a10' )
+ sw11 = self.addSwitch( 'sw11', dpid='0000000000000a11' )
+ sw12 = self.addSwitch( 'sw12', dpid='0000000000000a12' )
+ sw13 = self.addSwitch( 'sw13', dpid='0000000000000a13' )
+ sw14 = self.addSwitch( 'sw14', dpid='0000000000000a14' )
+ sw15 = self.addSwitch( 'sw15', dpid='0000000000000a15' )
+ sw16 = self.addSwitch( 'sw16', dpid='0000000000000a16' )
+ sw17 = self.addSwitch( 'sw17', dpid='0000000000000a17' )
+ sw18 = self.addSwitch( 'sw18', dpid='0000000000000a18' )
+ sw19 = self.addSwitch( 'sw19', dpid='0000000000000a19' )
+ sw20 = self.addSwitch( 'sw20', dpid='0000000000000a20' )
+ sw21 = self.addSwitch( 'sw21', dpid='0000000000000a21' )
+ sw22 = self.addSwitch( 'sw22', dpid='0000000000000a22' )
+ sw23 = self.addSwitch( 'sw23', dpid='0000000000000a23' )
+ sw24 = self.addSwitch( 'sw24', dpid='0000000000000a24' )
+ sw25 = self.addSwitch( 'sw25', dpid='0000000000000a25' )
+ sw26 = self.addSwitch( 'sw26', dpid='0000000000000a26' )
+ sw27 = self.addSwitch( 'sw27', dpid='0000000000000a27' )
+ sw28 = self.addSwitch( 'sw28', dpid='0000000000000a28' )
+ sw29 = self.addSwitch( 'sw29', dpid='0000000000000a29' )
+ sw30 = self.addSwitch( 'sw30', dpid='0000000000000a30' )
+ sw31 = self.addSwitch( 'sw31', dpid='0000000000000a31' )
+ sw32 = self.addSwitch( 'sw32', dpid='0000000000000a32' )
+ sw33 = self.addSwitch( 'sw33', dpid='0000000000000a33' )
+ sw34 = self.addSwitch( 'sw34', dpid='0000000000000a34' )
+ sw35 = self.addSwitch( 'sw35', dpid='0000000000000a35' )
+ sw36 = self.addSwitch( 'sw36', dpid='0000000000000a36' )
+ sw37 = self.addSwitch( 'sw37', dpid='0000000000000a37' )
+ sw38 = self.addSwitch( 'sw38', dpid='0000000000000a38' )
+ sw39 = self.addSwitch( 'sw39', dpid='0000000000000a39' )
# Add a layer2 switch for control plane connectivity
# This switch isn't part of the SDN topology
# We'll use the ovs-controller to turn this into a learning switch
- swCtl100 = self.addSwitch( 'swCtl100', dpid = '0000000000000100' )
-
+ swCtl100 = self.addSwitch( 'swCtl100', dpid='0000000000000100' )
# BGP speaker hosts
spk1 = self.addHost( 'spk1' )
spk2 = self.addHost( 'spk2', cls=VLANHost, vlan=20 )
spk3 = self.addHost( 'spk3', cls=VLANHost, vlan=10 )
- root = self.addHost( 'root', inNamespace = False , ip = '0' )
+ root = self.addHost( 'root', inNamespace=False, ip='0' )
# hosts behind each AS
h64514 = self.addHost( 'h64514' )
h64515 = self.addHost( 'h64515' )
h64516 = self.addHost( 'h64516' )
- #VLAN hosts behind each AS
+ # VLAN hosts behind each AS
h64517 = self.addHost( 'h64517', cls=VLANHost, vlan=20 )
h64518 = self.addHost( 'h64518', cls=VLANHost, vlan=20 )
h64519 = self.addHost( 'h64519', cls=VLANHost, vlan=10 )
@@ -257,7 +255,6 @@
self.addLink( p64519, h64519 )
self.addLink( p64520, h64520 )
-
# Internal Connection To Hosts
self.addLink( swCtl100, p64514 )
self.addLink( swCtl100, p64515 )
@@ -272,7 +269,6 @@
self.addLink( swCtl100, spk2 )
self.addLink( swCtl100, spk3 )
-
# add h64514 to control plane for ping test
self.addLink( swCtl100, h64514 )
self.addLink( swCtl100, h64517 )
@@ -289,23 +285,26 @@
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 ):
+
+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 )
host.cmd( "cd %s" % QUAGGA_CONFIG_DIR )
zebra_cmd = \
- '%s/zebra -d -f ./zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid'\
+ '%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 = '%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 )
+ % ( QUAGGA_DIR, config_file, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num )
print zebra_cmd
print quagga_cmd
@@ -313,32 +312,34 @@
host.cmd( zebra_cmd )
host.cmd( quagga_cmd )
+
def startquaggahost5( host, num ):
info( '*** Starting Quagga on %s\n' % host )
zebra_cmd = \
- '%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 )
+ '%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 = \
- '%s/bgpd -d -f ./as4quaggas/quagga%s.conf -z %s/zserv%s.api -i %s/bgpd%s.pid'\
+ '%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 = SDNTopo()
info( '*** Creating network\n' )
- # time.sleep( 30 )
- net = Mininet( topo = topo, controller = RemoteController )
-
+ # time.sleep( 30 )
+ net = Mininet( topo=topo, controller=RemoteController )
spk1, spk2, spk3, p64514, p64515, p64516, p64517, p64518, p64519, p64520 = \
- net.get( 'spk1', 'spk2', 'spk3',
- 'p64514', 'p64515', 'p64516', 'p64517', 'p64518', 'p64519', 'p64520' )
+ net.get( 'spk1', 'spk2', 'spk3',
+ 'p64514', 'p64515', 'p64516', 'p64517', 'p64518', 'p64519', 'p64520' )
# Adding addresses to host64513_1 interface connected to sw24
# for BGP peering
@@ -405,7 +406,6 @@
p64520.setIP( "20.0.0.254", 8, "p64520-eth1.10" )
p64520.setMAC( '00:00:00:00:00:20', 'p64520-eth1.10' )
-
# enable forwarding on BGP peer hosts
p64514.cmd( 'sysctl net.ipv4.conf.all.forwarding=1' )
p64515.cmd( 'sysctl net.ipv4.conf.all.forwarding=1' )
@@ -428,7 +428,7 @@
# Setup hosts in each non-SDN AS
h64514, h64515, h64516, h64517, h64518, h64519, h64520 = \
- net.get( 'h64514', 'h64515', 'h64516', 'h64517', 'h64518', 'h64519', 'h64520' )
+ net.get( 'h64514', 'h64515', 'h64516', 'h64517', 'h64518', 'h64519', 'h64520' )
h64514.cmd( 'ifconfig h64514-eth0 4.0.0.1 up' )
h64514.cmd( 'ip route add default via 4.0.0.254' )
h64514.setIP( '192.168.0.44', 24, 'h64514-eth1' ) # for control plane
@@ -455,16 +455,16 @@
swCtl100.cmd( 'ovs-vsctl set-fail-mode swCtl100 standalone' )
# connect all switches to controller
- '''
+ """
for i in range ( 1, numSw + 1 ):
swX = net.get( 'sw%s' % ( i ) )
swX.cmd( 'ovs-vsctl set-controller sw%s tcp:%s:6653' % ( i, onos1IP ) )
- '''
+ """
# Start Quagga as the external BGP routers
- '''
+ """
for i in range ( 64514, 64516 + 1 ):
startquagga( 'peer%s' % ( i ), i, 'quagga%s.conf' % ( i ) )
- '''
+ """
startquagga( p64514, 64514, 'quagga64514.conf' )
startquagga( p64515, 64515, 'quagga64515.conf' )
startquagga( p64516, 64516, 'quagga64516.conf' )
@@ -491,19 +491,18 @@
stopsshd()
hosts = [ p64514, p64515, p64516, p64517, p64518, p64519, p64520,
- h64514, h64517, h64519 ];
+ h64514, h64517, h64519 ]
startsshds( hosts )
#
- '''
+ """
forwarding1 = '%s:2000:%s:2000' % ( '1.1.1.2', onos1IP )
root.cmd( 'ssh -nNT -o "PasswordAuthentication no" \
-o "StrictHostKeyChecking no" -l sdn -L %s %s & ' % ( forwarding1, onos1IP ) )
- '''
+ """
# time.sleep( 3000000000 )
CLI( net )
-
stopsshd()
stopquagga()
net.stop()
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
index d058a85..499df34 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/USECASE_SdnipFunctionCluster.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,8 +18,9 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# Testing the functionality of SDN-IP with single ONOS instance
+
+
class USECASE_SdnipFunctionCluster:
def __init__( self ):
@@ -50,7 +51,7 @@
# connect all switches to controllers
swResult = main.TRUE
- for i in range ( 1, int( main.params['config']['switchNum'] ) + 1 ):
+ for i in range( 1, int( main.params[ 'config' ][ 'switchNum' ] ) + 1 ):
sw = "sw%s" % ( i )
swResult = swResult and \
main.Mininet.assignSwController( sw, main.Cluster.getIps() )
@@ -61,7 +62,6 @@
if not swResult:
main.cleanAndExit()
-
def CASE101( self, main ):
"""
Package ONOS and install it
@@ -98,7 +98,7 @@
def CASE200( self, main ):
main.case( "Activate sdn-ip application" )
main.log.info( "waiting link discovery......" )
- time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
+ time.sleep( int( main.params[ 'timers' ][ 'TopoDiscovery' ] ) )
main.step( "Get links in the network" )
summaryResult = main.Cluster.active( 0 ).CLI.summary()
@@ -106,7 +106,7 @@
main.log.info( "Expected 100 links, actual number is: {}".format( linkNum ) )
if linkNum < 100:
main.log.error( "Link number is wrong! Retrying..." )
- time.sleep( int( main.params['timers']['TopoDiscovery'] ) )
+ time.sleep( int( main.params[ 'timers' ][ 'TopoDiscovery' ] ) )
summaryResult = main.Cluster.active( 0 ).CLI.summary()
linkNum = json.loads( summaryResult )[ "links" ]
main.log.info( "Expected 100 links, actual number is: {}".format( linkNum ) )
@@ -128,10 +128,10 @@
main.cleanAndExit()
def CASE102( self, main ):
- '''
+ """
This test case is to load the methods from other Python files, and create
tunnels from mininet host to onos nodes.
- '''
+ """
import time
main.case( "Load methods from other Python file and create tunnels" )
# load the methods from other file
@@ -141,7 +141,7 @@
wrapperFile1 +
".py" )
# Create tunnels
- for i in range ( main.Cluster.numCtrls ):
+ for i in range( main.Cluster.numCtrls ):
main.Functions.setupTunnel( main,
'1.1.1.' + str( ( i + 1 ) * 2 ),
2000,
@@ -156,16 +156,15 @@
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
def CASE1( self, main ):
- '''
+ """
ping test from 3 bgp peers to BGP speaker
- '''
-
+ """
main.case( "Ping between BGP peers and speakers" )
main.Functions.pingSpeakerToPeer( main, speakers=[ "spk1" ],
peers=[ "p64514", "p64515", "p64516" ],
expectAllSuccess=True )
- main.Functions.pingSpeakerToPeer( main, speakers=["spk2"],
+ main.Functions.pingSpeakerToPeer( main, speakers=[ "spk2" ],
peers=[ p64514, p64515, p64516 ],
expectAllSuccess=True )
@@ -178,15 +177,15 @@
expectAllSuccess=True )
def CASE2( self, main ):
- '''
+ """
point-to-point intents test for each BGP peer and BGP speaker pair
- '''
+ """
main.sdnBase.pToPIntentTest( 12 )
def CASE3( self, main ):
- '''
+ """
routes and intents check to all BGP peers
- '''
+ """
import time
main.case( "Check routes and M2S intents to all BGP peers" )
@@ -202,44 +201,43 @@
main.sdnBase.routeAndIntentCheck( allRoutesExpected, 7 )
-
def CASE4( self, main ):
- '''
+ """
Ping test in data plane for each route
- '''
+ """
main.case( "Ping test for each route, all hosts behind BGP peers" )
main.Functions.pingHostToHost( main,
- hosts=["h64514", "h64515", "h64516"],
- expectAllSuccess=True )
- main.Functions.pingHostToHost(main,
- hosts=["h64517", "h64518"],
- expectAllSuccess=True)
+ hosts=[ "h64514", "h64515", "h64516" ],
+ expectAllSuccess=True )
+ main.Functions.pingHostToHost( main,
+ hosts=[ "h64517", "h64518" ],
+ expectAllSuccess=True )
main.Functions.pingHostToHost( main,
hosts=[ "h64519", "h64520" ],
expectAllSuccess=True )
def CASE5( self, main ):
- '''
+ """
Cut links to peers one by one, check routes/intents
- '''
+ """
main.sdnBase.linkUpDownCheck( "p64514", "p64515", "p64516",
6, 6, 5, 5, 4, 4,
"spk1", [ "h64514", "h64515", "h64516" ],
"down" )
def CASE6( self, main ):
- '''
+ """
Recover links to peers one by one, check routes/intents
- '''
+ """
main.sdnBase.linkUpDownCheck( "p64514", "p64515", "p64516",
5, 5, 6, 6, 7, 7,
"spk1", [ "h64514", "h64515", "h64516" ],
"up" )
def CASE7( self, main ):
- '''
+ """
Shut down a edge switch, check P-2-P and M-2-S intents, ping test
- '''
+ """
import time
main.case( "Stop edge sw32,check P-2-P and M-2-S intents, ping test" )
main.step( "Stop sw32" )
@@ -252,7 +250,7 @@
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
main.Functions.checkRouteNum( main, 6 )
main.Functions.checkM2SintentNum( main, 6 )
- main.Functions.checkP2PintentNum( main, 48 ) #14 * 2
+ main.Functions.checkP2PintentNum( main, 48 ) # 14 * 2
else:
main.log.error( "Stopping switch failed!" )
main.cleanAndExit()
@@ -268,7 +266,7 @@
onpass="Ping test result is correct",
onfail="Ping test result is wrong" )
- if pingResult1 == False:
+ if not pingResult1:
main.cleanAndExit()
main.step( "Check ping between BGP peers and spk1" )
@@ -282,7 +280,7 @@
onpass="Speaker1 ping peers successful",
onfail="Speaker1 ping peers NOT successful" )
- if pingResult2 == False:
+ if not pingResult2:
main.cleanAndExit()
main.step( "Check ping between BGP peers and spk2" )
@@ -297,13 +295,13 @@
onpass="Speaker2 ping peers successful",
onfail="Speaker2 ping peers NOT successful" )
- if pingResult3 == False:
+ if not pingResult3:
main.cleanAndExit()
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
main.FALSE,
- kwargs={'isPENDING':False},
+ kwargs={ 'isPENDING': False },
attempts=10 )
utilities.assert_equals( expect=main.TRUE,
actual=flowCheck,
@@ -311,10 +309,10 @@
onfail="Flow status is wrong!" )
def CASE8( self, main ):
- '''
- Bring up the edge switch (sw32) which was shut down in CASE7,
+ """
+ Bring up the edge switch ( sw32 ) which was shut down in CASE7,
check P-2-P and M-2-S intents, ping test
- '''
+ """
import time
main.case( "Start the edge sw32, check P-2-P and M-2-S intents, ping test" )
main.step( "Start sw32" )
@@ -334,7 +332,7 @@
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
main.Functions.checkRouteNum( main, 7 )
main.Functions.checkM2SintentNum( main, 7 )
- main.Functions.checkP2PintentNum( main, 30 * 2 ) # 18*2
+ main.Functions.checkP2PintentNum( main, 30 * 2 ) # 18*2
else:
main.log.error( "Starting switch failed!" )
main.cleanAndExit()
@@ -342,7 +340,7 @@
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
main.FALSE,
- kwargs={'isPENDING':False},
+ kwargs={ 'isPENDING': False },
attempts=10 )
utilities.assert_equals( expect=main.TRUE,
actual=flowCheck,
@@ -351,7 +349,7 @@
# Ping test
main.Functions.pingSpeakerToPeer( main, speakers=[ "spk1" ],
- peers=["p64514", "p64515", "p64516"],
+ peers=[ "p64514", "p64515", "p64516" ],
expectAllSuccess=True )
main.Functions.pingSpeakerToPeer( main, speakers=[ "spk2" ],
@@ -363,10 +361,10 @@
expectAllSuccess=True )
def CASE9( self, main ):
- '''
+ """
Bring down a switch in best path, check:
route number, P2P intent number, M2S intent number, ping test
- '''
+ """
main.case( "Stop sw11 located in best path, \
check route number, P2P intent number, M2S intent number, ping test" )
@@ -388,7 +386,7 @@
time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
main.Functions.checkRouteNum( main, 7 )
main.Functions.checkM2SintentNum( main, 7 )
- main.Functions.checkP2PintentNum( main, 30 * 2 ) #18 * 2
+ main.Functions.checkP2PintentNum( main, 30 * 2 ) # 18 * 2
else:
main.log.error( "Stopping switch failed!" )
main.cleanAndExit()
@@ -396,29 +394,28 @@
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
main.FALSE,
- kwargs={'isPENDING':False},
+ kwargs={ 'isPENDING': False },
attempts=10 )
utilities.assert_equals( expect=main.TRUE,
actual=flowCheck,
onpass="Flow status is correct!",
onfail="Flow status is wrong!" )
# Ping test
- main.Functions.pingSpeakerToPeer( main, speakers=["spk1"],
- peers=["p64514", "p64515", "p64516"],
- expectAllSuccess=True )
- main.Functions.pingSpeakerToPeer( main, speakers=["spk2"],
- peers=[p64514, p64515, p64516],
- expectAllSuccess=True )
+ main.Functions.pingSpeakerToPeer( main, speakers=[ "spk1" ],
+ peers=[ "p64514", "p64515", "p64516" ],
+ expectAllSuccess=True )
+ main.Functions.pingSpeakerToPeer( main, speakers=[ "spk2" ],
+ peers=[ p64514, p64515, p64516 ],
+ expectAllSuccess=True )
main.Functions.pingHostToHost( main,
- hosts=["h64514", "h64515", "h64516"],
- expectAllSuccess=True )
-
+ hosts=[ "h64514", "h64515", "h64516" ],
+ expectAllSuccess=True )
def CASE10( self, main ):
- '''
+ """
Bring up the switch which was stopped in CASE9, check:
route number, P2P intent number, M2S intent number, ping test
- '''
+ """
main.case( "Start sw11 which was stopped in CASE9, \
check route number, P2P intent number, M2S intent number, ping test" )
@@ -453,25 +450,24 @@
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
main.FALSE,
- kwargs={'isPENDING':False},
+ kwargs={ 'isPENDING': False },
attempts=10 )
utilities.assert_equals( expect=main.TRUE,
actual=flowCheck,
onpass="Flow status is correct!",
onfail="Flow status is wrong!" )
# Ping test
- main.Functions.pingSpeakerToPeer( main, speakers=["spk1"],
- peers=["p64514", "p64515", "p64516"],
- expectAllSuccess=True )
- main.Functions.pingSpeakerToPeer( main, speakers=["spk2"],
- peers=[p64514, p64515, p64516],
- expectAllSuccess=True )
+ main.Functions.pingSpeakerToPeer( main, speakers=[ "spk1" ],
+ peers=[ "p64514", "p64515", "p64516" ],
+ expectAllSuccess=True )
+ main.Functions.pingSpeakerToPeer( main, speakers=[ "spk2" ],
+ peers=[ p64514, p64515, p64516 ],
+ expectAllSuccess=True )
main.Functions.pingHostToHost( main,
- hosts=["h64514", "h64515", "h64516"],
- expectAllSuccess=True )
+ hosts=[ "h64514", "h64515", "h64516" ],
+ expectAllSuccess=True )
-
- def CASE11(self, main):
+ def CASE11( self, main ):
import time
main.case( "Kill spk1, check:\
route number, P2P intent number, M2S intent number, ping test" )
@@ -482,22 +478,22 @@
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
main.FALSE,
- kwargs={'isPENDING':False},
+ kwargs={ 'isPENDING': False },
attempts=10 )
utilities.assert_equals( expect=main.TRUE,
actual=flowCheck,
onpass="Flow status is correct!",
onfail="Flow status is wrong!" )
- main.Functions.pingSpeakerToPeer( main, speakers=["spk1"],
- peers=["p64514", "p64515", "p64516"],
- expectAllSuccess=True )
- main.Functions.pingSpeakerToPeer( main, speakers=["spk2"],
- peers=[p64514, p64515, p64516],
- expectAllSuccess=True )
+ main.Functions.pingSpeakerToPeer( main, speakers=[ "spk1" ],
+ peers=[ "p64514", "p64515", "p64516" ],
+ expectAllSuccess=True )
+ main.Functions.pingSpeakerToPeer( main, speakers=[ "spk2" ],
+ peers=[ p64514, p64515, p64516 ],
+ expectAllSuccess=True )
main.Functions.pingHostToHost( main,
- hosts=["h64514", "h64515", "h64516"],
- expectAllSuccess=True )
+ hosts=[ "h64514", "h64515", "h64516" ],
+ expectAllSuccess=True )
main.step( "Kill spk1" )
command1 = "ps -e | grep bgp -c"
@@ -519,7 +515,7 @@
actual=( "4" in result3 ),
onpass="Kill spk1 succeeded",
onfail="Kill spk1 failed" )
- if ( "4" not in result3 ) :
+ if ( "4" not in result3 ):
main.log.info( result3 )
main.cleanAndExit()
@@ -531,25 +527,24 @@
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
main.FALSE,
- kwargs={'isPENDING':False},
+ kwargs={ 'isPENDING': False },
attempts=10 )
utilities.assert_equals( expect=main.TRUE,
actual=flowCheck,
onpass="Flow status is correct!",
onfail="Flow status is wrong!" )
- '''
- main.Functions.pingSpeakerToPeer( main, speakers=["spk1"],
- peers=["p64514", "p64515", "p64516"],
+ """
+ main.Functions.pingSpeakerToPeer( main, speakers=[ "spk1" ],
+ peers=[ "p64514", "p64515", "p64516" ],
expectAllSuccess=False )
- '''
- main.Functions.pingSpeakerToPeer( main, speakers=["spk2"],
- peers=[p64514, p64515, p64516],
- expectAllSuccess=True )
+ """
+ main.Functions.pingSpeakerToPeer( main, speakers=[ "spk2" ],
+ peers=[ p64514, p64515, p64516 ],
+ expectAllSuccess=True )
main.Functions.pingHostToHost( main,
- hosts=["h64514", "h64515", "h64516"],
- expectAllSuccess=True )
-
+ hosts=[ "h64514", "h64515", "h64516" ],
+ expectAllSuccess=True )
def CASE12( self, main ):
import time
@@ -561,8 +556,8 @@
jsonResult = json.loads( result )
leaderIP = ""
for entry in jsonResult:
- if entry["topic"] == "org.onosproject.sdnip":
- leaderIP = entry["leader"]
+ if entry[ "topic" ] == "org.onosproject.sdnip":
+ leaderIP = entry[ "leader" ]
main.log.info( "leaderIP is: " )
main.log.info( leaderIP )
@@ -587,7 +582,7 @@
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
main.FALSE,
- kwargs={'isPENDING':False},
+ kwargs={ 'isPENDING': False },
attempts=10 )
utilities.assert_equals( expect=main.TRUE,
actual=flowCheck,
@@ -601,19 +596,19 @@
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
main.FALSE,
- kwargs={'isPENDING':False},
+ kwargs={ 'isPENDING': False },
attempts=10 )
utilities.assert_equals( expect=main.TRUE,
actual=flowCheck,
onpass="Flow status is correct!",
onfail="Flow status is wrong!" )
- main.Functions.pingSpeakerToPeer( main, speakers=["spk1"],
- peers=["p64514", "p64515", "p64516"],
- expectAllSuccess=True )
- main.Functions.pingSpeakerToPeer( main, speakers=["spk2"],
- peers=[p64514, p64515, p64516],
- expectAllSuccess=True )
+ main.Functions.pingSpeakerToPeer( main, speakers=[ "spk1" ],
+ peers=[ "p64514", "p64515", "p64516" ],
+ expectAllSuccess=True )
+ main.Functions.pingSpeakerToPeer( main, speakers=[ "spk2" ],
+ peers=[ p64514, p64515, p64516 ],
+ expectAllSuccess=True )
main.Functions.pingHostToHost( main,
- hosts=["h64514", "h64515", "h64516"],
- expectAllSuccess=True )
+ hosts=[ "h64514", "h64515", "h64516" ],
+ expectAllSuccess=True )
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/dependencies/Functions.py b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/dependencies/Functions.py
index 36f1eb4..8edc284 100644
--- a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/dependencies/Functions.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/dependencies/Functions.py
@@ -1,5 +1,5 @@
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,11 +18,10 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
def checkRouteNum( main, routeNumExpected, node=1 ):
import time
main.step( "Check routes installed" )
- wait = int( main.params['timers']['PathAvailable'] )
+ wait = int( main.params[ 'timers' ][ 'PathAvailable' ] )
main.log.info( "Route number expected:" )
main.log.info( routeNumExpected )
main.log.info( "Route number from ONOS CLI:" )
@@ -34,77 +33,80 @@
routeNumActual = cli.ipv4RouteNumber()
main.log.info( routeNumActual )
- utilities.assertEquals( \
- expect = routeNumExpected, actual = routeNumActual,
- onpass = "Route number is correct!",
- onfail = "Route number is wrong!" )
+ utilities.assertEquals(
+ expect=routeNumExpected, actual=routeNumActual,
+ onpass="Route number is correct!",
+ onfail="Route number is wrong!" )
+
def checkM2SintentNum( main, intentNumExpected, node=1 ):
import time
main.step( "Check M2S intents installed" )
- wait = int( main.params['timers']['PathAvailable'] )
+ wait = int( main.params[ 'timers' ][ 'PathAvailable' ] )
main.log.info( "Intent number expected:" )
main.log.info( intentNumExpected )
main.log.info( "Intent number from ONOS CLI:" )
cli = main.Cluster.active( node - 1 ).CLI
- jsonResult = cli.intents( jsonFormat = True, summary = True,
- TYPE = "multiPointToSinglePoint" )
- intentNumActual = jsonResult['installed']
+ jsonResult = cli.intents( jsonFormat=True, summary=True,
+ TYPE="multiPointToSinglePoint" )
+ intentNumActual = jsonResult[ 'installed' ]
if intentNumActual != intentNumExpected:
time.sleep( wait )
- jsonResult = cli.intents( jsonFormat = True, summary = True,
- TYPE = "multiPointToSinglePoint" )
- intentNumActual = jsonResult['installed']
+ jsonResult = cli.intents( jsonFormat=True, summary=True,
+ TYPE="multiPointToSinglePoint" )
+ intentNumActual = jsonResult[ 'installed' ]
main.log.info( intentNumActual )
- utilities.assertEquals( \
- expect = intentNumExpected, actual = intentNumActual,
- onpass = "M2S intent number is correct!",
- onfail = "M2S intent number is wrong!" )
+ utilities.assertEquals(
+ expect=intentNumExpected, actual=intentNumActual,
+ onpass="M2S intent number is correct!",
+ onfail="M2S intent number is wrong!" )
+
def checkP2PintentNum( main, intentNumExpected, node=1 ):
import time
main.step( "Check P2P intents installed" )
- wait = int( main.params['timers']['PathAvailable'] )
+ wait = int( main.params[ 'timers' ][ 'PathAvailable' ] )
main.log.info( "Intent number expected:" )
main.log.info( intentNumExpected )
main.log.info( "Intent number from ONOS CLI:" )
cli = main.Cluster.active( node - 1 ).CLI
- jsonResult = cli.intents( jsonFormat = True, summary = True,
- TYPE = "pointToPoint" )
- intentNumActual = jsonResult['installed']
+ jsonResult = cli.intents( jsonFormat=True, summary=True,
+ TYPE="pointToPoint" )
+ intentNumActual = jsonResult[ 'installed' ]
if intentNumActual != intentNumExpected:
time.sleep( wait )
- jsonResult = cli.intents( jsonFormat = True, summary = True,
- TYPE = "pointToPoint" )
- intentNumActual = jsonResult['installed']
+ jsonResult = cli.intents( jsonFormat=True, summary=True,
+ TYPE="pointToPoint" )
+ intentNumActual = jsonResult[ 'installed' ]
main.log.info( intentNumActual )
- utilities.assertEquals( \
- expect = intentNumExpected, actual = intentNumActual,
- onpass = "P2P intent number is correct!",
- onfail = "P2P intent number is wrong!" )
+ utilities.assertEquals(
+ expect=intentNumExpected, actual=intentNumActual,
+ onpass="P2P intent number is correct!",
+ onfail="P2P intent number is wrong!" )
+
def checkFlowNum( main, switch, flowNumExpected ):
import time
main.step( "Check flow entry number in " + switch )
- wait = int( main.params['timers']['PathAvailable'] )
+ wait = int( main.params[ 'timers' ][ 'PathAvailable' ] )
main.log.info( "Flow number expected:" )
main.log.info( flowNumExpected )
main.log.info( "Flow number actual:" )
flowNumActual = main.Mininet.getSwitchFlowCount( switch )
- if flowNumActual != flowNumExpected :
+ if flowNumActual != flowNumExpected:
time.sleep( wait )
flowNumActual = main.Mininet.getSwitchFlowCount( switch )
main.log.info( flowNumActual )
- utilities.assertEquals( \
- expect = flowNumExpected, actual = flowNumActual,
- onpass = "Flow number in " + switch + " is correct!",
- onfail = "Flow number in " + switch + " is wrong!" )
+ utilities.assertEquals(
+ expect=flowNumExpected, actual=flowNumActual,
+ onpass="Flow number in " + switch + " is correct!",
+ onfail="Flow number in " + switch + " is wrong!" )
-def pingSpeakerToPeer( main, speakers = ["spk1"],
- peers = ["p64514", "p64515", "p64516"],
- expectAllSuccess = True ):
+def pingSpeakerToPeer( main, speakers=[ "spk1" ],
+ peers=[ "p64514", "p64515", "p64516" ],
+ expectAllSuccess=True ):
"""
Carry out ping test between each BGP speaker and peer pair
Optional argument:
@@ -129,25 +131,25 @@
if expectAllSuccess:
for speaker in speakers:
for peer in peers:
- tmpResult = main.Mininet.pingHost( src = speaker,
- target = peer )
+ tmpResult = main.Mininet.pingHost( src=speaker,
+ target=peer )
result = result and ( tmpResult == main.TRUE )
else:
for speaker in speakers:
for peer in peers:
- tmpResult = main.Mininet.pingHost( src = speaker,
- target = peer )
+ tmpResult = main.Mininet.pingHost( src=speaker,
+ target=peer )
- utilities.assert_equals( expect = True, actual = result,
- onpass = "Ping test results are expected",
- onfail = "Ping test results are Not expected" )
+ utilities.assert_equals( expect=True, actual=result,
+ onpass="Ping test results are expected",
+ onfail="Ping test results are Not expected" )
- if result == False:
+ if not result:
main.cleanAndExit()
-def pingHostToHost( main, hosts = ["h64514", "h64515", "h64516"],
- expectAllSuccess = True ):
+def pingHostToHost( main, hosts=[ "h64514", "h64515", "h64516" ],
+ expectAllSuccess=True ):
"""
Carry out ping test between each BGP host pair
Optional argument:
@@ -166,45 +168,41 @@
for srcHost in hosts:
for targetHost in hosts:
if srcHost != targetHost:
- tmpResult = main.Mininet.pingHost( src = srcHost,
- target = targetHost )
+ tmpResult = main.Mininet.pingHost( src=srcHost,
+ target=targetHost )
result = result and ( tmpResult == main.TRUE )
else:
for srcHost in hosts:
for targetHost in hosts:
if srcHost != targetHost:
- tmpResult = main.Mininet.pingHost( src = srcHost,
- target = targetHost )
+ tmpResult = main.Mininet.pingHost( src=srcHost,
+ target=targetHost )
result = result and ( tmpResult == main.FALSE )
- utilities.assert_equals( expect = True, actual = result,
- onpass = "Ping test results are expected",
- onfail = "Ping test results are Not expected" )
+ utilities.assert_equals( expect=True, actual=result,
+ onpass="Ping test results are expected",
+ onfail="Ping test results are Not expected" )
- '''
+ """
if result == False:
main.cleanAndExit()
- '''
-
-
+ """
def setupTunnel( main, srcIp, srcPort, dstIp, dstPort ):
"""
Create a tunnel from Mininet host to host outside Mininet
"""
main.step( "Set up tunnel from Mininet node " +
str( srcIp ) + ":" + str( srcPort ) + " to ONOS node "
- + str(dstIp) + ":" + str(dstPort) )
+ + str( dstIp ) + ":" + str( dstPort ) )
forwarding = '%s:%s:%s:%s' % ( srcIp, srcPort, dstIp, dstPort )
command = 'ssh -nNT -o "PasswordAuthentication no" \
-o "StrictHostKeyChecking no" -l sdn -L %s %s & ' % ( forwarding, dstIp )
-
tunnelResult = main.TRUE
tunnelResult = main.Mininet.node( "root", command )
- utilities.assert_equals( expect = True,
- actual = ( "PasswordAuthentication" in tunnelResult ),
+ utilities.assert_equals( expect=True,
+ actual=( "PasswordAuthentication" in tunnelResult ),
onpass = "Created tunnel succeeded",
onfail = "Create tunnel failed" )
- if ( "PasswordAuthentication" not in tunnelResult ) :
+ if ( "PasswordAuthentication" not in tunnelResult ):
main.cleanAndExit()
-
diff --git a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/dependencies/USECASE_SdnipI2MN_Cluster.py b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/dependencies/USECASE_SdnipI2MN_Cluster.py
old mode 100755
new mode 100644
index b37a410..9227e18
--- a/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/dependencies/USECASE_SdnipI2MN_Cluster.py
+++ b/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/dependencies/USECASE_SdnipI2MN_Cluster.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
"""
-Copyright 2015 Open Networking Foundation (ONF)
+Copyright 2015 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -10,7 +10,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,18 +20,15 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Set up the SDN-IP topology as same as it on Internet2
"""
-
"""
-AS 64513, (SDN AS)
+AS 64513, ( SDN AS )
AS 64514, reachable by 10.0.4.1, 10.0.14.1
AS 64515, reachable by 10.0.5.1, 10.0.15.1
AS 64516, reachable by 10.0.6.1, 10.0.16.1
"""
-
from mininet.net import Mininet
from mininet.node import Controller, RemoteController
from mininet.log import setLogLevel, info
@@ -50,14 +47,17 @@
QUAGGA_CONFIG_DIR = '~/OnosSystemTest/TestON/tests/USECASE/USECASE_SdnipFunctionCluster/dependencies/'
numSw = 39
-# net = Mininet( controller = RemoteController )
+# net = Mininet( controller=RemoteController )
+
+
class VLANHost( Host ):
+
def config( self, vlan=100, intfName=None, **params ):
r = super( Host, self ).config( **params )
intf = self.intf( intfName )
self.cmd( 'ifconfig %s inet 0' % intf )
self.cmd( 'vconfig add %s %d' % ( intf, vlan ) )
- self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params['ip'] ) )
+ self.cmd( 'ifconfig %s.%d inet %s' % ( intf, vlan, params[ 'ip' ] ) )
newName = '%s.%d' % ( intf, vlan )
intf.name = newName
self.nameToIntf[ newName ] = intf
@@ -65,6 +65,7 @@
class SDNTopo( Topo ):
+
"SDN Topology"
def __init__( self, *args, **kwargs ):
@@ -81,100 +82,98 @@
p64519 = self.addHost( 'p64519', cls=VLANHost, vlan=10 )
p64520 = self.addHost( 'p64520', cls=VLANHost, vlan=10 )
- '''
- sw1 = self.addSwitch( 'SEAT', dpid = '00000000000000a1' )
- sw2 = self.addSwitch( 'PORT', dpid = '00000000000000a2' )
- sw3 = self.addSwitch( 'SUNN', dpid = '00000000000000a3' )
- sw4 = self.addSwitch( 'RENO', dpid = '00000000000000a4' )
- sw5 = self.addSwitch( 'LOSA', dpid = '00000000000000a5' )
- sw6 = self.addSwitch( 'MISS', dpid = '00000000000000a6' )
- sw7 = self.addSwitch( 'LASV', dpid = '00000000000000a7' )
- sw8 = self.addSwitch( 'SALT', dpid = '00000000000000a8' )
- sw9 = self.addSwitch( 'PHOE', dpid = '00000000000000a9' )
- sw10 = self.addSwitch( 'TUCS', dpid = '0000000000000a10' )
- sw11 = self.addSwitch( 'DENV', dpid = '0000000000000a11' )
- sw12 = self.addSwitch( 'ELPA', dpid = '0000000000000a12' )
- sw13 = self.addSwitch( 'MINN', dpid = '0000000000000a13' )
- sw14 = self.addSwitch( 'KANS', dpid = '0000000000000a14' )
- sw15 = self.addSwitch( 'TULS', dpid = '0000000000000a15' )
- sw16 = self.addSwitch( 'DALL', dpid = '0000000000000a16' )
- sw17 = self.addSwitch( 'HOUH', dpid = '0000000000000a17' )
- sw18 = self.addSwitch( 'COLU', dpid = '0000000000000a18' )
- sw19 = self.addSwitch( 'JCSN', dpid = '0000000000000a19' )
- sw20 = self.addSwitch( 'BATO', dpid = '0000000000000a20' )
- sw21 = self.addSwitch( 'EQCH', dpid = '0000000000000a21' )
- sw22 = self.addSwitch( 'STAR', dpid = '0000000000000a22' )
- sw23 = self.addSwitch( 'CHIC', dpid = '0000000000000a23' )
- sw24 = self.addSwitch( 'INDI', dpid = '0000000000000a24' )
- sw25 = self.addSwitch( 'CINC', dpid = '0000000000000a25' )
- sw26 = self.addSwitch( 'LOUI', dpid = '0000000000000a26' )
- sw27 = self.addSwitch( 'ATLA', dpid = '0000000000000a27' )
- sw28 = self.addSwitch( 'JACK', dpid = '0000000000000a28' )
- sw29 = self.addSwitch( 'CLEV', dpid = '0000000000000a29' )
- sw30 = self.addSwitch( 'PITT', dpid = '0000000000000a30' )
- sw31 = self.addSwitch( 'ASHB', dpid = '0000000000000a31' )
- sw32 = self.addSwitch( 'WASH', dpid = '0000000000000a32' )
- sw33 = self.addSwitch( 'RALE', dpid = '0000000000000a33' )
- sw34 = self.addSwitch( 'CHAR', dpid = '0000000000000a34' )
- sw35 = self.addSwitch( 'ALBA', dpid = '0000000000000a35' )
- sw36 = self.addSwitch( 'BOST', dpid = '0000000000000a36' )
- sw37 = self.addSwitch( 'HART', dpid = '0000000000000a37' )
- sw38 = self.addSwitch( 'NEWY', dpid = '0000000000000a38' )
- sw39 = self.addSwitch( 'PHIL', dpid = '0000000000000a39' )
- '''
- 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' )
- sw7 = self.addSwitch( 'sw7', dpid = '00000000000000a7' )
- sw8 = self.addSwitch( 'sw8', dpid = '00000000000000a8' )
- sw9 = self.addSwitch( 'sw9', dpid = '00000000000000a9' )
- sw10 = self.addSwitch( 'sw10', dpid = '0000000000000a10' )
- sw11 = self.addSwitch( 'sw11', dpid = '0000000000000a11' )
- sw12 = self.addSwitch( 'sw12', dpid = '0000000000000a12' )
- sw13 = self.addSwitch( 'sw13', dpid = '0000000000000a13' )
- sw14 = self.addSwitch( 'sw14', dpid = '0000000000000a14' )
- sw15 = self.addSwitch( 'sw15', dpid = '0000000000000a15' )
- sw16 = self.addSwitch( 'sw16', dpid = '0000000000000a16' )
- sw17 = self.addSwitch( 'sw17', dpid = '0000000000000a17' )
- sw18 = self.addSwitch( 'sw18', dpid = '0000000000000a18' )
- sw19 = self.addSwitch( 'sw19', dpid = '0000000000000a19' )
- sw20 = self.addSwitch( 'sw20', dpid = '0000000000000a20' )
- sw21 = self.addSwitch( 'sw21', dpid = '0000000000000a21' )
- sw22 = self.addSwitch( 'sw22', dpid = '0000000000000a22' )
- sw23 = self.addSwitch( 'sw23', dpid = '0000000000000a23' )
- sw24 = self.addSwitch( 'sw24', dpid = '0000000000000a24' )
- sw25 = self.addSwitch( 'sw25', dpid = '0000000000000a25' )
- sw26 = self.addSwitch( 'sw26', dpid = '0000000000000a26' )
- sw27 = self.addSwitch( 'sw27', dpid = '0000000000000a27' )
- sw28 = self.addSwitch( 'sw28', dpid = '0000000000000a28' )
- sw29 = self.addSwitch( 'sw29', dpid = '0000000000000a29' )
- sw30 = self.addSwitch( 'sw30', dpid = '0000000000000a30' )
- sw31 = self.addSwitch( 'sw31', dpid = '0000000000000a31' )
- sw32 = self.addSwitch( 'sw32', dpid = '0000000000000a32' )
- sw33 = self.addSwitch( 'sw33', dpid = '0000000000000a33' )
- sw34 = self.addSwitch( 'sw34', dpid = '0000000000000a34' )
- sw35 = self.addSwitch( 'sw35', dpid = '0000000000000a35' )
- sw36 = self.addSwitch( 'sw36', dpid = '0000000000000a36' )
- sw37 = self.addSwitch( 'sw37', dpid = '0000000000000a37' )
- sw38 = self.addSwitch( 'sw38', dpid = '0000000000000a38' )
- sw39 = self.addSwitch( 'sw39', dpid = '0000000000000a39' )
-
+ """
+ sw1 = self.addSwitch( 'SEAT', dpid='00000000000000a1' )
+ sw2 = self.addSwitch( 'PORT', dpid='00000000000000a2' )
+ sw3 = self.addSwitch( 'SUNN', dpid='00000000000000a3' )
+ sw4 = self.addSwitch( 'RENO', dpid='00000000000000a4' )
+ sw5 = self.addSwitch( 'LOSA', dpid='00000000000000a5' )
+ sw6 = self.addSwitch( 'MISS', dpid='00000000000000a6' )
+ sw7 = self.addSwitch( 'LASV', dpid='00000000000000a7' )
+ sw8 = self.addSwitch( 'SALT', dpid='00000000000000a8' )
+ sw9 = self.addSwitch( 'PHOE', dpid='00000000000000a9' )
+ sw10 = self.addSwitch( 'TUCS', dpid='0000000000000a10' )
+ sw11 = self.addSwitch( 'DENV', dpid='0000000000000a11' )
+ sw12 = self.addSwitch( 'ELPA', dpid='0000000000000a12' )
+ sw13 = self.addSwitch( 'MINN', dpid='0000000000000a13' )
+ sw14 = self.addSwitch( 'KANS', dpid='0000000000000a14' )
+ sw15 = self.addSwitch( 'TULS', dpid='0000000000000a15' )
+ sw16 = self.addSwitch( 'DALL', dpid='0000000000000a16' )
+ sw17 = self.addSwitch( 'HOUH', dpid='0000000000000a17' )
+ sw18 = self.addSwitch( 'COLU', dpid='0000000000000a18' )
+ sw19 = self.addSwitch( 'JCSN', dpid='0000000000000a19' )
+ sw20 = self.addSwitch( 'BATO', dpid='0000000000000a20' )
+ sw21 = self.addSwitch( 'EQCH', dpid='0000000000000a21' )
+ sw22 = self.addSwitch( 'STAR', dpid='0000000000000a22' )
+ sw23 = self.addSwitch( 'CHIC', dpid='0000000000000a23' )
+ sw24 = self.addSwitch( 'INDI', dpid='0000000000000a24' )
+ sw25 = self.addSwitch( 'CINC', dpid='0000000000000a25' )
+ sw26 = self.addSwitch( 'LOUI', dpid='0000000000000a26' )
+ sw27 = self.addSwitch( 'ATLA', dpid='0000000000000a27' )
+ sw28 = self.addSwitch( 'JACK', dpid='0000000000000a28' )
+ sw29 = self.addSwitch( 'CLEV', dpid='0000000000000a29' )
+ sw30 = self.addSwitch( 'PITT', dpid='0000000000000a30' )
+ sw31 = self.addSwitch( 'ASHB', dpid='0000000000000a31' )
+ sw32 = self.addSwitch( 'WASH', dpid='0000000000000a32' )
+ sw33 = self.addSwitch( 'RALE', dpid='0000000000000a33' )
+ sw34 = self.addSwitch( 'CHAR', dpid='0000000000000a34' )
+ sw35 = self.addSwitch( 'ALBA', dpid='0000000000000a35' )
+ sw36 = self.addSwitch( 'BOST', dpid='0000000000000a36' )
+ sw37 = self.addSwitch( 'HART', dpid='0000000000000a37' )
+ sw38 = self.addSwitch( 'NEWY', dpid='0000000000000a38' )
+ sw39 = self.addSwitch( 'PHIL', dpid='0000000000000a39' )
+ """
+ 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' )
+ sw7 = self.addSwitch( 'sw7', dpid='00000000000000a7' )
+ sw8 = self.addSwitch( 'sw8', dpid='00000000000000a8' )
+ sw9 = self.addSwitch( 'sw9', dpid='00000000000000a9' )
+ sw10 = self.addSwitch( 'sw10', dpid='0000000000000a10' )
+ sw11 = self.addSwitch( 'sw11', dpid='0000000000000a11' )
+ sw12 = self.addSwitch( 'sw12', dpid='0000000000000a12' )
+ sw13 = self.addSwitch( 'sw13', dpid='0000000000000a13' )
+ sw14 = self.addSwitch( 'sw14', dpid='0000000000000a14' )
+ sw15 = self.addSwitch( 'sw15', dpid='0000000000000a15' )
+ sw16 = self.addSwitch( 'sw16', dpid='0000000000000a16' )
+ sw17 = self.addSwitch( 'sw17', dpid='0000000000000a17' )
+ sw18 = self.addSwitch( 'sw18', dpid='0000000000000a18' )
+ sw19 = self.addSwitch( 'sw19', dpid='0000000000000a19' )
+ sw20 = self.addSwitch( 'sw20', dpid='0000000000000a20' )
+ sw21 = self.addSwitch( 'sw21', dpid='0000000000000a21' )
+ sw22 = self.addSwitch( 'sw22', dpid='0000000000000a22' )
+ sw23 = self.addSwitch( 'sw23', dpid='0000000000000a23' )
+ sw24 = self.addSwitch( 'sw24', dpid='0000000000000a24' )
+ sw25 = self.addSwitch( 'sw25', dpid='0000000000000a25' )
+ sw26 = self.addSwitch( 'sw26', dpid='0000000000000a26' )
+ sw27 = self.addSwitch( 'sw27', dpid='0000000000000a27' )
+ sw28 = self.addSwitch( 'sw28', dpid='0000000000000a28' )
+ sw29 = self.addSwitch( 'sw29', dpid='0000000000000a29' )
+ sw30 = self.addSwitch( 'sw30', dpid='0000000000000a30' )
+ sw31 = self.addSwitch( 'sw31', dpid='0000000000000a31' )
+ sw32 = self.addSwitch( 'sw32', dpid='0000000000000a32' )
+ sw33 = self.addSwitch( 'sw33', dpid='0000000000000a33' )
+ sw34 = self.addSwitch( 'sw34', dpid='0000000000000a34' )
+ sw35 = self.addSwitch( 'sw35', dpid='0000000000000a35' )
+ sw36 = self.addSwitch( 'sw36', dpid='0000000000000a36' )
+ sw37 = self.addSwitch( 'sw37', dpid='0000000000000a37' )
+ sw38 = self.addSwitch( 'sw38', dpid='0000000000000a38' )
+ sw39 = self.addSwitch( 'sw39', dpid='0000000000000a39' )
# Add a layer2 switch for control plane connectivity
# This switch isn't part of the SDN topology
# We'll use the ovs-controller to turn this into a learning switch
- swCtl100 = self.addSwitch( 'swCtl100', dpid = '0000000000000100' )
-
+ swCtl100 = self.addSwitch( 'swCtl100', dpid='0000000000000100' )
# BGP speaker hosts
spk1 = self.addHost( 'spk1' )
spk2 = self.addHost( 'spk2' )
spk3 = self.addHost( 'spk3', cls=VLANHost, vlan=10 )
spk4 = self.addHost( 'spk4', cls=VLANHost, vlan=20 )
- root = self.addHost( 'root', inNamespace = False , ip = '0' )
+ root = self.addHost( 'root', inNamespace=False, ip='0' )
# hosts behind each AS
h64514 = self.addHost( 'h64514' )
@@ -298,23 +297,26 @@
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 ):
+
+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 )
host.cmd( "cd %s" % QUAGGA_CONFIG_DIR )
zebra_cmd = \
- '%s/zebra -d -f ./zebra.conf -z %s/zserv%s.api -i %s/zebra%s.pid'\
+ '%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 = '%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 )
+ % ( QUAGGA_DIR, config_file, QUAGGA_RUN_DIR, num, QUAGGA_RUN_DIR, num )
print zebra_cmd
print quagga_cmd
@@ -322,20 +324,19 @@
host.cmd( zebra_cmd )
host.cmd( quagga_cmd )
-'''
+"""
def startQuaggaFromTeston( host, num, config_file ):
global net
h = net.get( str( host ) )
startquagga( h, num, config_file )
-'''
-
+"""
def startquaggahost5( host, num ):
info( '*** Starting Quagga on %s\n' % host )
zebra_cmd = \
- '%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 )
+ '%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 = \
- '%s/bgpd -d -f ./as4quaggas/quagga%s.conf -z %s/zserv%s.api -i %s/bgpd%s.pid'\
+ '%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 )
@@ -346,17 +347,17 @@
quietRun( 'sudo pkill -9 -f bgpd' )
quietRun( 'sudo pkill -9 -f zebra' )
+
def sdn1net():
topo = SDNTopo()
info( '*** Creating network\n' )
# global net
- net = Mininet( topo = topo, controller = RemoteController )
-
+ net = Mininet( topo=topo, controller=RemoteController )
spk1, spk2, spk3, spk4, p64514, p64515, p64516, p64517, p64518, p64519, p64520 = \
- net.get( 'spk1', 'spk2', 'spk3', 'spk4',
- 'p64514', 'p64515', 'p64516', 'p64517', 'p64518', 'p64519', 'p64520' )
+ net.get( 'spk1', 'spk2', 'spk3', 'spk4',
+ 'p64514', 'p64515', 'p64516', 'p64517', 'p64518', 'p64519', 'p64520' )
# Adding addresses to speakers' interface connected to sw24
# for BGP peering
@@ -399,7 +400,7 @@
# setup configuration on the interface connected to switch
p64514.cmd( "ifconfig p64514-eth0 10.0.4.1 up" )
p64514.cmd( "ip addr add 10.0.14.1/24 dev p64514-eth0" )
- p64514.setMAC( '00:00:00:00:00:14', 'p64514-eth0' ) # do not repeat spk4's MAC addr
+ p64514.setMAC( '00:00:00:00:00:14', 'p64514-eth0' ) # do not repeat spk4's MAC addr
p64515.cmd( "ifconfig p64515-eth0 10.0.5.1 up" )
p64515.cmd( "ip addr add 10.0.15.1/24 dev p64515-eth0" )
p64515.setMAC( '00:00:00:00:00:05', 'p64515-eth0' )
@@ -457,7 +458,7 @@
# Setup hosts in each non-SDN AS
h64514, h64515, h64516, h64517, h64518, h64519, h64520 = \
- net.get( 'h64514', 'h64515', 'h64516', 'h64517', 'h64518', 'h64519', 'h64520' )
+ net.get( 'h64514', 'h64515', 'h64516', 'h64517', 'h64518', 'h64519', 'h64520' )
h64514.cmd( 'ifconfig h64514-eth0 4.0.0.1 up' )
h64514.cmd( 'ip route add default via 4.0.0.254' )
h64514.setIP( '192.168.0.44', 24, 'h64514-eth1' ) # for control plane
@@ -478,22 +479,20 @@
h64520.cmd( 'ifconfig h64520-eth0.10 20.0.0.1 up' )
h64520.cmd( 'ip route add default via 20.0.0.254' )
-
# set up swCtl100 as a learning
swCtl100 = net.get( 'swCtl100' )
swCtl100.cmd( 'ovs-vsctl set-controller swCtl100 none' )
swCtl100.cmd( 'ovs-vsctl set-fail-mode swCtl100 standalone' )
# connect all switches to controller
- '''
+ """
onos1IP = "10.128.4.52"
onos2IP = "10.128.4.53"
onos3IP = "10.128.4.54"
for i in range ( 1, numSw + 1 ):
swX = net.get( 'sw%s' % ( i ) )
- swX.cmd( 'ovs-vsctl set-controller sw%s tcp:%s:6653 tcp:%s:6653 tcp:%s:6653' % ( i, onos1IP, onos2IP, onos3IP) )
- '''
-
+ swX.cmd( 'ovs-vsctl set-controller sw%s tcp:%s:6653 tcp:%s:6653 tcp:%s:6653' % ( i, onos1IP, onos2IP, onos3IP ) )
+ """
# Start Quagga on border routers
startquagga( p64514, 64514, 'quagga64514.conf' )
startquagga( p64515, 64515, 'quagga64515.conf' )
@@ -525,15 +524,13 @@
spk3.intf( 'spk3-eth1' ).setIP( '1.1.1.5/24' )
spk4.intf( 'spk4-eth1' ).setIP( '1.1.1.7/24' )
-
stopsshd()
hosts = [ p64514, p64515, p64516, p64517, p64518, p64519, p64520,
- h64514, h64517, h64519 ];
+ h64514, h64517, h64519 ]
startsshds( hosts )
-
- '''
+ """
forwarding1 = '%s:2000:%s:2000' % ( '1.1.1.2', onos1IP )
root.cmd( 'ssh -nNT -o "PasswordAuthentication no" \
-o "StrictHostKeyChecking no" -l sdn -L %s %s & ' % ( forwarding1, onos1IP ) )
@@ -545,7 +542,7 @@
forwarding3 = '%s:2000:%s:2000' % ( '1.1.1.6', onos3IP )
root.cmd( 'ssh -nNT -o "PasswordAuthentication no" \
-o "StrictHostKeyChecking no" -l sdn -L %s %s & ' % ( forwarding3, onos3IP ) )
- '''
+ """
CLI( net )
stopsshd()
diff --git a/TestON/tests/USECASE/VPLS/VPLSBasic/VPLSBasic.py b/TestON/tests/USECASE/VPLS/VPLSBasic/VPLSBasic.py
index 7c9905e..4f8d159 100644
--- a/TestON/tests/USECASE/VPLS/VPLSBasic/VPLSBasic.py
+++ b/TestON/tests/USECASE/VPLS/VPLSBasic/VPLSBasic.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
# CASE1: Startup
# CASE2: Load vpls topology and configurations from demo script
# CASE3: Test CLI commands
@@ -94,7 +93,6 @@
onpass="Mininet Started",
onfail="Error starting Mininet" )
-
main.step( "Activate apps defined in the params file" )
# get data from the params
apps = main.params.get( 'apps' )
@@ -140,7 +138,7 @@
main.step( "App Ids check" )
appCheck = main.Cluster.command( "appToIDCheck", returnBool=True )
- if appCheck != True:
+ if not appCheck:
main.log.warn( main.Cluster.active( 0 ).CLI.apps() )
main.log.warn( main.Cluster.active( 0 ).CLI.appIDs() )
utilities.assert_equals( expect=True, actual=appCheck,
@@ -199,7 +197,7 @@
result = False
getPorts = utilities.retry( f=main.Cluster.active( 0 ).REST.getNetCfg,
retValue=False,
- kwargs={ "subjectClass" :"ports" },
+ kwargs={ "subjectClass": "ports" },
sleep=main.sleep )
onosCfg = pprint( getPorts )
sentCfg = pprint( originalCfg.get( "ports" ) )
@@ -233,14 +231,13 @@
main.step( "Remove an interface from a vpls network" )
main.Cluster.active( 0 ).CLI.vplsRemIface( 'VPLS1', 'h1' )
time.sleep( main.sleep )
- #update master config json
+ # update master config json
for network in main.vplsConfig:
if network.get( 'name' ) == 'VPLS1':
ifaces = network.get( 'interfaces' )
ifaces.remove( 'h1' )
main.vpls.verify( main )
-
def CASE11( self, main ):
"""
Clean all VPLS configurations
@@ -251,7 +248,6 @@
main.vplsConfig = []
main.vpls.verify( main )
-
def CASE12( self, main ):
"""
Create a new VPLS network.
@@ -264,7 +260,6 @@
main.vplsConfig.append( network1 )
main.vpls.verify( main )
-
def CASE13( self, main ):
"""
Add interfaces to the new VPLS network.
@@ -292,7 +287,6 @@
network[ 'interfaces' ] = ifaces
main.vpls.verify( main )
-
def CASE14( self, main ):
"""
Add MPLS encapsulation.
@@ -306,7 +300,6 @@
time.sleep( main.sleep )
main.vpls.verify( main )
-
def CASE15( self, main ):
"""
Change an encapsulation type.
@@ -320,7 +313,6 @@
time.sleep( main.sleep )
main.vpls.verify( main )
-
def CASE16( self, main ):
"""
Remove encapsulation.
diff --git a/TestON/tests/USECASE/VPLS/VPLSfailsafe/VPLSfailsafe.py b/TestON/tests/USECASE/VPLS/VPLSfailsafe/VPLSfailsafe.py
index bda1ecd..55c9e2c 100644
--- a/TestON/tests/USECASE/VPLS/VPLSfailsafe/VPLSfailsafe.py
+++ b/TestON/tests/USECASE/VPLS/VPLSfailsafe/VPLSfailsafe.py
@@ -1,5 +1,5 @@
"""
-Copyright 2017 Open Networking Foundation (ONF)
+Copyright 2017 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,7 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
"""
Testing various connectivity failures for VPLS.
@@ -31,13 +30,11 @@
CASE310: Kill 1 ONOS node at a time and test connectivity.
CASE400: Bring down 1 link at a time and test connectivity.
"""
-
class VPLSfailsafe:
def __init__( self ):
self.default = ''
-
def CASE1( self, main ):
"""
CASE1 is to compile ONOS and push it to the test machines
@@ -103,7 +100,6 @@
onpass="Mininet Started",
onfail="Error starting Mininet" )
-
main.step( "Activate apps defined in the params file" )
# get data from the params
apps = main.params.get( 'apps' )
@@ -149,7 +145,7 @@
main.step( "App Ids check" )
appCheck = main.Cluster.command( "appToIDCheck", returnBool=True )
- if appCheck != True:
+ if appCheck is not True:
main.log.warn( main.Cluster.active( 0 ).CLI.apps() )
main.log.warn( main.Cluster.active( 0 ).CLI.appIDs() )
utilities.assert_equals( expect=True, actual=appCheck,
@@ -185,7 +181,7 @@
utilities.assert_equals( expect=main.TRUE,
actual=loadVPLSResult,
onpass="Loaded vpls configuration.",
- onfail="Failed to load vpls configuration.")
+ onfail="Failed to load vpls configuration." )
# Time for netcfg to load data
time.sleep( SLEEP )
@@ -211,7 +207,7 @@
result = False
getPorts = utilities.retry( f=main.ONOSrest1.getNetCfg,
retValue=False,
- kwargs={ "subjectClass" : "ports" },
+ kwargs={ "subjectClass": "ports" },
sleep=SLEEP )
onosCfg = pprint( getPorts )
sentCfg = pprint( originalCfg.get( "ports" ) )
@@ -239,8 +235,6 @@
onpass="Loaded vpls configuration.",
onfail="Failed to load vpls configuration." )
-
-
def CASE50( self, main ):
"""
Initial connectivity check
@@ -253,7 +247,6 @@
onpass="Connectivity is as expected.",
onfail="Connectivity is NOT as expected." )
-
def CASE100( self, main ):
"""
Bring down 1 host at a time and test connectivity
@@ -301,7 +294,7 @@
utilities.assert_equals( expect=main.TRUE, actual=result,
onpass="Connectivity is as expected.",
- onfail="Connectivity is NOT as expected.")
+ onfail="Connectivity is NOT as expected." )
def CASE200( self, main ):
"""
@@ -310,7 +303,7 @@
assert vpls, "vpls not defined"
main.case( "Bring down one switch at a time and test connectivity." )
- links = main.Mininet1.getLinks( ) # Obtain links here
+ links = main.Mininet1.getLinks() # Obtain links here
result = main.TRUE
for i in range( 5, hosts + 1 ):
@@ -318,7 +311,7 @@
stri = str( i )
# Bring switch down
- main.step( "Delete s" + stri + ".")
+ main.step( "Delete s" + stri + "." )
delSwitchResult = main.Mininet1.delSwitch( sw="s" + stri )
# Check if switch was deleted
@@ -332,17 +325,17 @@
result = result and connectivityResult
# Bring switch up
- main.step( "Add s" + stri + ".")
+ main.step( "Add s" + stri + "." )
addSwitchResult = main.Mininet1.addSwitch( sw="s" + stri )
# Check if switch was added
utilities.assert_equals( expect=main.TRUE, actual=addSwitchResult,
onpass="Successfully added switch.",
- onfail="Failed to add switch.")
+ onfail="Failed to add switch." )
result = result and addSwitchResult
# Reconnect links
- main.step( "Reconnecting links on s" + stri + ".")
+ main.step( "Reconnecting links on s" + stri + "." )
for j in links:
if ( j[ 'node1' ] == "s" + stri and j[ 'node2' ][ 0 ] == "s" ) or \
( j[ 'node2' ] == "s" + stri and j[ 'node1' ][ 0 ] == "s" ):
@@ -355,7 +348,6 @@
connectivityResult = vpls.testConnectivityVpls( main )
result = result and connectivityResult
-
utilities.assert_equals( expect=main.TRUE,
actual=result,
onpass="Connectivity is as expected.",
@@ -381,7 +373,7 @@
ip_address = main.Cluster.active( i ).ipAddress
# Stop an ONOS node: i
- main.step( "Stop ONOS node " + stri + ".")
+ main.step( "Stop ONOS node " + stri + "." )
stopResult = main.ONOSbench.onosStop( ip_address )
main.Cluster.runningNodes[ i ].active = False
@@ -394,7 +386,7 @@
result = result and connectivityResult
# Restart ONOS node
- main.step( "Restart ONOS node " + stri + " and checking status of restart.")
+ main.step( "Restart ONOS node " + stri + " and checking status of restart." )
startResult = main.ONOSbench.onosStart( ip_address )
utilities.assert_equals( expect=main.TRUE, actual=startResult,
@@ -451,7 +443,6 @@
onpass="Connectivity is as expected.",
onfail="Connectivity is NOT as expected." )
-
def CASE310( self, main ):
"""
Kill 1 ONOS node at a time and test connectivity
@@ -484,8 +475,7 @@
utilities.assert_equals( expect=main.TRUE,
actual=result,
onpass="Connectivity is as expected.",
- onfail="Connectivity is NOT as expected.")
-
+ onfail="Connectivity is NOT as expected." )
def CASE400( self, main ):
"""
@@ -493,7 +483,6 @@
"""
assert vpls, "vpls not defined"
-
main.case( "Bring down one link at a time and test connectivity." )
result = main.TRUE
diff --git a/TestON/tests/USECASE/VPLS/dependencies/vpls.py b/TestON/tests/USECASE/VPLS/dependencies/vpls.py
index 6240cb3..5c057bf 100644
--- a/TestON/tests/USECASE/VPLS/dependencies/vpls.py
+++ b/TestON/tests/USECASE/VPLS/dependencies/vpls.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -17,9 +17,7 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
-"""
-"""
Functions for the vpls tests
"""
import time
@@ -65,8 +63,6 @@
NOTE: This requires the expected/sent network config json for the vpls
application be stored in main.vplsConfig
"""
-
-
# Variables
app = main.params[ 'vpls' ][ 'name' ]
pprint = main.Cluster.active( 0 ).REST.pprint
@@ -78,7 +74,7 @@
result = False
getVPLS = utilities.retry( f=ctrl.REST.getNetCfg,
retValue=False,
- kwargs={"subjectClass":"apps", "subjectKey":app},
+ kwargs={ "subjectClass": "apps", "subjectKey": app },
sleep=SLEEP )
onosCfg = json.loads( getVPLS ).get( 'vpls' ).get( 'vplsList' )
onosCfg = pprint( sanitizeConfig( onosCfg ) )
@@ -100,7 +96,7 @@
clusterResult = True
for ctrl in main.Cluster.active():
result = False
- #TODO Read from vpls show and match to pushed json
+ # TODO Read from vpls show and match to pushed json
vpls = ctrl.CLI.parseVplsShow()
parsedVpls = pprint( sanitizeConfig( vpls ) )
sentVpls = pprint( sanitizeConfig( main.vplsConfig ) )
@@ -142,7 +138,7 @@
if pingResult != expected:
connectivityCheck = False
main.log.error( "%s <-> %s: %s; Expected: %s" %
- ( src, dst, pingResult, expected ) )
+ ( src, dst, pingResult, expected ) )
utilities.assert_equals( expect=True,
actual=connectivityCheck,
onpass="Connectivity is as expected",
@@ -151,7 +147,8 @@
# TODO: if encapsulation is set, look for that
# TODO: can we look at the intent keys?
-def checkIntentState( main , bl=[] ):
+
+def checkIntentState( main, bl=[] ):
# Print the intent states
intents = main.Cluster.active( 0 ).CLI.intents()
count = 0
@@ -179,7 +176,7 @@
result = {}
vplsConfig = main.vplsConfig
for v in vplsConfig:
- interfaces = v[ 'interfaces' ][:]
+ interfaces = v[ 'interfaces' ][ : ]
for i in bl:
if i in interfaces:
interfaces.remove( i )
diff --git a/TestON/tests/USECASE/dependencies/sdnipBaseFunction.py b/TestON/tests/USECASE/dependencies/sdnipBaseFunction.py
index 1d913cc..c5eb905 100644
--- a/TestON/tests/USECASE/dependencies/sdnipBaseFunction.py
+++ b/TestON/tests/USECASE/dependencies/sdnipBaseFunction.py
@@ -1,6 +1,8 @@
class SdnBase:
- def __init__(self):
+
+ def __init__( self ):
self.default = ''
+
def initSetup( self ):
import json
import time
@@ -30,9 +32,9 @@
cellName=cellName )
main.step( "Checking if ONOS CLI is ready for issuing commands" )
- ready = utilities.retry( main.Cluster.command,
+ ready = utilities.retry( main.Cluster.command,
False,
- kwargs={ "function":"summary", "contentCheck":True },
+ kwargs={ "function": "summary", "contentCheck": True },
sleep=30,
attempts=10 )
utilities.assert_equals( expect=True, actual=ready,
@@ -44,9 +46,9 @@
main.cleanAndExit()
def pToPIntentTest( self, intentExpectedNum ):
- '''
+ """
point-to-point intents test for each BGP peer and BGP speaker pair
- '''
+ """
import time
main.case( "Check point-to-point intents" )
main.log.info( "There are %s BGP peers in total "
@@ -58,7 +60,7 @@
main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
bgpIntentsExpectedNum = int( main.params[ 'config' ][ 'peerNum' ] ) * intentExpectedNum
if bgpIntentsActualNum != bgpIntentsExpectedNum:
- time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+ time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
getIntentsResult = main.Cluster.active( 0 ).CLI.intents( jsonFormat=True )
bgpIntentsActualNum = \
main.QuaggaCliSpeaker1.extractActualBgpIntentNum( getIntentsResult )
@@ -72,9 +74,9 @@
onfail="PointToPointIntent Intent Num is wrong!" )
def routeAndIntentCheck( self, allRoutesExpected, routeIntentsExpectedNum ):
- '''
+ """
routes and intents check to all BGP peers
- '''
+ """
import time
getRoutesResult = main.Cluster.active( 0 ).CLI.routes( jsonFormat=True )
allRoutesActual = \
@@ -82,7 +84,7 @@
allRoutesStrExpected = str( sorted( allRoutesExpected ) )
allRoutesStrActual = str( allRoutesActual ).replace( 'u', "" )
if allRoutesStrActual != allRoutesStrExpected:
- time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+ time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
getRoutesResult = main.Cluster.active( 0 ).CLI.routes( jsonFormat=True )
allRoutesActual = \
main.QuaggaCliSpeaker1.extractActualRoutesMaster( getRoutesResult )
@@ -93,7 +95,7 @@
main.log.info( allRoutesStrExpected )
main.log.info( "Routes get from ONOS CLI:" )
main.log.info( allRoutesStrActual )
- utilities.assertEquals( \
+ utilities.assertEquals(
expect=allRoutesStrExpected, actual=allRoutesStrActual,
onpass="Routes are correct!",
onfail="Routes are wrong!" )
@@ -103,7 +105,7 @@
routeIntentsActualNum = \
main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
if routeIntentsActualNum != routeIntentsExpectedNum:
- time.sleep( int( main.params['timers']['RouteDelivery'] ) )
+ time.sleep( int( main.params[ 'timers' ][ 'RouteDelivery' ] ) )
getIntentsResult = main.Cluster.active( 0 ).CLI.intents( jsonFormat=True )
routeIntentsActualNum = \
main.QuaggaCliSpeaker1.extractActualRouteIntentNum( getIntentsResult )
@@ -112,7 +114,7 @@
main.log.info( routeIntentsExpectedNum )
main.log.info( "MultiPointToSinglePoint Intent NUM Actual is:" )
main.log.info( routeIntentsActualNum )
- utilities.assertEquals( \
+ utilities.assertEquals(
expect=routeIntentsExpectedNum,
actual=routeIntentsActualNum,
onpass="MultiPointToSinglePoint Intent Num is correct!",
@@ -121,9 +123,9 @@
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
main.FALSE,
- kwargs={'isPENDING':False},
+ kwargs={ 'isPENDING': False },
attempts=10 )
- utilities.assertEquals( \
+ utilities.assertEquals(
expect=main.TRUE,
actual=flowCheck,
onpass="Flow status is correct!",
@@ -134,10 +136,10 @@
link2RouteNum, link2IntentNum,
link3RouteNum, link3IntentNum,
speakers, hosts, upOrDown ):
- '''
+ """
Cut/Recover links to peers one by one, check routes/intents
upOrDown - "up" or "down"
- '''
+ """
import time
main.case( "Bring " + upOrDown + " links and check routes/intents" )
main.step( "Bring " + upOrDown + " the link between sw32 and " + link1Peer )
@@ -171,7 +173,7 @@
main.log.error( "Bring " + upOrDown + " link failed!" )
main.cleanAndExit()
- main.step( "Bring " + upOrDown + " the link between sw28 and "+ link3Peer )
+ main.step( "Bring " + upOrDown + " the link between sw28 and " + link3Peer )
linkResult3 = main.Mininet.link( END1="sw28", END2=link3Peer,
OPTION=upOrDown )
utilities.assert_equals( expect=main.TRUE,
@@ -189,7 +191,7 @@
main.step( "Check whether all flow status are ADDED" )
flowCheck = utilities.retry( main.Cluster.active( 0 ).CLI.checkFlowsState,
main.FALSE,
- kwargs={'isPENDING':False},
+ kwargs={ 'isPENDING': False },
attempts=10 )
utilities.assert_equals( expect=main.TRUE,
actual=flowCheck,
@@ -198,8 +200,8 @@
# Ping test
main.Functions.pingSpeakerToPeer( main, speakers=[ speakers ],
- peers=[ link1Peer, link2Peer, link3Peer ],
- expectAllSuccess=False )
+ peers=[ link1Peer, link2Peer, link3Peer ],
+ expectAllSuccess=False )
main.Functions.pingHostToHost( main,
- hosts=hosts,
- expectAllSuccess=False )
\ No newline at end of file
+ hosts=hosts,
+ expectAllSuccess=False )
diff --git a/TestON/tests/__init__.py b/TestON/tests/__init__.py
index 8b13789..e69de29 100644
--- a/TestON/tests/__init__.py
+++ b/TestON/tests/__init__.py
@@ -1 +0,0 @@
-
diff --git a/TestON/tests/dependencies/Cluster.py b/TestON/tests/dependencies/Cluster.py
index 16dfd79..210134f 100644
--- a/TestON/tests/dependencies/Cluster.py
+++ b/TestON/tests/dependencies/Cluster.py
@@ -1,5 +1,5 @@
"""
-Copyright 2017 Open Networking Foundation (ONF)
+Copyright 2017 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -18,8 +18,6 @@
You should have received a copy of the GNU General Public License
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
-
-
class Cluster():
def __str__( self ):
@@ -33,14 +31,14 @@
return "%s[%s]" % ( self.name, ", ".join( controllers ) )
def __init__( self, ctrlList=[], name="Cluster" ):
- '''
+ """
controllers : All the nodes
runningNodes : Node that are specifically running from the test.
- ie) When the test is testing different number of nodes on each
+ ie ) When the test is testing different number of nodes on each
run.
numCtrls : number of runningNodes
maxCtrls : number of controllers
- '''
+ """
self.controllers = ctrlList
self.runningNodes = ctrlList
self.numCtrls = len( self.runningNodes )
@@ -107,7 +105,7 @@
Returns:
"""
self.runningNodes = []
- for i in numCtrls if isinstance( numCtrls, list ) else range( numCtrls ) :
+ for i in numCtrls if isinstance( numCtrls, list ) else range( numCtrls ):
self.runningNodes.append( self.controllers[ i ] )
self.numCtrls = len( numCtrls ) if isinstance( numCtrls, list ) else numCtrls
@@ -158,13 +156,13 @@
* cellName - The name of the cell.
* Mininet - a mininet driver that will be used.
* useSSH - True for using ssh when creating a cell
- * ips - ip(s) of the node(s).
+ * ips - ip( s ) of the node( s ).
Returns:
"""
self.command( "createCellFile",
args=[ main.ONOSbench.ip_address,
cellName,
- Mininet if isinstance(Mininet, str) else
+ Mininet if isinstance( Mininet, str ) else
Mininet.ip_address,
main.apps,
ips,
@@ -203,7 +201,6 @@
Returns:
Returns main.TRUE if it successfully set and verify cell.
"""
-
setCellResult = self.command( "setCell",
args=[ cellName ],
specificDriver=1,
@@ -254,7 +251,7 @@
max number of the nodes.
Required:
* killRemoveMax - The boolean that will decide either to kill
- only running nodes (False) or max number of nodes (True).
+ only running nodes ( False ) or max number of nodes ( True ).
* stopOnos - If wish to stop onos before killing it. True for
enable stop , False for disable stop.
Returns:
@@ -439,7 +436,7 @@
funcArgs = []
funcKwargs = {}
f = getattr( ( ctrl if not specificDriver else
- getattr( ctrl, drivers[ specificDriver ] ) ), function )
+ getattr( ctrl, drivers[ specificDriver ] ) ), function )
if funcFromCtrl:
if args:
for i in range( len( args ) ):
diff --git a/TestON/tests/dependencies/ONOSSetup.py b/TestON/tests/dependencies/ONOSSetup.py
index 8a73e32..750dde6 100644
--- a/TestON/tests/dependencies/ONOSSetup.py
+++ b/TestON/tests/dependencies/ONOSSetup.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,6 +20,7 @@
"""
import re
+
class ONOSSetup:
main = None
@@ -84,7 +85,7 @@
Returns:
Returns main.TRUE
"""
- if includeGitPull :
+ if includeGitPull:
self.gitPulling()
try:
@@ -151,7 +152,7 @@
Required:
* cluster - the cluster driver that will be used.
* killRemoveMax - The boolean that will decide either to kill
- only running nodes (False) or max number of nodes (True).
+ only running nodes ( False ) or max number of nodes ( True ).
* stopOnos - If wish to stop onos before killing it. True for
enable stop , False for disable stop.
Returns:
@@ -173,7 +174,7 @@
* cellName - The name of the cell.
* Mininet - a mininet driver that will be used.
* useSSH - True for using ssh when creating a cell
- * ips - ip(s) of the node(s).
+ * ips - ip( s ) of the node( s ).
Returns:
Returns main.TRUE if it successfully executed.
"""
@@ -324,8 +325,8 @@
Initial ONOS setting up of the tests. It will also verify the result of each steps.
The procedures will be:
killing onos
- creating (optional) /applying cell
- removing raft logs (optional)
+ creating ( optional ) /applying cell
+ removing raft logs ( optional )
uninstalling onos
extra procedure to be applied( optional )
building onos
@@ -342,10 +343,10 @@
* newCell - True for making a new cell and False for not making it.
* cellName - Name of the cell that will be used.
* removeLog - True if wish to remove raft logs
- * extraApply - Function(s) that will be called before building ONOS. Default to None.
- * applyArgs - argument of the functon(s) of the extraApply. Should be in list.
- * extraClean - Function(s) that will be called after building ONOS. Defaults to None.
- * cleanArgs - argument of the functon(s) of the extraClean. Should be in list.
+ * extraApply - Function( s ) that will be called before building ONOS. Default to None.
+ * applyArgs - argument of the functon( s ) of the extraApply. Should be in list.
+ * extraClean - Function( s ) that will be called after building ONOS. Defaults to None.
+ * cleanArgs - argument of the functon( s ) of the extraClean. Should be in list.
* skipPack - True if wish to skip some packing.
* installMax - True if wish to install onos max number of nodes
False if wish to install onos of running nodes only
@@ -378,7 +379,7 @@
useSSH, tempOnosIp,
installMax )
if removeLog:
- main.log.info("Removing raft logs")
+ main.log.info( "Removing raft logs" )
main.ONOSbench.onosRemoveRaftLogs()
onosUninstallResult = self.uninstallOnos( cluster, killRemoveMax )
diff --git a/TestON/tests/dependencies/topology.py b/TestON/tests/dependencies/topology.py
index 2a81987..96109d3 100644
--- a/TestON/tests/dependencies/topology.py
+++ b/TestON/tests/dependencies/topology.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -22,6 +22,8 @@
import re
import imp
import json
+
+
class Topology:
def __init__( self ):
@@ -47,7 +49,7 @@
for ctrl in main.Cluster.active():
func = getattr( ctrl.CLI, function )
t = main.Thread( target=utilities.retry if needRetry else func,
- name= function + "-" + str( ctrl ),
+ name=function + "-" + str( ctrl ),
args=[ func, [ None ] ] if needRetry else [],
kwargs=kwargs )
threads.append( t )
@@ -116,10 +118,10 @@
if isinstance( compareArg, list ):
compareArg.append( json.loads( compareElem[ controller ] ) )
else:
- compareArg = [compareArg, json.loads( compareElem[ controller ] ) ]
+ compareArg = [ compareArg, json.loads( compareElem[ controller ] ) ]
currentCompareResult = compareF( *compareArg )
- except(TypeError, ValueError):
+ except( TypeError, ValueError ):
main.log.error(
"Could not load json: {0} or {1}".format( str( compareElem[ controller ] ) ) )
currentCompareResult = main.FALSE
diff --git a/TestON/tests/dependencies/utils.py b/TestON/tests/dependencies/utils.py
index 240d4b2..5e15c2a 100644
--- a/TestON/tests/dependencies/utils.py
+++ b/TestON/tests/dependencies/utils.py
@@ -1,5 +1,5 @@
"""
-Copyright 2016 Open Networking Foundation (ONF)
+Copyright 2016 Open Networking Foundation ( ONF )
Please refer questions to either the onos test mailing list at <onos-test@onosproject.org>,
the System Testing Plans and Results wiki page at <https://wiki.onosproject.org/x/voMg>,
@@ -8,7 +8,7 @@
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
- (at your option) any later version.
+ ( at your option ) any later version.
TestON is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,6 +19,7 @@
along with TestON. If not, see <http://www.gnu.org/licenses/>.
"""
class Utils:
+
def __init__( self ):
self.default = ''