summaryrefslogblamecommitdiffstats
path: root/tests/ts-mount-mtablock
blob: 44834dc303464a79b14f16494aca1dbea428ab03 (plain) (tree)


































                                                                                    
#!/bin/bash

. commands.sh
. functions.sh

TS_COMPONENT="mount"
TS_DESC="mtablock"

#
# Be careful with number of processes. Don't forget that there is time limit
# when the mount waits on the mtab lock. If you define too much processes some
# of them will fail with timeout.
#
# Note: the original version (< 2.13) of util-linux is completely useless for
# this test (maximum for this old version is NLOOPS=10 and NPROCESSES=5 (2-way
# 2GHz machine)). It has terrible performance due a bad timeouts implemntation
# in lock_mtab().
#
NLOOPS=10
NPROCESSES=5

ts_init

> $TS_OUTPUT.debug
echo 0 > $TS_OUTPUT
SYNCTIME=$(( $(date +%s) + 10 ))

for id in $(seq 0 $(( $NPROCESSES - 1 ))); do
	$TS_CMD_MTABLOCK $id $SYNCTIME $TS_OUTPUT $NLOOPS >> $TS_OUTPUT.debug 2>&1 &
done

wait

ts_finalize