* [QTI-275] Add infrastructure integration testing On pull requests that originate from branches of the `hashicorp/boundary` repo, we now conditionally dispatch infrastructure integration tests using the Enos framework. The `integration` Enos scenario includes two `builder` variants which allow developers or CI to deploy a Boundary cluster in AWS using either a local `boundary` install bundle or that which is produced in the `build` workflow for CRT. The `test` variants determine which type of infrastructure integration test to run. At present those options are `cli_ui` (Bats CLI tests) or `smoke` (creates target instances and a target host catalog and verifies that `boundary` works). In addition to the new workflow and quality scenarios, we simplified the some `build` workflow steps and added Go module caching to speed up the build pipeline. See the [enos/README.md](https://github.com/hashicorp/boundary/blob/main/enos/README.md) for a detailed explanation on how to configure and execute Enos scenarios from your machine. Signed-off-by: Ryan Cragun <me@ryan.ec> Co-authored-by: Rebecca Willett <rwillett@hashicorp.com> Co-authored-by: Josh Branch <jbrand@hashicorp.com>
80 lines
1.8 KiB
Bash
80 lines
1.8 KiB
Bash
#!/usr/bin/env bats
|
|
|
|
load _accounts
|
|
load _auth
|
|
load _groups
|
|
load _helpers
|
|
|
|
export NEW_GROUP='test'
|
|
|
|
@test "boundary/login: can login as default user" {
|
|
run login $DEFAULT_LOGIN
|
|
echo "$output"
|
|
[ "$status" -eq 0 ]
|
|
}
|
|
|
|
@test "boundary/groups: can add $NEW_GROUP group" {
|
|
run create_group $NEW_GROUP
|
|
echo "$output"
|
|
[ "$status" -eq 0 ]
|
|
}
|
|
|
|
@test "boundary/groups: can not add already created $NEW_GROUP group" {
|
|
run create_group $NEW_GROUP
|
|
echo "$output"
|
|
[ "$status" -eq 1 ]
|
|
}
|
|
|
|
@test "boundary/groups: can read $NEW_GROUP group" {
|
|
local gid=$(group_id $NEW_GROUP)
|
|
run read_group $gid
|
|
echo "$output"
|
|
[ "$status" -eq 0 ]
|
|
}
|
|
|
|
@test "boundary/groups: the $NEW_GROUP group contains default authorized-actions" {
|
|
local gid=$(group_id $NEW_GROUP)
|
|
local out=$(read_group $gid)
|
|
|
|
run has_default_group_actions "$out"
|
|
echo "$output"
|
|
[ "$status" -eq 0 ]
|
|
}
|
|
|
|
@test "boundary/group/add-members: can associate $NEW_GROUP group with default user" {
|
|
if [ "$SKIP_FAILING_TESTS_IN_CI" == "true" ]; then
|
|
skip
|
|
fi
|
|
local gid=$(group_id $NEW_GROUP)
|
|
run assoc_group_acct 'u_1234567890' $gid
|
|
echo "$output"
|
|
diag "$output"
|
|
[ "$status" -eq 0 ]
|
|
}
|
|
|
|
@test "boundary/group/add-members: $NEW_GROUP group contains default user" {
|
|
if [ "$SKIP_FAILING_TESTS_IN_CI" == "true" ]; then
|
|
skip
|
|
fi
|
|
local gid=$(group_id $NEW_GROUP)
|
|
run group_has_member_id 'u_1234567890' $gid
|
|
echo "$output"
|
|
diag "$output"
|
|
[ "$status" -eq 0 ]
|
|
}
|
|
|
|
@test "boundary/group: can delete $NEW_GROUP group" {
|
|
local gid=$(group_id $NEW_GROUP)
|
|
run delete_group $gid
|
|
echo "$output"
|
|
run has_status_code "$output" "204"
|
|
[ "$status" -eq 0 ]
|
|
}
|
|
|
|
@test "boundary/groups: can not read deleted $NEW_GROUP group" {
|
|
local gid=$(group_id $NEW_GROUP)
|
|
run read_group $gid
|
|
echo "$output"
|
|
[ "$status" -eq 1 ]
|
|
}
|