Skip to content

Commit

Permalink
e2e-tests: Allows factory tag to be specified
Browse files Browse the repository at this point in the history
Previous version was always using "main" tag.

Signed-off-by: Andre Detsch <[email protected]>
  • Loading branch information
detsch committed Nov 6, 2024
1 parent 64f30ae commit 70ebcfe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dev-shell-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ down() {
trap down EXIT

mkdir -p $PWD/.device/sysroot
docker compose --env-file=${docker_path}/.env.dev -f ${docker_path}/docker-compose.yml run -e DEV_USER=$(id -u) -e DEV_GROUP=$(id -g) -e BASE_TARGET_VERSION=${BASE_TARGET_VERSION} -e USER_TOKEN=${USER_TOKEN} aklite-e2e-test "$@"
docker compose --env-file=${docker_path}/.env.dev -f ${docker_path}/docker-compose.yml run -e DEV_USER=$(id -u) -e DEV_GROUP=$(id -g) -e BASE_TARGET_VERSION=${BASE_TARGET_VERSION} -e USER_TOKEN=${USER_TOKEN} -e TAG=${TAG} aklite-e2e-test "$@"
9 changes: 7 additions & 2 deletions e2e-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ class ReturnCodes:
logger.error("BASE_TARGET_VERSION environment variable not set")
sys.exit()

tag = os.getenv("TAG")
if not tag:
logger.error("TAG environment variable not set")
sys.exit()

base_target_version = int(base_target_version)
logger.info(f"Base target version: {base_target_version}")

Expand Down Expand Up @@ -118,7 +123,7 @@ def __str__(self):
def register_if_required():
if not os.path.exists("/var/sota/client.pem"):
user_token = os.getenv("USER_TOKEN")
cmd = f'DEVICE_FACTORY={factory_name} lmp-device-register --api-token "{user_token}" --start-daemon 0 --tags main'
cmd = f'DEVICE_FACTORY={factory_name} lmp-device-register --api-token "{user_token}" --start-daemon 0 --tags {tag}'
logger.info(f"Registering device...")
output = os.popen(cmd).read().strip()
logger.info(output)
Expand Down Expand Up @@ -224,7 +229,7 @@ def write_settings(apps=None, prune=True):
content = \
f"""
[pacman]
tags = "main"
tags = "{tag}"
"""
if apps is not None:
apps_str = ",".join(apps)
Expand Down

0 comments on commit 70ebcfe

Please sign in to comment.