Skip to content
Snippets Groups Projects
Verified Commit dfab9718 authored by Dylan Van Assche's avatar Dylan Van Assche
Browse files

test_upgrade_compatibility: initial CI

parent ef63115a
No related branches found
No related tags found
No related merge requests found
Pipeline #163206 failed
#!/usr/bin/env python3
# Copyright 2022 Dylan Van Assche
# SPDX-License-Identifier: GPL-3.0-or-later
import sys
import glob
import os
import pytest
import pmb.helpers.logging
import pmb.parse.apkindex
import pmb.parse
@pytest.fixture
def args(request):
# Initialize args
sys.argv = ["pmbootstrap", "chroot"]
args = pmb.parse.arguments()
# Initialize logging
pmb.helpers.logging.init(args)
request.addfinalizer(pmb.helpers.logging.logfd.close)
return args
def test_latest_stable_to_edge(args):
"""
Verify if we can upgrade from the latest stable image to edge.
"""
POSTMARKETOS_VERSION="21.12"
ALPINE_VERSION="3.15"
# Switch to latest stable in chroot
if pmb.helpers.run.user(args, ["git", "checkout", "v" + POSTMARKETOS_VERSION],
args.aports, "interactive", check=False):
raise RuntimeError("Failed to switch branch. Go to your pmaports and"
" fix what git complained about, then try again: "
f"{args.aports}")
pmb.helpers.other.init_cache()
# Clear chroot
pmb.chroot.zap(args, confirm=False)
# Edit repositories to switch to edge
# FIXME: This sed command doesn't affect the actual repositories list
pmb.chroot.root(args, ["sed", "-i", "-e", "s/v" + POSTMARKETOS_VERSION + "/master/g", "/etc/apk/repositories"])
pmb.chroot.root(args, ["sed", "-i", "-e", "s/v" + ALPINE_VERSION + "/edge/g", "/etc/apk/repositories"])
# Perform upgrade
pmb.chroot.root(args, ["apk", "upgrade", "-a"])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment