summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/tools/test/bin/onos-show-cell
diff options
context:
space:
mode:
authorAshlee Young <ashlee@onosfw.com>2015-09-09 22:15:21 -0700
committerAshlee Young <ashlee@onosfw.com>2015-09-09 22:15:21 -0700
commit13d05bc8458758ee39cb829098241e89616717ee (patch)
tree22a4d1ce65f15952f07a3df5af4b462b4697cb3a /framework/src/onos/tools/test/bin/onos-show-cell
parent6139282e1e93c2322076de4b91b1c85d0bc4a8b3 (diff)
ONOS checkin based on commit tag e796610b1f721d02f9b0e213cf6f7790c10ecd60
Change-Id: Ife8810491034fe7becdba75dda20de4267bd15cd
Diffstat (limited to 'framework/src/onos/tools/test/bin/onos-show-cell')
-rwxr-xr-xframework/src/onos/tools/test/bin/onos-show-cell57
1 files changed, 57 insertions, 0 deletions
diff --git a/framework/src/onos/tools/test/bin/onos-show-cell b/framework/src/onos/tools/test/bin/onos-show-cell
new file mode 100755
index 00000000..f5c75726
--- /dev/null
+++ b/framework/src/onos/tools/test/bin/onos-show-cell
@@ -0,0 +1,57 @@
+#!/bin/bash
+# -----------------------------------------------------------------------------
+# Print the configuration of an ONOS cell.
+# -----------------------------------------------------------------------------
+
+[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
+. $ONOS_ROOT/tools/build/envDefaults
+
+function print_usage {
+ echo "Print the configuration of an ONOS cell."
+ echo "If no arguments are specified, it will print the configuration for the default"
+ echo "ONOS cell as specified in the 'ONOS_CELL' environmental variable."
+ echo
+ echo "Optional arguments:"
+ echo " [cell-name] Print the configuration of 'cell-name'"
+ echo " [-h | --help] Print this help"
+}
+
+if [ "${1}" = "-h" -o "${1}" = "--help" ]; then
+ print_usage
+ exit 0
+fi
+
+if [ -n "${1}" ]; then
+ cell="${1}"
+else
+ if [ -z "${ONOS_CELL}" ]; then
+ echo "Environmental variable 'ONOS_CELL' is not defined"
+ exit 1
+ else
+ cell="${ONOS_CELL}"
+ fi
+fi
+
+if [ ! -f $ONOS_ROOT/tools/test/cells/${cell} ]; then
+ echo "No such cell: ${cell}"
+ exit 1
+fi
+
+# Load the cell setup
+. $ONOS_ROOT/tools/test/cells/${cell}
+
+echo "ONOS_CELL=${ONOS_CELL}"
+echo "ONOS_NIC=${ONOS_NIC}"
+# get number of OC variables
+max=$( env | egrep 'OC[0-9]+' | wc -l )
+for n in $( seq 0 ${max} ); do
+ ocn="OC${n}"
+ if [ -n "${!ocn}" ]; then
+ echo "$ocn=${!ocn}"
+ fi
+done
+echo "OCN=${OCN}"
+echo "OCT=${OCT}"
+echo "OCI=${OCI}"
+echo "ONOS_APPS=${ONOS_APPS}"
+echo "ONOS_BOOT_FEATURES=${ONOS_BOOT_FEATURES}"