From 2eda125ee37dcce9395aba948b8f0087f9974441 Mon Sep 17 00:00:00 2001 From: Venita Hagerty Date: Mon, 3 Oct 2022 21:02:02 +0000 Subject: [PATCH 1/2] Accept a local configuration file for tests --- regression/regression_driver.sh | 5 +++++ regression/regression_var.sh | 16 +++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/regression/regression_driver.sh b/regression/regression_driver.sh index 08f0154819..fb5bf15e42 100755 --- a/regression/regression_driver.sh +++ b/regression/regression_driver.sh @@ -5,6 +5,11 @@ set -x # regression test to launch export regtest=$1 +# option to set local values with a config file +if [ -d $config_path ]; then + source $config_path/local_vars.sh +fi + # source the necessary files to setup if [ "$#" -eq 2 ]; then export regdir=$2 diff --git a/regression/regression_var.sh b/regression/regression_var.sh index 4951ab31f5..cb98003647 100755 --- a/regression/regression_var.sh +++ b/regression/regression_var.sh @@ -103,28 +103,30 @@ case $machine in export accnt="p48503002" ;; Hera) - if [ -d /scratch1/NCEPDEV/da/$LOGNAME ]; then - export noscrub="/scratch1/NCEPDEV/da/$LOGNAME/noscrub" + + export local_or_default="${local_or_default:-/scratch1/NCEPDEV/da/$LOGNAME}" + if [ -d $local_or_default ]; then + export noscrub="$local_or_default/noscrub" elif [ -d /scratch1/NCEPDEV/global/$LOGNAME ]; then export noscrub="/scratch1/NCEPDEV/global/$LOGNAME/noscrub" elif [ -d /scratch2/BMC/gsienkf/$LOGNAME ]; then export noscrub="/scratch2/BMC/gsienkf/$LOGNAME" fi - export group="global" - export queue="batch" + export group="${group:-global}" + export queue="${queue:-batch}" if [[ "$cmaketest" = "false" ]]; then export basedir="/scratch1/NCEPDEV/da/$LOGNAME/git/gsi" fi - export ptmp="/scratch1/NCEPDEV/stmp2/$LOGNAME/$ptmpName" + export ptmp="${ptmp:-/scratch1/NCEPDEV/stmp2/$LOGNAME/$ptmpName}" - export fixcrtm="/scratch1/NCEPDEV/da/Michael.Lueken/CRTM_REL-2.2.3/crtm_v2.2.3/fix_update" + export fixcrtm="${fixcrtm:-/scratch1/NCEPDEV/da/Michael.Lueken/CRTM_REL-2.2.3/crtm_v2.2.3/fix_update}" export casesdir="/scratch1/NCEPDEV/da/Michael.Lueken/noscrub/CASES" export check_resource="no" - export accnt="da-cpu" + export accnt="${accnt:-da-cpu}" # On Hera, there are no scrubbers to remove old contents from stmp* directories. # After completion of regression tests, will remove the regression test subdirecories From 19ae29081ec52029264df11f47d2762367e865c7 Mon Sep 17 00:00:00 2001 From: Venita Hagerty <38571614+venitahagerty@users.noreply.github.com> Date: Fri, 4 Nov 2022 06:37:08 -0600 Subject: [PATCH 2/2] Add quotes to $config_path --- regression/regression_driver.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regression/regression_driver.sh b/regression/regression_driver.sh index fb5bf15e42..e67b2081b1 100755 --- a/regression/regression_driver.sh +++ b/regression/regression_driver.sh @@ -6,7 +6,7 @@ set -x export regtest=$1 # option to set local values with a config file -if [ -d $config_path ]; then +if [ -d "$config_path" ]; then source $config_path/local_vars.sh fi