[ONOS-7676] Enable support for fabric.p4 in SegmentRouting ONOS System Tests
Change-Id: I3dde8fe5d90d2c595021ff05ab45ccb37bbfbef6
diff --git a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
index 1b86dcb..88e5736 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
+++ b/TestON/tests/USECASE/SegmentRouting/SRRouting/SRRouting.params
@@ -14,6 +14,7 @@
<DEPENDENCY>
<useCommonConf>False</useCommonConf>
<useCommonTopo>True</useCommonTopo>
+ <useBmv2>False</useBmv2>
<topology>hagg_fabric.py</topology>
<lib>routinglib.py,trellislib.py,trellis_fabric.py</lib>
<conf>bgpdbgp1.conf,bgpdbgp2.conf,bgpdr1.conf,bgpdr2.conf,dhcpd6.conf,dhcpd.conf,zebradbgp1.conf,zebradbgp2.conf</conf>
@@ -21,7 +22,7 @@
<ENV>
<cellName>productionCell</cellName>
- <cellApps>drivers,openflow,segmentrouting,fpm,dhcprelay,netcfghostprovider,routeradvertisement,t3,hostprobingprovider</cellApps>
+ <cellApps>drivers,openflow,segmentrouting,fpm,dhcprelay,netcfghostprovider,routeradvertisement,t3,hostprobingprovider,drivers.bmv2,pipelines.fabric</cellApps>
</ENV>
<GIT>
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: