Debian Codegraph @

nfsometerlib/workloads/filebench_fileserver.nfsometer

raw
1 #
2 # RUNDIR - a newly created directory on the nfs share.
3 # will exist only when running COMMAND.
4 #
5 # LOCALDIR - a directory on the local fs meant to serve as storage space for
6 # the fetch stage and setup() call
7 # will exist for setup, fetch stages and when COMMAND is run, but
8 # not durning check().
9 #
10 FB_WORKLOAD=fileserver.f
11 FB_RUNTIME=300
12
13 FB_SOURCE="/usr/share/filebench/workloads/$FB_WORKLOAD"
14 FB_FILE="nfsometer-$FB_WORKLOAD"
15
16 #
17 # the command to run
18 #
19 COMMAND="cd $LOCALDIR && filebench -f $FB_FILE"
20
21 #
22 # command description
23 #
24 DESCRIPTION="A 5 minute run of the fileserver workload from the filebench test suite"
25
26 # workload_check()
27 # - no arguments
28 # - any output to stdout means the check failed
29 # - use need_* functions from workloads.sh
30 workload_check()
31 {
32 need_bin filebench
33 need_file $FB_SOURCE
34 }
35
36 # workload_setup()
37 # - no arguments
38 # - non-zero return indicates a problem
39 workload_setup()
40 {
41 sudo sh -c "echo 0 > /proc/sys/kernel/randomize_va_space"
42
43 cp $FB_SOURCE ./$FB_FILE || return 1
44 echo "set \$dir = $RUNDIR" >> ./$FB_FILE || return 1
45 echo "run $FB_RUNTIME" >> ./$FB_FILE || return 1
46
47 return 0
48 }