Remove building with NOCRYPTO option
[minix3.git] / tests / fs / ffs / ffs_common.sh
blobeaf7142808a1d48e392ff4cc06341c081f854be9
1 # $NetBSD: ffs_common.sh,v 1.2 2013/07/29 13:15:24 skrll Exp $
3 create_ffs()
5 local endian=$1; shift
6 local vers=$1; shift
7 local type=$1; shift
8 local op;
9 if [ ${type} = "both" ]; then
10 op="-q user -q group"
11 else
12 op="-q ${type}"
14 atf_check -o ignore -e ignore newfs ${op} \
15 -B ${endian} -O ${vers} -s 4000 -F ${IMG}
18 create_ffs_server()
20 local sarg=$1; shift
21 create_ffs $*
22 atf_check -o ignore -e ignore $(atf_get_srcdir)/h_ffs_server \
23 ${sarg} ${IMG} ${RUMP_SERVER}
26 rump_shutdown()
28 for s in ${RUMP_SOCKETS_LIST}; do
29 atf_check -s exit:0 env RUMP_SERVER=unix://${s} rump.halt;
30 done
31 # check that the quota inode creation didn't corrupt the filesystem
32 atf_check -s exit:0 -o "match:already clean" \
33 -o "match:Phase 6 - Check Quotas" \
34 fsck_ffs -nf -F ${IMG}
37 # from tests/ipf/h_common.sh via tests/sbin/resize_ffs
38 test_case()
40 local name="${1}"; shift
41 local check_function="${1}"; shift
42 local descr="${1}"; shift
44 atf_test_case "${name}" cleanup
46 eval "${name}_head() { \
47 atf_set "descr" "${descr}"
48 atf_set "timeout" "60"
50 eval "${name}_body() { \
51 RUMP_SOCKETS_LIST=\${RUMP_SOCKET}; \
52 export RUMP_SERVER=unix://\${RUMP_SOCKET}; \
53 ${check_function} " "${@}" "; \
55 eval "${name}_cleanup() { \
56 for s in \${RUMP_SOCKETS_LIST}; do \
57 export RUMP_SERVER=unix://\${s}; \
58 atf_check -s exit:1 -o ignore -e ignore rump.halt; \
59 done; \
61 tests="${tests} ${name}"
64 test_case_root()
66 local name="${1}"; shift
67 local check_function="${1}"; shift
68 local descr="${1}"; shift
70 atf_test_case "${name}" cleanup
72 eval "${name}_head() { \
73 atf_set "descr" "${descr}"
74 atf_set "require.user" "root"
75 atf_set "timeout" "360"
77 eval "${name}_body() { \
78 RUMP_SOCKETS_LIST=\${RUMP_SOCKET}; \
79 export RUMP_SERVER=unix://\${RUMP_SOCKET}; \
80 ${check_function} " "${@}" "; \
82 eval "${name}_cleanup() { \
83 for s in \${RUMP_SOCKETS_LIST}; do \
84 export RUMP_SERVER=unix://\${s}; \
85 atf_check -s exit:1 -o ignore -e ignore rump.halt; \
86 done; \
88 tests="${tests} ${name}"
91 atf_init_test_cases()
93 IMG=fsimage
94 DIR=target
95 RUMP_SOCKET=test;
96 for i in ${tests}; do
97 atf_add_test_case $i
98 done