[ONOS-7039] [ONOS-7044] Fix PEP8 Warnings in TestON
Change-Id: Ied79ff9caff5487a6df50466307f757468d7ca3a
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 )