aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Luis Duran <jlduran@gmail.com>2024-07-23 22:28:45 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2024-09-03 07:05:24 +0000
commit5f7256579cd0b663e4a7013e81067d11b632fe10 (patch)
tree510fada4c49cad332a812ca92e62caa1906e044e
parent3dbc333a9ef40c71f56507c672e919547eaea248 (diff)
nuageinit: Fix tests
Commit 07d17ca189fcf3cc44b7706040b05ca8135c3b85 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: 07d17ca189f nuageinit: Set recommended SSH permissions Reported by: Jenkins (cherry picked from commit 8edd6c07c8dafcc5828bceb5fea0684c7d0d0775)
-rw-r--r--libexec/nuageinit/tests/nuage.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh
index 531c171a3271..29842bff3d6b 100644
--- a/libexec/nuageinit/tests/nuage.sh
+++ b/libexec/nuageinit/tests/nuage.sh
@@ -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