Skip to content

Added get_session_env_var scripts#630

Merged
bieryAtFnal merged 2 commits into
developfrom
kbiery/get_sev_script
Jul 14, 2026
Merged

Added get_session_env_var scripts#630
bieryAtFnal merged 2 commits into
developfrom
kbiery/get_sev_script

Conversation

@bieryAtFnal

Copy link
Copy Markdown
Contributor

Description

We already have a pair of scripts to set a environment variable in an OKS session environment, and this PR adds a pair of scripts to get the value of an existing env var (from an OKS session). The "get" functionality will be useful as part of setting TRACE levels from integration tests.

Here are suggested steps for testing the new script:

DATE_PREFIX=`date '+%d%b'`
TIME_SUFFIX=`date '+%H%M'`

source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh
setup_dbt latest
dbt-create -n NFD_DEV_260714_A9 ${DATE_PREFIX}FDDevTest_${TIME_SUFFIX}
cd ${DATE_PREFIX}FDDevTest_${TIME_SUFFIX}/sourcecode

git clone https://github.com/DUNE-DAQ/daqconf.git -b kbiery/get_sev_script
git clone https://github.com/DUNE-DAQ/daqsystemtest.git -b develop

cd ..

. ./env.sh
dbt-build -j 12
dbt-workarea-env

daqconf_get_session_env_var local-1x1-config config/daqsystemtest/example-configs.data.xml TRACE_FILE

echo ""
echo -e "\U1F535 \U2705 Note that an existing value for TRACE_FILE was not found. \U2705 \U1F535"
echo ""
echo ""
sleep 3

echo ""
echo -e "\U1F535 \U2705 Setting the value of the env var to \"ABC\". \U2705 \U1F535"
echo ""
echo ""

daqconf_set_session_env_var local-1x1-config config/daqsystemtest/example-configs.data.xml TRACE_FILE "ABC"

echo ""
echo -e "\U1F535 \U2705 Reading back the value of the env var. \U2705 \U1F535"
echo ""
echo ""

daqconf_get_session_env_var local-1x1-config config/daqsystemtest/example-configs.data.xml TRACE_FILE
sleep 3

echo ""
echo -e "\U1F535 \U2705 Setting the value to \"DEF\". \U2705 \U1F535"
echo ""
echo ""

daqconf_set_session_env_var local-1x1-config config/daqsystemtest/example-configs.data.xml TRACE_FILE "DEF"

echo ""
echo -e "\U1F535 \U2705 Reading back the value of the env var. \U2705 \U1F535"
echo ""
echo ""

daqconf_get_session_env_var local-1x1-config config/daqsystemtest/example-configs.data.xml TRACE_FILE
sleep 3

echo ""
echo -e "\U1F535 \U2705 Setting the value to \"/tmp/pytest-of-${USER}/pytest-current/integtest-dunedaq.trace\". \U2705 \U1F535"
echo ""
echo ""

daqconf_set_session_env_var local-1x1-config config/daqsystemtest/example-configs.data.xml TRACE_FILE "/tmp/pytest-of-${USER}/pytest-current/integtest-dunedaq.trace"

echo ""
echo -e "\U1F535 \U2705 Reading back the value of the env var. \U2705 \U1F535"
echo ""
echo ""

daqconf_get_session_env_var local-1x1-config config/daqsystemtest/example-configs.data.xml TRACE_FILE

Type of change

  • New feature or enhancement (non-breaking change which adds functionality)

Kurt Biery added 2 commits July 14, 2026 07:09
…tderr. Also moved the setting of the new env var value to a more logical place in the code.
@bieryAtFnal
bieryAtFnal requested a review from andrewmogan July 14, 2026 15:20

@andrewmogan andrewmogan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tests work as stated.

@bieryAtFnal
bieryAtFnal merged commit 756bb75 into develop Jul 14, 2026
1 check passed
@bieryAtFnal
bieryAtFnal deleted the kbiery/get_sev_script branch July 14, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants