[LTP] [PATCH] testcases:Fix the failure of shell script to get path

Petr Vorel pvorel@suse.cz
Tue Apr 4 15:36:50 CEST 2023


> For example, in the file testcases/kernel/controllers/cpuset/cpuset_funcs.sh, if the path is obtained by
> find "$CPUSET" -type d | sort | sed -n '2,$p' | tac | while read subdir, the escaped characters will be lost,
> and by adding the -r option, the escaped characters will be kept as they are without escaping
> The errors are as follows:
> /opt/ltp/testcases/bin/cpuset_funcs.sh:line178: /dev/cpuset/machine.slice/machine-qemux2d157x2dzhx2dsxf.scope/vcpu7/tasks: The file or directory is not available

Could you print the path how it looks like with ls:

ls -l /dev/cpuset/machine.slice/

FYI cgroup tests written in shell are broken by design, we write new tests in C.
Not sure if these old tests are relevant enough to be rewritten into C.

...
> +++ b/testcases/open_posix_testsuite/scripts/generate-makefiles.sh
> @@ -312,7 +312,7 @@ generate_locate_test_makefile buildonly '.test' "$buildonly_compiler_args"
>  generate_locate_test_makefile runnable '.run-test'
>  generate_locate_test_makefile test-tools ''

> -find . -name Makefile.1 -exec dirname {} \; | while read dir; do
> +find . -name Makefile.1 -exec dirname {} \; | while read -r dir; do
I don't think it's needed for open posix.

Kind regards,
Petr


More information about the ltp mailing list