test: add tests for authorized-action (#893)

This commit is contained in:
Jeff Malnick authored and GitHub committed 2021-01-29 08:04:46 -08:00
1 parent d65d4dbf6f
commit 10a5f1b832
17 files changed
+216 -13

No files matched your search

+16 -1
View File
@@ -1,9 +1,11 @@
load _authorized_actions
function create_group() {
boundary groups create -scope-id global -name $1 -description 'test group'
}
function read_group() {
boundary groups read -id $1
boundary groups read -id $1 -format json
}
function delete_group() {
@@ -39,3 +41,16 @@ function group_has_member_id() {
done
return 1
}
function has_default_group_actions() {
# tests that the group resource contains default actions
local out=$1
local actions=('read' 'update' 'delete' 'add-members' 'set-members' 'remove-members')
for action in ${actions[@]}; do
$(has_authorized_action "$out" "$action") || {
echo "failed to find $action action in output: $out"
return 1
}
done
}