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
This commit is contained in:
Baptiste Daroussin
2024-06-05 10:58:17 +02:00
parent fa07b02f6e
commit 8d7331e62a
+7 -7
View File
@@ -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
}