Skip to content

Commit

Permalink
makefile: Add helpers to run common tasks inside e2e tests container
Browse files Browse the repository at this point in the history
Code based on sotactl Makefile.

Signed-off-by: Andre Detsch <[email protected]>
  • Loading branch information
detsch committed Oct 17, 2024
1 parent bcef2ce commit d0b9146
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,36 @@ all $(TASKS) config-coverage test-coverage-html:

test:
docker run --init -u $(shell id -u):$(shell id -g) --rm -v $(PWD):$(PWD) -w $(PWD) -eTEST_LABEL=$(TEST_LABEL) -eCTEST_ARGS=$(CTEST_ARGS) -eBUILD_DIR=$(BUILD_DIR) -eGTEST_FILTER=$(GTEST_FILTER) $(CONTAINER) make -f dev-flow.mk $@

# Commands to be used inside the aklite-e2e-test docker
BIN ?= build/src/aktualizr-lite
SOTA_DIR = /var/sota
DEVICE_FACTORY ?= ${FACTORY}
DEVICE_TOKEN ?= ${AUTH_TOKEN}
DEVICE_TAG ?= main

${SOTA_DIR}:
mkdir -p ${SOTA_DIR}/reset-apps
mkdir -p ${SOTA_DIR}/compose-apps

register: ${SOTA_DIR}
DEVICE_FACTORY=${DEVICE_FACTORY} lmp-device-register -T ${DEVICE_TOKEN} --start-daemon 0 -d ${SOTA_DIR} -t ${DEVICE_TAG}

unregister:
@rm -rf ${SOTA_DIR}/sql.db
@rm ${SOTA_DIR}/*.toml

check:
${BIN} check

update:
@ostree config set core.mode bare-user
${BIN} pull
@ostree config set core.mode bare-user-only
${BIN} install

reboot:
@rm -f /var/run/aktualizr-session/need_reboot

run:
${BIN} run

0 comments on commit d0b9146

Please sign in to comment.