diff options
-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") |