From: Anand Jain Date: Wed, 29 Jan 2025 07:54:50 +0000 (+0800) Subject: fstests: common/rc: set_fs_sysfs_attr: redirect errors to stdout X-Git-Tag: v2025.04.13~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0a9011ae6a365b93f1e47c812920b61bef2e64f3;p=xfstests-dev.git fstests: common/rc: set_fs_sysfs_attr: redirect errors to stdout 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 Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- diff --git a/common/rc b/common/rc index 17597f14..9bed6dad 100644 --- 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