-
Notifications
You must be signed in to change notification settings - Fork 0
/
condor_plugin_t.pl
41 lines (26 loc) · 981 Bytes
/
condor_plugin_t.pl
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
#!/usr/bin/perl
use 5.010;
use strict;
use warnings;
use Test::More;
use Data::Dumper;
use File::Slurp;
use Condor::QueueParser;
my @condor_q = read_file( 'input.txt' ) ;
ok (scalar(@condor_q) > 100, 'Dummy input file is here');
my $cparser = Condor::QueueParser->new();
ok($cparser, 'Condor::QueueParser instance ok');
my %schedds_map = $cparser->load_schedds_xml(\@condor_q);
ok (scalar(keys %schedds_map) == 2, "We got 2 schedulers here");
foreach my $schedd (keys %schedds_map) {
ok($schedds_map{$schedd}{'xml'}, "Got an xml for $schedd");
}
%schedds_map = $cparser->convert_to_compatible_xml(\%schedds_map);
%schedds_map = $cparser->xml_to_hrefs(\%schedds_map);
foreach my $schedd (keys %schedds_map) {
ok($schedds_map{$schedd}{'href'}, "Got a perl href for $schedd");
}
foreach my $schedd (keys %schedds_map) {
ok(length($cparser->schedd_json(\%schedds_map, $schedd)) > 2000, "JSON Length is big enough to contain something relevant");
}
done_testing();