blob: 2c90181a312beaee748f3f631b81a56132789c91 [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
8
9remote=$ONOS_USER@${1:-$OCI}
10
Yuta HIGUCHI1a606042014-11-10 11:01:37 -080011ssh -t $remote "
Thomas Vachuska12bf4452015-06-26 09:15:38 -070012 set -x
tom2d7acb72014-09-22 22:13:00 -070013 # Wait until we reach the run-level 100
Thomas Vachuska12bf4452015-06-26 09:15:38 -070014 for i in \$(seq 1 45); do
tom2d7acb72014-09-22 22:13:00 -070015 $ONOS_INSTALL_DIR/bin/onos bundle:list 2>/dev/null | \
Thomas Vachuska4cfcc562015-06-03 09:51:02 -070016 grep -q 'START LEVEL 100' && break || sleep 2
tom2d7acb72014-09-22 22:13:00 -070017 done
18
Thomas Vachuska4cfcc562015-06-03 09:51:02 -070019 # Wait until ApplicationManager is available
Thomas Vachuska12bf4452015-06-26 09:15:38 -070020 for i in \$(seq 1 10); do
Thomas Vachuska4cfcc562015-06-03 09:51:02 -070021 grep -q \" ApplicationManager .* Started\" \
22 $ONOS_INSTALL_DIR/log/karaf.log && break || sleep 1
23 done
Thomas Vachuskaebe42a52015-06-10 12:05:50 -070024
25 grep -q \" ApplicationManager .* Started\" $ONOS_INSTALL_DIR/log/karaf.log
tom2d7acb72014-09-22 22:13:00 -070026"