Hi Tao,
On Mon, 8 Aug 2022 19:52:26 +0800
Tao Liu <ltao(a)redhat.com> wrote:
Previously, all files within $TESTCASEDIR/$test_case are regarded
as shell script files for testing. However there might be config
files under the directory. So let's only iterate the .sh files.
Signed-off-by: Tao Liu <ltao(a)redhat.com>
---
tests/scripts/run-test.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/scripts/run-test.sh b/tests/scripts/run-test.sh
index 1501db4..68df5fd 100755
--- a/tests/scripts/run-test.sh
+++ b/tests/scripts/run-test.sh
@@ -85,8 +85,8 @@ for test_case in $testcases; do
results[$test_case]="<Test Skipped>"
testdir=$TESTCASEDIR/$test_case
- script_num=$(ls -1 $testdir | wc -l)
- scripts=$(ls -r -1 $testdir | tr '\n' ' ')
+ script_num=$(ls -1 $testdir | egrep "\.sh$" | wc -l)
I don't see any user for script_num. I think you can simply drop it.
+ scripts=$(ls -r -1 $testdir | egrep "\.sh$" | tr
'\n' ' ')
Instead of piping to egrep you can simply use the bash globbing, i.e.
ls -r -1 $testdir/*.sh ...
Thanks
Philipp
test_outputs=""
read main_script aux_script <<< "$scripts"