Commit e13c6000 authored by Natanael Copa's avatar Natanael Copa
Browse files

setup-alpine: update generated answerfile and add test

test that the generated answerfile actually is interactive
parent 02c95521
Pipeline #126790 passed with stage
in 21 seconds
......@@ -80,13 +80,14 @@ if [ -n "$CREATEANSWERFILE" ]; then
# If you don't want to use a certain option, then comment it out
# Use US layout with US variant
KEYMAPOPTS="us us"
# KEYMAPOPTS="us us"
KEYMAPOPTS=none
# Set hostname to alpine-test
HOSTNAMEOPTS="-n alpine-test"
# Set hostname to 'alpine'
HOSTNAMEOPTS=alpine
# Set device manager to mdev
DEVDOPTS="mdev"
DEVDOPTS=mdev
# Contents of /etc/network/interfaces
INTERFACESOPTS="auto lo
......@@ -98,29 +99,39 @@ if [ -n "$CREATEANSWERFILE" ]; then
"
# Search domain of example.com, Google public nameserver
DNSOPTS="-d example.com 8.8.8.8"
# DNSOPTS="-d example.com 8.8.8.8"
# Set timezone to UTC
TIMEZONEOPTS="-z UTC"
#TIMEZONEOPTS="UTC"
TIMEZONEOPTS=none
# set http/ftp proxy
PROXYOPTS="http://webproxy:8080"
#PROXYOPTS="http://webproxy:8080"
PROXYOPTS=none
# Add a random mirror
APKREPOSOPTS="-r"
# Add first mirror (CDN)
APKREPOSOPTS="-1"
# Create admin user
USEROPTS="-a -u -g audio,video,netdev -k https://example.com/juser.keys juser"
# Install Openssh
SSHDOPTS="-c openssh"
SSHDOPTS=openssh
# Use openntpd
NTPOPTS="-c openntpd"
# NTPOPTS="openntpd"
NTPOPTS=none
# Use /dev/sda as a sys disk
# DISKOPTS="-m sys /dev/sda"
DISKOPTS=none
# Use /dev/sda as a data disk
DISKOPTS="-m data /dev/sda"
# Setup storage with label APKOVL for config storage
#LBUOPTS="LABEL=APKOVL"
LBUOPTS=none
# Setup in /media/sdb1
LBUOPTS="/media/sdb1"
APKCACHEOPTS="/media/sdb1/cache"
#APKCACHEOPTS="/media/LABEL=APKOVL/cache"
APKCACHEOPTS=none
__EOF__
echo "Answer file $CREATEANSWERFILE has been created. Please add or remove options as desired in that file"
......
......@@ -3,7 +3,8 @@
. $(atf_get_srcdir)/test_env.sh
init_tests \
setup_alpine_usage \
setup_alpine_quick
setup_alpine_quick \
setup_alpine_create_answerfile
setup_alpine_usage_body() {
test_usage setup-alpine
......@@ -17,3 +18,22 @@ setup_alpine_quick_body() {
-e empty \
setup-alpine -q
}
setup_alpine_create_answerfile_body() {
init_env
atf_check -s exit:0 \
-o match:"Answer file answers has been created" \
setup-alpine -c answers
mkdir -p usr/share/zoneinfo/
touch usr/share/zoneinfo/UTC
atf_check -s exit:0 \
-o match:"Starting hostname" \
-o match:"Starting mdev" \
-o match:"Added mirror" \
-o match:"adduser" \
-o match:"apk add" \
setup-alpine -f answers
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment