Files
infix/test/case/cli_pretty/run.sh
T
Joachim WibergandTobias Waldekranz d69f51a173 Fix #224: relocate /lib/infix to /libexec/infix
The /lib directory is not intended for executable scripts and programs.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2023-12-04 10:24:35 +01:00

30 lines
560 B
Bash
Executable File

#!/bin/sh
SCRIPT_PATH="$(dirname "$(readlink -f "$0")")"
if [ $# -lt 2 ]; then
echo "Usage: $0 JSON-FILE MODULE [ ARGS ]"
exit 1
fi
json=$1; shift
module=$1; shift
echo "1..1"
if [ ! -e "$SCRIPT_PATH/$json" ]; then
echo "not ok 1 - $SCRIPT_PATH/$json not found"
exit 1
fi
cat "$SCRIPT_PATH/$json" | \
"$SCRIPT_PATH"/../../../board/netconf/rootfs/libexec/infix/cli-pretty \
"$module" $*
if [ $? -eq 0 ]; then
echo "ok 1 - $json printed without crashing"
exit 0
fi
echo "not ok 1 - $json printing returned non zero"
exit 1