File: 01-clusters_get.t

package info (click to toggle)
slurm-wlm 20.11.7%2Breally20.11.4-2%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 48,216 kB
  • sloc: ansic: 441,290; exp: 88,649; sh: 8,457; javascript: 6,528; perl: 4,586; makefile: 4,459; python: 882
file content (39 lines) | stat: -rwxr-xr-x 1,330 bytes parent folder | download | duplicates (9)
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
#!/usr/bin/perl -T
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl Slurmdb.t'
use strict;
use warnings;

#########################

use Test::More tests => 3;
BEGIN { use_ok('Slurmdb') };

#########################

# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.

my $db_conn = Slurmdb::connection_get();

my %hv = ();

my $clusters = Slurmdb::clusters_get($db_conn, \%hv);
ok( $clusters != 0, 'clusters_get' );

for (my $i = 0; $i < @$clusters; $i++) {

#     print "accounting_list $clusters->[$i]{'accounting_list'}\n";
      print "classification $clusters->[$i]{'classification'}\n";
      print "control_host   $clusters->[$i]{'control_host'}\n";
      print "control_port   $clusters->[$i]{'control_port'}\n";
      print "cpu_count      $clusters->[$i]{'cpu_count'}\n";
      print "name           $clusters->[$i]{'name'}\n";
      print "nodes          $clusters->[$i]{'nodes'}\n"
	  if exists $clusters->[$i]{'nodes'};
#     print "root_assoc     $clusters->[$i]{'root_assoc'}\n";
      print "rpc_version    $clusters->[$i]{'rpc_version'}\n\n";
}

my $rc = Slurmdb::connection_close(\$db_conn);
ok( $rc == 0, 'connection_close' );