tests: add bats tests for testing CLI on arbitrary Boundary deployments (#614)
This commit is contained in:
1 parent
3db9a07ace
commit
90e1dbe444
10 files changed
+308
No files matched your search
@@ -0,0 +1,95 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load _accounts
|
||||
load _auth
|
||||
load _users
|
||||
load _helpers
|
||||
|
||||
export NEW_USER='test'
|
||||
|
||||
@test "boundary/login: can login as default user" {
|
||||
run login $DEFAULT_USER
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "boundary/users: can add $NEW_USER user" {
|
||||
run create_user $NEW_USER
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "boundary/users: can not add already created $NEW_USER user" {
|
||||
run create_user $NEW_USER
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
@test "boundary/users: can read $NEW_USER user" {
|
||||
local uid=$(user_id $NEW_USER)
|
||||
run read_user $uid
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "boundary/account/password: can add $NEW_USER account" {
|
||||
run create_account $NEW_USER
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "boundary/account/password: can not add already created $NEW_USER account" {
|
||||
run create_account $NEW_USER
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
@test "boundary/account/password: can read created $NEW_USER account" {
|
||||
local aid=$(account_id $NEW_USER)
|
||||
run read_account $aid
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "boundary/user/account-add: can associate $NEW_USER account with $NEW_USER user" {
|
||||
local uid=$(user_id $NEW_USER)
|
||||
local aid=$(account_id $NEW_USER)
|
||||
run assoc_user_acct $aid $uid
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "boundary/login: can login as $NEW_USER user" {
|
||||
run login $NEW_USER
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "boundary/user: can delete $NEW_USER user" {
|
||||
login $DEFAULT_USER
|
||||
local uid=$(user_id $NEW_USER)
|
||||
run delete_user $uid
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "boundary/user: can not delete already deleted $NEW_USER user" {
|
||||
login $DEFAULT_USER
|
||||
local uid=$(user_id $NEW_USER)
|
||||
run delete_user $uid
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
@test "boundary/users: can not read deleted $NEW_USER user" {
|
||||
local uid=$(user_id $NEW_USER)
|
||||
run read_user $uid
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
@test "boundary/account/password: can delete $NEW_USER account" {
|
||||
local aid=$(account_id $NEW_USER)
|
||||
run delete_account $aid
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "boundary/account/password: can not delete already deleted $NEW_USER account" {
|
||||
local aid=$(account_id $NEW_USER)
|
||||
run delete_account $aid
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
@test "boundary/account/password: can not read deleted $NEW_USER account" {
|
||||
local aid=$(account_id $NEW_USER)
|
||||
run read_account $aid
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
Reference in new issue
Block a user