changes for failing tests in nightly tests
Change-Id: Ib9c475f56e0444498b3ace5b86c22c8d782eaf3a
diff --git a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
index 4ff3a85..c338588 100644
--- a/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
+++ b/TestON/tests/USECASE/SegmentRouting/dependencies/Testcaselib.py
@@ -244,10 +244,10 @@
main.Cluster.active( 0 ).REST.setXconnectJson( xconnect )
@staticmethod
- def loadChart( main ):
+ def loadChart( main, suffix='' ):
try:
- filename = "%s%s.chart" % ( main.configPath + main.forChart,
- main.cfgName )
+ filename = "%s%s.chart%s" % ( main.configPath + main.forChart,
+ main.cfgName, suffix )
with open( filename ) as chart:
main.pingChart = json.load( chart )
except IOError:
@@ -738,8 +738,22 @@
onpass="IPv6 connectivity successfully tested",
onfail="IPv6 connectivity failed" )
elif main.physicalNet:
- pa = main.Network.pingallHosts( hosts, ipv6=True, useScapy=useScapy )
- utilities.assert_equals( expect=expect, actual=pa,
+ pa = main.Network.pingallHosts( hosts, ipv6=True, useScapy=useScapy, returnResult=True )
+ combinedResult = True
+ for result in pa:
+ expectedResult = None
+ for ping in main.pingChart.values():
+ if result["src"] in ping["hosts"] and result["dst"] in ping["hosts"]:
+ # Check if the vlan in ping is the same as in the result. If true, set the expected result to result at expect
+ # If expected result is not the same as the actual result, then the combined result is false
+ # if we cannot find the expected result, then expect should be the default between the hosts
+ if str(result["vlan"]) in ping.get("vlans", [] ):
+ expectedResult = ping["vlans"].get(str(result["vlan"]))
+ if expectedResult is None:
+ expectedRresult = expect
+ if expectedResult != result["result"]:
+ combinedResult = False
+ utilities.assert_equals( expect=True, actual=combinedResult,
onpass="IP connectivity successfully tested",
onfail="IP connectivity failed" )
else: