1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

nuageinit: Fix tests

Commit 07d17ca189 set the recommended
permissions for the SSH authorized keys file and directory.  The tests,
however, were failing on CI.

Use stat to check for the proper permissions.

Fixes:	07d17ca189 nuageinit: Set recommended SSH permissions
Reported by:	Jenkins
This commit is contained in:
Jose Luis Duran 2024-07-23 22:28:45 +00:00 committed by Baptiste Daroussin
parent 7aecd689e3
commit 8edd6c07c8

View File

@ -17,8 +17,8 @@ addsshkey_body() {
if [ ! -f .ssh/authorized_keys ]; then
atf_fail "ssh key not added"
fi
atf_check -o inline:".ssh: 040700 [drwx------ ] -> 040700 [drwx------ ]\n" chmod -vv 0700 .ssh
atf_check -o inline:".ssh/authorized_keys: 0100600 [-rw------- ] -> 0100600 [-rw------- ]\n" chmod -vv 0600 .ssh/authorized_keys
atf_check -o inline:"40700\n" stat -f %p .ssh
atf_check -o inline:"100600\n" stat -f %p .ssh/authorized_keys
atf_check -o inline:"mykey\n" cat .ssh/authorized_keys
atf_check /usr/libexec/flua $(atf_get_srcdir)/addsshkey.lua
atf_check -o inline:"mykey\nmykey\n" cat .ssh/authorized_keys