Minor refactoring in the ONOS cell configuration:
* Each cell-specific variable is explicitly listed
in the cell config file:
ONOS_CELL, ONOS_NIC, OC1-OC9, OCN, OCI, ONOS_FEATURES
* Cleanup and bug fixes inside bash_profile:
- Don't export explicitly OCI and ONOS_CELL, because those
are now exported in the cell config file
- unset ONOS_CELL, ONOS_NIC, ONOS_FEATURES (the last two weren't
unset before)
- The built-in "cell" function shows OC1 to OC9 instead of OC0-OC9;
OC0 is never used/setup anywhere else
* Added two new shell commands:
- tools/test/bin/onos-lsit-cells : lists existing ONOS cell configurations
It is the equivalent of the "cells" built-in bash command
- tools/test/bin/onos-show-cell : shows the configuration of an ONOS cell
It is the equivalent of the "cell" built-in bash command, but
it can show also the configuration of any ONOS cell (not only
the default one).
diff --git a/tools/test/bin/onos-list-cells b/tools/test/bin/onos-list-cells
new file mode 100755
index 0000000..39a70ee
--- /dev/null
+++ b/tools/test/bin/onos-list-cells
@@ -0,0 +1,18 @@
+#!/bin/bash
+# -----------------------------------------------------------------------------
+# List available ONOS cells configuration.
+# -----------------------------------------------------------------------------
+
+[ ! -d "$ONOS_ROOT" ] && echo "ONOS_ROOT is not defined" >&2 && exit 1
+. $ONOS_ROOT/tools/build/envDefaults
+
+# Lists available cells
+for cell in $(ls -1 $ONOS_ROOT/tools/test/cells); do
+ if [ ${cell} = "${ONOS_CELL}" ]; then
+ cell_id="${cell} *"
+ else
+ cell_id="${cell}"
+ fi
+ cell_descr="$(grep '^#' $ONOS_ROOT/tools/test/cells/$cell | head -n 1)"
+ printf "%-12s %s\n" "${cell_id}" "${cell_descr}"
+done