Whamcloud - gitweb
LU-17471 osd: add symlink for brw_stats
[fs/lustre-release.git] / lustre / tests / sanity-compr.sh
1 #!/bin/bash
2 #
3 # Run select tests by setting ONLY, or as arguments to the script.
4 # Skip specific tests by setting EXCEPT.
5 #
6
7 set -e
8
9 ONLY=${ONLY:-"$*"}
10
11 LUSTRE=${LUSTRE:-$(dirname $0)/..}
12 . $LUSTRE/tests/test-framework.sh
13 init_test_env "$@"
14 init_logging
15
16 # bug number for skipped test:
17 ALWAYS_EXCEPT="$SANITY_COMPR_EXCEPT"
18
19 build_test_filter
20
21 FAIL_ON_ERROR=false
22
23 check_and_setup_lustre
24
25 # $RUNAS_ID may get set incorrectly somewhere else
26 if [[ $UID -eq 0 && $RUNAS_ID -eq 0 ]]; then
27         skip_env "\$RUNAS_ID set to 0, but \$UID is also 0!" && exit
28 fi
29 check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS
30
31 save_layout_restore_at_exit $MOUNT
32 # Set file system with different layout
33 COMPR_EXTRA_LAYOUT=${COMPR_EXTRA_LAYOUT:-"-E EOF -c 1"}
34 $LFS setstripe $COMPR_EXTRA_LAYOUT $MOUNT
35
36 test_sanity()
37 {
38         always_except LU-16928 56wb
39         local rc=0
40
41         SANITY_EXCEPT=$ALWAYS_EXCEPT bash sanity.sh
42         rc=$?
43         return $rc
44 }
45 run_test sanity "Run sanity with PFL layout"
46
47 test_sanityn()
48 {
49         local rc=0
50
51         bash sanityn.sh
52         rc=$?
53         return $rc
54 }
55 run_test sanityn "Run sanityn with PFL layout"
56
57 complete_test $SECONDS
58 check_and_cleanup_lustre
59 declare -a logs=($ONLY)
60 logs=("${logs[@]/#/$TMP/}")
61 exit_status "$(echo "${logs[@]/%/.log}")"