]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
fstests: common/rc: set_fs_sysfs_attr: redirect errors to stdout
authorAnand Jain <anand.jain@oracle.com>
Wed, 29 Jan 2025 07:54:50 +0000 (15:54 +0800)
committerZorro Lang <zlang@kernel.org>
Fri, 11 Apr 2025 04:25:08 +0000 (12:25 +0800)
Redirect sysfs write errors to stdout as a preparatory patch to enable
testing of expected sysfs write failures. Also, log the executed
sysfs write command and its failure if any to seqres.full for better
debugging and traceability.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/rc

index 17597f145dae940c2f6cdb7c758c496858931e70..9bed6dad9303db6f368dda126fbd36ae18da0898 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -5209,7 +5209,8 @@ _set_fs_sysfs_attr()
 
        local dname=$(_fs_sysfs_dname $dev)
 
-       echo "$content" > /sys/fs/${FSTYP}/${dname}/${attr}
+       echo "echo '$content' 2>&1 > /sys/fs/${FSTYP}/${dname}/${attr}" >> $seqres.full
+       echo "$content" 2>&1 > /sys/fs/${FSTYP}/${dname}/${attr} | tee -a $seqres.full
 }
 
 # Print the content of /sys/fs/$FSTYP/$DEV/$ATTR