Accepting request 988732 from home:eeich:branches:network:cluster
- Package the Slurm testsuite for QA purposes. * Fixes for test suite: Keep-logs-of-skipped-test-when-running-test-cases-sequentially.patch Fix-test-21.41.patch Fix-test-38.11.patch Fix-test-32.8.patch Fix-test-3.13.patch Fix-test7.2-to-find-libpmix-under-lib64-as-well.patch * Add documentation: README_Testsuite.md - Allow log in as user 'slurm'. This allows admins to run certain priviledged commands more easily without becoming root. OBS-URL: https://build.opensuse.org/request/show/988732 OBS-URL: https://build.opensuse.org/package/show/network:cluster/slurm?expand=0&rev=207
This commit is contained in:
parent
52adf61c22
commit
7d13a7ba97
65
Fix-test-21.41.patch
Normal file
65
Fix-test-21.41.patch
Normal file
@ -0,0 +1,65 @@
|
||||
From: Egbert Eich <eich@suse.com>
|
||||
Date: Wed Jun 22 14:39:10 2022 +0200
|
||||
Subject: Fix test 21.41
|
||||
Patch-mainline: Not yet
|
||||
Git-repo: https://github.com/SchedMD/slurm
|
||||
Git-commit: 21619ffa15d1d656ee11a477ebb8215a06387fdd
|
||||
References:
|
||||
|
||||
Since expect is not line oriented, the output is not matched line by line.
|
||||
Thus the order in which results are returned by sacctmgr actually matters:
|
||||
If the first test case matches what is returned first, this part will be
|
||||
consumed. If the 2nd test case will then match what is left over, the
|
||||
test will actually succeed.
|
||||
If this is not the case, ie if the first test matches a part that is
|
||||
actually sent later, the earlier parts will actually be forgotten and
|
||||
won't match at all.
|
||||
To make the test resilient to different order of results, the test has
|
||||
been rewritten to only contain a single match line.
|
||||
|
||||
Signed-off-by: Egbert Eich <eich@suse.com>
|
||||
Signed-off-by: Egbert Eich <eich@suse.de>
|
||||
---
|
||||
testsuite/expect/test21.41 | 30 +++++++++++++++---------------
|
||||
1 file changed, 15 insertions(+), 15 deletions(-)
|
||||
diff --git a/testsuite/expect/test21.41 b/testsuite/expect/test21.41
|
||||
index c0961522db..1fd921a48f 100755
|
||||
--- a/testsuite/expect/test21.41
|
||||
+++ b/testsuite/expect/test21.41
|
||||
@@ -372,21 +372,21 @@ expect {
|
||||
-re "There was a problem" {
|
||||
fail "There was a problem with the sacctmgr command"
|
||||
}
|
||||
- -re "$user1.$wckey1.($number)." {
|
||||
- set user1wckey1 $expect_out(1,string)
|
||||
- exp_continue
|
||||
- }
|
||||
- -re "$user2.$wckey1.($number)." {
|
||||
- set user2wckey1 $expect_out(1,string)
|
||||
- exp_continue
|
||||
- }
|
||||
- -re "$user1.$wckey2.($number)." {
|
||||
- set user1wckey2 $expect_out(1,string)
|
||||
- exp_continue
|
||||
- }
|
||||
- -re "$user2.$wckey2.($number)." {
|
||||
- set user2wckey2 $expect_out(1,string)
|
||||
- exp_continue
|
||||
+ -re "($user1|$user2).($wckey1|$wckey2).($number)." {
|
||||
+ if { $expect_out(1,string) eq $user1 } {
|
||||
+ if { $expect_out(2,string) eq $wckey1 } {
|
||||
+ set user1wckey1 $expect_out(3,string)
|
||||
+ } elseif { $expect_out(2,string) eq $wckey2 } {
|
||||
+ set user1wckey2 $expect_out(3,string)
|
||||
+ }
|
||||
+ } elseif { $expect_out(1,string) eq $user2 } {
|
||||
+ if { $expect_out(2,string) eq $wckey1 } {
|
||||
+ set user2wckey1 $expect_out(3,string)
|
||||
+ } elseif { $expect_out(2,string) eq $wckey2 } {
|
||||
+ set user2wckey2 $expect_out(3,string)
|
||||
+ }
|
||||
+ }
|
||||
+ exp_continue
|
||||
}
|
||||
timeout {
|
||||
fail "sacctmgr wckeys not responding"
|
35
Fix-test-3.13.patch
Normal file
35
Fix-test-3.13.patch
Normal file
@ -0,0 +1,35 @@
|
||||
From: Egbert Eich <eich@suse.com>
|
||||
Date: Wed Jun 15 08:40:50 2022 +0200
|
||||
Subject: - Fix test 3.13
|
||||
Patch-mainline: Not yet
|
||||
Git-repo: https://github.com/SchedMD/slurm
|
||||
Git-commit: cc82d21d77ccd4753ed56f80e14cfa13acd3643d
|
||||
References:
|
||||
|
||||
Signed-off-by: Egbert Eich <eich@suse.com>
|
||||
Signed-off-by: Egbert Eich <eich@suse.de>
|
||||
---
|
||||
testsuite/expect/test3.13 | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
diff --git a/testsuite/expect/test3.13 b/testsuite/expect/test3.13
|
||||
index bcce201215..9781ffcff9 100755
|
||||
--- a/testsuite/expect/test3.13
|
||||
+++ b/testsuite/expect/test3.13
|
||||
@@ -109,7 +109,7 @@ log_info "Test 1"
|
||||
set no_jobs 0
|
||||
spawn $scontrol update JobName=$script_name UserID=1 Priority=$new_prio
|
||||
expect {
|
||||
- -re "No jobs with" {
|
||||
+ -re "Invalid UserID" {
|
||||
set no_jobs 1
|
||||
exp_continue
|
||||
}
|
||||
@@ -130,7 +130,7 @@ set no_jobs 0
|
||||
set my_uid [get_my_uid]
|
||||
spawn $scontrol update JobName=$script_name UserID=$my_uid Priority=$new_prio
|
||||
expect {
|
||||
- -re "No jobs with" {
|
||||
+ -re "Invalid UserID" {
|
||||
set no_jobs 1
|
||||
exp_continue
|
||||
}
|
26
Fix-test-32.8.patch
Normal file
26
Fix-test-32.8.patch
Normal file
@ -0,0 +1,26 @@
|
||||
From: Egbert Eich <eich@suse.com>
|
||||
Date: Wed Jun 15 08:41:16 2022 +0200
|
||||
Subject: Fix test 32.8
|
||||
Patch-mainline: Not yet
|
||||
Git-repo: https://github.com/SchedMD/slurm
|
||||
Git-commit: 6641a03b1d1dfcb937617067f50c8069a04ec9b0
|
||||
References:
|
||||
|
||||
Signed-off-by: Egbert Eich <eich@suse.com>
|
||||
Signed-off-by: Egbert Eich <eich@suse.de>
|
||||
---
|
||||
testsuite/expect/test32.8 | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
diff --git a/testsuite/expect/test32.8 b/testsuite/expect/test32.8
|
||||
index 76f65c3ccc..61dba8759b 100755
|
||||
--- a/testsuite/expect/test32.8
|
||||
+++ b/testsuite/expect/test32.8
|
||||
@@ -86,7 +86,7 @@ if {$job_id == 0} {
|
||||
}
|
||||
|
||||
wait_for_job -fail $job_id "DONE"
|
||||
-wai_for_file -fail $file_out
|
||||
+wait_for_file -fail $file_out
|
||||
|
||||
set number_1 -1
|
||||
set number_2 -1
|
30
Fix-test-38.11.patch
Normal file
30
Fix-test-38.11.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From: Egbert Eich <eich@suse.com>
|
||||
Date: Wed Jun 15 08:41:45 2022 +0200
|
||||
Subject: Fix test 38.11
|
||||
Patch-mainline: Not yet
|
||||
Git-repo: https://github.com/SchedMD/slurm
|
||||
Git-commit: 235768790cb2e9cf011e6d08116a468ebec71582
|
||||
References:
|
||||
|
||||
Signed-off-by: Egbert Eich <eich@suse.com>
|
||||
Signed-off-by: Egbert Eich <eich@suse.de>
|
||||
---
|
||||
testsuite/expect/test38.11 | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
diff --git a/testsuite/expect/test38.11 b/testsuite/expect/test38.11
|
||||
index d2c07d60c7..bf5d10ecc9 100755
|
||||
--- a/testsuite/expect/test38.11
|
||||
+++ b/testsuite/expect/test38.11
|
||||
@@ -99,9 +99,9 @@ make_bash_script $script "
|
||||
$srun -N1 -n1 --het-group=0 mkdir -p $tmp_dir/$node1
|
||||
$srun -N1 -n1 --het-group=1 mkdir -p $tmp_dir/$node2
|
||||
|
||||
-$sbcast -f -j$het_job_id $srun $tmp_dir/file
|
||||
-$sbcast -f -j${het_job_id}+0 $srun $tmp_dir/$node1/file_comp0
|
||||
-$sbcast -f -j${het_job_id}+1 $srun $tmp_dir/$node2/file_comp1
|
||||
+$sbcast -f -j\$SLURM_JOBID $srun $tmp_dir/file
|
||||
+$sbcast -f -j\$SLURM_JOBID $srun $tmp_dir/$node1/file_comp0
|
||||
+$sbcast -f -j\$((SLURM_JOBID+1)) $srun $tmp_dir/$node2/file_comp1
|
||||
|
||||
echo -n \"\nChecking node 1: \"
|
||||
$srun -Q -N1 -n1 --het-group=1 ls $tmp_dir/file
|
26
Fix-test7.2-to-find-libpmix-under-lib64-as-well.patch
Normal file
26
Fix-test7.2-to-find-libpmix-under-lib64-as-well.patch
Normal file
@ -0,0 +1,26 @@
|
||||
From: Egbert Eich <eich@suse.com>
|
||||
Date: Sat Jul 2 11:25:11 2022 +0200
|
||||
Subject: Fix test7.2 to find libpmix under lib64 as well
|
||||
Patch-mainline: Not yet
|
||||
Git-repo: https://github.com/SchedMD/slurm
|
||||
Git-commit: 4771b96995f90a64a828aac16a10bd56db61a711
|
||||
References:
|
||||
|
||||
Signed-off-by: Egbert Eich <eich@suse.com>
|
||||
Signed-off-by: Egbert Eich <eich@suse.de>
|
||||
---
|
||||
testsuite/expect/test7.2 | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
diff --git a/testsuite/expect/test7.2 b/testsuite/expect/test7.2
|
||||
index 9d1f1a2dee..f63ecd643e 100755
|
||||
--- a/testsuite/expect/test7.2
|
||||
+++ b/testsuite/expect/test7.2
|
||||
@@ -42,7 +42,7 @@ if {[get_config_param "SwitchType"] eq "switch/cray"} {
|
||||
skip "This test is incompatible with Cray systems"
|
||||
}
|
||||
|
||||
-if { [file exists ${slurm_dir}/lib/libpmi.so] == 0 } {
|
||||
+if { ![file exists ${slurm_dir}/lib/libpmi.so] && ![file exists ${slurm_dir}/lib64/libpmi.so]} {
|
||||
skip "PMI library not compiled, can't perform pmi testing"
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
From: Egbert Eich <eich@suse.com>
|
||||
Date: Wed Jun 22 16:32:35 2022 +0200
|
||||
Subject: Keep logs of skipped test when running test cases sequentially.
|
||||
Patch-mainline: Not yet
|
||||
Git-repo: https://github.com/SchedMD/slurm
|
||||
Git-commit: 457a53ca97b50530bb2fafda72d465507c434960
|
||||
References:
|
||||
|
||||
Signed-off-by: Egbert Eich <eich@suse.com>
|
||||
Signed-off-by: Egbert Eich <eich@suse.de>
|
||||
---
|
||||
testsuite/expect/regression.py | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
diff --git a/testsuite/expect/regression.py b/testsuite/expect/regression.py
|
||||
index bcccaadbf5..b39af0c4e2 100755
|
||||
--- a/testsuite/expect/regression.py
|
||||
+++ b/testsuite/expect/regression.py
|
||||
@@ -199,7 +199,8 @@ def main(argv=None):
|
||||
sys.stdout.write('SKIPPED\n')
|
||||
if not options.keep_logs:
|
||||
try:
|
||||
- os.remove(testlog_name)
|
||||
+# os.remove(testlog_name)
|
||||
+ os.rename(testlog_name, testlog_name+'.skipped')
|
||||
except IOError as e:
|
||||
print('ERROR failed to close %s %s' % (testlog_name, e),
|
||||
file=sys.stederr);
|
128
README_Testsuite.md
Normal file
128
README_Testsuite.md
Normal file
@ -0,0 +1,128 @@
|
||||
# Running the Slurm 'expect' Testsuite
|
||||
|
||||
The ```slurm-testsuite``` package contains the Slurm expect test suite.
|
||||
This package is meant to be installed on a test setup only, it should
|
||||
NEVER BE INSTALLED ON A REGULAR OR EVEN PRODUCTION SYSTEM.
|
||||
SUSE uses this package to determine regressions and for quality assurance.
|
||||
The results are monitored and evaluated regularly in house.
|
||||
A specific configuration is required to run this test suite, this document
|
||||
attempts to describe the steps needed.
|
||||
A small subset of tests is currently failing. The reasons are yet to be
|
||||
determined.
|
||||
|
||||
Please do not file bug reports based on test results!
|
||||
|
||||
The testsuite is preconfigured to work with 4 nodes: ```node01```,...,
|
||||
```node04```. ```node01``` serves as control and compute node. The slurm
|
||||
configuration, home, and the test suite are shared across the nodes.
|
||||
The test suite should be mounted under /home (to make ```sgather``` work
|
||||
correctly).
|
||||
|
||||
For tests involving MPI this test suite currently uses OpenMPI version 4.
|
||||
|
||||
## Install and set up the Base System
|
||||
|
||||
1. Prepare image with a minimal minimal text mode installation.
|
||||
2. Add NFS kernel server support:
|
||||
```
|
||||
# zypper install nfs-kernel-server
|
||||
```
|
||||
3. Install, enable and start sshd and make sure root is able to log in
|
||||
without password across all nodes.
|
||||
```
|
||||
# zypper install openssh-server openssh-clients
|
||||
# systemctl enable --now sshd
|
||||
# ssh-keygen -t rsa -f .ssh/id_rsa -N
|
||||
# cat .ssh/id_rsa.pub >> .ssh/authorized_keys
|
||||
```
|
||||
4. Create a test user 'auser' allow ssh from/to root:
|
||||
```
|
||||
# useradd -m auser
|
||||
# cp -r /root/.ssh /home/auser
|
||||
```
|
||||
5. Set up a persistent network if to obtain the network address and
|
||||
hostname thru DHCP:
|
||||
```
|
||||
# echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", '\
|
||||
'ATTR{address}=="?*", ATTR{dev_id}=="0x0", ATTR{type}=="1",'\
|
||||
' KERNEL=="?*", NAME="lan0"
|
||||
# cat > root/etc/sysconfig/network/ifcfg-lan0 <<EOF
|
||||
BOOTPROTO='dhcp'
|
||||
MTU=''
|
||||
REMOTE_IPADDR=''
|
||||
STARTMODE='onboot'
|
||||
EOF
|
||||
# sed -i 's/DHCLIENT_SET_HOSTNAME="no"/DHCLIENT_SET_HOSTNAME="yes"/' \
|
||||
/etc/sysconfig/network/dhcp
|
||||
```
|
||||
|
||||
## Install and set up the Slurm specific Environment
|
||||
|
||||
1. Install package slurm-testsuite.
|
||||
2. Set up, enable mariadb, add slurm accounting database:
|
||||
```
|
||||
# sed -i -e "/^bind-address/s@\(^.*$\)@# \1@" /etc/my.cnf
|
||||
# systemctl start maridb
|
||||
# mysql -uroot -e "create user 'slurm'@'node01' identified by 'linux';"
|
||||
# mysql -uroot -e "create database slurm_acct_db;"
|
||||
# mysql -uroot -e "grant all on slurm_acct_db.* TO 'slurm'@'node01';"
|
||||
```
|
||||
3. Set up shared home, testsuite and slurm config directories, enable
|
||||
NFS server:
|
||||
```
|
||||
# mkdir -p /srv/home
|
||||
# mv /home/auser /srv/home
|
||||
# mkdir /home/slurm-testsuite
|
||||
# chown slurm:slurm /home/slurm-testsuite
|
||||
# cat >> /etc/exports <<EOF
|
||||
/srv/home *(rw,no_subtree_check,sync,no_root_squash)
|
||||
/srv/slurm-testsuite *(rw,no_subtree_check,sync,no_root_squash)
|
||||
/srv/slurm-testsuite/shared *(rw,no_subtree_check,sync,no_root_squash)
|
||||
/srv/slurm-testsuite/config *(rw,no_subtree_check,sync,no_root_squash)
|
||||
EOF
|
||||
# cat >> /etc/fstab <<EOF
|
||||
node01:/srv/home /home nfs sync,hard,rw 0 0
|
||||
node01:/srv/slurm-testsuite/config /etc/slurm nfs sync,hard,rw 0 0
|
||||
node01:/srv/slurm-testsuite/shared /var/lib/slurm/shared nfs sync,hard,rw 0 0
|
||||
node01:/srv/slurm-testsuite /home/slurm-testsuite nfs sync,hard,rw 0 0
|
||||
# systemctl enable nfs-server
|
||||
|
||||
```
|
||||
# Clone Nodes and bring up Test System
|
||||
|
||||
1. Now halt the system and duplicate it 3 times.
|
||||
|
||||
2. Set up the dhcp server and make sure the nodes receive the hostnames
|
||||
``node01```,..., ```node04```.
|
||||
|
||||
3. Enable munge and slurmd:
|
||||
```
|
||||
# systemctl enable munge
|
||||
# systemctl enable slurmd
|
||||
```
|
||||
|
||||
4. Boot all 4 nodes (start with ```node01```).
|
||||
5. On ```node01```, log in as ```root``` and run ```setup-testsuite.sh```:
|
||||
```
|
||||
# ./setup-testsuite.sh
|
||||
```
|
||||
6. Load the environment and run the tests as user 'slurm':
|
||||
```
|
||||
# sudo -s -u slurm
|
||||
$ module load gnu openmpi
|
||||
$ cd /home/test/home/slurm-testsuite/testsuite/expect
|
||||
$ ./regression.py
|
||||
```
|
||||
|
||||
There are a number of tests which require a different configuration
|
||||
and thus will be skipped.
|
||||
For a number of these, the alternatives are documented in the config
|
||||
file shipped with this package.
|
||||
A small number of tests fail for yet unknown reasons.
|
||||
Also, when run sequentially, some tests may fail intermittendly as the
|
||||
test suite is not race free. Often the reason for this is that tests
|
||||
try to determine the availability of resources and may behave incorrectly
|
||||
if an insufficient number is marked 'idle'. This problem may be less
|
||||
pronounced when more resources (nodes) are available. Usually, these
|
||||
issues will not show when tests are run manually. Therefore, it is important
|
||||
the re-check failed tests manually.
|
@ -2,32 +2,49 @@ addFilter(".*obsolete-not-provided slurm-sched-wiki.*")
|
||||
addFilter(".*obsolete-not-provided slurmdb-direct.*")
|
||||
|
||||
# libslurm provides an ABI and a wire protocol. The wire protocol may change
|
||||
# with any SLURM version in an incompatible way. Therefore, multiple versions
|
||||
# of libslurm should not be installed on the same system.
|
||||
# Thus, libraries depending on libslurm need to match the installed SLURM
|
||||
# with any Slurm version in an incompatible way. The wire protocol is
|
||||
# implemented in the library libslurm.
|
||||
# Therefore, multiple versions of libslurm should not be installed on the
|
||||
# same system.
|
||||
# Thus, libraries depending on libslurm need to match the installed Slurm
|
||||
# version - independent of their major versions.
|
||||
# To host multiple SLURM versions in the same repository we add the version
|
||||
# To host multiple Slurm versions in the same repository we add the version
|
||||
# string to package names for none-base versions - even to library packages.
|
||||
# This mainly applies to upgrade packages for Leap and SLE in the maintenance
|
||||
# channel.
|
||||
addFilter("libnss_slurm\d_\d{2}_\d{2}.*: .* shlib-policy-name-error.*")
|
||||
addFilter("libnss_slurm\d_\d{2}_\d{2}.*: E: shlib-policy-name-error.*")
|
||||
|
||||
# slurms uses shared libraries for its plugins, so these plugins can have
|
||||
# no dependency information
|
||||
|
||||
addFilter(".*shared-library-without-dependency-information /usr/lib64/slurm/.*so")
|
||||
# Our logrotate file names are derived from the service name.
|
||||
addFilter(".* E: incoherent-logrotate-file /etc/logrotate.d/slurm.*\.conf")
|
||||
|
||||
# Testsuite is not meant to be installed on a running system.
|
||||
# ? Why should we package the log dir?
|
||||
addFilter(".*: E: logrotate-log-dir-not-packaged /var/log")
|
||||
# these packages contain %service_del_postun_without_restart -
|
||||
# which we define if it is not defined. This needs to be kept
|
||||
# as long as we need to support the HPC module for SLE-12.
|
||||
addFilter("slurm(|-node|-slurmdbd)\..*: systemd-service-without-service_del_postun .*")
|
||||
|
||||
# Testsuite is not meant to be installed on a user system.
|
||||
# The idea is to place the test suite into a package mostly unaltered
|
||||
# to place it to a test rig without requiring to install the full Slurm
|
||||
# sources.
|
||||
# Test setup requires /opt to be shared between nodes in a test system
|
||||
addFilter("slurm-testsuite.*: E: devel-file-in-non-devel-package .*")
|
||||
# For the same reason do not bother with /usr/bin/env expect
|
||||
addFilter("slurm-testsuite.*: E: env-script-interpreter .*")
|
||||
# Likewise, the test suite requires all of Slurm to be installed - even devel
|
||||
addFilter("slurm-testsuite.*: E: devel-dependency slurm-devel.*")
|
||||
# ... and in the same vein
|
||||
addFilter("slurm-testsuite.*: E: filelist-forbidden-opt /opt/slurmtest")
|
||||
addFilter("slurm-testsuite.*: E: non-executable-script /opt/slurmtest/testsuite/expect/.* .* /usr/bin/env (expect)|(bash)")
|
||||
addFilter("slurm-testsuite.*: E: spurious-executable-perm /opt/slurmtest/testsuite/expect/*.c)
|
||||
addFilter("slurm(|_.*)-testsuite.*: E: filelist-forbidden-opt /opt/slurmtest")
|
||||
# This is by intention - the test suite requires a test suite specific
|
||||
# systemd unit file.
|
||||
addFilter("slurm(|_.*)-testsuite.*: E: filelist-forbidden-systemd-userdirs")
|
||||
# It is not a devel package but a test suite. The test suite is designed to
|
||||
# build test binaries when it is executed.
|
||||
addFilter("slurm(|_.*)-testsuite.*: E: devel-file-in-non-devel-package")
|
||||
# We want to give root a script to set up the test system
|
||||
addFilter("slurm(|_.*)-testsuite.*: E: filelist-forbidden-fhs23 /root")
|
||||
# Testsuite needs this as it builds test binaries.
|
||||
addFilter("slurm(|_.*)-testsuite.*: devel-dependency libnuma-devel")
|
||||
addFilter("slurm(|_.*)-testsuite.*: E: explicit-lib-dependency libnuma-devel")
|
||||
# To reduce the amount of preparation, the test suite supplies all required
|
||||
# settings.
|
||||
addFilter("slurm(|_.*)-testsuite.*: sudoers-file-unauthorized .*")
|
||||
|
@ -8,12 +8,23 @@ Mon Jun 20 09:23:17 UTC 2022 - Christian Goll <cgoll@suse.com>
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 8 13:15:24 UTC 2022 - Egbert Eich <eich@suse.com>
|
||||
|
||||
- Package the Slrum testsuite for QA purposes.
|
||||
- Package the Slurm testsuite for QA purposes.
|
||||
NOTE: This package is not meant to be used for testing by the
|
||||
user but rather for testing by the maintainers to ensure the
|
||||
package is working properly.
|
||||
DO NOT report test suite failures unless you are able to confirm
|
||||
that the failure is really a bug.
|
||||
* Fixes for test suite:
|
||||
Keep-logs-of-skipped-test-when-running-test-cases-sequentially.patch
|
||||
Fix-test-21.41.patch
|
||||
Fix-test-38.11.patch
|
||||
Fix-test-32.8.patch
|
||||
Fix-test-3.13.patch
|
||||
Fix-test7.2-to-find-libpmix-under-lib64-as-well.patch
|
||||
* Add documentation:
|
||||
README_Testsuite.md
|
||||
- Allow log in as user 'slurm'. This allows admins to run certain
|
||||
priviledged commands more easily without becoming root.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 31 12:56:05 UTC 2022 - Christian Goll <cgoll@suse.com>
|
||||
|
162
slurm.spec
162
slurm.spec
@ -51,7 +51,7 @@ ExclusiveArch: do_not_build
|
||||
%if 0%{?sle_version} == 150200
|
||||
%define base_ver 2002
|
||||
%endif
|
||||
%if 0%{?sle_version} == 150300
|
||||
%if 0%{?sle_version} == 150300 || 0%{?sle_version} == 150400
|
||||
%define base_ver 2011
|
||||
%endif
|
||||
|
||||
@ -89,6 +89,7 @@ ExclusiveArch: do_not_build
|
||||
%define have_http_parser 1
|
||||
%endif
|
||||
|
||||
# it seems as disabling slurmrestd has no effect on 22.05
|
||||
%if 0%{?have_http_parser} && 0%{?have_json_c}
|
||||
%define build_slurmrestd 1
|
||||
%endif
|
||||
@ -126,7 +127,7 @@ ExclusiveArch: do_not_build
|
||||
%define slurm_g root
|
||||
%endif
|
||||
%define slurm_uid 120
|
||||
%define slurmdir %{_sysconfdir}/slurm
|
||||
%define slurmdir %{_rundir}/slurm
|
||||
%define slurmdescr "SLURM workload manager"
|
||||
|
||||
%define libslurm libslurm%{so_version}
|
||||
@ -135,6 +136,9 @@ ExclusiveArch: do_not_build
|
||||
%if !0%{?_pam_moduledir:1}
|
||||
%define _pam_moduledir /%_lib
|
||||
%endif
|
||||
%if !0%{?%_pam_secconfdir:1}
|
||||
%define _pam_secconfdir %_sysconfdir/security
|
||||
%endif
|
||||
|
||||
Name: %{pname}%{?upgrade:%{_ver}}
|
||||
Version: %{ver}
|
||||
@ -148,8 +152,17 @@ Source1: slurm-rpmlintrc
|
||||
Source10: https://raw.githubusercontent.com/openSUSE/hpc/10c105e/files/slurm/slurmd.xml
|
||||
Source11: https://raw.githubusercontent.com/openSUSE/hpc/10c105e/files/slurm/slurmctld.xml
|
||||
Source12: https://raw.githubusercontent.com/openSUSE/hpc/10c105e/files/slurm/slurmdbd.xml
|
||||
# create: tar --owner=nobody --group=nogroup -cvzf test_setup.tar.gz test_setup
|
||||
Source20: test_setup.tar.gz
|
||||
Source21: README_Testsuite.md
|
||||
Patch0: Remove-rpath-from-build.patch
|
||||
Patch2: pam_slurm-Initialize-arrays-and-pass-sizes.patch
|
||||
Patch10: Fix-test-21.41.patch
|
||||
Patch11: Fix-test-38.11.patch
|
||||
Patch12: Fix-test-32.8.patch
|
||||
Patch13: Fix-test-3.13.patch
|
||||
Patch14: Keep-logs-of-skipped-test-when-running-test-cases-sequentially.patch
|
||||
Patch15: Fix-test7.2-to-find-libpmix-under-lib64-as-well.patch
|
||||
|
||||
%{?upgrade:Provides: %{pname} = %{version}}
|
||||
%{?upgrade:Conflicts: %{pname}}
|
||||
@ -231,12 +244,14 @@ management, scheduling and accounting modules.
|
||||
%package doc
|
||||
Summary: Documentation for SLURM
|
||||
Group: Documentation/HTML
|
||||
BuildArch: noarch
|
||||
%{?upgrade:Provides: %{pname}-doc = %{version}}
|
||||
%{?upgrade:Conflicts: %{pname}-doc}
|
||||
|
||||
%package webdoc
|
||||
Summary: Set up SLURM Documentation Server
|
||||
Group: Productivity/Clustering/Computing
|
||||
BuildArch: noarch
|
||||
%if 0%{?have_apache_rpm_macros}
|
||||
BuildRequires: apache-rpm-macros
|
||||
%else
|
||||
@ -502,6 +517,7 @@ Recommends: (%{name}-munge = %version if munge)
|
||||
%else
|
||||
Recommends: %{name}-munge = %version
|
||||
%endif
|
||||
%{?with_pmix:Recommends: pmix-devel}
|
||||
%if 0%{?with_systemd}
|
||||
%{?systemd_ordering}
|
||||
%else
|
||||
@ -517,6 +533,7 @@ This package contains just the minmal code to run a compute node.
|
||||
Summary: Config files and directories for slurm services
|
||||
Group: Productivity/Clustering/Computing
|
||||
Requires: logrotate
|
||||
BuildArch: noarch
|
||||
%if 0%{?suse_version} <= 1140
|
||||
Requires(pre): pwdutils
|
||||
%else
|
||||
@ -535,6 +552,7 @@ for the slurm daemons.
|
||||
%package config-man
|
||||
Summary: Config files and directories for slurm services
|
||||
Group: Documentation/Man
|
||||
BuildArch: noarch
|
||||
%{?upgrade:Provides: %{pname}-config-man = %{version}}
|
||||
%{?upgrade:Conflicts: %{pname}-config-man}
|
||||
|
||||
@ -576,14 +594,28 @@ Requires: %{name}-sjstat = %version
|
||||
Requires: %{name}-slurmdbd = %version
|
||||
Requires: %{name}-sql = %version
|
||||
Requires: %{name}-torque = %version
|
||||
Requires: mariadb
|
||||
%{?with_pmix:Requires: pmix-devel}
|
||||
Requires: bzip2
|
||||
Requires: expect
|
||||
Requires: gcc-c++
|
||||
Requires: libnuma-devel
|
||||
Requires: openmpi4-gnu-hpc-devel
|
||||
Requires: pdsh
|
||||
Requires: perl-%{name} = %version
|
||||
Requires: sudo
|
||||
Requires: tar
|
||||
BuildRequires: sudo
|
||||
|
||||
%description testsuite
|
||||
The Slurm sources provide a number of regression tests implemented as 'expect'
|
||||
scripts.
|
||||
NOTE: Not all of the tests are expected to pass, some require a specific setup.
|
||||
This test package is meant for internal purposes.
|
||||
NOTE: THIS PACKAGE IS FOR TESTING PURPOSES ONLY. IT REQUIRES A
|
||||
DEDICATED TESTING ENVIRONMENT.
|
||||
|
||||
DO NOT INSTALL ON A PRODUCTION SYSTEM!
|
||||
|
||||
Slurm provides a test set implemented as 'expect' scripts.
|
||||
Not all of the tests are expected to pass, some require a modified
|
||||
configuration. This test package is meant for internal purposes.
|
||||
Do not run test suite and file bug reports for each failed test!
|
||||
|
||||
%prep
|
||||
@ -592,6 +624,13 @@ Do not run test suite and file bug reports for each failed test!
|
||||
#%%patch1 -p1
|
||||
%patch2 -p1
|
||||
#%%patch3 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
|
||||
%if 0%{?python_ver} < 3
|
||||
# Workaround for wrongly flagged python3 to keep SLE-11-SP4 building
|
||||
mkdir -p mybin; ln -s /usr/bin/python2 mybin/python3
|
||||
@ -609,9 +648,9 @@ autoreconf
|
||||
--without-datawarp \
|
||||
--with-shared-libslurm \
|
||||
--with-pam_dir=%_pam_moduledir \
|
||||
%{?with_pmix:--with-pmix=/usr/} \
|
||||
%if 0%{?build_slurmrestd}
|
||||
--enable-slurmrestd \
|
||||
%{?with_pmix:--with-pmix=%_prefix/} \
|
||||
%if 0%{!?build_slurmrestd:1}
|
||||
--disable-slurmrestd \
|
||||
%endif
|
||||
--with-yaml \
|
||||
%{!?have_netloc:--without-netloc} \
|
||||
@ -650,7 +689,6 @@ mkdir -p %{buildroot}%{_localstatedir}/spool/slurm
|
||||
install -D -m644 etc/cgroup.conf.example %{buildroot}/%{_sysconfdir}/%{pname}/cgroup.conf
|
||||
install -D -m644 etc/slurm.conf.example %{buildroot}/%{_sysconfdir}/%{pname}/slurm.conf.example
|
||||
install -D -m600 etc/slurmdbd.conf.example %{buildroot}/%{_sysconfdir}/%{pname}/slurmdbd.conf
|
||||
install -D -m600 etc/slurmdbd.conf.example %{buildroot}%{_sysconfdir}/%{pname}/slurmdbd.conf.example
|
||||
install -D -m755 contribs/sjstat %{buildroot}%{_bindir}/sjstat
|
||||
install -D -m755 contribs/sgather/sgather %{buildroot}%{_bindir}/sgather
|
||||
%if 0%{?have_firewalld}
|
||||
@ -707,7 +745,8 @@ sed -i -e "s@PIDFile=.*@PIDFile=%{_localstatedir}/run/slurm/slurmdbd.pid@" \
|
||||
-e 's@After=\(.*\)@After=\1 mariadb.service@' \
|
||||
%{buildroot}/%{_unitdir}/slurmdbd.service
|
||||
%if 0%{?have_sysuser}
|
||||
echo "u %slurm_u %{slurm_uid} \"%slurmdescr\" %{slurmdir}\n" > system-user-%{pname}.conf
|
||||
[ -e /usr/bin/bash ] && BASH_BIN=/usr/bin/bash || BASH_BIN=/bin/bash
|
||||
echo "u %slurm_u %{slurm_uid} \"%slurmdescr\" %{slurmdir} ${BASH_BIN}" > system-user-%{pname}.conf
|
||||
%sysusers_generate_pre system-user-%{pname}.conf %{pname} system-user-%{pname}.conf
|
||||
install -D -m 644 system-user-%{pname}.conf %{buildroot}%{_sysusersdir}/system-user-%{pname}.conf
|
||||
%endif
|
||||
@ -799,32 +838,78 @@ EOF
|
||||
# bug in testsuite
|
||||
ln -sf /usr/lib64/libslurm.so %{buildroot}/usr/lib64/slurm/libslurm.so
|
||||
|
||||
mkdir -p %{buildroot}/opt/slurmtest
|
||||
pwd
|
||||
mkdir -p %{buildroot}/srv/slurm-testsuite
|
||||
cd testsuite/expect
|
||||
filelist="$(grep '#include' *.c | cut -d: -f2 | grep src | sed -e 's/[^\"]*\"\([^\"]*\)\"/\1/' | sort | uniq)"
|
||||
filelist="$(grep '#include' *.c | sed -ne 's/.*:#include *\"\([^\"]*\)\".*/\1/p' | sort | uniq)"
|
||||
while true; do
|
||||
oldfilelist=$filelist; tlist=""
|
||||
for i in $filelist; do
|
||||
nlist=" $(grep '#include' ../../$i | sed -ne 's/#include *\"\([^\"]*\)\".*/\1/p')"
|
||||
tlist+=" $(for j in $nlist; do [ -e ../../$j ] && echo $j || true; done)"
|
||||
done
|
||||
filelist="$(for i in $filelist $tlist; do echo $i; done | sort | uniq)"
|
||||
[ "$filelist" = "$oldfilelist" ] && break
|
||||
done
|
||||
filelist+=" $(grep -r "build_dir.*\.[oa]" | sed -e 's@.*[^ ]*{build_dir}/\([^\]*\.o\).*@\1@' | sort | uniq)"
|
||||
cd -
|
||||
pwd
|
||||
newlist=""
|
||||
for i in $filelist; do
|
||||
dir=$(dirname $i)
|
||||
[ -d %{buildroot}/opt/slurmtest/$dir ] || mkdir -p %{buildroot}/opt/slurmtest/$dir
|
||||
cp -a $i %{buildroot}/opt/slurmtest/$dir/
|
||||
[ -d %{buildroot}/srv/slurm-testsuite/$dir ] || mkdir -p %{buildroot}/srv/slurm-testsuite/$dir
|
||||
cp -a $i %{buildroot}/srv/slurm-testsuite/$dir/
|
||||
done
|
||||
mkdir -p %{buildroot}/opt/slurmtest/testsuite/expect
|
||||
cp -ax testsuite/expect/ %{buildroot}/opt/slurmtest/testsuite/
|
||||
cat > %{buildroot}/opt/slurmtest/testsuite/expect/globals.local <<EOF
|
||||
set slurm_dir "/usr/local"
|
||||
set build_dir "/opt/slurmtest/testsuite"
|
||||
set src_dir "/opt/slurmtest/testsuite"
|
||||
mkdir -p %{buildroot}/srv/slurm-testsuite/testsuite/expect
|
||||
cp -ax testsuite/expect %{buildroot}/srv/slurm-testsuite/testsuite/
|
||||
cat > %{buildroot}/srv/slurm-testsuite/testsuite/expect/globals.local <<EOF
|
||||
set slurm_dir "/usr"
|
||||
set build_dir "/srv/slurm-testsuite"
|
||||
set src_dir "/srv/slurm-testsuite"
|
||||
set mpicc [ exec which mpicc ]
|
||||
set testsuite_user "auser"
|
||||
#set testsuite_cleanup_on_failure false
|
||||
EOF
|
||||
mkdir -p %{buildroot}/srv/slurm-testsuite/shared
|
||||
mkdir -p %{buildroot}%_localstatedir/lib/slurm/shared
|
||||
cd %{buildroot}/srv/slurm-testsuite
|
||||
tar --group=%slurm_g --owner=%slurm_u -cjf /tmp/slurmtest.tar.bz2 *
|
||||
cd -
|
||||
rm -rf %{buildroot}/srv/slurm-testsuite
|
||||
mkdir -p %{buildroot}/srv/slurm-testsuite
|
||||
mv /tmp/slurmtest.tar.bz2 %{buildroot}/srv/slurm-testsuite
|
||||
|
||||
mkdir -p %{buildroot}/etc/sudoers.d
|
||||
echo "slurm ALL=(auser) NOPASSWD:ALL" > %{buildroot}/etc/sudoers.d/slurm
|
||||
chmod 0440 %{buildroot}/etc/sudoers.d/slurm
|
||||
|
||||
SLURMD_SERVICE=%{buildroot}%_sysconfdir/systemd/system/slurmd.service
|
||||
mkdir -p `dirname $SLURMD_SERVICE`
|
||||
cp %{buildroot}/%_unitdir/slurmd.service $SLURMD_SERVICE
|
||||
if grep -qE "^LimitNPROC" $SLURMD_SERVICE; then
|
||||
sed -i -e '/LimitNPROC/s@=.*@=infinity@' $SLURMD_SERVICE
|
||||
else
|
||||
sed -i -e '/LimitSTACK/aLimitNPROC=infinity' $SLURMD_SERVICE
|
||||
fi
|
||||
sed -i -e '/ExecStart/aExecStartPre=/bin/bash -c "for i in 0 1 2 3; do test -e /dev/nvidia$i || mknod /dev/nvidia$i c 10 $((i+2)); done"' $SLURMD_SERVICE
|
||||
|
||||
tar -xzf %{S:20}
|
||||
mkdir -p %{buildroot}%{_pam_secconfdir}/limits.d
|
||||
mv test_setup/slurm.conf.limits %{buildroot}%_pam_secconfdir/limits.d/slurm.conf
|
||||
|
||||
mkdir -p %{buildroot}/root
|
||||
mv test_setup/setup-testsuite.sh %{buildroot}/root
|
||||
|
||||
mkdir -p %{buildroot}/srv/slurm-testsuite/config/plugstack.conf.d
|
||||
mv test_setup/* %{buildroot}/srv/slurm-testsuite/config
|
||||
cp %{S:21} .
|
||||
%endif
|
||||
|
||||
%fdupes -s %{buildroot}
|
||||
|
||||
# Temporary - remove when build is fixed upstream.
|
||||
%if !0%{?build_slurmrestd}
|
||||
rm -f %{buildroot}/%{_mandir}/man8/slurmrestd.*
|
||||
rm -f %{buildroot}%{_mandir}/man8/slurmrestd.*
|
||||
rm -f %{buildroot}%{_libdir}/slurm/openapi_*.so
|
||||
rm -f %{buildroot}%{_libdir}/slurm/rest_auth_*.so
|
||||
%endif
|
||||
|
||||
%check
|
||||
@ -919,7 +1004,7 @@ rm -f %{buildroot}/%{_mandir}/man8/slurmrestd.*
|
||||
%pre config %{?have_sysuser:-f %{pname}.pre}
|
||||
%if 0%{!?have_sysuser:1}
|
||||
getent group %slurm_g >/dev/null || groupadd -r %slurm_g
|
||||
getent passwd %slurm_u >/dev/null || useradd -r -g %slurm_g -d %slurmdir -s /bin/false -c %{slurmdescr} %slurm_u
|
||||
getent passwd %slurm_u >/dev/null || useradd -r -g %slurm_g -d %slurmdir -s /bin/bash -c %{slurmdescr} %slurm_u
|
||||
[ -d %{_localstatedir}/spool/slurm ] && /bin/chown -h %slurm_u:%slurm_g %{_localstatedir}/spool/slurm
|
||||
exit 0
|
||||
%endif
|
||||
@ -942,6 +1027,13 @@ exit 0
|
||||
%post -n libnss_%{pname}%{nss_so}%{?upgrade:%{_ver}} -p /sbin/ldconfig
|
||||
%postun -n libnss_%{pname}%{nss_so}%{?upgrade:%{_ver}} -p /sbin/ldconfig
|
||||
|
||||
%post testsuite
|
||||
rm -rf /srv/slurm-testsuite/src /srv/slurm-testsuite/testsuite /srv/slurm-testsuite/config.h
|
||||
tar --same-owner -C /srv/slurm-testsuite -xjf /srv/slurm-testsuite/slurmtest.tar.bz2
|
||||
|
||||
%preun testsuite
|
||||
rm -rf /srv/slurm-testsuite/src /srv/slurm-testsuite/testsuite /srv/slurm-testsuite/config.h
|
||||
|
||||
%{!?nil:
|
||||
# On update the %%postun code of the old package restarts the
|
||||
# service. This breaks in case the ABI between slurm and its
|
||||
@ -1073,7 +1165,7 @@ exit 0
|
||||
|
||||
%files webdoc
|
||||
%{?comp_at}
|
||||
%{apache_sysconfdir}/conf.d/slurm.conf
|
||||
%config %{apache_sysconfdir}/conf.d/slurm.conf
|
||||
|
||||
%files -n %{libslurm}
|
||||
%{?comp_at}
|
||||
@ -1127,7 +1219,6 @@ exit 0
|
||||
%{_mandir}/man5/slurmdbd.*
|
||||
%{_mandir}/man8/slurmdbd.*
|
||||
%config(noreplace) %attr(0600,%slurm_u,%slurm_g) %{_sysconfdir}/%{pname}/slurmdbd.conf
|
||||
%attr(0600,%slurm_u,%slurm_g) %{_sysconfdir}/%{pname}/slurmdbd.conf.example
|
||||
%if 0%{?with_systemd}
|
||||
%{_unitdir}/slurmdbd.service
|
||||
%else
|
||||
@ -1163,7 +1254,9 @@ exit 0
|
||||
%{_libdir}/slurm/burst_buffer_lua.so
|
||||
%{?have_json_c:%{_libdir}/slurm/burst_buffer_datawarp.so}
|
||||
%{_libdir}/slurm/cgroup_v1.so
|
||||
%if 0%{?suse_version} >= 1500
|
||||
%{_libdir}/slurm/cgroup_v2.so
|
||||
%endif
|
||||
%{_libdir}/slurm/core_spec_none.so
|
||||
%{_libdir}/slurm/cli_filter_none.so
|
||||
%{_libdir}/slurm/cli_filter_lua.so
|
||||
@ -1370,10 +1463,21 @@ exit 0
|
||||
|
||||
%if 0%{?slurm_testsuite}
|
||||
%files testsuite
|
||||
%defattr(-, %slurm_u, %slurm_u, -)
|
||||
%dir %attr(-, %slurm_u, %slurm_u) /srv/slurm-testsuite
|
||||
%if 0%{?sle_version} == 120200
|
||||
%dir %{_pam_secconfdir}/limits.d
|
||||
%endif
|
||||
%doc testsuite/expect/README
|
||||
%dir /opt/slurmtest
|
||||
/opt/slurmtest/*
|
||||
%doc %{basename: %{S:21}}
|
||||
%config %attr( -, root, root) %{_sysconfdir}/systemd/system/slurmd.service
|
||||
%config %attr(0440, root, root) %{_sysconfdir}/sudoers.d/slurm
|
||||
%config %attr( -, root, root) %{_pam_secconfdir}/limits.d/slurm.conf
|
||||
%{_libdir}/slurm/libslurm.so
|
||||
%attr(0600, %slurm_u, %slurm_g) /srv/slurm-testsuite/config/slurmdbd.conf
|
||||
/srv/slurm-testsuite/*
|
||||
%dir %attr(-, %slurm_u, %slurm_g) %_localstatedir/lib/slurm/shared
|
||||
%attr( -, root, root) /root/setup-testsuite.sh
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
3
test_setup.tar.gz
Normal file
3
test_setup.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:981cd56a0203f88f65ff762b6ab09655d7f529bc383e5ffc7f5d0a034001a9ea
|
||||
size 3104
|
Loading…
Reference in New Issue
Block a user