diff --git a/backend/copr-backend.spec b/backend/copr-backend.spec index 74dc57a16..1a449ec2c 100644 --- a/backend/copr-backend.spec +++ b/backend/copr-backend.spec @@ -59,6 +59,7 @@ BuildRequires: python3-zstandard BuildRequires: python3-cachetools BuildRequires: modulemd-tools >= 0.6 BuildRequires: prunerepo >= %prunerepo_version +BuildRequires: resalloc-server BuildRequires: dnf Requires: (copr-selinux if selinux-policy-targeted) diff --git a/backend/fake_executables b/backend/fake_executables new file mode 100755 index 000000000..e69de29bb diff --git a/backend/run/copr-backend-unknown-resalloc-tickets.py b/backend/run/copr-backend-unknown-resalloc-tickets.py index f54fca191..65abb8f31 100755 --- a/backend/run/copr-backend-unknown-resalloc-tickets.py +++ b/backend/run/copr-backend-unknown-resalloc-tickets.py @@ -20,6 +20,7 @@ from copr_common.helpers import script_requires_user + def used_ids(): """ Return a `set()` of ticket IDs currently in use by @@ -34,7 +35,8 @@ def used_ids(): output = output.strip() tickets = set() for ticket_id in output.split("\n"): - if ticket_id: # ignore empty lines + ticket_id = ticket_id.strip() + if not ticket_id: # ignore empty lines continue assert ticket_id.isdigit() tickets.add(int(ticket_id)) @@ -64,6 +66,7 @@ def print_once(message): print(message) storage[message] = True + def _main(): script_requires_user("resalloc") diff --git a/backend/tests/fake_executables/unknown_tickets/ps b/backend/tests/fake_executables/unknown_tickets/ps new file mode 100755 index 000000000..f3c59168b --- /dev/null +++ b/backend/tests/fake_executables/unknown_tickets/ps @@ -0,0 +1,25 @@ +#! /bin/sh + +cat <