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 |
Jonathan Hart | 1a4d359 | 2015-08-31 10:59:16 +0200 | [diff] [blame] | 8 | . $ONOS_ROOT/tools/test/bin/find-node.sh |
tom | 2d7acb7 | 2014-09-22 22:13:00 -0700 | [diff] [blame] | 9 | |
Jonathan Hart | 1a4d359 | 2015-08-31 10:59:16 +0200 | [diff] [blame] | 10 | node=$(find_node ${1:-$OCI}) |
| 11 | |
| 12 | remote=$ONOS_USER@$node |
tom | 2d7acb7 | 2014-09-22 22:13:00 -0700 | [diff] [blame] | 13 | |
nosignal | f43b3d5 | 2017-08-23 17:11:57 +0800 | [diff] [blame^] | 14 | # Wait until we reach the run-level 100 |
| 15 | for 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 |
| 18 | done |
tom | 2d7acb7 | 2014-09-22 22:13:00 -0700 | [diff] [blame] | 19 | |
nosignal | f43b3d5 | 2017-08-23 17:11:57 +0800 | [diff] [blame^] | 20 | ssh -t -t $remote " |
Thomas Vachuska | 4cfcc56 | 2015-06-03 09:51:02 -0700 | [diff] [blame] | 21 | # Wait until ApplicationManager is available |
Thomas Vachuska | 822bc14 | 2016-11-22 15:47:23 -0800 | [diff] [blame] | 22 | for i in {1..10}; do |
Thomas Vachuska | 4cfcc56 | 2015-06-03 09:51:02 -0700 | [diff] [blame] | 23 | grep -q \" ApplicationManager .* Started\" \ |
Jordan Halterman | 3044b66 | 2017-03-21 10:44:09 -0700 | [diff] [blame] | 24 | $ONOS_INSTALL_DIR/log/karaf.log* && break || sleep 1 |
Thomas Vachuska | 4cfcc56 | 2015-06-03 09:51:02 -0700 | [diff] [blame] | 25 | done |
Thomas Vachuska | ebe42a5 | 2015-06-10 12:05:50 -0700 | [diff] [blame] | 26 | |
Jordan Halterman | 3044b66 | 2017-03-21 10:44:09 -0700 | [diff] [blame] | 27 | grep -q \" ApplicationManager .* Started\" $ONOS_INSTALL_DIR/log/karaf.log* |
tom | 2d7acb7 | 2014-09-22 22:13:00 -0700 | [diff] [blame] | 28 | " |