git: 2a86992ab501 - main - nuageninit: modify the test to show the issue fixed inc316ec259011
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 06 May 2026 21:16:48 UTC
The branch main has been updated by bapt:
URL: https://cgit.FreeBSD.org/src/commit/?id=2a86992ab5019b4997ccadf7427011ba44e33c97
commit 2a86992ab5019b4997ccadf7427011ba44e33c97
Author: Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2026-05-06 20:45:50 +0000
Commit: Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2026-05-06 21:16:37 +0000
nuageninit: modify the test to show the issue fixed inc316ec259011
Ensure the script used is invalid when parsed by libyaml which
highlight the issue revealed in PR295062
while at here validate the mode of the file is properly changed
PR: 295062
MFC After: 1 day
---
libexec/nuageinit/tests/nuageinit.sh | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh
index 3a01413f8487..1fd68d5a178e 100644
--- a/libexec/nuageinit/tests/nuageinit.sh
+++ b/libexec/nuageinit/tests/nuageinit.sh
@@ -76,10 +76,12 @@ nocloud_userdata_script_body()
{
mkdir -p media/nuageinit
printf "instance-id: iid-local01\n" > "${PWD}"/media/nuageinit/meta-data
- printf "#!/bin/sh\necho yeah\n" > "${PWD}"/media/nuageinit/user-data
- chmod 755 "${PWD}"/media/nuageinit/user-data
+ # ensure this is an invalid when parsed with the yaml parser
+ printf "#!/bin/sh\n: ${test:-yes}\necho $test\n" > "${PWD}"/media/nuageinit/user-data
+ chmod 644 "${PWD}"/media/nuageinit/user-data
atf_check -s exit:0 /usr/libexec/nuageinit "${PWD}"/media/nuageinit nocloud
- atf_check -o inline:"#!/bin/sh\necho yeah\n" cat var/cache/nuageinit/user_data
+ atf_check test -x var/cache/nuageinit/user_data
+ atf_check -o inline:"#!/bin/sh\n: ${test:-yes}\necho $test\n" cat var/cache/nuageinit/user_data
}
nocloud_user_data_script_body()