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_password_auth_method() {
local name=$1
boundary auth-methods create password -name $name -format json
}
function read_auth_method() {
local amid=$1
boundary auth-methods read -id $amid -format json
}
function list_auth_methods() {
boundary auth-methods list -format json
}
function delete_auth_method() {
local amid=$1
boundary auth-methods delete -id $amid -format json
}
function update_password_auth_method() {
local amid=$1
boundary auth-methods update password -id $amid -description "TEST"
}
function auth_method_id() {
local name=$1
strip $(list_auth_methods | jq -c ".items[] | select(.name != null) | select(.name | contains(\"$name\")) | .[\"id\"]")
}
function get_default_ldap_auth_method_id() {
strip $(list_auth_methods | jq -c ".items[] | select(.type | contains(\"ldap\")) | .[\"id\"]")
}