t/one-core-peak: Improving check_sysblock_value error handling
authorErwan Velu <erwanaliasr1@gmail.com>
Tue, 12 Oct 2021 19:39:58 +0000 (21:39 +0200)
committerErwan Velu <erwanaliasr1@gmail.com>
Tue, 12 Oct 2021 19:47:49 +0000 (21:47 +0200)
commit38820f4ab33573e31239fbf4ee20b937c159b53f
tree950b153e396e8d698347c470703ee435be39cd48
parentd9f27d9190b91eb2e92f55145b59066084d12695
t/one-core-peak: Improving check_sysblock_value error handling

The current code was reporting the following output:
cat: /sys/block/nvme0n1/queue/wbt_lat_usec: Argument invalide
nvme0n1: /sys/block/nvme0n1/queue/wbt_lat_usec set to 0.
Warning: nvme0n1: Cannot set 0 on /sys/block/nvme0n1/queue/wbt_lat_usec

This is problematic for several reasons:
- cat reports an error at reading wbt_lat_usec
- a message says it set wbt_lat_usec to 0
- a warning reports it cannot set wbt_lat_usec to 0

This commit:
- prevents the first error to be printed
- only report wbt_lat_usec is set to 0 if succeed unles it print the Warning message.

Signed-off-by: Erwan Velu <erwanaliasr1@gmail.com>
t/one-core-peak.sh