@@ -8,8 +8,34 @@ source $TOOLS/functestlib.sh
8
8
9
9
# Find test case path by name
10
10
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
13
39
}
14
40
15
41
# Execute a test case
@@ -35,8 +61,9 @@ execute_test_case() {
35
61
36
62
# Function to run a specific test case by name
37
63
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 " ." )
40
67
if [ -z " $test_path " ]; then
41
68
log " Test case with name $test_name not found."
42
69
else
0 commit comments