4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 # You may only use this file in accordance with the terms of version
9 # A full copy of the text of the CDDL should have accompanied this
10 # source. A copy of the CDDL is also available via the Internet at
11 # http://www.illumos.org/license/CDDL.
15 # Copyright (c) 2017 by Lawrence Livermore National Security, LLC.
18 .
$STF_SUITE/include
/libtest.shlib
22 # zdb -l exit codes are correct
26 # 2. Overwrite label 0 on vdev[1] with dd
27 # 3. Create an empty file
28 # 3. Run zdb -l on vdev[0] and verify exit value 0
29 # 4. Run zdb -l on vdev[1] and verify exit value 1
30 # 5. Run zdb -l on the empty file and verify exit value 2
33 log_assert
"Verify zdb -l exit codes are correct"
38 datasetexists
$TESTPOOL && destroy_pool
$TESTPOOL
41 verify_runnable
"global"
42 verify_disk_count
"$DISKS" 2
46 default_mirror_setup_noexit
$DISKS
47 log_must
$DD if=/dev
/zero of
=$DEV_RDSKDIR/${DISK[1]} bs
=1K count
=256 conv
=notrunc
48 log_must
$TRUNCATE -s 0 $TEMPFILE
50 $ZDB -l $DEV_RDSKDIR/${DISK[0]}
52 log_fail
"zdb -l exit codes are incorrect."
54 $ZDB -l $DEV_RDSKDIR/${DISK[1]}
56 log_fail
"zdb -l exit codes are incorrect."
60 log_fail
"zdb -l exit codes are incorrect."
64 log_pass
"zdb -l exit codes are correct."