Ray Milkey | b0ade29 | 2016-03-08 08:42:11 -0800 | [diff] [blame] | 1 | #!/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 Hall | a67dc45 | 2017-02-15 16:01:17 -0800 | [diff] [blame] | 9 | aux=/tmp/stc/stc-$$.log |
Ray Milkey | b0ade29 | 2016-03-08 08:42:11 -0800 | [diff] [blame] | 10 | trap "rm -f $aux 2>/dev/null" EXIT |
| 11 | target=${1:-$OCI} |
| 12 | |
| 13 | echo onos-find-driver: $* |
| 14 | |
| 15 | node=$1 |
| 16 | driver=$2 |
| 17 | id=$3 |
| 18 | set -x |
| 19 | |
| 20 | onos $target "onos:drivers" | tee $aux |
| 21 | driverString=`cat $aux | grep "driver=$driver"` |
| 22 | if [ driverString != "" ] |
| 23 | then |
| 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 |
| 32 | fi |
| 33 | |
| 34 | cat $aux |
| 35 | exit 1 |
| 36 | |