git: 5f7256579cd0 - stable/14 - nuageinit: Fix tests

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Tue, 03 Sep 2024 07:08:20 UTC
The branch stable/14 has been updated by bapt:

URL: https://cgit.FreeBSD.org/src/commit/?id=5f7256579cd0b663e4a7013e81067d11b632fe10

commit 5f7256579cd0b663e4a7013e81067d11b632fe10
Author:     Jose Luis Duran <jlduran@gmail.com>
AuthorDate: 2024-07-23 22:28:45 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2024-09-03 07:05:24 +0000

    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)
---
 libexec/nuageinit/tests/nuage.sh | 4 ++--
 1 file 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