| 1 |
#!/usr/bin/env bash |
| 2 |
# SPDX-License-Identifier: BSD-3-Clause |
| 3 |
# Copyright 2014-2019, Intel Corporation |
| 4 |
|
| 5 |
# |
| 6 |
# src/test/blk_recovery/TEST0 -- unit test for pmemblk recovery |
| 7 |
# |
| 8 |
|
| 9 |
. ../unittest/unittest.sh |
| 10 |
|
| 11 |
require_test_type medium |
| 12 |
|
| 13 |
# doesn't make sense to run in local directory |
| 14 |
require_fs_type pmem non-pmem |
| 15 |
require_build_type nondebug static-nondebug |
| 16 |
|
| 17 |
setup |
| 18 |
|
| 19 |
# single arena case |
| 20 |
truncate -s 2G $DIR/testfile1 |
| 21 |
|
| 22 |
# |
| 23 |
# Simple case, one write interrupted. pmemblk_check() should note |
| 24 |
# that testfile1 is consistent (after recovery steps were taken). |
| 25 |
# |
| 26 |
expect_abnormal_exit ./blk_recovery$EXESUFFIX 4096 $DIR/testfile1 5 10 2>/dev/null |
| 27 |
mv out0.log interrupted0.log |
| 28 |
|
| 29 |
expect_normal_exit ./blk_recovery$EXESUFFIX 4096 $DIR/testfile1 |
| 30 |
mv out0.log check0.log |
| 31 |
|
| 32 |
check_pool $DIR/testfile1 |
| 33 |
|
| 34 |
check |
| 35 |
|
| 36 |
pass |