Debian Codegraph @

src/test/obj_list_recovery/TEST0

raw
1 #!/usr/bin/env bash
2 # SPDX-License-Identifier: BSD-3-Clause
3 # Copyright 2015-2019, Intel Corporation
4
5 #
6 # src/test/obj_list_recovery/TEST0 -- unit test for list recovery process
7 #
8
9 . ../unittest/unittest.sh
10
11 require_test_type medium
12 require_build_type debug
13
14 # exits with locked mutexes
15 configure_valgrind helgrind force-disable
16 configure_valgrind drd force-disable
17
18 # the test delibretly fails at various stages of redo logging
19 configure_valgrind pmemcheck force-disable ../obj_list/obj_list$EXESUFFIX
20
21 setup
22
23 create_holey_file 1M $DIR/testfile
24
25 rm -f log${UNITTEST_NUM}.log
26
27 function concat_log()
28 {
29 cat out${UNITTEST_NUM}.log >> log${UNITTEST_NUM}.log
30 rm out${UNITTEST_NUM}.log
31 }
32
33 # fail after finish flag is set in redo log
34 expect_normal_exit\
35 ../obj_list/obj_list$EXESUFFIX $DIR/testfile\
36 i:1:0 i:1:0\
37 F:after_finish\
38 i:1:0
39
40 concat_log
41
42 # check
43 expect_normal_exit\
44 ../obj_list/obj_list$EXESUFFIX $DIR/testfile\
45 P:2 R:2\
46 V\
47 P:2 R:2
48
49 concat_log
50
51 # fail before finish flag is set in redo log
52 expect_normal_exit\
53 ../obj_list/obj_list$EXESUFFIX $DIR/testfile\
54 F:before_finish\
55 i:1:0
56
57 concat_log
58
59 # check
60 expect_normal_exit\
61 ../obj_list/obj_list$EXESUFFIX $DIR/testfile\
62 P:2 R:2\
63 V\
64 P:2 R:2
65
66 concat_log
67
68 check
69
70 pass