rc = testfn(); \
fprintf(stderr, "Finishing test " #testfn " at %lld\n", \
(unsigned long long)time(NULL)); \
- cleanup(); \
} while (0)
/* Name of file/directory. Will be set once and will not change. */
static char mainpath[PATH_MAX];
-static const char *mainfile = "lockahead_test_654";
+static char *mainfile;
static char fsmountdir[PATH_MAX]; /* Lustre mountpoint */
static char *lustre_dir; /* Test directory inside Lustre */
{
int c;
- while ((c = getopt(argc, argv, "d:t:")) != -1) {
+ while ((c = getopt(argc, argv, "d:f:t:")) != -1) {
switch (c) {
+ case 'f':
+ mainfile = optarg;
+ break;
case 'd':
lustre_dir = optarg;
break;
process_args(argc, argv);
if (lustre_dir == NULL)
lustre_dir = "/mnt/lustre";
+ if (mainfile == NULL)
+ mainfile = "lockahead_test_654";
rc = llapi_search_mounts(lustre_dir, 0, fsmountdir, fsname);
if (rc != 0) {
ASSERTF(rc > 0 && rc < sizeof(mainpath), "invalid name for mainpath");
cleanup();
- atexit(cleanup);
-
switch (single_test) {
case 0:
PERFORM(test10);
#test 10 returns only success/failure
i=10
- lockahead_test -d $DIR/$tdir -t $i
+ lockahead_test -d $DIR/$tdir -t $i -f $tfile
rc=$?
if [ $rc -eq 255 ]; then
error "Ladvise test${i} failed, ${rc}"
$LCTL get_param -n ost.OSS.ost.stats)
count=$(echo "$count" | grep ldlm_extent_enqueue | awk '{ print $2 }')
- lockahead_test -d $DIR/$tdir -t $i
+ lockahead_test -d $DIR/$tdir -t $i -f $tfile
rc=$?
if [ $rc -eq 255 ]; then
error "Ladvise test${i} failed, ${rc}"
count=$($LCTL get_param -n \
ldlm.namespaces.$FSNAME-OST0000*osc-f*.lock_unused_count)
- lockahead_test -d $DIR/$tdir -t $i
+ lockahead_test -d $DIR/$tdir -t $i -f $tfile
rc=$?
if [ $rc -eq 255 ]; then
error "Ladvise test ${i} failed, ${rc}"
#test 22 returns only success/failure
i=22
- lockahead_test -d $DIR/$tdir -t $i
+ lockahead_test -d $DIR/$tdir -t $i -f $tfile
rc=$?
if [ $rc -eq 255 ]; then
error "Ladvise test${i} failed, ${rc}"
fi
-
}
run_test 255c "suite of ladvise lockahead tests"