1#!/bin/ksh 2 3# 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 7# 1.0 of the CDDL. 8# 9 10# 11# Description: 12# 13# Test whether zhack label repair can recover 14# corrupted checksums on devices of varied size, 15# but not undetached devices. 16# 17# Strategy: 18# 19# 1. Create pool on a loopback device with some test data 20# 2. Export the pool. 21# 3. Corrupt all label checksums in the pool 22# 4. Check that pool cannot be imported 23# 5. Verify that it cannot be imported after using zhack label repair -u 24# to ensure that the -u option will quit on corrupted checksums. 25# 6. Use zhack label repair -c on device 26# 7. Check that pool can be imported and that data is intact 27 28. "$STF_SUITE"/tests/functional/cli_root/zhack/library.kshlib 29 30run_test_one "$(get_devsize)" 31