diff options
author | Ural Tunaboyu <ural.tunaboyu@canonical.com> | 2025-03-14 08:06:07 -0700 |
---|---|---|
committer | Ural Tunaboyu <ural.tunaboyu@canonical.com> | 2025-03-14 08:06:07 -0700 |
commit | d72e9a4a36cb560ef06f23fc202338194351c084 (patch) | |
tree | 6c62594a02a87bd428796ccb06bfd9bf4127c936 | |
parent | 0b065353ac86bf975dbc292b2bca68340610f520 (diff) |
Fixed permissions on /var/crash
check-var-crash-empty had been failing to copy files out of /var/crash, this fixes the permissions issue.
-rwxr-xr-x | tests/check-var-crash-empty | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/check-var-crash-empty b/tests/check-var-crash-empty index 46a164d..922f1f8 100755 --- a/tests/check-var-crash-empty +++ b/tests/check-var-crash-empty @@ -6,6 +6,7 @@ import shutil import sys import subprocess from datetime import date +from getpass import getuser from pathlib import Path @@ -38,7 +39,14 @@ except Exception as e: crash_list = [] -for crash in Path("/var/crash").glob("*.crash"): +crash_dir = "/var/crash" + +try: + subprocess.run(["sudo", "chown", "-R", getuser(), crash_dir], check=True) +except subprocess.CalledProcessError: + print("Unable to set ownership of /var/crash. Extracting artifacts will fail!") + +for crash in Path(crash_dir).glob("*.crash"): print(f"Found crash `{crash}`") uploaded_file = crash.with_suffix(".uploaded") |