tom | 2d7acb7 | 2014-09-22 22:13:00 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Pavlin Radoslavov | 9141379 | 2014-10-15 11:00:32 -0700 | [diff] [blame] | 2 | # ----------------------------------------------------------------------------- |
tom | 1a2908c | 2014-09-23 16:37:39 -0700 | [diff] [blame] | 3 | # Waits for ONOS to reach run-level 100 on the specified remote node. |
Pavlin Radoslavov | 9141379 | 2014-10-15 11:00:32 -0700 | [diff] [blame] | 4 | # ----------------------------------------------------------------------------- |
tom | 2d7acb7 | 2014-09-22 22:13:00 -0700 | [diff] [blame] | 5 | |
| 6 | [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 |
| 7 | . $ONOS_ROOT/tools/build/envDefaults |
| 8 | |
| 9 | remote=$ONOS_USER@${1:-$OCI} |
| 10 | |
Yuta HIGUCHI | 1a60604 | 2014-11-10 11:01:37 -0800 | [diff] [blame] | 11 | ssh -t $remote " |
Thomas Vachuska | 12bf445 | 2015-06-26 09:15:38 -0700 | [diff] [blame^] | 12 | set -x |
tom | 2d7acb7 | 2014-09-22 22:13:00 -0700 | [diff] [blame] | 13 | # Wait until we reach the run-level 100 |
Thomas Vachuska | 12bf445 | 2015-06-26 09:15:38 -0700 | [diff] [blame^] | 14 | for i in \$(seq 1 45); do |
tom | 2d7acb7 | 2014-09-22 22:13:00 -0700 | [diff] [blame] | 15 | $ONOS_INSTALL_DIR/bin/onos bundle:list 2>/dev/null | \ |
Thomas Vachuska | 4cfcc56 | 2015-06-03 09:51:02 -0700 | [diff] [blame] | 16 | grep -q 'START LEVEL 100' && break || sleep 2 |
tom | 2d7acb7 | 2014-09-22 22:13:00 -0700 | [diff] [blame] | 17 | done |
| 18 | |
Thomas Vachuska | 4cfcc56 | 2015-06-03 09:51:02 -0700 | [diff] [blame] | 19 | # Wait until ApplicationManager is available |
Thomas Vachuska | 12bf445 | 2015-06-26 09:15:38 -0700 | [diff] [blame^] | 20 | for i in \$(seq 1 10); do |
Thomas Vachuska | 4cfcc56 | 2015-06-03 09:51:02 -0700 | [diff] [blame] | 21 | grep -q \" ApplicationManager .* Started\" \ |
| 22 | $ONOS_INSTALL_DIR/log/karaf.log && break || sleep 1 |
| 23 | done |
Thomas Vachuska | ebe42a5 | 2015-06-10 12:05:50 -0700 | [diff] [blame] | 24 | |
| 25 | grep -q \" ApplicationManager .* Started\" $ONOS_INSTALL_DIR/log/karaf.log |
tom | 2d7acb7 | 2014-09-22 22:13:00 -0700 | [diff] [blame] | 26 | " |