]> git.hungrycats.org Git - btrfs-progs/commitdiff
btrfs-progs: tests: run dmesg with sudo
authorDavid Sterba <dsterba@suse.com>
Fri, 17 Jul 2026 19:59:28 +0000 (21:59 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 17 Jul 2026 19:59:28 +0000 (21:59 +0200)
On many systems 'dmesg' is not available for regular users and this
fails some of our tests. Use the sudo helper.

Signed-off-by: David Sterba <dsterba@suse.com>
tests/common

index fe6c61f9b643e40b27488b60be871c0399a14606..661b0ee1f985e8ae0e10952a6690d198c312005d 100644 (file)
@@ -235,7 +235,7 @@ run_check()
        "${cmd_array[@]}" >> "$RESULTS" 2>&1
        if [ "$?" -ne 0 ]; then
                if echo "${cmd_array[@]}" | grep -q mount; then
-                       dmesg | tail -n 15 >> "$RESULTS"
+                       $SUDO_HELPER dmesg | tail -n 15 >> "$RESULTS"
                fi
                _fail "failed: ${cmd_array[@]}"
        fi