Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
monitoring
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
postmarketOS
monitoring
Commits
afa7184f
Commit
afa7184f
authored
5 months ago
by
Luca Weiss
Browse files
Options
Downloads
Patches
Plain Diff
test_upstream_compat: update for pmb v3
Update the testcases to use the new pmb v3 API.
parent
bceede68
Branches
master
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#208402
failed
5 months ago
Stage: check
Stage: badge
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test_upstream_compat.py
+16
-19
16 additions, 19 deletions
test_upstream_compat.py
with
16 additions
and
19 deletions
test_upstream_compat.py
+
16
−
19
View file @
afa7184f
...
...
@@ -3,40 +3,37 @@
# 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
from
pmb.core.context
import
get_context
@pytest.fixture
def
args
(
request
):
def
setup_module
(
module
):
# Initialize args
sys
.
argv
=
[
"
pmbootstrap
"
,
"
--aports
"
,
os
.
environ
[
"
PMAPORTS
"
],
"
chroot
"
]
args
=
pmb
.
parse
.
arguments
()
context
=
get_context
()
# Initialize logging
pmb
.
helpers
.
logging
.
init
(
args
)
request
.
addfinalizer
(
pmb
.
helpers
.
logging
.
logfd
.
close
)
return
args
pmb
.
helpers
.
logging
.
init
(
context
.
log
,
args
.
verbose
,
context
.
details_to_stdout
)
def
test_qt_versions
(
args
):
def
test_qt_versions
():
"""
Verify, that all postmarketOS qt5- package versions match with Alpine
'
s
qt5-qtbase version.
"""
# Upstream version
index
=
pmb
.
helpers
.
repo
.
alpine_apkindex_path
(
args
,
"
community
"
,
"
x86_64
"
)
index_data
=
pmb
.
parse
.
apkindex
.
package
(
args
,
"
qt5-qtbase
"
,
indexes
=
[
index
])
pkgver_upstream
=
index_data
[
"
version
"
]
.
split
(
"
-r
"
)[
0
]
index
=
pmb
.
helpers
.
repo
.
alpine_apkindex_path
(
"
community
"
,
"
x86_64
"
)
index_data
=
pmb
.
parse
.
apkindex
.
package
(
"
qt5-qtbase
"
,
indexes
=
[
index
])
pkgver_upstream
=
index_data
.
version
.
split
(
"
-r
"
)[
0
]
# Iterate over our packages
failed
=
[]
for
path
in
g
lob
.
glob
(
args
.
aports
+
"
/
*/qt5-*/APKBUILD
"
):
for
path
in
g
et_context
().
config
.
aports
[
0
].
glob
(
"
*/qt5-*/APKBUILD
"
):
# Read the pkgver
apkbuild
=
pmb
.
parse
.
apkbuild
(
path
)
pkgname
=
apkbuild
[
"
pkgname
"
]
...
...
@@ -60,14 +57,14 @@ def test_qt_versions(args):
assert
[]
==
failed
def
test_aportgen_versions
(
args
):
def
test_aportgen_versions
():
"""
Verify that the packages generated by
'
pmbootstrap aportgen
'
have
the same version (pkgver *and* pkgrel!) as the upstream packages
they are based on.
"""
# Get Alpine's "main" repository APKINDEX path
index
=
pmb
.
helpers
.
repo
.
alpine_apkindex_path
(
args
,
"
main
"
,
"
x86_64
"
)
index
=
pmb
.
helpers
.
repo
.
alpine_apkindex_path
(
"
main
"
,
"
x86_64
"
)
# Alpine packages and patterns for our derivatives
map
=
{
...
...
@@ -83,11 +80,11 @@ def test_aportgen_versions(args):
generated
=
"
# Automatically generated aport, do not edit!
"
for
pkgname
,
pattern
in
map
.
items
():
# Upstream version
index_data
=
pmb
.
parse
.
apkindex
.
package
(
args
,
pkgname
,
indexes
=
[
index
])
version_upstream
=
index_data
[
"
version
"
]
index_data
=
pmb
.
parse
.
apkindex
.
package
(
pkgname
,
indexes
=
[
index
])
version_upstream
=
index_data
.
version
# Iterate over our packages
for
path
in
g
lob
.
glob
(
args
.
aports
+
"
/
*/
"
+
pattern
+
"
/APKBUILD
"
):
for
path
in
g
et_context
().
config
.
aports
[
0
].
glob
(
"
*/
"
+
pattern
+
"
/APKBUILD
"
):
# Skip non-aportgen APKBUILDs
with
open
(
path
)
as
handle
:
if
generated
not
in
handle
.
read
():
...
...
@@ -106,12 +103,12 @@ def test_aportgen_versions(args):
assert
[]
==
failed
def
test_soname_bump
(
args
):
def
test_soname_bump
():
"""
Use pmb.helpers.pkgrel_bump to check if the pmaports need a pkgrel bump
caused by a soname bump in Alpine. Example: a new openssl version was
released, which increased the soname version, and now all packages that
link against it, need to be rebuilt.
"""
if
pmb
.
helpers
.
pkgrel_bump
.
auto
(
args
,
True
):
if
pmb
.
helpers
.
pkgrel_bump
.
auto
(
True
):
raise
RuntimeError
(
"
One or more packages need to be rebuilt, because a library they link against had an
"
"
incompatible upgrade (soname bump). Run
'
pmbootstrap pkgrel_bump --auto
'
to
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment