-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_all.sh
More file actions
executable file
·87 lines (69 loc) · 2.95 KB
/
Copy pathtest_all.sh
File metadata and controls
executable file
·87 lines (69 loc) · 2.95 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
set -ex
date_str=`date "+%Y_%m_%d_%H_%M_%S"`
DRY_RUN=0
SUFFIX=""
if [ "$1" = "quick" ]; then
SUFFIX="_quick"
echo "quick cbd test."
else
echo "full cbd test."
fi
if [ "$2" = "dryrun" ]; then
DRY_RUN=1
echo "dryrun....."
fi
source ./local_conf
CBD_TESTS_DIR=`pwd`
source ./utils/utils.sh
source /etc/os-release
case "$ID" in
debian|ubuntu|devuan|elementary|softiron)
echo "ubuntu"
apt install -y fio python3 python3-pip
;;
rocky|centos|fedora|rhel|ol|virtuozzo)
echo "centos"
yum install -y fio python3 python3-pip
;;
*)
echo "$ID is unknown, dependencies will have to be installed manually."
exit 1
;;
esac
# install requirements
pip install avocado-framework==96.0 avocado-framework-plugin-varianter-yaml-to-mux==96.0 avocado-framework-plugin-result-html==96.0
# build and insmod cbd
setup
# replace default options with the real options
cd ${CBD_TESTS_DIR}
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml XFSTESTS_DIR_DEFAULT ${CBD_TESTS_XFSTESTS_DIR}
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml CBD_TESTS_DIR_DEFAULT ${CBD_TESTS_DIR}
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml SCRATCH_MNT_DEFAULT ${XFSTESTS_SCRATCH_MNT}
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml TEST_MNT_DEFAULT ${XFSTESTS_TEST_MNT}
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml TEST_DEV_DEFAULT /dev/cbd0
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml SCRATCH_DEV_DEFAULT /dev/cbd1
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml CACHE_TEST_DEFAULT /dev/cbd2
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml CACHE_SCRATCH_DEFAULT /dev/cbd3
replace_option fio.py.data/fio${SUFFIX}.yaml CBD_DEV_PATH /dev/cbd0
replace_option fio.py.data/fio${SUFFIX}.yaml OUTPUT_FILE "output.cvs"
#replace_option upgradeonline.py.data/upgradeonline${SUFFIX}.yaml CBD_TESTS_DIR_DEFAULT ${CBD_TESTS_DIR}
#replace_option upgradeonline.py.data/upgradeonline${SUFFIX}.yaml CBD_DEV_DEFAULT /dev/cbd0
if [ ${DRY_RUN} -eq 0 ]; then
./all_test${SUFFIX}.py
fi
if [ ! -z "$CBD_TESTS_POST_TEST_CMDS" ]; then
${CBD_TESTS_POST_TEST_CMDS}
fi
replace_option fio.py.data/fio${SUFFIX}.yaml "output.cvs" OUTPUT_FILE
replace_option fio.py.data/fio${SUFFIX}.yaml /dev/cbd0 CBD_DEV_PATH
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml /dev/cbd3 CACHE_SCRATCH_DEFAULT
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml /dev/cbd2 CACHE_TEST_DEFAULT
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml /dev/cbd1 SCRATCH_DEV_DEFAULT
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml /dev/cbd0 TEST_DEV_DEFAULT
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml ${XFSTESTS_TEST_MNT} TEST_MNT_DEFAULT
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml ${XFSTESTS_SCRATCH_MNT} SCRATCH_MNT_DEFAULT
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml ${CBD_TESTS_DIR} CBD_TESTS_DIR_DEFAULT
replace_option xfstests.py.data/xfstests${SUFFIX}.yaml ${CBD_TESTS_XFSTESTS_DIR} XFSTESTS_DIR_DEFAULT
# cleanup
cleanup