summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Warnicke <eaw@cisco.com>2016-04-04 14:37:21 -0700
committerEd Warnicke <eaw@cisco.com>2016-04-04 15:53:44 -0700
commit33007f505b540149b79b101c0346261b70983e9a (patch)
tree0955b2bd264821a58625fd5cad12e26ec8ec882e
parentaff04a092124b34a07dd5530a97a44d819c879fe (diff)
Fix vppctl for multivpp
Change-Id: If028aca042dbba653cc0f51a0149b36bed5c7853 Signed-off-by: Ed Warnicke <eaw@cisco.com>
-rwxr-xr-xvpp-api-test/scripts/vppctl22
1 files changed, 19 insertions, 3 deletions
diff --git a/vpp-api-test/scripts/vppctl b/vpp-api-test/scripts/vppctl
index 88b48d8b280..f4062b64f20 100755
--- a/vpp-api-test/scripts/vppctl
+++ b/vpp-api-test/scripts/vppctl
@@ -1,13 +1,29 @@
#!/bin/bash
-if [ $# -gt 0 ]; then
- echo exec ${@} | vpp_api_test | sed 's/vat# //g'
+PREFIX_ARGS=""
+CMD_ARGS=""
+while [[ $# -gt 0 ]]; do
+ arg=$1
+ shift
+ case ${arg} in
+ --prefix|-p)
+ PREFIX_ARGS="chroot prefix ${1}"
+ shift
+ ;;
+ *)
+ CMD_ARGS="$CMD_ARGS ${arg}"
+ ;;
+ esac
+done
+
+if [ "x${CMD_ARGS}" != "x" ]; then
+ echo exec ${CMD_ARGS} | vpp_api_test $PREFIX_ARGS | sed 's/vat# //g'
else
echo -n "vpp# "
while read CMD; do
if [ "x$CMD" == "xexit" ]; then
exit
elif [ "x$CMD" != "x" ]; then
- echo exec $CMD | vpp_api_test | sed 's/vat# //g'
+ echo exec $CMD | vpp_api_test $PREFIX_ARGS| sed 's/vat# //g'
fi
echo -n "vpp# "
done