Skip to content

Commit

Permalink
add env var for tmpdir prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
bdevcich committed Dec 13, 2024
1 parent db0e37f commit 712ab60
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions system-test/system-test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ if [[ -z "${GLOBAL_LUSTRE_ROOT}" ]]; then
GLOBAL_LUSTRE_ROOT=/lus/global
fi

# Test Tempdir directory
if [[ -z "${TEST_TMPDIR_PREFIX}" ]]; then
TEST_TMPDIR_PREFIX=${HOME}/nnf/tmp
fi

# Number of compute nodes; default to 4
if [[ -z "${N}" ]]; then
N=4
Expand Down Expand Up @@ -61,15 +66,14 @@ function setup_file {

# For lustre tests, use the total capacity given the node count
export LUS_CAPACITY=$(($N * $GB_PER_NODE))

# Ensure tempdir prefix directory exists
mkdir -p ${TEST_TMPDIR_PREFIX}
}

function setup {
# Create a tmpdir. To run flux jobs from this directory (which we do), I believe this needs to
# reside in the users homedir so the computes can reach the script. For now, use the working
# directory, which is assumed to be somewhere in a homedir.
# TODO: How is this going to work on dev systems with no NFS homedirs?
script_dir=$(pwd)
export TEST_TMPDIR=$(mktemp -d -p $script_dir)
# Create a test tmpdir at the supplied prefix (e.g. /home/user/nnf/tmp.x8e8f0a/)
export TEST_TMPDIR=$(mktemp -d -p ${TEST_TMPDIR_PREFIX})
}

function teardown {
Expand Down Expand Up @@ -327,6 +331,7 @@ function create_capacity_file {
chmod +x $runit_file
cat << 'EOF' >> $runit_file
#!/bin/bash
echo "jobid: $(flux getattr jobid)"
requested_size=$1
capacity_percent=$2
Expand Down

0 comments on commit 712ab60

Please sign in to comment.