1
0
mirror of https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git synced 2025-12-14 19:02:45 +03:00

Rename Phases & Support doas.conf

This commit is contained in:
Jake Buchholz Göktürk 2023-05-22 00:34:28 +00:00
parent 69733fbedd
commit 5f26d1f579
13 changed files with 239 additions and 232 deletions

15
TODO.md
View File

@ -1,20 +1,17 @@
# TODO
## Tiny Cloud v3.0.0
* Support for Alpine Linux ISO auto-install via NoCloud `CIDATA` volumes, which
have pre-network access to UserData and MetaData. Adjust phase actions as
appropriate.
* Detect UserData content type. In addition to handling `#!` scripts and raw
data, provide basic handling a subset of `#cloud-config` directives.
## FUTURE
* cloud auto-detection
* `#cloud-config` user-data handler (support a useful subset)
* `#tiny-config` user-data handler (should be simple-yet-flexible)
* `imds-net-sync` improvements
* Feature parity with current [amazon-ec2-net-utils](
https://github.com/amazonlinux/amazon-ec2-net-utils)
* Support for non-AWS clouds
* daemonize to pick up IMDS network changes between reboots
* Support LVM partitioning and non-`ext[234]` filesystems

16
dist/openrc/tiny-cloud-boot vendored Executable file
View File

@ -0,0 +1,16 @@
#!/sbin/openrc-run
# vim:set ft=sh:
# shellcheck shell=sh
description="Tiny Cloud Bootstrap - boot phase"
depend() {
after root logger
before net
}
start() {
ebegin "Tiny Cloud - boot phase"
tiny-cloud boot
eend $?
}

View File

@ -5,8 +5,8 @@
description="Tiny Cloud Bootstrap - early phase"
depend() {
after root logger
before net
need net
before tiny-cloud-main
}
start() {

View File

@ -3,7 +3,6 @@
# shellcheck shell=sh
description="Tiny Cloud Bootstrap - main phase"
extra_commands="complete incomplete"
depend() {
need net
@ -15,7 +14,3 @@ start() {
tiny-cloud main
eend $?
}
# allow setting / unsetting of bootstrapped state
complete() { tiny-cloud --bootstrap complete ; }
incomplete() { tiny-cloud --bootstrap incomplete ; }

View File

@ -1,15 +0,0 @@
#!/sbin/openrc-run
# vim:set ft=sh:
# shellcheck shell=sh
description="Tiny Cloud Bootstrap - net phase"
depend() {
need net
before tiny-cloud
}
start() {
ebegin "Tiny Cloud - net"
tiny-cloud net
eend $?
}

View File

@ -2,7 +2,7 @@
# vim:set ft=sh:
# shellcheck shell=sh
INIT_ACTIONS_EARLY="$(replace_word set_default_interfaces set_network_interfaces $INIT_ACTIONS_EARLY)"
INIT_ACTIONS_BOOT="$(replace_word set_default_interfaces set_network_interfaces $INIT_ACTIONS_BOOT)"
set_resolv_conf() {
# resolv.conf

View File

@ -11,14 +11,14 @@
### default phase actions (without leading 'init__')
DEFAULT_ACTIONS_EARLY="
DEFAULT_ACTIONS_BOOT="
expand_root
install_hotplugs
set_default_interfaces
create_default_user
enable_sshd
"
DEFAULT_ACTIONS_NET="
DEFAULT_ACTIONS_EARLY="
save_userdata
"
DEFAULT_ACTIONS_MAIN="
@ -27,8 +27,8 @@ DEFAULT_ACTIONS_MAIN="
"
DEFAULT_ACTIONS_FINAL=""
: "${INIT_ACTIONS_BOOT=$DEFAULT_ACTIONS_BOOT}"
: "${INIT_ACTIONS_EARLY=$DEFAULT_ACTIONS_EARLY}"
: "${INIT_ACTIONS_NET=$DEFAULT_ACTIONS_NET}"
: "${INIT_ACTIONS_MAIN=$DEFAULT_ACTIONS_MAIN}"
: "${INIT_ACTIONS_FINAL=$DEFAULT_ACTIONS_FINAL}"
@ -37,7 +37,7 @@ DEFAULT_ACTIONS_FINAL=""
[ ! -d "$TINY_CLOUD_VAR" ] && mkdir -p "$TINY_CLOUD_VAR" || true
### standard init-early functions...
### standard boot phase functions...
init__expand_root() {
local dev=$(awk '$2 == "/" {print $1}' "$ROOT"/proc/mounts 2>/dev/null)
@ -185,6 +185,8 @@ init__create_default_user() {
fi
if [ -d "$ROOT/etc/doas.d" ]; then
echo 'permit nopass :wheel' > "$TARGET/etc/doas.d/wheel.conf"
elif [ -f "$ROOT/etc/doas.conf" ]; then
add_once "$TARGET/etc/doas.conf" "permit nopass :wheel"
fi
}
@ -194,8 +196,39 @@ init__enable_sshd() {
$MOCK rc-update --update
}
### standard early phase functions
### standard init-main functions
init__save_userdata() {
local userdata="$TINY_CLOUD_VAR/user-data"
if [ -f "$userdata" ]; then
log -i -t "$phase" info "$ACTION: user-data already saved"
return
fi
local tmpfile=$(mktemp "$userdata.XXXXXX")
imds -e @userdata > "$tmpfile"
if printf '\037\213\010' | cmp -s -n 3 "$tmpfile"; then
gzip -dc "$tmpfile" > "$userdata"
elif printf 'BZh' | cmp -s -n 3 "$tmpfile"; then
bzip2 -dc "$tmpfile" > "$userdata"
elif printf '\375\067\172\130\132\000' | cmp -s -n 6 "$tmpfile"; then
unxz -c "$tmpfile" > "$userdata"
elif printf '\135\000\000' | cmp -s -n 3 "$tmpfile"; then
lzma -dc "$tmpfile" > "$userdata"
elif printf '\211\114\132' | cmp -s -n 3 "$tmpfile"; then
lzop -dc "$tmpfile" > "$userdata"
elif printf '\004\042\115\030' | cmp -s -n 4 "$tmpfile"; then
lz4 -dc "$tmpfile" > "$userdata"
elif printf '(\265/\375' | cmp -s -n 4 "$tmpfile"; then
zstd -dc "$tmpfile" > "$userdata"
else
cp "$tmpfile" "$userdata"
fi
rm "$tmpfile"
}
### standard main phase functions
init__set_hostname() {
local fqdn=$(imds @hostname)
@ -243,37 +276,8 @@ init__set_ssh_keys() {
echo "$sshkeys" > "$keys_file"
}
init__save_userdata() {
local userdata="$TINY_CLOUD_VAR/user-data"
if [ -f "$userdata" ]; then
log -i -t "$phase" info "$ACTION: user-data already saved"
return
fi
local tmpfile=$(mktemp "$userdata.XXXXXX")
imds -e @userdata > "$tmpfile"
if printf '\037\213\010' | cmp -s -n 3 "$tmpfile"; then
gzip -dc "$tmpfile" > "$userdata"
elif printf 'BZh' | cmp -s -n 3 "$tmpfile"; then
bzip2 -dc "$tmpfile" > "$userdata"
elif printf '\375\067\172\130\132\000' | cmp -s -n 6 "$tmpfile"; then
unxz -c "$tmpfile" > "$userdata"
elif printf '\135\000\000' | cmp -s -n 3 "$tmpfile"; then
lzma -dc "$tmpfile" > "$userdata"
elif printf '\211\114\132' | cmp -s -n 3 "$tmpfile"; then
lzop -dc "$tmpfile" > "$userdata"
elif printf '\004\042\115\030' | cmp -s -n 4 "$tmpfile"; then
lz4 -dc "$tmpfile" > "$userdata"
elif printf '(\265/\375' | cmp -s -n 4 "$tmpfile"; then
zstd -dc "$tmpfile" > "$userdata"
else
cp "$tmpfile" "$userdata"
fi
rm "$tmpfile"
}
### standard init-final functions would be here, if there were any
### standard final phase functions would be here, if there were any
### load cloud-specific init functions / vars (potentially overriding)

View File

@ -10,7 +10,7 @@ set -e
usage() {
cat <<-EOF
Usage: ${0##*/} [-h | --help] { early | net | main | final | --bootstrap {complete|incomplete|status} | --setup }
Usage: ${0##*/} [-h | --help] { boot | early | main | final | --bootstrap {complete|incomplete|status} | --setup }
EOF
}
@ -46,12 +46,12 @@ while true; do
esac
exit 0;;
-s|--setup) # just openrc for now
for phase in -early -net '' -final; do
for phase in -boot -early -main -final '' -net; do
rc-update -a del "tiny-cloud$phase" || true
done
rc-update add tiny-cloud-early boot
rc-update add tiny-cloud-net default
rc-update add tiny-cloud default
rc-update add tiny-cloud-boot boot
rc-update add tiny-cloud-early default
rc-update add tiny-cloud-main default
rc-update add tiny-cloud-final default
exit 0;;
--) shift; break;;
@ -64,7 +64,7 @@ phase="$1"
shift
case "$phase" in
early|net|main|final) ;;
boot|early|main|final) ;;
*) usage >&2; exit 1;;
esac
@ -97,8 +97,8 @@ INIT_ACTIONS_FINAL="${INIT_ACTIONS_FINAL} bootstrap_complete"
### let's do stuff!
case "$phase" in
boot) INIT_ACTIONS="$INIT_ACTIONS_BOOT";;
early) INIT_ACTIONS="$INIT_ACTIONS_EARLY";;
net) INIT_ACTIONS="$INIT_ACTIONS_NET";;
main) INIT_ACTIONS="$INIT_ACTIONS_MAIN";;
final) INIT_ACTIONS="$INIT_ACTIONS_FINAL";;
*) usage >&2; exit 1;;

