From 5ad063e34b9428f13d93b7ae388bdd817ba6b519 Mon Sep 17 00:00:00 2001 From: Danny Auble <da@llnl.gov> Date: Mon, 11 Aug 2008 17:31:17 +0000 Subject: [PATCH] added test to see if we are running a correct accounting type --- testsuite/expect/globals | 34 ++++++++++++++++++++++++++++++++++ testsuite/expect/test21.1 | 2 +- testsuite/expect/test21.10 | 5 +++++ testsuite/expect/test21.11 | 5 +++++ testsuite/expect/test21.12 | 5 +++++ testsuite/expect/test21.15 | 5 +++++ testsuite/expect/test21.16 | 5 +++++ testsuite/expect/test21.17 | 5 +++++ testsuite/expect/test21.18 | 5 +++++ testsuite/expect/test21.5 | 5 +++++ testsuite/expect/test21.6 | 5 +++++ testsuite/expect/test21.7 | 5 +++++ testsuite/expect/test21.8 | 5 +++++ testsuite/expect/test21.9 | 5 +++++ 14 files changed, 95 insertions(+), 1 deletion(-) diff --git a/testsuite/expect/globals b/testsuite/expect/globals index 05204c45556..cc0003d8686 100755 --- a/testsuite/expect/globals +++ b/testsuite/expect/globals @@ -538,6 +538,40 @@ proc test_assoc_enforced { } { return $assoc_enforced } +################################################################ +# +# Proc: test_account_storage +# +# Purpose: Determine if we are using a usable accounting storage +# package. +# This is based upon +# the value of AccountingStorageType in the slurm.conf. +# +# Returns 1 if the system is running an accounting storage type +# that is complete, 0 otherwise +# +################################################################ + +proc test_account_storage { } { + global scontrol + + log_user 0 + set account_storage 0 + spawn $scontrol show config + expect { + -re "(accounting_storage/slurmdbd|accounting_storage/mysql)" { + set account_storage 1 + exp_continue + } + eof { + wait + } + } + log_user 1 + + return $account_storage +} + ################################################################ # # Proc: get_default_acct diff --git a/testsuite/expect/test21.1 b/testsuite/expect/test21.1 index e2e217a3e16..3a142cc8226 100755 --- a/testsuite/expect/test21.1 +++ b/testsuite/expect/test21.1 @@ -41,7 +41,7 @@ print_header $test_id # # Report the sacctmgr usage format # - + spawn $sacctmgr --usage expect { -re "commit changes immediately" { diff --git a/testsuite/expect/test21.10 b/testsuite/expect/test21.10 index c35e8cc5328..574c1f71a5f 100755 --- a/testsuite/expect/test21.10 +++ b/testsuite/expect/test21.10 @@ -71,6 +71,11 @@ set qs1 normal print_header $test_id +if { [test_account_storage] == 0 } { + send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n" + exit 0 +} + # # Use sacctmgr to create a cluster # diff --git a/testsuite/expect/test21.11 b/testsuite/expect/test21.11 index b5cfda14d6e..bb3573716a7 100755 --- a/testsuite/expect/test21.11 +++ b/testsuite/expect/test21.11 @@ -74,6 +74,11 @@ set qs1 normal print_header $test_id +if { [test_account_storage] == 0 } { + send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n" + exit 0 +} + # # Use sacctmgr to create a cluster # diff --git a/testsuite/expect/test21.12 b/testsuite/expect/test21.12 index e5370f8a41f..73739785fa2 100755 --- a/testsuite/expect/test21.12 +++ b/testsuite/expect/test21.12 @@ -75,6 +75,11 @@ set qs1 normal print_header $test_id +if { [test_account_storage] == 0 } { + send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n" + exit 0 +} + # # Use sacctmgr to create a cluster # diff --git a/testsuite/expect/test21.15 b/testsuite/expect/test21.15 index 90bae610fa7..171754d77f3 100755 --- a/testsuite/expect/test21.15 +++ b/testsuite/expect/test21.15 @@ -87,6 +87,11 @@ set dbu debug print_header $test_id +if { [test_account_storage] == 0 } { + send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n" + exit 0 +} + # # Use sacctmgr to create a cluster # diff --git a/testsuite/expect/test21.16 b/testsuite/expect/test21.16 index 94f4f81bdbd..dd6a84e58a9 100755 --- a/testsuite/expect/test21.16 +++ b/testsuite/expect/test21.16 @@ -92,6 +92,11 @@ set dbu debug print_header $test_id +if { [test_account_storage] == 0 } { + send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n" + exit 0 +} + # # Use sacctmgr to create a cluster # diff --git a/testsuite/expect/test21.17 b/testsuite/expect/test21.17 index cb77ed3330d..6eff09152b6 100755 --- a/testsuite/expect/test21.17 +++ b/testsuite/expect/test21.17 @@ -94,6 +94,11 @@ set dbu debug print_header $test_id +if { [test_account_storage] == 0 } { + send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n" + exit 0 +} + # # Use sacctmgr to create a cluster # diff --git a/testsuite/expect/test21.18 b/testsuite/expect/test21.18 index 920c510d545..18ad868c244 100755 --- a/testsuite/expect/test21.18 +++ b/testsuite/expect/test21.18 @@ -94,6 +94,11 @@ set dbu debug print_header $test_id +if { [test_account_storage] == 0 } { + send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n" + exit 0 +} + # # Use sacctmgr to create a cluster # diff --git a/testsuite/expect/test21.5 b/testsuite/expect/test21.5 index 60f8c6d93ab..40d07e57caf 100755 --- a/testsuite/expect/test21.5 +++ b/testsuite/expect/test21.5 @@ -59,6 +59,11 @@ set mw1 01:00:00 print_header $test_id +if { [test_account_storage] == 0 } { + send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n" + exit 0 +} + # # Use sacctmgr to create a cluster # diff --git a/testsuite/expect/test21.6 b/testsuite/expect/test21.6 index 7ebf96df6e5..458c178f808 100755 --- a/testsuite/expect/test21.6 +++ b/testsuite/expect/test21.6 @@ -61,6 +61,11 @@ set mw1 01:00:00 print_header $test_id +if { [test_account_storage] == 0 } { + send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n" + exit 0 +} + # # Use sacctmgr to create a cluster # diff --git a/testsuite/expect/test21.7 b/testsuite/expect/test21.7 index 622967c5127..022dcf1330c 100755 --- a/testsuite/expect/test21.7 +++ b/testsuite/expect/test21.7 @@ -61,6 +61,11 @@ set mw1 01:00:00 print_header $test_id +if { [test_account_storage] == 0 } { + send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n" + exit 0 +} + # # Use sacctmgr to create a cluster # diff --git a/testsuite/expect/test21.8 b/testsuite/expect/test21.8 index 17004441782..ba55414132a 100755 --- a/testsuite/expect/test21.8 +++ b/testsuite/expect/test21.8 @@ -67,6 +67,11 @@ set mw2 12:00:00 print_header $test_id +if { [test_account_storage] == 0 } { + send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n" + exit 0 +} + # # Use sacctmgr to create a cluster # diff --git a/testsuite/expect/test21.9 b/testsuite/expect/test21.9 index 12c0dd9113f..0afb6832434 100755 --- a/testsuite/expect/test21.9 +++ b/testsuite/expect/test21.9 @@ -67,6 +67,11 @@ set mw2 12:00:00 print_header $test_id +if { [test_account_storage] == 0 } { + send_user "\nWARNING: This test can't be run without a usable AccountStorageType\n" + exit 0 +} + # # Use sacctmgr to create a cluster # -- GitLab