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 */
advice = malloc(sizeof(struct llapi_lu_ladvise)*count);
- for (i = 0; i < 5000; i++) {
+ for (i = 0; i < 500; i++) {
/* The 'UL' designators are required to avoid undefined
* behavior which GCC turns in to an infinite loop */
__u64 start = i * 1024UL * 1024UL * 10UL;
/* We have to map our expected return in to the range of valid return
* codes, 0-255. */
- expected_lock_count = expected_lock_count/1000;
+ expected_lock_count = expected_lock_count/100;
return expected_lock_count;
}
{
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);