Skip to content

Commit

Permalink
update testscripts
Browse files Browse the repository at this point in the history
  • Loading branch information
AlvinSchiller committed Nov 17, 2023
1 parent cfa01b7 commit bc00403
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 82 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/test_docker_debian_codename_sub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,11 @@ jobs:
strategy:
fail-fast: false
matrix:
username: ['pi', 'hans']
test_script: ['run_installation_tests.sh', 'run_install_kiosk_mode.sh', 'run_install_faststartup.sh']
username: ['pi']
test_script: ['run_install_test.sh', 'run_install_webapp.sh', 'run_install_faststartup.sh']
include:
- username: hans
test_script: run_install_user_not_pi.sh

steps:
- name: Set up QEMU
Expand Down
2 changes: 1 addition & 1 deletion ci/ci-debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG BASE_TEST_IMAGE=test-code
FROM debian:${DEBIAN_CODENAME}-slim as base
ARG DEBIAN_CODENAME

ENV DOCKER_RUNNING=true TERM=xterm
ENV CI_RUNNING=true TERM=xterm

# create pi configs to test installation
RUN touch /boot/cmdline.txt
Expand Down
36 changes: 13 additions & 23 deletions ci/installation/run_install_faststartup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,19 @@ export DEBIAN_FRONTEND=noninteractive
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections

# Run installation (in interactive mode)
# y confirm setup
# y dont use static ip
# y dont deactivate ipv6
# y dont use autohotspot
# n use default password
# y dont deactivate bluetooth
# y dont disable on-chip audio
# n configure samba
# n dont use rfid reader
# n dont build local WebApp
# n build local docs
# - no kiosk mode (only with WebApp = y)
# - install node (only with WebApp = y)
# n dont reboot

# y - start setup
# y - use static ip
# y - deactivate ipv6
# y - setup autohotspot
# n - use custom password
# y - deactivate bluetooth
# y - disable on-chip audio
# n - setup samba
# n - setup rfid reader
# n - build local WebApp
# - - setup kiosk mode (only with WebApp = y)
# - - install node (only with WebApp = y)
# n - reboot

"$local_install_script_path"/install-jukebox.sh <<< 'y
y
Expand All @@ -41,12 +39,4 @@ n
n
n
n
n
'
INSTALLATION_EXITCODE=$?

# count abortion due to "not user pi" as success
if [ "${INSTALLATION_EXITCODE}" -eq 2 ]; then
INSTALLATION_EXITCODE=0
fi
exit "${INSTALLATION_EXITCODE}"
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,18 @@ export DEBIAN_FRONTEND=noninteractive
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections

# Run installation (in interactive mode)
# y confirm setup
# n dont use static ip
# n dont deactivate ipv6
# n dont use autohotspot
# n dont deactivate bluetooth
# n dont disable on-chip audio
# y configure samba
# n dont use rfid reader
# y dont build local WebApp
# y build local docs
# n no kiosk mode
# y install node
# n dont reboot

# y - start setup
# n - use static ip
# n - deactivate ipv6
# n - setup autohotspot
# n - deactivate bluetooth
# n - disable on-chip audio
# y - setup samba
# n - setup rfid reader
# y - build local WebApp
# n - setup kiosk mode
# y - install node
# n - reboot

"$local_install_script_path"/install-jukebox.sh <<< 'y
n
Expand All @@ -38,15 +36,7 @@ n
y
n
y
y
n
y
n
'
INSTALLATION_EXITCODE=$?

# count abortion due to "not user pi" as success
if [ "${INSTALLATION_EXITCODE}" -eq 2 ]; then
INSTALLATION_EXITCODE=0
fi
exit "${INSTALLATION_EXITCODE}"
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,26 @@ export DEBIAN_FRONTEND=noninteractive
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections

# Run installation (in interactive mode)
# y confirm setup
# n dont use static ip
# n dont deactivate ipv6
# n dont use autohotspot
# n dont deactivate bluetooth
# n dont disable on-chip audio
# n configure samba
# n dont use rfid reader
# n dont build local WebApp
# n build local docs
# y no kiosk mode
# n install node
# n dont reboot


"$local_install_script_path"/install-jukebox.sh <<< 'y
n
n
n
n
n
n
n
y
n
y
n
n
'
# y - start setup
# n - use static ip
# n - deactivate ipv6
# n - setup autohotspot
# n - deactivate bluetooth
# n - disable on-chip audio
# y - setup samba
# n - setup rfid reader
# y - build local WebApp
# n - setup kiosk mode
# y - install node
# n - reboot

"$local_install_script_path"/install-jukebox.sh
INSTALLATION_EXITCODE=$?

# count abortion due to "not user pi" as success
# only count abortion due to "not user pi" as success
if [ "${INSTALLATION_EXITCODE}" -eq 2 ]; then
INSTALLATION_EXITCODE=0
else
INSTALLATION_EXITCODE=1
fi
exit "${INSTALLATION_EXITCODE}"
42 changes: 42 additions & 0 deletions ci/installation/run_install_webapp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash

# Install Phoniebox and test it
# Used e.g. for tests on Docker

# Objective: Test installation with script using a simple configuration

local_install_script_path="${INSTALL_SCRIPT_PATH:-./../../installation/}"
local_install_script_path="${local_install_script_path%/}"

# Preparations
# No interactive frontend
export DEBIAN_FRONTEND=noninteractive
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections

# Run installation (in interactive mode)
# y - start setup
# n - use static ip
# n - deactivate ipv6
# n - setup autohotspot
# n - deactivate bluetooth
# n - disable on-chip audio
# n - setup samba
# n - setup rfid reader
# y - build local WebApp
# y - setup kiosk mode
# y - install node
# n - reboot

"$local_install_script_path"/install-jukebox.sh <<< 'y
n
n
n
n
n
n
n
y
y
y
n
'
2 changes: 1 addition & 1 deletion installation/install-jukebox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ checkPrerequisite
### RUN INSTALLATION
cd "${HOME_PATH}"
INSTALLATION_LOGFILE="${HOME_PATH}/INSTALL-${INSTALL_ID}.log"
if [ "$DOCKER_RUNNING" == "true" ]; then
if [ "$CI_RUNNING" == "true" ]; then
exec 3>&1 2>&1
else
exec 3>&1 1>>"${INSTALLATION_LOGFILE}" 2>&1 || { echo "Cannot create log file. Panic."; exit 1; }
Expand Down
6 changes: 3 additions & 3 deletions installation/routines/customize_options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ ${DISABLE_ONBOARD_AUDIO_BACKUP} if things go pear-shaped.)

_option_webapp_devel_build() {
# Let's detect if we are on the official release branch
if [[ "$GIT_BRANCH" != "${GIT_BRANCH_RELEASE}" || "$GIT_USER" != "$GIT_UPSTREAM_USER" ]]; then
if [[ "$GIT_BRANCH" != "${GIT_BRANCH_RELEASE}" || "$GIT_USER" != "$GIT_UPSTREAM_USER" || "$CI_RUNNING" == "true" ]]; then
ENABLE_INSTALL_NODE=true
# Unless ENABLE_WEBAPP_PROD_DOWNLOAD is forced to true by user override, do not download a potentially stale build
if [[ "$ENABLE_WEBAPP_PROD_DOWNLOAD" = "release-only" ]]; then
if [[ "$ENABLE_WEBAPP_PROD_DOWNLOAD" == "release-only" ]]; then
ENABLE_WEBAPP_PROD_DOWNLOAD=false
fi

if [[ "$ENABLE_WEBAPP_PROD_DOWNLOAD" = false ]]; then
if [[ "$ENABLE_WEBAPP_PROD_DOWNLOAD" == false ]]; then
echo -e "Your are installing from a non-release branch.
This means, you will need to build the web app locally.
For that you'll need Node.
Expand Down

0 comments on commit bc00403

Please sign in to comment.