Commit 5e18e801 authored by Matthieu Muffato's avatar Matthieu Muffato Committed by ens-bwalts

Check that LSF detection works as expected

parent 3c9db527
......@@ -21,13 +21,14 @@ use warnings;
use Cwd;
use File::Basename;
use Test::More tests => 22;
use Test::More tests => 24;
use Test::Exception;
use Bio::EnsEMBL::Hive::Utils::Config;
BEGIN {
use_ok( 'Bio::EnsEMBL::Hive::Valley' );
use_ok( 'Bio::EnsEMBL::Hive::Meadow::LSF' );
}
# Need EHIVE_ROOT_DIR to access the default config file
......@@ -223,5 +224,23 @@ lives_and( sub {
} # end local $ENV{'PATH'}
subtest "Cluster detection", sub {
my $lsf_detection_root_dir = $ENV{'EHIVE_ROOT_DIR'}.'/t/04.meadow/lsf_detection';
opendir( my $dir_fh, $lsf_detection_root_dir) || die "Can't opendir $lsf_detection_root_dir: $!";
foreach my $subdir ( readdir($dir_fh) ) {
next unless -d "$lsf_detection_root_dir/$subdir";
local $ENV{'PATH'} = "$lsf_detection_root_dir/$subdir:$ini_path";
if ($subdir =~ /^ok_(.*)$/) {
my $detected_name = Bio::EnsEMBL::Hive::Meadow::LSF::name();
ok($detected_name, "Detects $subdir");
is($detected_name, $1, "Correct cluster name");
} elsif ($subdir =~ /^no/) {
my $detected_name = Bio::EnsEMBL::Hive::Meadow::LSF::name();
ok(!$detected_name, "Does not detect $subdir");
}
}
closedir($dir_fh);
};
done_testing();
#!/bin/sh
exec cat <<EOF
Slurm 20.02.3, Feb 1 2020
Copyright SchedMD LLC, 2010-2017.
My cluster name is g2
My master name is g2-controller
EOF
#!/bin/sh
# LSF EBI "noah" farm
exec cat <<EOF
IBM Spectrum LSF Standard 10.1.0.6, May 25 2018
Copyright International Business Machines Corp. 1992, 2016.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
My cluster name is EBI
My master name is ebi-master-001
EOF
#!/bin/sh
# LSF EBI "yoda" farm
exec cat <<EOF
IBM Spectrum LSF Standard 10.1.0.0, Jul 08 2016
Copyright International Business Machines Corp. 1992, 2016.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
My cluster name is YODA
My master name is hh-yoda-02-02.ebi.ac.uk
EOF
#!/bin/sh
# Old LSF version (7.*)
# http://sunray2.mit.edu/kits/platform-lsf/7.0.6/1/guides/kit_lsf_guide_source/admin/cluster_ops.html
exec cat <<EOF
Platform LSF 7 Update 6 May 6 2009
Copyright 1992-2009 Platform Computing Corporation
My cluster name is cluster1
My master name is hostA
EOF
#!/bin/sh
# Old LSF version (9.*)
# https://www.bsc.es/support/LSF/9.1.2/lsf_admin/index.htm?cluster_info_viewing_lsf.html~main
exec cat <<EOF
IBM Platform LSF Standard 9.1.2, May 5 2013
© Copyright IBM Corporation 1992, 2013.
US Governmant Users Restricted Rights - Use, duplication or disclosure restricted
by GSA ADP Schedule Contract with IBM Corp.
My cluster name is lsf91_bw3
My master name is delpe04.lsf.ibm.com
EOF
#!/bin/sh
# openlava
# https://jensd.be/404/linux/install-and-use-the-openlava-job-scheduler-and-openlava-web-gui-on-centos
exec cat <<EOF
openlava project 2.2, Nov 6 2014
My cluster name is openlava
My master name is node01
EOF
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment