mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-31 03:04:11 +03:00
Fix dbufstats_001_pos
Implement a new helper within_tolerance to test if a value is within range of a target. Because the dbufstats and dbufs kstat file are being read at slightly different times, it is possible for stats to be slightly off. Use within_tolerance to determine if the value is "close enough" to the target. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov> Closes #7239 Closes #7266
This commit is contained in:
committed by
Brian Behlendorf
parent
639b18944a
commit
a07ad58847
@@ -55,10 +55,11 @@ function testdbufstat # stat_name dbufstat_filter
|
||||
|
||||
[[ -n "$2" ]] && filter="-F $2"
|
||||
|
||||
verify_eq \
|
||||
$(grep -w "$name" "$DBUFSTATS_FILE" | awk '{ print $3 }') \
|
||||
$(dbufstat.py -bxn -i "$DBUFS_FILE" "$filter" | wc -l) \
|
||||
"$name"
|
||||
from_dbufstat=$(grep -w "$name" "$DBUFSTATS_FILE" | awk '{ print $3 }')
|
||||
from_dbufs=$(dbufstat.py -bxn -i "$DBUFS_FILE" "$filter" | wc -l)
|
||||
|
||||
within_tolerance $from_dbufstat $from_dbufs 5 \
|
||||
|| log_fail "Stat $name exceeded tolerance"
|
||||
}
|
||||
|
||||
verify_runnable "both"
|
||||
|
||||
Reference in New Issue
Block a user