Fixes for new jenkins environment and other tweeks
- Fix ERROR message if there are no traffic components to cleanup
- Use full path for "sudo ip" command
- Fix missing testcase declarations
- Make sure we creat dst host components in topology.ping()
Change-Id: Ie01ed72f26fa4c3187f61fefa63f4a791d77b88d
diff --git a/TestON/tests/USECASE/SegmentRouting/SRStaging/SRStaging.topo b/TestON/tests/USECASE/SegmentRouting/SRStaging/SRStaging.topo
index 2f4c8f2..b9d705e 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRStaging/SRStaging.topo
+++ b/TestON/tests/USECASE/SegmentRouting/SRStaging/SRStaging.topo
@@ -183,7 +183,7 @@
</Host3>
<ng40vm>
- <host>192.168.122.102</host>
+ <host>10.92.1.95</host>
<user>ng40</user>
<password>ng40</password>
<type>HostDriver</type>
diff --git a/TestON/tests/USECASE/SegmentRouting/SRStaging/SRpairedLeaves/SRpairedLeaves.py b/TestON/tests/USECASE/SegmentRouting/SRStaging/SRpairedLeaves/SRpairedLeaves.py
index 077df04..5911832 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRStaging/SRpairedLeaves/SRpairedLeaves.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRStaging/SRpairedLeaves/SRpairedLeaves.py
@@ -48,6 +48,7 @@
"""
try:
from tests.USECASE.SegmentRouting.SRStaging.dependencies.SRStagingTest import SRStagingTest
+ from tests.USECASE.SegmentRouting.dependencies.Testcaselib import Testcaselib as run
import json
except ImportError:
main.log.error( "SRStagingTest not found. Exiting the test" )
@@ -63,6 +64,7 @@
topology='0x2',
onosNodes=3,
description="%s tests on the %s pod" % ( descPrefix, pod ) )
+ hosts = [ 'h1', 'h2', 'h3', 'mgmt' ]
run.pingAllFabricIntfs( main, hosts, dumpFlows=False )
main.funcs.cleanup( main )
diff --git a/TestON/tests/USECASE/SegmentRouting/SRStaging/dependencies/SRStagingTest.py b/TestON/tests/USECASE/SegmentRouting/SRStaging/dependencies/SRStagingTest.py
index a3ab6ba..5da933b 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRStaging/dependencies/SRStagingTest.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRStaging/dependencies/SRStagingTest.py
@@ -1353,8 +1353,9 @@
def cleanup( self, main, headerOrder=None ):
try:
- for component in main.trafficComponents:
- main.Network.removeComponent( component.name )
+ if getattr( main, "trafficComponents" ):
+ for component in main.trafficComponents:
+ main.Network.removeComponent( component.name )
main.trafficComponents = []
except Exception:
main.log.exception( "Error cleaning up traffic components" )
diff --git a/TestON/tests/dependencies/topology.py b/TestON/tests/dependencies/topology.py
index 9d20cda..56a29a9 100644
--- a/TestON/tests/dependencies/topology.py
+++ b/TestON/tests/dependencies/topology.py
@@ -263,6 +263,15 @@
srcIpList[ src ] = main.Network.getIPAddress( src, proto='IPV6' if ipv6 else 'IPV4', iface=hostHandle.interfaces[0].get("name") )
unexpectedPings = []
for dst in dstList:
+ if not hasattr( main, dst ):
+ main.log.info( "Creating component for host {}".format( dst ) )
+ main.Network.createHostComponent( dst )
+ hostHandle = getattr( main, dst )
+ if hasattr( main, 'Mininet1' ):
+ main.log.info( "Starting CLI on host {}".format( dst ) )
+ hostHandle.startHostCli()
+ else:
+ hostHandle.connectInband()
hostHandle = getattr( main, dst )
dstIp = main.Network.getIPAddress( dst, proto='IPV6' if ipv6 else 'IPV4', iface=hostHandle.interfaces[0].get("name") )
# Start pings from src hosts in parallel