Skip to content

Commit

Permalink
Modified the way that tests source files
Browse files Browse the repository at this point in the history
Modified the way that tests source files, so that they no longer use
relative pathing and instead are using absolute pathing. This allows the
tests to be called from anywhere regardless of the current working
directory.

Also added the test_xdd_createnewfiles.sh to the list of tests to run,
as it was being skipped.
  • Loading branch information
MigeljanImeri committed Sep 28, 2023
1 parent 21387af commit 4e0b7bc
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 41 deletions.
4 changes: 2 additions & 2 deletions tests/debug/test_xdd_debug_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

initialize_test

Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_createnewfiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# Create the test location
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_createnewfiles2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

initialize_test
data_file="${XDDTEST_LOCAL_MOUNT}/${TESTNAME}/test"
Expand Down
9 changes: 6 additions & 3 deletions tests/functional/test_xdd_dryrun.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
#
# Description - passes the dry run option to a simple xdd command
#
# Get path to script
SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
#
source ../test_config
source ../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# Perform pre-test
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_heartbeat_byte.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# Pre-test set-up

Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_heartbeat_elapsed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# Pre-test set-up
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_heartbeat_lf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# pre-test set-up
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_heartbeat_output.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# Pre-test set-up
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_heartbeat_target.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# pre-test set-up
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_heartbeat_tod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# pre-test set-up
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_lockstep1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# Create the test location
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_lockstep2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# Create the test location
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_passdelay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# Pre-test set-up
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_pretruncate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# Pre-test create test directory and file
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_reopen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# pre-test set-up
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# Perform pre-test
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_startdelay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# Pre-test set-up
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_startoffset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# Pre-test set-up
initialize_test
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_syncwrite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

#skip test on non-Linux platforms
if [[ "$(uname)" != "Linux" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions tests/functional/test_xdd_timelimit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ SCRIPT=$(realpath "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

# Source the test configuration environment
source $SCRIPTPATH/../test_config
source $SCRIPTPATH/../common.sh
source "$SCRIPTPATH"/../test_config
source "$SCRIPTPATH"/../common.sh

# Perform pre-test
initialize_test
Expand Down

0 comments on commit 4e0b7bc

Please sign in to comment.