3 my $mtpt = shift || usage();
4 my $mount_count = shift || usage();
5 my $i = shift || usage();
7 my $mcreate = 0; # should we use mcreate or open?
10 print "Usage: $0 <mount point prefix> <mount count> <iterations>\n";
11 print "example: $0 /mnt/lustre 2 50\n";
12 print " will test in /mnt/lustre1 and /mnt/lustre2\n";
13 print " $0 /mnt/lustre -1 50\n";
14 print " will test in /mnt/lustre only\n";
22 my $tmp = `./mcreate $path`;
24 $tmp =~ /.*error: (.*)\n/;
25 print "Created $path: $1\n";
27 print "Created $path: Success\n";
30 open(FH, ">$path") || die "open($PATH): $!";
31 print "Opened $path: Success\n";
38 if ($mount_count > 0) {
39 $which = int(rand() * $mount_count) + 1;
41 $d = int(rand() * $files);
42 do_open("$mtpt$which/$d");
44 if ($mount_count > 0) {
45 $which = int(rand() * $mount_count) + 1;
47 $d = int(rand() * $files);
48 $path = "$mtpt$which/$d";
50 print "Unlinked $path: Success\n";
52 print "Unlinked $path: $!\n";