diff options
-rw-r--r-- | setup-alpine.in | 43 | ||||
-rwxr-xr-x | tests/setup_alpine_test | 22 |
2 files changed, 48 insertions, 17 deletions
diff --git a/setup-alpine.in b/setup-alpine.in index 21a989b..d393c5d 100644 --- a/setup-alpine.in +++ b/setup-alpine.in @@ -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" diff --git a/tests/setup_alpine_test b/tests/setup_alpine_test index 4699df9..22555ee 100755 --- a/tests/setup_alpine_test +++ b/tests/setup_alpine_test @@ -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 +} + |