improve api tests and error output

show only relevant aptly logs if a test fails.
for async tasks, show task output, as it contains the error message.
This commit is contained in:
André Roth
2024-07-16 19:48:04 +02:00
parent 8029305d32
commit 440c3debdc
11 changed files with 278 additions and 175 deletions
+8 -3
View File
@@ -7,11 +7,16 @@ from api_lib import APITest
def check_gpgkey_exists(gpg_key, keyring):
subprocess.check_call([
p = subprocess.Popen([
"gpg", "--no-default-keyring",
"--keyring", keyring,
"--fingerprint", gpg_key,
])
"--fingerprint", gpg_key],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
p.communicate()
if p.returncode != 0:
raise Exception("gpg key does not exists")
class GPGAPITestAddKey(APITest):