Skip to content

Commit 84f73c5

Browse files
committed
Modified the find command to identify the testcase
Modified the find command
1 parent 61b8021 commit 84f73c5

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

Runner/run-test.sh

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,34 @@ source $TOOLS/functestlib.sh
88

99
# Find test case path by name
1010
find_test_case_by_name() {
11-
local test_name="$1"
12-
find /var/Runner/suites -type d -iname "$test_name" 2>/dev/null
11+
# local test_name="$1"
12+
# dir= "."
13+
# Check if the file is a directory
14+
if [ -d "$1" ]; then
15+
# Get the directory name
16+
dir_name_in_dir=${1##*/}
17+
18+
# Check if the directory name matches the user input (ignoring case)
19+
if [ "${dir_name_in_dir,,}" = "$test_name" ]; then
20+
# Get the absolute path of the directory
21+
abs_path=$(readlink -f "$1")
22+
echo "$abs_path"
23+
# Check if the run.sh file is present in the absolute path (ignoring case)
24+
# if [ -f "$abs_path/run.sh" ]; then
25+
# Print the absolute path of run.sh
26+
# echo "Absolute path of run.sh: $abs_path/run.sh"
27+
# fi
28+
fi
29+
fi
30+
31+
# Recursively search for the directory in the subdirectory
32+
for file in "$1"/*; do
33+
# Check if the file is a directory
34+
if [ -d "$file" ]; then
35+
# Recursively search for the directory in the subdirectory
36+
find_test_case_by_name "$file"
37+
fi
38+
done
1339
}
1440

1541
# Execute a test case
@@ -35,8 +61,9 @@ execute_test_case() {
3561

3662
# Function to run a specific test case by name
3763
run_specific_test_by_name() {
38-
local test_name="$1"
39-
test_path=$(find_test_case_by_name "$test_name")
64+
test_name="$1"
65+
test_name=${test_name,,}
66+
test_path=$(find_test_case_by_name ".")
4067
if [ -z "$test_path" ]; then
4168
log "Test case with name $test_name not found."
4269
else

0 commit comments

Comments
 (0)