Skip to content

Commit

Permalink
automated: linux: use modular toml in factory-reset
Browse files Browse the repository at this point in the history
This change aligns factory reset test with all OTA tests in using
modular approach to .toml files.

Signed-off-by: Milosz Wasilewski <[email protected]>
  • Loading branch information
mwasilew authored and roxell committed Jan 19, 2024
1 parent 0c5084a commit 8a62e7c
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
9 changes: 6 additions & 3 deletions automated/linux/factory-reset/prepare-reset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export RESULT_FILE
TYPE="factory_reset"
ADDITIONAL_TYPE=""
LABEL=""
SOTA_CONFDIR="/etc/sota/conf.d"

usage() {
echo "\
Expand Down Expand Up @@ -47,10 +48,12 @@ create_out_dir "${OUTPUT}"
cp aklite-callback.sh /var/sota/
chmod 755 /var/sota/aklite-callback.sh

mkdir -p /etc/sota/conf.d
cp z-99-aklite-callback.toml /etc/sota/conf.d/
mkdir -p "${SOTA_CONFDIR}"
cp z-99-aklite-callback.toml "${SOTA_CONFDIR}"
cp z-99-aklite-disable-reboot.toml "${SOTA_CONFDIR}"
if [ -n "${LABEL}" ]; then
echo "${LABEL}" >> /etc/sota/tag
echo "[pacman]" > "${SOTA_CONFDIR}"/z-99-aklite-tag.toml
echo "tags = ${LABEL}" >> "${SOTA_CONFDIR}"/z-99-aklite-tag.toml
fi
# create signal files
touch /var/sota/ota.signal
Expand Down
3 changes: 2 additions & 1 deletion automated/linux/factory-reset/verify-reboot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ OUTPUT="$(pwd)/output"
RESULT_FILE="${OUTPUT}/result.txt"
export RESULT_FILE
TYPE="factory_reset"
SOTA_CONFDIR="/etc/sota/conf.d"

usage() {
echo "\
Expand Down Expand Up @@ -36,7 +37,7 @@ create_out_dir "${OUTPUT}"
ls -l /etc/
ls -l /var/sota

if [ -f /etc/sota/conf.d/z-99-aklite-callback.toml ]; then
if [ -f "${SOTA_CONFDIR}/z-99-aklite-callback.toml" ]; then
report_fail "${TYPE}-reset-aklite-callback-exists"
else
report_pass "${TYPE}-reset-aklite-callback-exists"
Expand Down
4 changes: 0 additions & 4 deletions automated/linux/factory-reset/z-99-aklite-callback.toml

This file was deleted.

1 change: 1 addition & 0 deletions automated/linux/factory-reset/z-99-aklite-callback.toml
2 changes: 1 addition & 1 deletion automated/linux/ota-apps/update-apps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ TYPE="regular"
APPNAME=""
VERSION=""
DEBUG="false"
SOTA_CONFDIR="/etc/sota/conf.d/"
SOTA_CONFDIR="/etc/sota/conf.d"

usage() {
echo "\
Expand Down
3 changes: 1 addition & 2 deletions automated/linux/ota-rollback/download-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export UBOOT_VAR_SET_TOOL
PACMAN_TYPE="ostree+compose_apps"
UBOOT_IMAGE_NAME="u-boot.itb"
DEBUG="false"
SOTA_CONFDIR="/etc/sota/conf.d/"
SOTA_CONFDIR="/etc/sota/conf.d"

usage() {
echo "\
Expand Down Expand Up @@ -93,7 +93,6 @@ cp z-99-aklite-disable-reboot.toml "${SOTA_CONFDIR}"
if [ "${PACMAN_TYPE}" = "ostree" ]; then
cp z-99-ostree.toml "${SOTA_CONFDIR}"
fi

report_pass "${TYPE}-create-aklite-callback"
# create signal files
touch /var/sota/ota.signal
Expand Down
2 changes: 1 addition & 1 deletion automated/linux/ota-update/download-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PACMAN_TYPE="ostree+compose_apps"
U_BOOT_VARIABLE_NAME="foobar"
U_BOOT_VARIABLE_VALUE="baz"
DEBUG="false"
SOTA_CONFDIR="/etc/sota/conf.d/"
SOTA_CONFDIR="/etc/sota/conf.d"

usage() {
echo "\
Expand Down
2 changes: 1 addition & 1 deletion automated/linux/ota-update/static-delta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ OTA_THRESHOLD=90
# than 100 means there should not be enough space for the
# OTA update
FILL_SIZE=99
SOTA_CONFDIR="/etc/sota/conf.d/"
SOTA_CONFDIR="/etc/sota/conf.d"

usage() {
echo "\
Expand Down

0 comments on commit 8a62e7c

Please sign in to comment.