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 | 2d7acb7 | 2014-09-22 22:13:00 -0700 | [diff] [blame] | 3 | # Verifies connectivity to each node in ONOS cell. |
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 | |
Ray Milkey | eee2162 | 2018-05-08 15:18:52 -0700 | [diff] [blame] | 9 | let err=0 |
| 10 | |
Thomas Vachuska | fd8cb68 | 2018-07-27 12:29:14 -0700 | [diff] [blame] | 11 | for node in $OCT $OCN $(env | sort | egrep "^OC[C]*[0-9]+" | cut -d= -f2 | sort -u); do |
Ray Milkey | f752a1d | 2018-05-14 16:14:00 -0700 | [diff] [blame] | 12 | for i in {1..18}; do |
Ray Milkey | eee2162 | 2018-05-08 15:18:52 -0700 | [diff] [blame] | 13 | printf "%s: " $node; ssh -n -q -o StrictHostKeyChecking=no -o PasswordAuthentication=no -o ConnectTimeout=10 $ONOS_USER@$node hostname |
| 14 | if [ $? -eq 0 ]; then |
| 15 | let err=0 |
| 16 | break |
| 17 | fi |
Ray Milkey | 847b3e7 | 2018-05-09 07:40:37 -0700 | [diff] [blame] | 18 | let err=1+$err |
Ray Milkey | eee2162 | 2018-05-08 15:18:52 -0700 | [diff] [blame] | 19 | done |
| 20 | if [ $err -ne 0 ]; then |
| 21 | exit 1 |
| 22 | fi |
Pavlin Radoslavov | 9141379 | 2014-10-15 11:00:32 -0700 | [diff] [blame] | 23 | done |