3 my $mtpt = shift || usage();
4 my $mount_count = shift || usage();
5 my $i = shift || usage();
7 my $mcreate = 1; # 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 print "Creating [" . $$."]...\n";
25 $tmp =~ /.*error: (.*)\n/;
26 print "Create done [$$] $path: $!\n";
28 print "Create done [$$] $path: Success\n";
31 print "Opening [" . $$."]...\n";
32 open(FH, ">$path") || die "open($PATH): $!";
33 print "Open done [$$] $path: Success\n";
40 if ($mount_count > 0) {
41 $which = int(rand() * $mount_count) + 1;
43 $d = int(rand() * $files);
44 do_open("$mtpt$which/$d");
46 if ($mount_count > 0) {
47 $which = int(rand() * $mount_count) + 1;
49 $d = int(rand() * $files);
50 $path = "$mtpt$which/$d";
51 print "Unlink start [" . $$."]...\n";
53 print "Unlink done [$$] $path: Success\n";
55 print "Unlink done [$$] $path: $!\n";