STC scenario for Trellis HAG topology

Change-Id: Ie0b40a15748a1d925167a247ac31f78b9ed206ac
diff --git a/tools/test/bin/onos-check-summary b/tools/test/bin/onos-check-summary
index 948e5d5..6e7bfcf 100755
--- a/tools/test/bin/onos-check-summary
+++ b/tools/test/bin/onos-check-summary
@@ -6,7 +6,7 @@
 aux=/tmp/stc/stc-$$.log
 trap "rm -f $aux 2>/dev/null" EXIT
 
-for i in {1..15}; do
+for i in {1..30}; do
     onos ${1:-$OCI} "onos:summary" > $aux
     cat $aux
 
diff --git a/tools/test/bin/onos-clean-routing b/tools/test/bin/onos-clean-routing
new file mode 100755
index 0000000..ec6dcfd
--- /dev/null
+++ b/tools/test/bin/onos-clean-routing
@@ -0,0 +1,13 @@
+#!/bin/bash
+# -----------------------------------------------------------------------------
+# Cleans up /tmp if a local copy of the routing repo was created
+# -----------------------------------------------------------------------------
+
+
+routing="$1"
+
+[ ! -d "$routing" ] && echo "routing source tree not found" >&2 && exit 1
+
+if [[ $routing = *"/tmp/routing."* ]]; then
+  rm -rf $routing
+fi
diff --git a/tools/test/bin/onos-find-host b/tools/test/bin/onos-find-host
new file mode 100755
index 0000000..4989357
--- /dev/null
+++ b/tools/test/bin/onos-find-host
@@ -0,0 +1,29 @@
+#!/bin/bash
+# -----------------------------------------------------------------------------
+# Finds a host in the system.
+# -----------------------------------------------------------------------------
+
+[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
+. $ONOS_ROOT/tools/build/envDefaults
+
+aux=/tmp/stc/stc-$$.log
+trap "rm -f $aux 2>/dev/null" EXIT
+
+echo onos-find-host: $*
+
+target=${1:-$OCI}
+mac=$2
+locations=$3
+ips=$4
+set -x
+
+onos $target "onos:hosts" | tee $aux
+cat $aux | fgrep "mac=$mac" | fgrep "locations=[$locations]" | grep "ip.*[.*$ips.*]"
+
+if [ $? -ne 0 ]
+then
+    exit 1;
+fi
+
+exit 0
+
diff --git a/tools/test/bin/onos-mininet b/tools/test/bin/onos-mininet
index 2683a29..4c60e42 100755
--- a/tools/test/bin/onos-mininet
+++ b/tools/test/bin/onos-mininet
@@ -34,7 +34,7 @@
     ssh $remote "
         let count=0
         sleep 1 && while test ! -f $log; do if test \$count -ge $MAX_WAIT; then exit 1; fi; sleep 1; let count=count+1; done
-        while ! (tail -n1 $log | egrep -q '^mininet>'); do if [ \$count -ge $MAX_WAIT ]; then exit 1; fi; sleep 1; done
+        while ! (tail -n1 $log | egrep -q '^[ ]*[0]*mininet>'); do if [ \$count -ge $MAX_WAIT ]; then exit 1; fi; sleep 1; done
         sleep ${1-:1}
     "
     ;;
@@ -45,8 +45,8 @@
         sleep 1
         if [ ! -f $log ]; then exit 1; fi;
         let count=0
-        while ! (tail -n1 $log | egrep -q '^mininet>'); do if test \$count -ge $MAX_WAIT; then exit 1; fi; sleep 1; let count=count+1; done
-        tac $log | awk '{ print \$0; } /^mininet>/ { if (on) { exit 0; } on=1; }' | tac > $aux
+        while ! (tail -n1 $log | egrep -q '^[ ]*[0]*mininet>'); do if test \$count -ge $MAX_WAIT; then exit 1; fi; sleep 1; let count=count+1; done
+        tac $log | awk '{ print \$0; } /^[ ]*[0]*mininet>/ { if (on) { exit 0; } on=1; }' | tac > $aux
         cat $aux
         set -x
         egrep \"$@\" $aux
diff --git a/tools/test/bin/onos-push-routing b/tools/test/bin/onos-push-routing
new file mode 100755
index 0000000..0926772
--- /dev/null
+++ b/tools/test/bin/onos-push-routing
@@ -0,0 +1,26 @@
+#!/bin/bash
+# -----------------------------------------------------------------------------
+# Remotely pushes routing scripts a remote mininet test machine.
+# -----------------------------------------------------------------------------
+
+[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
+. $ONOS_ROOT/tools/build/envDefaults
+
+routing="${ONOS_ROUTING:-}"
+routing_root="${ONOS_ROUTING:-}"
+
+if [ -z "$routing_root" ]; then
+    routing_root=$(mktemp -d /tmp/routing.XXXXX)
+    ( cd $routing_root && git init && git clone https://gerrit.onosproject.org/routing )
+    routing=$routing_root/routing
+fi
+
+[ ! -d "$routing" ] && echo "routing source tree not found" >&2 && exit 1
+
+node=${1:-$OCN}
+
+ssh $ONOS_USER@$node sudo rm -rf routing
+scp -qr $routing $ONOS_USER@$node:
+
+echo "@stc routing_root=$routing_root"
+echo "@stc routing=$routing"
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