mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-06 23:43:20 +02:00
cli-pretty: Refactor to not take model as argument
Instead focus on the task to do 'show hardware', 'show interfaces' and more, this to make it more logical.
This commit is contained in:
@@ -3,37 +3,37 @@
|
||||
name: "interfaces-empty"
|
||||
opts:
|
||||
- "json/empty.json"
|
||||
- "ietf-interfaces"
|
||||
- "show-interfaces"
|
||||
|
||||
- case: run.sh
|
||||
name: "interfaces-factory"
|
||||
opts:
|
||||
- "json/factory.json"
|
||||
- "ietf-interfaces"
|
||||
- "show-interfaces"
|
||||
|
||||
- case: run.sh
|
||||
name: "interfaces-bloated"
|
||||
opts:
|
||||
- "json/bloated.json"
|
||||
- "ietf-interfaces"
|
||||
- "show-interfaces"
|
||||
|
||||
- case: run.sh
|
||||
name: "interface-ethernet"
|
||||
opts:
|
||||
- "json/bloated.json"
|
||||
- "ietf-interfaces"
|
||||
- "show-interfaces"
|
||||
- "-n e0"
|
||||
|
||||
- case: run.sh
|
||||
name: "interface-vlan"
|
||||
opts:
|
||||
- "json/bloated.json"
|
||||
- "ietf-interfaces"
|
||||
- "show-interfaces"
|
||||
- "-n vlan1"
|
||||
|
||||
- case: run.sh
|
||||
name: "interface-bridge"
|
||||
opts:
|
||||
- "json/bloated.json"
|
||||
- "ietf-interfaces"
|
||||
- "show-interfaces"
|
||||
- "-n br0"
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
SCRIPT_PATH="$(dirname "$(readlink -f "$0")")"
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "Usage: $0 JSON-FILE MODULE [ ARGS ]"
|
||||
echo "Usage: $0 JSON-FILE COMMAND [ ARGS ]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
json=$1; shift
|
||||
module=$1; shift
|
||||
command=$1; shift
|
||||
|
||||
echo "1..1"
|
||||
|
||||
@@ -19,7 +19,7 @@ fi
|
||||
|
||||
cat "$SCRIPT_PATH/$json" | \
|
||||
"$SCRIPT_PATH"/../../../src/statd/cli-pretty \
|
||||
"$module" $*
|
||||
"$command" $*
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "ok 1 - $json printed without crashing"
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user