forked from llnl/UnifyFS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path0001-setup.t
More file actions
executable file
·80 lines (70 loc) · 2.2 KB
/
Copy path0001-setup.t
File metadata and controls
executable file
·80 lines (70 loc) · 2.2 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
#!/bin/bash
#
# Perform some initial setup for the test suite. This is not
# implemented as a sharness test because leaving a process running
# behind (i.e. unifyfsd) causes tap-driver.sh to hang waiting for
# the process to exit.
#
# Print TAP plan
echo 1..1
#
# Create temporary directories to be used as a common mount point and a
# common metadata directory across multiple tests. Save the value to a
# script in known location that later test scripts can source.
#
export UNIFYFS_TEST_TMPDIR=$(mktemp -d)
mkdir -p $UNIFYFS_TEST_TMPDIR/{meta,mount,share,spill,state}
export UNIFYFS_TEST_META=$UNIFYFS_TEST_TMPDIR/meta
export UNIFYFS_TEST_MOUNT=$UNIFYFS_TEST_TMPDIR/mount
export UNIFYFS_TEST_SHARE=$UNIFYFS_TEST_TMPDIR/share
export UNIFYFS_TEST_SPILL=$UNIFYFS_TEST_TMPDIR/spill
export UNIFYFS_TEST_STATE=$UNIFYFS_TEST_TMPDIR/state
#
# Source test environment first to pick up UNIFYFS_TEST_RUN_SCRIPT
#
. $(dirname $0)/sharness.d/00-test-env.sh
cat >"$UNIFYFS_TEST_RUN_SCRIPT" <<-EOF
export UNIFYFS_TEST_TMPDIR=$UNIFYFS_TEST_TMPDIR
export UNIFYFS_TEST_META=$UNIFYFS_TEST_META
export UNIFYFS_TEST_MOUNT=$UNIFYFS_TEST_MOUNT
export UNIFYFS_TEST_SHARE=$UNIFYFS_TEST_SHARE
export UNIFYFS_TEST_SPILL=$UNIFYFS_TEST_SPILL
export UNIFYFS_TEST_STATE=$UNIFYFS_TEST_STATE
export UNIFYFS_LOG_VERBOSITY=5
EOF
. $(dirname $0)/sharness.d/01-unifyfs-settings.sh
. $(dirname $0)/sharness.d/02-functions.sh
#
# Start the UnifyFS daemon after killing any previously
# running instance.
#
unifyfsd_stop_daemon
unifyfsd_start_daemon
#
# Make sure the unifyfsd process starts.
#
if ! process_is_running unifyfsd 5 ; then
cat $UNIFYFS_LOG_DIR/${UNIFYFS_LOG_FILE}* >&3
echo not ok 1 - unifyfsd started
exit 1
fi
#
# Make sure unifyfsd stays running for 5 more seconds to catch cases where
# it dies during initialization.
#
if process_is_not_running unifyfsd 5; then
cat $UNIFYFS_LOG_DIR/${UNIFYFS_LOG_FILE}* >&3
echo not ok 1 - unifyfsd running
exit 1
fi
#
# Make sure unifyfsd successfully generated client runstate file
#
uid=$(id -u)
if ! test -f $UNIFYFS_RUNSTATE_DIR/unifyfs-runstate.conf.$uid ; then
cat $UNIFYFS_LOG_DIR/${UNIFYFS_LOG_FILE}* >&3
echo not ok 1 - unifyfsd runstate
exit 1
fi
echo ok 1 - unifyfsd running
exit 0