blob: a0aa52bc7ba244d816e4ab216710d9fdedca2a68 [file] [log] [blame]
Jordan Halterman3c65d1b2018-01-09 13:01:03 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Checks whether the specified ONOS cluster node has the desired state.
4# -----------------------------------------------------------------------------
5
6aux=/tmp/stc/stc-$$.log
7trap "rm -f $aux 2>/dev/null" EXIT
8
9function onos_nodes() {
10 echo $(env | sort | egrep "^OC[0-9]+" | cut -d= -f2)
11}
12
13nodes=$(onos_nodes)
14
15for attempt in {1..5}; do
16 for node in $nodes; do
17 onos $node issu status > $aux
18 cat $aux
19
20 status=$(cat $aux)
21
22 [ "$status" = "${1}" ] && exit 0
23 sleep 1
24 done
25done
26
27exit 1