123
tests/init-boot.test Executable file
View File

@ -0,0 +1,123 @@
#!/usr/bin/env atf-sh
# vim:set ft=sh
# shellcheck shell=sh
. $(atf_get_srcdir)/test_env.sh
export PREFIX="$srcdir"
export MOCK=echo
lib="$srcdir"/lib/tiny-cloud/init
init_tests \
expand_root \
expand_root_partition \
install_hotplugs_fail \
ethernets \
find_first_interface_up \
auto_detect_ethernet_interface \
set_default_interfaces \
enable_sshd \
create_default_user
PROVIDERS="alpine aws azure gcp nocloud oci"
expand_root_body() {
mkdir proc
echo "/dev/xvda / ext4 rw,noatime 0 0" > proc/mounts
for provider in $PROVIDERS; do
CLOUD="$provider" atf_check \
-o match:"resize2fs /dev/xvda" \
sh -c ". $lib; init__expand_root"
done
}
expand_root_partition_body() {
mkdir -p proc sys/class/block \
sys/devices/pci0000:00/0000:00:1b.0/0000:01:00.0/nvme/nvme0/nvme0n1/nvme0n1p2 \
sys/devices/pci0000:00/0000:00:1b.0/0000:01:00.0/nvme/nvme0/nvme0n1/device
ln -s ../../devices/pci0000:00/0000:00:1b.0/0000:01:00.0/nvme/nvme0/nvme0n1 sys/class/block/nvme0n1
ln -s ../../devices/pci0000:00/0000:00:1b.0/0000:01:00.0/nvme/nvme0/nvme0n1/nvme0n1p2 sys/class/block/nvme0n1p2
echo 2 > sys/class/block/nvme0n1p2/partition
echo "/dev/nvme0n1p2 / ext4 rw,noatime 0 0" > proc/mounts
for provider in $PROVIDERS; do
CLOUD="$provider" atf_check \
-o match:"sfdisk .*/dev/nvme0n1" \
-o match:"partx .*/dev/nvme0n1" \
-o match:"resize2fs /dev/nvme0n1p2" \
sh -c ". $lib; init__expand_root"
done
}
install_hotplugs_fail_body() {
CLOUD=aws atf_check -s not-exit:0 \
-e match:"vnic_eth_hotplug: failed" \
sh -c ". $lib; HOTPLUG_MODULES='vnic_eth_hotplug'; init__install_hotplugs"
}
ethernets_body() {
fake_interfaces lo br0 eth0 eth2 eth11
# check that they are sorted by ifindex, not name
# and that br0 and lo are excluded
atf_check \
-o match:"eth0 eth2 eth11" \
-o not-match:"br0" \
-o not-match:"lo" \
sh -c ". $lib; ethernets | tr '\n' ' '"
}
find_first_interface_up_body() {
fake_interfaces eth0 eth1
echo up > sys/class/net/eth1/operstate
atf_check \
-o match:"eth1" \
sh -c ". $lib; find_first_interface_up eth0 eth1"
}
auto_detect_ethernet_interface_body() {
fake_interfaces eth0 eth1
echo up > sys/class/net/eth1/operstate
atf_check \
-o match:"^eth1$" \
sh -c ". $lib; auto_detect_ethernet_interface"
# test that we pick first if all are down
echo down > sys/class/net/eth1/operstate
atf_check \
-o match:"^eth0$" \
sh -c ". $lib; TINY_CLOUD_LINK_WAIT_MAX=1; auto_detect_ethernet_interface"
}
set_default_interfaces_body() {
fake_interfaces eth0 eth1
echo up > sys/class/net/eth1/operstate
atf_check \
sh -c ". $lib; init__set_default_interfaces"
atf_check \
-o match:"auto lo" \
-o match:"iface eth1" \
-o match:"use dhcp" \
cat etc/network/interfaces
}
enable_sshd_body() {
for provider in $PROVIDERS; do
CLOUD="$provider" atf_check \
-o match:"rc-update.* add sshd default" \
-o match:"rc-update.* --update" \
sh -c ". $lib; init__enable_sshd"
done
}
create_default_user_body() {
atf_check \
-o match:"addgroup alpine" \
-o match:"adduser.*alpine" \
-o match:"addgroup alpine wheel" \
-o match:"chpasswd -e" \
sh -c ". $lib; init__create_default_user"
}

