-
Notifications
You must be signed in to change notification settings - Fork 510
/
Copy pathTEST2.PS1
56 lines (44 loc) · 1.88 KB
/
TEST2.PS1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2017-2019, Intel Corporation
#
#
# compat_incompat_features/TEST2.PS1 -- test for compat/incompat feature flags
#
# check if pool fails to open when incompat flags are equal, nonzero and other
# than poolset options
#
. ..\unittest\unittest.ps1
require_test_type medium
require_fs_type any
setup
. .\common.PS1
# Create poolset file
create_poolset $POOLSET `
20M:$DIR\part0:x `
20M:$DIR\part1:x
Foreach ($type in $POOL_TYPES)
{
expect_normal_exit $PMEMPOOL rm -f $POOLSET | out-file -append -encoding ascii -literalpath $LOG_TEMP
expect_normal_exit $PMEMPOOL create $create_args[$type] | out-file -append -encoding ascii -literalpath $LOG_TEMP
# Set compat flag in part 0 header
set_incompat $DIR\part0 $POOL_FEAT_SINGLEHDR | out-file -append -encoding ascii -literalpath $LOG_TEMP
set_incompat $DIR\part1 $POOL_FEAT_SINGLEHDR | out-file -append -encoding ascii -literalpath $LOG_TEMP
# Check if pool fails to open
expect_abnormal_exit $Env:EXE_DIR\pool_open$Env:EXESUFFIX $type $POOLSET 2>&1
cat -Encoding Ascii $LOG | out-file -append -encoding ascii -literalpath $LOG_TEMP
cat -Encoding Ascii $ERR | out-file -append -encoding ascii -literalpath $ERR_TEMP
Foreach ($flag in $UNKNOWN_INCOMPAT)
{
# Set compat/incompat flags in headers
set_incompat $DIR\part0 $flag | out-file -append -encoding ascii -literalpath $LOG_TEMP
set_incompat $DIR\part1 $flag | out-file -append -encoding ascii -literalpath $LOG_TEMP
# Check if pool fails to open
expect_abnormal_exit $Env:EXE_DIR\pool_open$Env:EXESUFFIX $type $POOLSET 2>&1
cat -Encoding Ascii $LOG | out-file -append -encoding ascii -literalpath $LOG_TEMP
cat -Encoding Ascii $ERR | out-file -append -encoding ascii -literalpath $ERR_TEMP
}
}
mv -Force $LOG_TEMP $LOG
mv -Force $ERR_TEMP $ERR
check
pass