blob: a684c2302819fc1ed4cc6546bfe48c88e243de4c [file] [log] [blame]
Thomas Vachuska13a93f32016-11-22 14:15:04 -08001#!/bin/bash
2# -----------------------------------------------------------------------------
3# Waits for ONOS java process to terminate.
4# -----------------------------------------------------------------------------
5
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
8. $ONOS_ROOT/tools/test/bin/find-node.sh
9
10node=$(find_node ${1:-$OCI})
11
12remote=$ONOS_USER@$node
13
14ssh -t $remote "
15 # Wait until ONOS Java process terminates
16 for i in \$(seq 1 45); do
17 ps -ef | egrep 'java .*/onos/.* org\.apache\.karaf\.main\.Main' | grep -qv grep || exit 0
18 sleep 1
19 done
20 exit 1
21"