View File

@ -9,115 +9,30 @@ export MOCK=echo
lib="$srcdir"/lib/tiny-cloud/init
init_tests \
expand_root \
expand_root_partition \
install_hotplugs_fail \
ethernets \
find_first_interface_up \
auto_detect_ethernet_interface \
set_default_interfaces \
enable_sshd \
create_default_user
save_userdata_plain \
save_userdata_compressed
PROVIDERS="alpine aws azure gcp nocloud oci"
save_userdata_plain_body() {
fake_userdata_nocloud <<-EOF
#userdata
EOF
CLOUD="nocloud" atf_check -e match:"NoCloud 'meta-data' is empty" \
sh -c ". \"$lib\"; init__save_userdata"
atf_check -o match:"^#userdata" cat var/lib/cloud/user-data
}
expand_root_body() {
mkdir proc
echo "/dev/xvda / ext4 rw,noatime 0 0" > proc/mounts
for provider in $PROVIDERS; do
CLOUD="$provider" atf_check \
-o match:"resize2fs /dev/xvda" \
sh -c ". $lib; init__expand_root"
save_userdata_compressed_body() {
for comp in gzip bzip2 xz lzma lzop lz4 zstd; do
# fake_userdata_nocloud will set PATH so dont run it in a subshell
printf "%s\n" "#userdata" | $comp -c > tmpfile
fake_userdata_nocloud < tmpfile
CLOUD="nocloud" atf_check \
-e 'ignore' \
sh -c ". \"$lib\"; init__save_userdata"
if ! grep "^#userdata" var/lib/cloud/user-data; then
atf_fail "$comp failed"
fi
done
}
expand_root_partition_body() {
mkdir -p proc sys/class/block \
sys/devices/pci0000:00/0000:00:1b.0/0000:01:00.0/nvme/nvme0/nvme0n1/nvme0n1p2 \
sys/devices/pci0000:00/0000:00:1b.0/0000:01:00.0/nvme/nvme0/nvme0n1/device
ln -s ../../devices/pci0000:00/0000:00:1b.0/0000:01:00.0/nvme/nvme0/nvme0n1 sys/class/block/nvme0n1
ln -s ../../devices/pci0000:00/0000:00:1b.0/0000:01:00.0/nvme/nvme0/nvme0n1/nvme0n1p2 sys/class/block/nvme0n1p2
echo 2 > sys/class/block/nvme0n1p2/partition
echo "/dev/nvme0n1p2 / ext4 rw,noatime 0 0" > proc/mounts
for provider in $PROVIDERS; do
CLOUD="$provider" atf_check \
-o match:"sfdisk .*/dev/nvme0n1" \
-o match:"partx .*/dev/nvme0n1" \
-o match:"resize2fs /dev/nvme0n1p2" \
sh -c ". $lib; init__expand_root"
done
}
install_hotplugs_fail_body() {
CLOUD=aws atf_check -s not-exit:0 \
-e match:"vnic_eth_hotplug: failed" \
sh -c ". $lib; HOTPLUG_MODULES='vnic_eth_hotplug'; init__install_hotplugs"
}
ethernets_body() {
fake_interfaces lo br0 eth0 eth2 eth11
# check that they are sorted by ifindex, not name
# and that br0 and lo are excluded
atf_check \
-o match:"eth0 eth2 eth11" \
-o not-match:"br0" \
-o not-match:"lo" \
sh -c ". $lib; ethernets | tr '\n' ' '"
}
find_first_interface_up_body() {
fake_interfaces eth0 eth1
echo up > sys/class/net/eth1/operstate
atf_check \
-o match:"eth1" \
sh -c ". $lib; find_first_interface_up eth0 eth1"
}
auto_detect_ethernet_interface_body() {
fake_interfaces eth0 eth1
echo up > sys/class/net/eth1/operstate
atf_check \
-o match:"^eth1$" \
sh -c ". $lib; auto_detect_ethernet_interface"
# test that we pick first if all are down
echo down > sys/class/net/eth1/operstate
atf_check \
-o match:"^eth0$" \
sh -c ". $lib; TINY_CLOUD_LINK_WAIT_MAX=1; auto_detect_ethernet_interface"
}
set_default_interfaces_body() {
fake_interfaces eth0 eth1
echo up > sys/class/net/eth1/operstate
atf_check \
sh -c ". $lib; init__set_default_interfaces"
atf_check \
-o match:"auto lo" \
-o match:"iface eth1" \
-o match:"use dhcp" \
cat etc/network/interfaces
}
enable_sshd_body() {
for provider in $PROVIDERS; do
CLOUD="$provider" atf_check \
-o match:"rc-update.* add sshd default" \
-o match:"rc-update.* --update" \
sh -c ". $lib; init__enable_sshd"
done
}
create_default_user_body() {
atf_check \
-o match:"addgroup alpine" \
-o match:"adduser.*alpine" \
-o match:"addgroup alpine wheel" \
-o match:"chpasswd -e" \
sh -c ". $lib; init__create_default_user"
}

View File

@ -10,10 +10,7 @@ lib="$srcdir"/lib/tiny-cloud/init
init_tests \
set_hostname \
set_ssh_keys \
save_userdata_plain \
save_userdata_compressed
set_ssh_keys
set_nocloud_meta() {
local metadata="$(cat)"
@ -65,28 +62,3 @@ set_ssh_keys_body() {
-o match:"^ssh-rsa foobar" \
cat home/alpine/.ssh/authorized_keys
}
save_userdata_plain_body() {
fake_userdata_nocloud <<-EOF
#userdata
EOF
CLOUD="nocloud" atf_check -e match:"NoCloud 'meta-data' is empty" \
sh -c ". \"$lib\"; init__save_userdata"
atf_check -o match:"^#userdata" cat var/lib/cloud/user-data
}
save_userdata_compressed_body() {
for comp in gzip bzip2 xz lzma lzop lz4 zstd; do
# fake_userdata_nocloud will set PATH so dont run it in a subshell
printf "%s\n" "#userdata" | $comp -c > tmpfile
fake_userdata_nocloud < tmpfile
CLOUD="nocloud" atf_check \
-e 'ignore' \
sh -c ". \"$lib\"; init__save_userdata"
if ! grep "^#userdata" var/lib/cloud/user-data; then
atf_fail "$comp failed"
fi
done
}

View File

@ -44,7 +44,7 @@ set_network_config_network_interfaces_body() {
atf_check \
-o match:"rc-update" \
-e match:"set_network_interfaces: done" \
tiny-cloud early
tiny-cloud boot
atf_check \
-o match:"auto eth1" \
-o match:"iface eth1" \
@ -70,7 +70,7 @@ set_network_config_auto_body() {
atf_check \
-o match:"rc-update" \
-e match:"set_network_interfaces: done" \
tiny-cloud early
tiny-cloud boot
atf_check \
-o match:"auto eth1" \
-o match:"iface eth1" \
@ -89,7 +89,7 @@ userdata_bootcmd_body() {
- echo foo
- echo bar
EOF
atf_check -e ignore -o ignore tiny-cloud net
atf_check -e ignore -o ignore tiny-cloud early
atf_check \
-e match:"userdata_bootcmd: done" \
-o match:"^foo$" -o match:"^bar$" \
@ -102,7 +102,7 @@ userdata_ntp_body() {
ntp:
enabled: true
EOF
atf_check -e ignore -o ignore tiny-cloud net
atf_check -e ignore -o ignore tiny-cloud early
atf_check \
-e match:"userdata_ntp: done" \
-o match:"apk add.*chrony" \
@ -118,7 +118,7 @@ userdata_ntp_busybox_body() {
enabled: true
ntp_client: busybox
EOF
atf_check -e ignore -o ignore tiny-cloud net
atf_check -e ignore -o ignore tiny-cloud early
atf_check \
-e match:"userdata_ntp: done" \
-o not-match:"apk add" \
@ -134,7 +134,7 @@ userdata_ntp_openntpd_body() {
enabled: true
ntp_client: openntpd
EOF
atf_check -e ignore -o ignore tiny-cloud net
atf_check -e ignore -o ignore tiny-cloud early
atf_check \
-e match:"userdata_ntp: done" \
-o match:"apk add.*openntpd" \
@ -149,7 +149,7 @@ userdata_apk_cache_body() {
apk:
cache: /var/cache/apk
EOF
atf_check -e ignore -o ignore tiny-cloud net
atf_check -e ignore -o ignore tiny-cloud early
atf_check \
-e match:"userdata_apk_cache: done" \
-o ignore \
@ -165,7 +165,7 @@ userdata_apk_repositories_body() {
- base_url: /srv/packages
repos: [ "main", "community" ]
EOF
atf_check -e ignore -o ignore tiny-cloud net
atf_check -e ignore -o ignore tiny-cloud early
atf_check \
-e match:"userdata_apk_repositories: done" \
-o ignore \
@ -184,7 +184,7 @@ userdata_apk_repositories_version_body() {
version: edge
repos: [ "main", "community" ]
EOF
atf_check -e ignore -o ignore tiny-cloud net
atf_check -e ignore -o ignore tiny-cloud early
atf_check \
-e match:"userdata_apk_repositories: done" \
-o ignore \
@ -205,7 +205,7 @@ userdata_apk_repositories_version_auto_edge_body() {
mkdir -p etc
echo "VERSION_ID=3.18_alpha20230329" > etc/os-release
atf_check -e ignore -o ignore tiny-cloud net
atf_check -e ignore -o ignore tiny-cloud early
atf_check \
-e match:"userdata_apk_repositories: done" \
-o ignore \
@ -220,7 +220,7 @@ userdata_package_update_body() {
#alpine-config
package_update: true
EOF
atf_check -e ignore -o ignore tiny-cloud net
atf_check -e ignore -o ignore tiny-cloud early
atf_check \
-e match:"userdata_package_update: done" \
-o match:"apk update" \
@ -232,7 +232,7 @@ userdata_package_upgrade_body() {
#alpine-config
package_upgrade: true
EOF
atf_check -e ignore -o ignore tiny-cloud net
atf_check -e ignore -o ignore tiny-cloud early
atf_check \
-e match:"userdata_package_upgrade: done" \
-o match:"apk upgrade" \
@ -246,7 +246,7 @@ userdata_packages_body() {
- tmux
- vim
EOF
atf_check -e ignore -o ignore tiny-cloud net
atf_check -e ignore -o ignore tiny-cloud early
atf_check \
-e match:"userdata_packages: done" \
-o match:"apk add .*tmux" \
@ -262,7 +262,7 @@ userdata_runcmd_body() {
- echo bar
EOF
# run net phase to extract the user data
atf_check -e ignore -o ignore tiny-cloud net
atf_check -e ignore -o ignore tiny-cloud early
atf_check \
-e match:"userdata_runcmd: done" \
-o match:"^foo$" -o match:"^bar$" \
@ -301,7 +301,7 @@ userdata_write_files_body() {
world
EOF
# fetch user-data
atf_check -e ignore -o ignore tiny-cloud net
atf_check -e ignore -o ignore tiny-cloud early
atf_check \
-e match:"userdata_write_files: done" \

View File

@ -10,8 +10,8 @@ PROVIDERS="alpine aws azure gcp nocloud oci"
init_tests \
tiny_cloud_help \
no_metadata_early \
no_userdata_net \
no_metadata_boot \
no_userdata_early \
no_userdata_main \
no_userdata_final
@ -27,23 +27,23 @@ tiny_cloud_help_body() {
done
}
no_metadata_early_body() {
no_metadata_boot_body() {
for provider in $PROVIDERS; do
CLOUD="$provider" atf_check \
-e not-match:"unknown" \
-e not-match:"not found" \
-e not-match:"o such file" \
-o match:"rc-update add.*sshd" \
tiny-cloud early
tiny-cloud boot
done
}
no_userdata_net_body() {
no_userdata_early_body() {
for provider in $PROVIDERS; do
CLOUD="$provider" atf_check \
-e not-match:"unknown" \
-e match:"save_userdata.*done" \
tiny-cloud net
tiny-cloud early
done
}