git: 8d7331e62a5a - main - nuageinit: fix authorized_key test
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 05 Jun 2024 09:03:08 UTC
The branch main has been updated by bapt:
URL: https://cgit.FreeBSD.org/src/commit/?id=8d7331e62a5aa75760ac54e3cb1594b0001645c6
commit 8d7331e62a5aa75760ac54e3cb1594b0001645c6
Author: Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2024-06-05 08:58:17 +0000
Commit: Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2024-06-05 09:00:54 +0000
nuageinit: fix authorized_key test
After miss reading the cloudinit spec I ended up writting a wrong
test for basic ssh key setup, nuageinit has been fixed, but not
the test, here is the actual fix.
Reported by: markj
---
libexec/nuageinit/tests/nuageinit.sh | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh
index 926233bcf66d..42c95e1b2abd 100644
--- a/libexec/nuageinit/tests/nuageinit.sh
+++ b/libexec/nuageinit/tests/nuageinit.sh
@@ -173,16 +173,17 @@ EOF
config2_pubkeys_body()
{
here=$(pwd)
+ export NUAGE_FAKE_ROOTDIR=$(pwd)
if [ $(id -u) -ne 0 ]; then
atf_skip "root required"
fi
mkdir -p media/nuageinit
- cat > media/nuageinit/meta_data.json << EOF
-{
- "public_keys": {
- "mykey": "ssh-rsa AAAAB3NzaC1y...== Generated by Nova"
- },
-}
+ touch media/nuageinit/meta_data.json
+ cat > media/nuageinit/user-data << EOF
+#cloud-config
+
+ssh_authorized_keys:
+ - "ssh-rsa AAAAB3NzaC1y...== Generated by Nova"
EOF
mkdir -p etc
cat > etc/master.passwd <<EOF
@@ -194,7 +195,6 @@ EOF
wheel:*:0:root
users:*:1:
EOF
- export NUAGE_FAKE_ROOTDIR=$(pwd)
atf_check /usr/libexec/nuageinit ${here}/media/nuageinit config-2
atf_check -o inline:"ssh-rsa AAAAB3NzaC1y...== Generated by Nova\n" cat home/freebsd/.ssh/authorized_keys
}