Skip to content

Commit 4dab18e

Browse files
committed
add test for stanley_rsa file ownership
1 parent 46fd763 commit 4dab18e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/st2tests.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ load "${BATS_HELPERS_DIR}/bats-file/load.bash"
3030
assert_line --partial 'St2-Api-Key'
3131
}
3232

33+
@test 'stanley_rsa file has correct permissions and ownership' {
34+
local private_key="/home/stanley/.ssh/stanley_rsa"
35+
assert_file_exist "${private_key}"
36+
assert_file_not_empty "${private_key}"
37+
assert_file_permission "500" "${private_key}"
38+
assert_file_permission "400" "${private_key}"
39+
assert_file_owner "stanley" "${private_key}"
40+
}
41+
3342
@test 'st2 user can log in with auth credentials' {
3443
run st2 login ${ST2_AUTH_USERNAME} --password ${ST2_AUTH_PASSWORD} -w
3544
assert_success

0 commit comments

Comments
 (0)