-
Notifications
You must be signed in to change notification settings - Fork 141
/
torque.test
executable file
·59 lines (54 loc) · 1.7 KB
/
torque.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/perl -w
#
# Commandline Options:
#
# -f - Force: run the test in non-interactive mode
#
# -u <username> - User: username to use when submitting jobs to TORQUE
#
use strict;
use warnings;
use Test::Harness;
use Getopt::Std;
print '-' x 21, "\n",
"- TORQUE Test Suite -\n",
'-' x 21, "\n\n";
our ($opt_f, $opt_u) = (undef, undef);
getopts('fu:');
$ENV{'TORQUE_TEST_USER'} = $opt_u
if defined $opt_u;
if (defined $opt_f)
{
# Non-Interactive Mode
print "* Non-Interactive Mode *\n\n";
}
else
{
# Interactive Mode
print "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n"
. "* This test suite attempts to verify that the TORQUE install is *\n"
. "* complete and configured correctly. As part of the test jobs will *\n"
. "* be submitted to TORQUE for execution. One test will attempt to *\n"
. "* start a job on every processor in your cluster. This can take *\n"
. "* some time, depending on the size of your cluster. *\n"
. "* *\n"
. "* This prompt can be bypassed by using the -f commandline flag. *\n"
. "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n";
my $cont = '';
while ($cont !~ /^[YN]$/)
{
print 'Continue [y/N] ';
$cont = uc <stdin>;
chomp $cont;
$cont = 'N' unless length $cont;
}
exit unless 'Y' eq $cont;
}
my $dir = 't/';
opendir DIR, $dir or die "Cannot open test directory: $!";
my @tests = sort
grep { /^$dir\d\d_\w+\.t$/ }
map { s/[\r\n]//g; "$dir$_" }
readdir DIR;
closedir DIR;
runtests(@tests);