blob: 2cc500276885d221ef6c6ee5e9062b5bc7ff44a0 [file] [log] [blame]
tom2d7acb72014-09-22 22:13:00 -07001#!/bin/bash
Pavlin Radoslavov91413792014-10-15 11:00:32 -07002# -----------------------------------------------------------------------------
tom1a2908c2014-09-23 16:37:39 -07003# Waits for ONOS to reach run-level 100 on the specified remote node.
Pavlin Radoslavov91413792014-10-15 11:00:32 -07004# -----------------------------------------------------------------------------
tom2d7acb72014-09-22 22:13:00 -07005
6[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7. $ONOS_ROOT/tools/build/envDefaults
Jonathan Hart1a4d3592015-08-31 10:59:16 +02008. $ONOS_ROOT/tools/test/bin/find-node.sh
tom2d7acb72014-09-22 22:13:00 -07009
Jonathan Hart1a4d3592015-08-31 10:59:16 +020010node=$(find_node ${1:-$OCI})
11
12remote=$ONOS_USER@$node
tom2d7acb72014-09-22 22:13:00 -070013
nosignalf43b3d52017-08-23 17:11:57 +080014# Wait until we reach the run-level 100
15for i in {1..90}; do
16 $ONOS_ROOT/tools/test/bin/onos $node bundle:list 2>/dev/null | \
17 grep -q 'START LEVEL 100' && break || sleep 2
18done
tom2d7acb72014-09-22 22:13:00 -070019
nosignalf43b3d52017-08-23 17:11:57 +080020ssh -t -t $remote "
Thomas Vachuska4cfcc562015-06-03 09:51:02 -070021 # Wait until ApplicationManager is available
Thomas Vachuska822bc142016-11-22 15:47:23 -080022 for i in {1..10}; do
Thomas Vachuska4cfcc562015-06-03 09:51:02 -070023 grep -q \" ApplicationManager .* Started\" \
Jordan Halterman3044b662017-03-21 10:44:09 -070024 $ONOS_INSTALL_DIR/log/karaf.log* && break || sleep 1
Thomas Vachuska4cfcc562015-06-03 09:51:02 -070025 done
Thomas Vachuskaebe42a52015-06-10 12:05:50 -070026
Jordan Halterman3044b662017-03-21 10:44:09 -070027 grep -q \" ApplicationManager .* Started\" $ONOS_INSTALL_DIR/log/karaf.log*
tom2d7acb72014-09-22 22:13:00 -070028"