Fixes to allow running p4 trellis scenario
Change-Id: I4882668168521b9119692ecd696189b2b8d5f9de
(cherry picked from commit a61ba5792d9e7a25d3446f37179fbf13ac152098)
diff --git a/tools/test/scenarios/net-trellis-p4-links.xml b/tools/test/scenarios/net-trellis-p4-links.xml
new file mode 100644
index 0000000..bc4192b
--- /dev/null
+++ b/tools/test/scenarios/net-trellis-p4-links.xml
@@ -0,0 +1,90 @@
+<!--
+ ~ Copyright 2018-present Open Networking Foundation
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+
+
+<scenario name="net-trellis-p4-links" description="Trellis P4 network link check steps">
+
+ <group name="Net-Trellis-P4-Links">
+ <!-- Verify some links using the REST API -->
+
+ <!-- Bi-Directional link between s204 and s226 -->
+ <!-- Link 1 -->
+ <step name="Net-Trellis-HAG-Links.Query-204-226-Link-1"
+ exec="find-link.py ${OC1} link_204_226_1_ device:bmv2:s204 1 device:bmv2:s226 1"/>
+ <step name="Net-Trellis-HAG-Links.Validate-204-226-Link-1-State" requires="^"
+ exec="test '${link_204_226_1_State}' == 'ACTIVE'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-204-226-Link-1-Type" requires="^"
+ exec="test '${link_204_226_1_Type}' == 'DIRECT'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-204-226-Link-1-Src-Device" requires="^"
+ exec="test '${link_204_226_1_SrcDevice}' == 'device:bmv2:s204'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-204-226-Link-1-Dst-Device" requires="^"
+ exec="test '${link_204_226_1_DstDevice}' == 'device:bmv2:s226'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-204-226-Link-1-Src-Port" requires="^"
+ exec="test '${link_204_226_1_SrcPort}' == '1'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-204-226-Link-1-Dst-Port" requires="^"
+ exec="test '${link_204_226_1_DstPort}' == '1'"/>
+
+ <step name="Net-Trellis-HAG-Links.Query-226-204-Link-2"
+ exec="find-link.py ${OC1} link_226_204_2_ device:bmv2:s226 1 device:bmv2:s204 1"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-204-Link-2-State" requires="^"
+ exec="test '${link_226_204_2_State}' == 'ACTIVE'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-204-Link-2-Type" requires="^"
+ exec="test '${link_226_204_2_Type}' == 'DIRECT'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-204-Link-2-Src-Device" requires="^"
+ exec="test '${link_226_204_2_SrcDevice}' == 'device:bmv2:s226'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-204-Link-2-Dst-Device" requires="^"
+ exec="test '${link_226_204_2_DstDevice}' == 'device:bmv2:s204'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-204-Link-2-Src-Port" requires="^"
+ exec="test '${link_226_204_2_SrcPort}' == '1'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-204-Link-2-Dst-Port" requires="^"
+ exec="test '${link_226_204_2_DstPort}' == '1'"/>
+
+ <!-- Bi-Directional link between s205 and s227 -->
+ <!-- Link 1 -->
+ <step name="Net-Trellis-HAG-Links.Query-205-227-Link-1"
+ exec="find-link.py ${OC1} link_205_227_1_ device:bmv2:s205 2 device:bmv2:s227 2"/>
+ <step name="Net-Trellis-HAG-Links.Validate-205-227-Link-1-State" requires="^"
+ exec="test '${link_205_227_1_State}' == 'ACTIVE'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-205-227-Link-1-Type" requires="^"
+ exec="test '${link_205_227_1_Type}' == 'DIRECT'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-205-227-Link-1-Src-Device" requires="^"
+ exec="test '${link_205_227_1_SrcDevice}' == 'device:bmv2:s205'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-205-227-Link-1-Dst-Device" requires="^"
+ exec="test '${link_205_227_1_DstDevice}' == 'device:bmv2:s227'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-205-227-Link-1-Src-Port" requires="^"
+ exec="test '${link_205_227_1_SrcPort}' == '2'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-205-227-Link-1-Dst-Port" requires="^"
+ exec="test '${link_205_227_1_DstPort}' == '2'"/>
+
+ <step name="Net-Trellis-HAG-Links.Query-227-205-Link-2"
+ exec="find-link.py ${OC1} link_227_205_2_ device:bmv2:s227 2 device:bmv2:s205 2"/>
+ <step name="Net-Trellis-HAG-Links.Validate-227-205-Link-2-State" requires="^"
+ exec="test '${link_227_205_2_State}' == 'ACTIVE'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-227-205-Link-2-Type" requires="^"
+ exec="test '${link_227_205_2_Type}' == 'DIRECT'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-227-205-Link-2-Src-Device" requires="^"
+ exec="test '${link_227_205_2_SrcDevice}' == 'device:bmv2:s227'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-227-205-Link-2-Dst-Device" requires="^"
+ exec="test '${link_227_205_2_DstDevice}' == 'device:bmv2:s205'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-227-205-Link-2-Src-Port" requires="^"
+ exec="test '${link_227_205_2_SrcPort}' == '2'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-227-205-Link-2-Dst-Port" requires="^"
+ exec="test '${link_227_205_2_DstPort}' == '2'"/>
+
+ </group>
+
+</scenario>