changes for failing tests in nightly tests
Change-Id: Ib9c475f56e0444498b3ace5b86c22c8d782eaf3a
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/SRBridgingTest.py b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/SRBridgingTest.py
index 098db74..ee04e89 100644
--- a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/SRBridgingTest.py
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/SRBridgingTest.py
@@ -74,7 +74,7 @@
run.loadJson( main, suffix=suf )
else:
run.loadJson( main )
- run.loadChart( main ) # stores hosts to ping and expected results
+ run.loadChart( main, suf ) # stores hosts to ping and expected results
if hasattr( main, 'Mininet1' ):
run.mnDockerSetup( main ) # optionally create and setup docker image
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE06.chart.tucson b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE06.chart.tucson
new file mode 100644
index 0000000..f5b2a09
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE06.chart.tucson
@@ -0,0 +1,6 @@
+{
+ "leaf1": {"expect": "True",
+ "hosts":["h1", "h2"],
+ "vlans":{"None":"True"}
+ }
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE16.chart.tucson b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE16.chart.tucson
new file mode 100644
index 0000000..42d4a6a
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE16.chart.tucson
@@ -0,0 +1,6 @@
+{
+ "leaf1": {"expect": "True",
+ "hosts":["h1", "h2"],
+ "vlans":{"111":"True"}
+ }
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE26.chart.tucson b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE26.chart.tucson
new file mode 100644
index 0000000..361d69f
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE26.chart.tucson
@@ -0,0 +1,6 @@
+{
+ "leaf1": {"expect": "True",
+ "hosts":["h1", "h2"],
+ "vlans":{"None": "True", "120": "True"}
+ }
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE36.chart.tucson b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE36.chart.tucson
new file mode 100644
index 0000000..570bfe2
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE36.chart.tucson
@@ -0,0 +1,6 @@
+{
+ "leaf1": {"expect": "True",
+ "hosts":["h1", "h2"],
+ "vlans":{"None":"True", "120":"False"}
+ }
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE46.chart.tucson b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE46.chart.tucson
new file mode 100644
index 0000000..e078e31
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE46.chart.tucson
@@ -0,0 +1,6 @@
+{
+ "leaf1": {"expect": "True",
+ "hosts":["h1", "h2"],
+ "vlans":{"None":"True", "111":"True"}
+ }
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE56.chart.tucson b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE56.chart.tucson
new file mode 100644
index 0000000..83a7b48
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE56.chart.tucson
@@ -0,0 +1,6 @@
+{
+ "leaf1": {"expect": "False",
+ "hosts":["h1", "h2"],
+ "vlans":{"None":"False"}
+ }
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE66.chart.tucson b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE66.chart.tucson
new file mode 100644
index 0000000..80e1b7d
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE66.chart.tucson
@@ -0,0 +1,6 @@
+{
+ "leaf1": {"expect": "False",
+ "hosts":["h1", "h2"],
+ "vlans":{"111":"False", "120":"False"}
+ }
+}
diff --git a/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE76.chart.tucson b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE76.chart.tucson
new file mode 100644
index 0000000..79233ae
--- /dev/null
+++ b/TestON/tests/USECASE/SegmentRouting/SRBridging/dependencies/chart/CASE76.chart.tucson
@@ -0,0 +1,6 @@
+{
+ "leaf1": {"expect": "False",
+ "hosts":["h1", "h2"],
+ "vlans":{"None":"False", "120":"False"}
+ }
+}
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: