1
0
mirror of https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git synced 2025-12-18 12:52:42 +03:00

Hide mount failures when looking for CIDATA

fixes https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud/-/issues/43
This commit is contained in:
Natanael Copa 2023-05-22 11:43:18 +02:00
parent 40d15db038
commit 3ca6b74a48
2 changed files with 4 additions and 1 deletions

View File

@ -56,7 +56,7 @@ _load_nocloud_volume() {
[ "$mounted" ] && break [ "$mounted" ] && break
for label in cidata CIDATA; do for label in cidata CIDATA; do
[ -n "$mounted" ] && break [ -n "$mounted" ] && break
mount -o ro -t "$fstype" LABEL="$label" "$mntdir" && mounted=1 mount -o ro -t "$fstype" LABEL="$label" "$mntdir" 2>/dev/null && mounted=1
done done
done done
if [ -n "$mounted" ]; then if [ -n "$mounted" ]; then

View File

@ -34,6 +34,7 @@ no_metadata_boot_body() {
-e not-match:"not found" \ -e not-match:"not found" \
-e not-match:"o such file" \ -e not-match:"o such file" \
-o match:"rc-update add.*sshd" \ -o match:"rc-update add.*sshd" \
-e not-match:"mount:" \
tiny-cloud boot tiny-cloud boot
done done
} }
@ -43,6 +44,7 @@ no_userdata_early_body() {
CLOUD="$provider" atf_check \ CLOUD="$provider" atf_check \
-e not-match:"unknown" \ -e not-match:"unknown" \
-e match:"save_userdata.*done" \ -e match:"save_userdata.*done" \
-e not-match:"mount:" \
tiny-cloud early tiny-cloud early
done done
} }
@ -52,6 +54,7 @@ no_userdata_main_body() {
# we should not set empty hostname # we should not set empty hostname
# we should not create .ssh dir for non-existing user # we should not create .ssh dir for non-existing user
CLOUD="$provider" atf_check \ CLOUD="$provider" atf_check \
-e not-match:"mount:" \
-e not-match:"failed" \ -e not-match:"failed" \
-e not-match:"unknown" \ -e not-match:"unknown" \
-o not-match:"hostname.*-F" \ -o not-match:"hostname.*-F" \