AFS-Monitor
view release on metacpan or search on metacpan
examples/xstat_fs_test view on Meta::CPAN
#!/usr/bin/perl -w
#
# Copyright © 2004-2006
# Alf Wachsmann <alfw@slac.stanford.edu> and
# Elizabeth Cassell <e_a_c@mailsnare.net>
#
# $Revision: 1.8 $ $Date: 2006/07/05 22:25:10 $ $Author: alfw $
#
use blib;
use strict;
use AFS::Monitor qw(xstat_fs_test constant);
use Data::Dumper;
#my @fsname = ("virtue.openafs.org", "andrew.e.kth.se");
my @fsname = ("afs101.slac.stanford.edu");
my @collID = (0, 1, 2, 3);
my @tests; # choose which tests to run
$tests[1] = 0; # test of fsname @fsname and collIDs @collID
$tests[2] = 0; # test of fsname but no collID
$tests[3] = 1; # test of single fsname with collID 0
$tests[4] = 1; # test of single fsname with collID 1
$tests[5] = 0; # test of single fsname with collID 2
$tests[6] = 1; # test of single fsname with collID 3
$tests[7] = 0; # test of single fsname but no single collID
my $all = 0;
my $showdump = 0; # print entire contents of hash for each test
my $formatted = 1; # print formatted like original xstat_fs_test program
print "# Starting now... #\n";
my $result;
if ($all || $tests[1]) {
print "\n******** TEST 1: ********\n";
print "\nxstat_fs_test -fsname ", join(" ", @fsname),
" -collID ", join(" ", @collID), "\n\n";
$result = xstat_fs_test(fsname => \@fsname,
collID => \@collID);
parse_result($result);
}
if ($all || $tests[2]) {
print "\n******** TEST 2: ********\n";
print "\nxstat_fs_test -fsname ", join(" ", @fsname), "\n\n";
$result = xstat_fs_test(fsname => \@fsname);
parse_result($result);
}
if ($all || $tests[3]) {
print "\n******** TEST 3: ********\n";
print "\nxstat_fs_test -fsname ", $fsname[0],
" -collID 0\n\n";
$result = xstat_fs_test(fsname => $fsname[0],
collID => 0);
parse_result($result);
}
if ($all || $tests[4]) {
print "\n******** TEST 4: ********\n";
print "\nxstat_fs_test -fsname ", $fsname[0],
" -collID 1\n\n";
$result = xstat_fs_test(fsname => $fsname[0],
collID => 1);
parse_result($result);
}
if ($all || $tests[5]) {
print "\n******** TEST 5: ********\n";
print "\nxstat_fs_test -fsname ", $fsname[0],
" -collID 2\n\n";
$result = xstat_fs_test(fsname => $fsname[0],
collID => 2);
parse_result($result);
}
if ($all || $tests[6]) {
( run in 2.073 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )