[ONOS-7676] Enable support for fabric.p4 in SegmentRouting ONOS System Tests
Change-Id: I3dde8fe5d90d2c595021ff05ab45ccb37bbfbef6
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py
index 479b3f4..0b13a61 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/dependencies/SRRoutingTest.py
@@ -25,6 +25,7 @@
SRRouting test setup
"""
from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as lib
+ import tests.USECASE.SegmentRouting.dependencies.cfgtranslator as translator
import time
skipPackage = False
@@ -61,6 +62,11 @@
1 if ipv6 else 0)
else:
main.cfgName = main.params[ "DEPENDENCY" ][ "confName" ]
+ if main.useBmv2:
+ # Translate configuration file from OVS-OFDPA to BMv2 driver
+ translator.ofdpaToBmv2( main )
+ else:
+ translator.bmv2ToOfdpa( main )
lib.loadJson( main )
time.sleep( float( main.params[ 'timers' ][ 'loadNetcfgSleep' ] ) )
lib.loadHost( main )
@@ -81,6 +87,9 @@
# Run the test with Mininet
mininet_args = ' --dhcp=1 --routers=1 --ipv6={} --ipv4={}'.format( 1 if ipv6 else 0,
1 if ipv4 else 0 )
+ if main.useBmv2:
+ mininet_args += ' --switch bmv2'
+ main.log.info( "Using BMv2 switch" )
lib.startMininet( main, main.params[ 'DEPENDENCY' ][ 'topology' ], args=mininet_args )
time.sleep( float( main.params[ "timers" ][ "startMininetSleep" ] ) )
else: