init: a repo for various pipelines of workspaces
This commit is contained in:
47
tests/test_validate_command_access.sh
Executable file
47
tests/test_validate_command_access.sh
Executable file
@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
cat >access.yml <<EOF
|
||||
pallav:
|
||||
fixedArgsCommands:
|
||||
build:
|
||||
- base
|
||||
- workspace
|
||||
- all
|
||||
clean:
|
||||
status:
|
||||
multiArgsCommands:
|
||||
remove:
|
||||
- palak
|
||||
- param
|
||||
- darshan
|
||||
EOF
|
||||
|
||||
source ./validate_command_access.sh
|
||||
|
||||
testcase() {
|
||||
local desc="$1"
|
||||
shift
|
||||
if validate_command pallav "$@"; then
|
||||
echo "PASS: $desc"
|
||||
else
|
||||
echo "FAIL: $desc"
|
||||
fi
|
||||
}
|
||||
|
||||
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 "clean (zero-arg, valid)" clean
|
||||
testcase "clean with arg (invalid)" clean foo || true
|
||||
|
||||
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 (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
|
Reference in New Issue
Block a user