STC scenario for Trellis HAG topology
Change-Id: Ie0b40a15748a1d925167a247ac31f78b9ed206ac
diff --git a/tools/test/scenarios/bin/mininet-trellis b/tools/test/scenarios/bin/mininet-trellis
new file mode 100755
index 0000000..8be1922
--- /dev/null
+++ b/tools/test/scenarios/bin/mininet-trellis
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+remote=$ONOS_USER@$OCN
+mininet="ssh -t -t $remote screen -L -S mininet"
+
+CONTROLLERS="$OC1"
+if [ "$OC2" != "" ]; then
+ CONTROLLERS=${CONTROLLERS},${OC2}
+fi
+if [ "$OC3" != "" ]; then
+ CONTROLLERS=${CONTROLLERS},${OC3}
+fi
+
+echo >/tmp/invoke_trellis_hag "cd routing/trellis && sudo ./trellis_hag.py -c '$CONTROLLERS'"
+chmod +x /tmp/invoke_trellis_hag
+scp /tmp/invoke_trellis_hag $remote:
+
+ssh $remote "rm -f $log; echo logfile flush 1 > ~/.screenrc"
+ (
+ $mininet ./invoke_trellis_hag
+ scp $remote:$log /tmp/mininet.log
+ ssh $remote rm -f $log
+ ) &
+
+
+
+
+
diff --git a/tools/test/scenarios/bin/set-up-trellis-hag b/tools/test/scenarios/bin/set-up-trellis-hag
new file mode 100755
index 0000000..9071e0d
--- /dev/null
+++ b/tools/test/scenarios/bin/set-up-trellis-hag
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+remote=$ONOS_USER@$OCN
+
+ssh -t $remote "
+
+ set -euxo pipefail
+
+ sudo killall -9 dhclient || true
+ sudo killall -9 zebra || true
+ sudo killall -9 bgpd || true
+ sudo killall -9 dhcpd || true
+ sudo killall -9 screen || true
+
+ # Preconfigure isc-dhcp-relay for headless install
+ echo isc-dhcp-relay isc-dhcp-relay/interfaces string "" | sudo debconf-set-selections
+ echo isc-dhcp-relay isc-dhcp-relay/options string "" | sudo debconf-set-selections
+ echo isc-dhcp-relay isc-dhcp-relay/servers string "" | sudo debconf-set-selections
+ sudo apt-get update
+ sudo apt-get install -y linux-image-\$(uname -r) gawk texinfo python-pip build-essential iptables isc-dhcp-server isc-dhcp-relay
+
+ # Make sure python dependencies are installed
+ sudo pip install ipaddress configobj
+
+ # Setup quagga
+ # make sure quagga user exists
+ if ! grep -q -E "^quagga" /etc/group ; then
+ sudo groupadd quagga
+ fi
+ if ! id -u quagga > /dev/null 2>&1 ; then
+ sudo useradd -g quagga -s /bin/false quagga
+ fi
+ rm -rf quagga
+ git clone -b onos-1.11 https://gerrit.opencord.org/quagga
+ cd quagga
+ ./bootstrap.sh
+ ./configure --enable-fpm --sbindir=/usr/lib/quagga
+ make
+ sudo make install
+ cd ..
+"
diff --git a/tools/test/scenarios/net-setup-trellis-hag.xml b/tools/test/scenarios/net-setup-trellis-hag.xml
new file mode 100644
index 0000000..c7a5c7a
--- /dev/null
+++ b/tools/test/scenarios/net-setup-trellis-hag.xml
@@ -0,0 +1,92 @@
+<!--
+ ~ Copyright 2015-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-setup-trellis-hag" description="Trellis HAG network setup steps">
+
+ <group name="Trellis-Net-HAG-Setup">
+ <step name="Trellis-Net-HAG-Setup.Push-Topos" exec="onos-push-topos ${OCN}"/>
+ <step name="Trellis-Net-HAG-Setup.Push-Routing" exec="onos-push-routing ${OCN}"/>
+
+ <step name="Trellis-Net-HAG-Setup.Stop-Mininet-If-Needed" env="~" exec="onos-mininet stop"/>
+ <step name="Trellis-Net-HAG-Setup.Clean-Mininet-If-Needed" env="~" exec="onos-mininet cleanup" requires="^"/>
+ <step name="Trellis-Net-HAG-Setup.Wipe-Out-Data-Before" exec="onos-wipe-out" requires="^"/>
+
+ <!-- Make sure that there is no data in the system -->
+ <step name="Trellis-Net-HAG-Setup.Initial-Summary-Check" requires="~Trellis-Net-HAG-Setup.Wipe-Out-Data-Before"
+ exec="onos-check-summary ${OC1} [0-9]* 0 0 0"/>
+
+ <!-- Deactivate unneeded apps -->
+ <group name="Trellis-Net-HAG-Setup.Deactivate-Apps" requires="Trellis-Net-HAG-Setup.Initial-Summary-Check">
+ <step name="App-Deactivate-PathPainter"
+ exec="onos ${OCI} app deactivate org.onosproject.pathpainter"
+ requires="Trellis-Net-HAG-Setup.Initial-Summary-Check"/>
+ <step name="App-Deactivate-Mobility"
+ exec="onos ${OCI} app deactivate org.onosproject.mobility"
+ requires="Trellis-Net-HAG-Setup.Initial-Summary-Check"/>
+ <step name="App-Deactivate-ProxyArp"
+ exec="onos ${OCI} app deactivate org.onosproject.proxyarp"
+ requires="Trellis-Net-HAG-Setup.Initial-Summary-Check"/>
+ <step name="App-Deactivate-RouteService"
+ exec="onos ${OCI} app deactivate org.onosproject.route-service"
+ requires="Trellis-Net-HAG-Setup.Initial-Summary-Check"/>
+ </group>
+
+ <!-- Active required apps -->
+ <group name="Trellis-Net-HAG-Setup.Activate-Apps" requires="Trellis-Net-HAG-Setup.Deactivate-Apps">
+ <step name="App-Activate-Openflow"
+ exec="onos ${OCI} app activate org.onosproject.openflow"
+ requires="Trellis-Net-HAG-Setup.Deactivate-Apps"/>
+ <step name="App-Activate-SegmentRouting"
+ exec="onos ${OCI} app activate org.onosproject.segmentrouting"
+ requires="Trellis-Net-HAG-Setup.Deactivate-Apps"/>
+ <step name="App-Activate-Fpm"
+ exec="onos ${OCI} app activate org.onosproject.fpm"
+ requires="Trellis-Net-HAG-Setup.Deactivate-Apps"/>
+ <step name="App-Activate-DhcpRelay"
+ exec="onos ${OCI} app activate org.onosproject.dhcprelay"
+ requires="Trellis-Net-HAG-Setup.Deactivate-Apps"/>
+ <step name="App-Activate-NetCfgHostProvider"
+ exec="onos ${OCI} app activate org.onosproject.netcfghostprovider"
+ requires="Trellis-Net-HAG-Setup.Deactivate-Apps"/>
+ <step name="App-Activate-RouterAdvertisement"
+ exec="onos ${OCI} app activate org.onosproject.routeradvertisement"
+ requires="Trellis-Net-HAG-Setup.Deactivate-Apps"/>
+ <step name="App-Activate-Mcast"
+ exec="onos ${OCI} app activate org.onosproject.mcast"
+ requires="Trellis-Net-HAG-Setup.Deactivate-Apps"/>
+ </group>
+
+ <!-- set up the trellis environment -->
+ <step name="Trellis-Net-HAG-Setup.Set-Up-Trellis" exec="set-up-trellis-hag ${OCN}" requires="Trellis-Net-HAG-Setup.Activate-Apps"/>
+
+ <!-- configure the trellis topology in ONOS -->
+ <step name="Trellis-Net-HAG-Setup.Config-Topo"
+ requires="Trellis-Net-HAG-Setup.Set-Up-Trellis,Trellis-Net-HAG-Setup.Push-Topos,Trellis-Net-HAG-Setup.Push-Routing"
+ exec="onos-netcfg ${OC1} ${routing}/trellis/trellis_hag.json"/>
+
+ <!-- Bring up mininet -->
+ <step name="Trellis-Net-HAG-Setup.Start-Mininet"
+ requires="Trellis-Net-HAG-Setup.Config-Topo,Trellis-Net-HAG-Setup.Push-Topos,Trellis-Net-HAG-Setup.Stop-Mininet-If-Needed"
+ exec="mininet-trellis ${ONOS_INSTANCES}"/>
+ <step name="Trellis-Net-HAG-Setup.Wait-For-Mininet" requires="Trellis-Net-HAG-Setup.Start-Mininet"
+ exec="onos-mininet wait 10"/>
+
+ <!-- clean up local routing repo if necessary -->
+ <step name="Trellis-Net-HAG-Setup.Clean-Routing"
+ requires="Trellis-Net-HAG-Setup.Start-Mininet"
+ exec="onos-clean-routing ${routing_root}"/>
+ </group>
+</scenario>
diff --git a/tools/test/scenarios/net-trellis-hag-connectivity.xml b/tools/test/scenarios/net-trellis-hag-connectivity.xml
new file mode 100644
index 0000000..9fa5bd2
--- /dev/null
+++ b/tools/test/scenarios/net-trellis-hag-connectivity.xml
@@ -0,0 +1,41 @@
+<!--
+ ~ 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-HAG-connectivity" description="Trellis HAG network connectivity test steps">
+
+ <group name="Net-Trellis-HAG-Connectivity">
+ <step name="Net-Trellis-HAG-Connectivity.IP4Ping1"
+ exec="onos-mininet sendAndExpect h1 ping -c3 h2 --expect \ 0% packet loss"/>
+ <step name="Net-Trellis-HAG-Connectivity.IP4Ping2" requires="^"
+ exec="onos-mininet sendAndExpect h2 ping -c3 h1 --expect \ 0% packet loss"/>
+ <step name="Net-Trellis-HAG-Connectivity.IP4Ping3" requires="^"
+ exec="onos-mininet sendAndExpect h3 ping -c3 h4 --expect \ 0% packet loss"/>
+ <step name="Net-Trellis-HAG-Connectivity.IP4Ping4" requires="^"
+ exec="onos-mininet sendAndExpect h4 ping -c3 h3 --expect \ 0% packet loss"/>
+
+ <step name="Net-Trellis-HAG-Connectivity.IP6Ping1" requires="^"
+ exec="onos-mininet sendAndExpect h1v6 ping6 -c3 2000::201 --expect \ 0% packet loss"/>
+ <step name="Net-Trellis-HAG-Connectivity.IP6Ping2" requires="^"
+ exec="onos-mininet sendAndExpect h1v6 ping6 -c3 2000::202 --expect \ 0% packet loss"/>
+ <step name="Net-Trellis-HAG-Connectivity.IP6Ping3" requires="^"
+ exec="onos-mininet sendAndExpect h3v6 ping6 -c3 2000::301 --expect \ 0% packet loss"/>
+ <step name="Net-Trellis-HAG-Connectivity.IP6Ping4" requires="^"
+ exec="onos-mininet sendAndExpect h3v6 ping6 -c3 2000::302 --expect \ 0% packet loss"/>
+ </group>
+
+</scenario>
\ No newline at end of file
diff --git a/tools/test/scenarios/net-trellis-hag-hosts.xml b/tools/test/scenarios/net-trellis-hag-hosts.xml
new file mode 100644
index 0000000..a638e08
--- /dev/null
+++ b/tools/test/scenarios/net-trellis-hag-hosts.xml
@@ -0,0 +1,40 @@
+<!--
+ ~ 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-HAG-hosts" description="Trellis HAG network host check steps">
+
+ <group name="Net-Trellis-HAG-Hosts">
+
+ <step name="Net-Trellis-HAG-Hosts.Host-1"
+ exec="onos-find-host ${OC1} 00:EE:00:00:00:02 of:0000000000000208/4 fe80::2ee:ff:fe00:2"/>
+
+ <step name="Net-Trellis-HAG-Hosts.Host-2"
+ exec="onos-find-host ${OC1} 00:88:00:00:00:04 of:0000000000000206/6 fe80::288:ff:fe00:4"/>
+
+ <step name="Net-Trellis-Hosts-HAG.Host-3"
+ exec="onos-find-host ${OC1} 00:88:00:00:00:01 of:0000000000000205/12 10.0.1.1"/>
+
+ <step name="Net-Trellis-Hosts-HAG.Host-4"
+ exec="onos-find-host ${OC1} 00:BB:00:00:00:01 of:0000000000000204/8 fe80::2bb:ff:fe00:1"/>
+
+ <step name="Net-Trellis-Hosts-HAG.Host-5"
+ exec="onos-find-host ${OC1} 00:AA:00:00:00:01 of:0000000000000204/6 10.0.2.1"/>
+
+ </group>
+
+</scenario>
\ No newline at end of file
diff --git a/tools/test/scenarios/net-trellis-hag-links.xml b/tools/test/scenarios/net-trellis-hag-links.xml
new file mode 100644
index 0000000..620ad90
--- /dev/null
+++ b/tools/test/scenarios/net-trellis-hag-links.xml
@@ -0,0 +1,88 @@
+<!--
+ ~ 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-HAG-links" description="Trellis network link check steps">
+
+ <group name="Net-Trellis-HAG-Links">
+ <!-- Verify some links using the REST API -->
+
+ <!-- Two Bi-Directional links between s206 and s226 -->
+ <!-- Link 1 -->
+ <step name="Net-Trellis-HAG-Links.Query-206-226-Link-1"
+ exec="find-link.py ${OC1} link_206_226_1_ of:0000000000000206 1 of:0000000000000226 7"/>
+ <step name="Net-Trellis-HAG-Links.Validate-206-226-Link-1-State" requires="^"
+ exec="test '${link_206_226_1_State}' == 'ACTIVE'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-206-226-Link-1-Type" requires="^"
+ exec="test '${link_206_226_1_Type}' == 'DIRECT'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-206-226-Link-1-Src-Device" requires="^"
+ exec="test '${link_206_226_1_SrcDevice}' == 'of:0000000000000206'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-206-226-Link-1-Dst-Device" requires="^"
+ exec="test '${link_206_226_1_DstDevice}' == 'of:0000000000000226'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-206-226-Link-1-Src-Port" requires="^"
+ exec="test '${link_206_226_1_SrcPort}' == '1'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-206-226-Link-1-Dst-Port" requires="^"
+ exec="test '${link_206_226_1_DstPort}' == '7'"/>
+
+ <step name="Net-Trellis-HAG-Links.Query-226-206-Link-1"
+ exec="find-link.py ${OC1} link_226_206_1_ of:0000000000000226 7 of:0000000000000206 1"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-206-Link-1-State" requires="^"
+ exec="test '${link_226_206_1_State}' == 'ACTIVE'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-206-Link-1-Type" requires="^"
+ exec="test '${link_226_206_1_Type}' == 'DIRECT'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-206-Link-1-Src-Device" requires="^"
+ exec="test '${link_226_206_1_SrcDevice}' == 'of:0000000000000226'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-206-Link-1-Dst-Device" requires="^"
+ exec="test '${link_226_206_1_DstDevice}' == 'of:0000000000000206'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-206-Link-1-Src-Port" requires="^"
+ exec="test '${link_226_206_1_SrcPort}' == '7'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-206-Link-1-Dst-Port" requires="^"
+ exec="test '${link_226_206_1_DstPort}' == '1'"/>
+
+ <!-- Link 2 -->
+ <step name="Net-Trellis-HAG-Links.Query-206-226-Link-2"
+ exec="find-link.py ${OC1} link_206_226_2_ of:0000000000000206 2 of:0000000000000226 8"/>
+ <step name="Net-Trellis-HAG-Links.Validate-206-226-Link-2-State" requires="^"
+ exec="test '${link_206_226_2_State}' == 'ACTIVE'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-206-226-Link-2-Type" requires="^"
+ exec="test '${link_206_226_2_Type}' == 'DIRECT'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-206-226-Link-2-Src-Device" requires="^"
+ exec="test '${link_206_226_2_SrcDevice}' == 'of:0000000000000206'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-206-226-Link-2-Dst-Device" requires="^"
+ exec="test '${link_206_226_2_DstDevice}' == 'of:0000000000000226'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-206-226-Link-2-Src-Port" requires="^"
+ exec="test '${link_206_226_2_SrcPort}' == '2'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-206-226-Link-2-Dst-Port" requires="^"
+ exec="test '${link_206_226_2_DstPort}' == '8'"/>
+
+ <step name="Net-Trellis-HAG-Links.Query-226-206-Link-2"
+ exec="find-link.py ${OC1} link_226_206_2_ of:0000000000000226 8 of:0000000000000206 2"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-206-Link-2-State" requires="^"
+ exec="test '${link_226_206_2_State}' == 'ACTIVE'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-206-Link-2-Type" requires="^"
+ exec="test '${link_226_206_2_Type}' == 'DIRECT'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-206-Link-2-Src-Device" requires="^"
+ exec="test '${link_226_206_2_SrcDevice}' == 'of:0000000000000226'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-206-Link-2-Dst-Device" requires="^"
+ exec="test '${link_226_206_2_DstDevice}' == 'of:0000000000000206'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-206-Link-2-Src-Port" requires="^"
+ exec="test '${link_226_206_2_SrcPort}' == '8'"/>
+ <step name="Net-Trellis-HAG-Links.Validate-226-206-Link-2-Dst-Port" requires="^"
+ exec="test '${link_226_206_2_DstPort}' == '2'"/>
+ </group>
+
+</scenario>
diff --git a/tools/test/scenarios/net-trellis-hag-smoke.xml b/tools/test/scenarios/net-trellis-hag-smoke.xml
new file mode 100644
index 0000000..7109457
--- /dev/null
+++ b/tools/test/scenarios/net-trellis-hag-smoke.xml
@@ -0,0 +1,43 @@
+<!--
+ ~ 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-hag-smoke" description="Trellis HAG network connectivity test steps">
+
+ <import file="${ONOS_SCENARIOS}/net-setup-trellis-hag.xml"/>
+
+ <step name="Check-Summary" requires="Trellis-Net-HAG-Setup.Wait-For-Mininet" delay="15"
+ exec="onos-check-summary ${OC1} [0-9]* 10 48 22"/>
+
+ <import file="${ONOS_SCENARIOS}/net-trellis-hag-connectivity.xml"/>
+ <dependency name="Net-Trellis-HAG-Connectivity" requires="Check-Summary"/>
+
+ <import file="${ONOS_SCENARIOS}/net-trellis-hag-links.xml"/>
+ <dependency name="Net-Trellis-HAG-Links" requires="Check-Summary"/>
+
+ <import file="${ONOS_SCENARIOS}/net-trellis-hag-hosts.xml"/>
+ <dependency name="Net-Trellis-HAG-Hosts" requires="Check-Summary"/>
+
+ <import file="${ONOS_SCENARIOS}/net-teardown.xml"/>
+ <dependency name="Net-Teardown" requires="~Net-Trellis-HAG-Connectivity,~Net-Trellis-HAG-Links,~Net-Trellis-HAG-Hosts"/>
+
+ <parallel var="${OC#}">
+ <step name="Net-Smoke-Check-Logs-${#}" requires="~Net-Teardown"
+ exec="onos-check-logs ${OC#}"/>
+ </parallel>
+
+</scenario>
\ No newline at end of file