tests: add scopes CLI tests (#645)

This commit is contained in:
Jeff Malnick authored and GitHub committed 2020-10-12 21:15:49 -07:00
1 parent 70e696a446
commit 3c1670c0d0
4 files changed
+102 -1

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
function create_scope() {
local parent=$1
local name=$2
echo "name $name scope $parent"
boundary scopes create -name $name -scope-id $parent
}
function read_scope() {
local sid=$1
boundary scopes read -id $sid -format json
}
function delete_scope() {
local sid=$1
boundary scopes delete -id $sid
}
function list_scopes() {
boundary scopes list -scope-id $1 -format json
}
function scope_id() {
local name=$1
local sid=$2
strip $(list_scopes $sid | jq -c ".[] | select(.name | contains(\"$name\")) | .[\"id\"]")
}