Thomas Vachuska
Committed by Pavlin Radoslavov

Added a short-hand for setting the OCI variable.

Added export.

Change-Id: I1e9b5366ce460995d494f7df81659fea0b6c8584
...@@ -46,6 +46,7 @@ alias op='onos-package' ...@@ -46,6 +46,7 @@ alias op='onos-package'
46 alias ot='onos-test' 46 alias ot='onos-test'
47 alias ol='onos-log' 47 alias ol='onos-log'
48 alias ow='onos-watch' 48 alias ow='onos-watch'
49 +alias oi='setPrimaryInstance'
49 alias go='ob && ot && onos -w' 50 alias go='ob && ot && onos -w'
50 alias pub='onos-push-update-bundle' 51 alias pub='onos-push-update-bundle'
51 52
...@@ -99,6 +100,12 @@ function cells { ...@@ -99,6 +100,12 @@ function cells {
99 done 100 done
100 } 101 }
101 102
103 +# Sets the primary instance to the specified instance number.
104 +function setPrimaryInstance {
105 + export OCI=$(env | egrep "OC[0-9]+" | sort | egrep OC${1:-1} | cut -d= -f2)
106 + echo $OCI
107 +}
108 +
102 # Miscellaneous 109 # Miscellaneous
103 function spy { 110 function spy {
104 ps -ef | egrep "$@" | grep -v egrep 111 ps -ef | egrep "$@" | grep -v egrep
......
...@@ -25,7 +25,7 @@ if [ -n "${1}" ]; then ...@@ -25,7 +25,7 @@ if [ -n "${1}" ]; then
25 cell="${1}" 25 cell="${1}"
26 else 26 else
27 if [ -z "${ONOS_CELL}" ]; then 27 if [ -z "${ONOS_CELL}" ]; then
28 - echo "Environmental variable 'ONOS_CELL' is not defiled" 28 + echo "Environmental variable 'ONOS_CELL' is not defined"
29 exit 1 29 exit 1
30 else 30 else
31 cell="${ONOS_CELL}" 31 cell="${ONOS_CELL}"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
6 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1 6 [ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
7 . $ONOS_ROOT/tools/build/envDefaults 7 . $ONOS_ROOT/tools/build/envDefaults
8 8
9 -node="${1:-$OC1}" 9 +node="${1:-$OCI}"
10 file="${2:-$ONOS_ROOT/tools/test/topos/oe-linear-3.json}" 10 file="${2:-$ONOS_ROOT/tools/test/topos/oe-linear-3.json}"
11 11
12 curl -sS --fail -L -X POST -H 'Content-Type:application/json' \ 12 curl -sS --fail -L -X POST -H 'Content-Type:application/json' \
......