1
0
mirror of https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git synced 2025-12-15 11:22:43 +03:00

Use printf for skip_action

printf is posix compatible and works with all shell. echo -n does not
work with yash and is not posix compatible.

Add test for skipping expand_root
This commit is contained in:
Natanael Copa 2023-03-08 18:25:39 +01:00
parent a626e694c6
commit 091af053c5
2 changed files with 17 additions and 2 deletions

View File

@ -25,5 +25,5 @@ skip_action() {
# action not in the skip list?
echo "$SKIP_INIT_ACTIONS" | grep -Eq "\b$action\b" || return 1
echo -n " SKIPPING"
printf " SKIPPING"
}

View File

@ -7,7 +7,8 @@ export MOCK=echo
init_tests \
expand_root \
expand_root_partition
expand_root_partition \
expand_root_skip
PROVIDERS="aws azure gcp nocloud oci"
@ -49,3 +50,17 @@ expand_root_partition_body() {
done
}
expand_root_skip_body() {
fake_bin test-expand-root <<-EOF
#!/bin/sh
SKIP_INIT_ACTIONS=expand_root
. "$srcdir"/lib/tiny-cloud/init-early
expand_root
EOF
for provider in $PROVIDERS; do
CLOUD="$provider" atf_check \
-o match:'^ SKIPPING$' \
test-expand-root
done
}