test: update command validation test with new cases

This commit is contained in:
null 2025-05-17 17:08:20 +00:00
parent aa6d5ebbfb
commit 0a76fb12d8

View File

@ -8,13 +8,18 @@ pallav:
- base
- workspace
- all
update:
- access
clean:
status:
multiArgsCommands:
remove:
- pallav
- palak
- param
- darshan
arbitArgsCommands:
- rmi
EOF
source ./validate_command_access.sh
@ -29,19 +34,33 @@ testcase() {
fi
}
# ----- Fixed Args Commands -----
testcase "build base (valid)" build base
testcase "build all (valid)" build all
testcase "build base workspace (invalid)" build base workspace || true
testcase "build (no arg, invalid)" build || true
testcase "update access (valid)" update access
testcase "clean (zero-arg, valid)" clean
testcase "clean with arg (invalid)" clean foo || true
testcase "status (zero-arg, valid)" status
testcase "status foo (invalid)" status foo || true
# ----- Multi Args Commands -----
testcase "remove palak (valid)" remove palak
testcase "remove param palak (valid, any order)" remove param palak
testcase "remove palak param darshan (valid, any order)" remove palak param darshan
testcase "remove pallav (valid)" remove pallav -f
testcase "remove (no arg, invalid)" remove || true
testcase "remove foo (invalid)" remove foo || true
testcase "remove palak palak (duplicate, invalid)" remove palak palak || true
testcase "status (zero-arg, valid)" status
testcase "status foo (invalid)" status foo || true
# ----- Arbitrary Args Commands -----
testcase "rmi no args (valid)" rmi
testcase "rmi one arg (valid)" rmi image1
testcase "rmi multiple args (valid)" rmi image1 image2 image3
testcase "rmi with flag (valid)" rmi -f image1 image2
testcase "rmi with only flag (valid)" rmi -f
# ----- Disallowed command -----
testcase "foo (invalid command)" foo image1 # should fail