Skip to content

Commit b119062

Browse files
committed
Use current directory in case suite is not installed
When suite is run from a different directory than /var/ functions won't be able to find tests by name. This patch fixes the issue and allows to discover tests that are executed from current path. Signed-off-by: Milosz Wasilewski <[email protected]>
1 parent 085bf1d commit b119062

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Runner/utils/functestlib.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ log() {
2121
# Find test case path by name
2222
find_test_case_by_name() {
2323
local test_name="$1"
24-
find $__RUNNER_SUITES_DIR -type d -iname "$test_name" 2>/dev/null
24+
if [ -d "$__RUNNER_SUITES_DIR" ]; then
25+
find $__RUNNER_SUITES_DIR -type d -iname "$test_name" 2>/dev/null
26+
else
27+
find "${PWD}" -type d -iname "$test_name" 2>/dev/null
28+
fi
2529
}
2630

2731
# Find test case path by name
@@ -33,7 +37,11 @@ find_test_case_bin_by_name() {
3337
# Find test case path by name
3438
find_test_case_script_by_name() {
3539
local test_name="$1"
36-
find $__RUNNER_UTILS_BIN_DIR -type d -iname "$test_name" 2>/dev/null
40+
if [ -d "$__RUNNER_UTILS_BIN_DIR" ]; then
41+
find $__RUNNER_UTILS_BIN_DIR -type d -iname "$test_name" 2>/dev/null
42+
else
43+
find "${PWD}" -type d -iname "$test_name" 2>/dev/null
44+
fi
3745
}
3846

3947
check_dependencies() {

0 commit comments

Comments
 (0)