summaryrefslogtreecommitdiffstats
path: root/tests/ts-mount-mtablock
Commit message (Collapse)AuthorAgeFilesLines
* tests: add license notices, change from gplv2-only to gplv2-or-laterKarel Zak2007-07-231-0/+15
| | | | | | | The previous "gplv2-only" was copy&past mistake. This re-licensing is correct -- there is not any other contributor to this code. Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: use relative paths when sourcing filesMike Frysinger2007-07-231-2/+2
| | | | | | | | | The "." command will search $PATH before $PWD if the argument specified contains no path qualifiers which can cause problems if you happen to have something in $PATH named the same. The attached patch changes all of the ". <foo>" in the tests subdir. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* tests: pass all arguments to ts_init, add ts_has_option functionKarel Zak2007-06-111-1/+1
| | | | | | | | | This patch: - replaces "$1" with "$*" for ts_init function - add ts_has_option function - removes some tailing white-spaces Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add ts_log and --verbose supportKarel Zak2007-05-181-1/+1
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: code refactoring -- new ts_skip_nonroot functionKarel Zak2007-05-181-4/+1Star
| | | | | | | The patch moves "if $UID != 0" test to a new function. That's better than duplicate the code on many places. Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: enable mtablock test when uid=0 onlyKarel Zak2007-04-031-1/+6
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* mount: fix mtab_lockKarel Zak2007-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * the lock function uses F_SETLK / F_SETLKW as a conditional wait. It's more reliable and better for performance to close the MOUNTED_LOCK file in unlock_mtab(), otherwise concurrent process will be wait by while () { link() } loop instead on fcntl(F_SETLKW). Thanks to Jeff Moyer <moyer@redhat.com> who found the problem two year ago. * when open(MOUNTED_LOCK) failed, we need to try everything again, but the original code didn't zeroize "we_created_lockfile" and the old version in particular case left lock_mtab() without locked /etc/mtab. This is nasty bug. * the original locking code had bad performance due too long sleep (1s), between attempts. Now we're more aggressive and we use 5000ms. The result is that more processes is able to lock mtab in short time slice. Thanks to Peter Rockai <prockai@redhat.com> who found the problem and suggest a first version of the code with usleep. * now we don't count number of attempts anymore, but we count sum of time which we spend in the mtab_lock(). The number of attempts is not important (and it also depends on CPU performance, load, scheduler, ...), the important thing is how long we spend with locking. Now time limit is 30s. Signed-off-by: Karel Zak <kzak@redhat.com>
* tests: add lock_mtab() performance and reliability testKarel Zak2007-03-281-0/+35
The test starts concurrently many processes that use lock_mtab() as lock for access to same file. Signed-off-by: Karel Zak <kzak@redhat.com>