new file mode 100644
@@ -0,0 +1,15 @@
+# This software is a part of Isar.
+# Copyright (C) 2026 Siemens AG
+#
+# SPDX-License-Identifier: MIT
+
+# Test that a .deb without a Priority field can be added to the repository.
+# The debianize class sets Priority in the Source stanza of debian/control;
+# we strip it here so the resulting .deb has no Priority metadata, exercising
+# the prio_opt fallback in repository.bbclass.
+
+inherit dpkg-raw
+
+do_prepare_build:append() {
+ sed -i '/^Priority:/d' ${S}/debian/control
+}
@@ -61,14 +61,23 @@ repo_add_packages() {
local dir="$1"
local dbdir="$2"
local codename="$3"
+ local package
+ local priority
+ local prio_opt
shift; shift; shift
if [ -n "${GNUPGHOME}" ]; then
export GNUPGHOME="${GNUPGHOME}"
fi
- reprepro -b "${dir}" --dbdir "${dbdir}" -C main \
- includedeb "${codename}" \
- "$@"
+ for package in "$@"; do
+ prio_opt=""
+ priority=$(dpkg-deb -f "${package}" Priority 2>/dev/null || true)
+ if [ -z "${priority}" ]; then
+ prio_opt="-P optional"
+ fi
+ reprepro -b "${dir}" --dbdir "${dbdir}" -C main ${prio_opt} \
+ includedeb "${codename}" "${package}"
+ done
}
repo_del_srcpackage() {
old mode 100755
new mode 100644
@@ -131,6 +131,23 @@ class CompatTest(CIBaseTest):
self.perform_build_test(targets, compat_arch=True)
+class RepositoryTest(CIBaseTest):
+ """
+ Test repository functionality.
+ :avocado: tags=repository,fast
+ """
+
+ def test_repository_nopriority(self):
+ """Test that packages without a Priority field can be added to the repo."""
+ targets = [
+ 'mc:qemuamd64-bookworm:isar-image-ci',
+ ]
+
+ self.init()
+ self.perform_build_test(targets,
+ image_install='test-nopriority')
+
+
class SbuildFlavor(CIBaseTest):
"""
Test package build with a custom sbuild chroot.