Skip to content

Commit

Permalink
Update test scripts
Browse files Browse the repository at this point in the history
use robust path determination
move noninteractive to dockerfile
  • Loading branch information
AlvinSchiller committed Nov 20, 2023
1 parent 292bd97 commit 7ee75dd
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 33 deletions.
3 changes: 2 additions & 1 deletion ci/ci-debian.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ ARG BASE_TEST_IMAGE=test-code
FROM debian:${DEBIAN_CODENAME}-slim as base
ARG DEBIAN_CODENAME

ENV CI_RUNNING=true TERM=xterm
ENV CI_RUNNING=true TERM=xterm DEBIAN_FRONTEND=noninteractive
RUN 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections

# create pi configs to test installation
RUN touch /boot/config.txt
Expand Down
12 changes: 4 additions & 8 deletions ci/installation/run_install_faststartup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@

# 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
SOURCE="${BASH_SOURCE[0]}"
SCRIPT_DIR="$(dirname "$SOURCE")"
INSTALL_SCRIPT_PATH="${SCRIPT_DIR}/../../installation"

# Run installation (in interactive mode)
# y - start setup
Expand All @@ -28,7 +24,7 @@ echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selecti
# - - install node (only with WebApp = y)
# n - reboot

"$local_install_script_path"/install-jukebox.sh <<< 'y
"${INSTALL_SCRIPT_PATH}/install-jukebox.sh" <<< 'y
y
y
n
Expand Down
12 changes: 4 additions & 8 deletions ci/installation/run_install_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@

# 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
SOURCE="${BASH_SOURCE[0]}"
SCRIPT_DIR="$(dirname "$SOURCE")"
INSTALL_SCRIPT_PATH="${SCRIPT_DIR}/../../installation"

# Run installation (in interactive mode)
# y - start setup
Expand All @@ -29,7 +25,7 @@ echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selecti
# y - install node
# n - reboot

"$local_install_script_path"/install-jukebox.sh <<< 'y
"${INSTALL_SCRIPT_PATH}/install-jukebox.sh" <<< 'y
n
n
y
Expand Down
12 changes: 4 additions & 8 deletions ci/installation/run_install_user_not_pi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@

# 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
SOURCE="${BASH_SOURCE[0]}"
SCRIPT_DIR="$(dirname "$SOURCE")"
INSTALL_SCRIPT_PATH="${SCRIPT_DIR}/../../installation"

# Run installation (in interactive mode)
# - - Installation must abort early

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

# only count abortion due to "not user pi" as success
Expand Down
12 changes: 4 additions & 8 deletions ci/installation/run_install_webapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@

# 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
SOURCE="${BASH_SOURCE[0]}"
SCRIPT_DIR="$(dirname "$SOURCE")"
INSTALL_SCRIPT_PATH="${SCRIPT_DIR}/../../installation"

# Run installation (in interactive mode)
# y - start setup
Expand All @@ -28,7 +24,7 @@ echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selecti
# y - install node
# n - reboot

"$local_install_script_path"/install-jukebox.sh <<< 'y
"${INSTALL_SCRIPT_PATH}/install-jukebox.sh" <<< 'y
n
n
n
Expand Down

0 comments on commit 7ee75dd

Please sign in to comment.