SHA256
1
0
forked from pool/slurm
slurm/Fix-test-21.41.patch
Egbert Eich 7d13a7ba97 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
2022-07-12 20:03:18 +00:00

66 lines
2.3 KiB
Diff

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"