blob: 1f533eff3f844137a538bfa4a02454041be7d0d3 [file] [log] [blame]
Ray Milkeyb0ade292016-03-08 08:42:11 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Checks that all intents in the system have a given state.
4# -----------------------------------------------------------------------------
5
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8
Jon Hallfb6009d2017-02-15 16:01:17 -08009aux=/tmp/stc/stc-$$.log
Ray Milkeyb0ade292016-03-08 08:42:11 -080010trap "rm -f $aux 2>/dev/null" EXIT
11target=${1:-$OCI}
12
13echo onos-find-driver: $*
14
15node=$1
16driver=$2
17id=$3
18set -x
19
20onos $target "onos:drivers" | tee $aux
21driverString=`cat $aux | grep "driver=$driver"`
22if [ driverString != "" ]
23then
24 for token in $driverString
25 do
26 if [[ $token =~ "driver=" ]]
27 then
28 echo "@stc ${id}Driver=${token}"
29 exit 0
30 fi
31 done
32fi
33
34cat $aux
35exit 1
36