test(bats): Add list tests for other resource types (#3869)

This commit is contained in:
Michael Li authored and GitHub committed 2023-10-20 12:09:32 -04:00
1 parent cad044926f
commit e089aa219d
6 files changed
+175 -2

No files matched your search

@@ -0,0 +1,35 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
function create_ldap_managed_group() {
local amid=$1
local name=$2
local gnames=$3
boundary managed-groups create ldap -auth-method-id $amid -name $name -group-names $gnames -format json
}
function read_managed_group() {
local mgid=$1
boundary managed-groups read -id $mgid -format json
}
function list_managed_groups() {
local amid=$1
boundary managed-groups list -auth-method-id $amid -format json
}
function update_ldap_managed_group() {
local $mgid=$1
boundary managed-groups update ldap -id $mgid -description "TEST"
}
function delete_managed_group() {
local mgid=$1
boundary managed-groups delete -id $mgid -format json
}
function managed_group_id() {
local amid=$1
local name=$2
strip $(list_managed_groups $amid | jq -c ".items[] | select(.name != null) | select(.name | contains(\"$name\")) | .[\"id\"]")
}