]> granicus.if.org Git - zfs/commit
ZTS: Fix parsing of zpool status in checksum test
authorJohn Wren Kennedy <jwk404@gmail.com>
Tue, 20 Nov 2018 17:51:42 +0000 (10:51 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 20 Nov 2018 17:51:42 +0000 (09:51 -0800)
commit70621ff20eb9dab94dde5e1c5cba7113e4cb7036
treec58bba54087f330183484a6299c4e2184b313314
parentebb873590173fe8b98b4b1b48074925c89245aa0
ZTS: Fix parsing of zpool status in checksum test

filetest_001_pos consumes the output using read -r, assigning each
field to a variable. The problem comes when a vdev is marked degraded,
which appends extra fields to the line. This causes the trailing text
to be treated as part of the `cksum` variable. Using awk instead of
read -r allows us to extract the checksum error count from the output
whether the vdev is degraded or not.

Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: John Wren Kennedy <john.kennedy@delphix.com>
Closes #8136
tests/zfs-tests/tests/functional/checksum/filetest_001_pos.ksh