* [LTP] [PATCH v2] testcases:Fix the failure of shell script to get path
@ 2023-05-06 9:27 Hao Zeng
2023-05-06 18:55 ` Petr Vorel
0 siblings, 1 reply; 3+ messages in thread
From: Hao Zeng @ 2023-05-06 9:27 UTC (permalink / raw)
To: pvorel; +Cc: Hao Zeng, ltp
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
rmdir: delete
'/dev/cpuset/machine.slice/machine-qemux2d157x2dzhx2dsxf.scope/vcpu7'
Failure: The file or directory is not available
cpuset_memory_pressure 1 TFAIL: Couldn't remove subdir -
/opt/ltp/testcases/bin/cpuset_funcs.sh:line178:
/dev/cpuset/machine.slice/machine-qemux2d157x2dzhx2dsxf.scope/vcpu7/tasks:
The file or directory is not available
rmdir: delete
'/dev/cpuset/machine.slice/machine-qemux2d157x2dzhx2dsxf.scope/vcpu7'
Failure: The file or directory is not available
cpuset_memory_pressure 1 TFAIL: Couldn't remove subdir -
Signed-off-by: Hao Zeng <zenghao@kylinos.cn>
Suggested-by: Petr Vorel <pvorel@suse.cz>
---
testcases/kernel/controllers/cpuset/cpuset_funcs.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/controllers/cpuset/cpuset_funcs.sh b/testcases/kernel/controllers/cpuset/cpuset_funcs.sh
index 87ba7da1f..0cfa0c17e 100755
--- a/testcases/kernel/controllers/cpuset/cpuset_funcs.sh
+++ b/testcases/kernel/controllers/cpuset/cpuset_funcs.sh
@@ -184,7 +184,7 @@ cleanup()
echo $CHILDREN_VALUE > $CLONE_CHILDREN
echo $SCHED_LB_VALUE > $SCHED_LB
- find "$CPUSET" -type d | sort | sed -n '2,$p' | tac | while read subdir
+ find "$CPUSET" -type d | sort | sed -n '2,$p' | tac | while read -r subdir
do
while read pid
do
--
2.37.2
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH v2] testcases:Fix the failure of shell script to get path
2023-05-06 9:27 [LTP] [PATCH v2] testcases:Fix the failure of shell script to get path Hao Zeng
@ 2023-05-06 18:55 ` Petr Vorel
2023-05-08 1:43 ` Hao Zeng
0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2023-05-06 18:55 UTC (permalink / raw)
To: Hao Zeng; +Cc: ltp
Hi Hao,
> 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
> rmdir: delete
> '/dev/cpuset/machine.slice/machine-qemux2d157x2dzhx2dsxf.scope/vcpu7'
> Failure: The file or directory is not available
> cpuset_memory_pressure 1 TFAIL: Couldn't remove subdir -
> /opt/ltp/testcases/bin/cpuset_funcs.sh:line178:
> /dev/cpuset/machine.slice/machine-qemux2d157x2dzhx2dsxf.scope/vcpu7/tasks:
> The file or directory is not available
> rmdir: delete
> '/dev/cpuset/machine.slice/machine-qemux2d157x2dzhx2dsxf.scope/vcpu7'
> Failure: The file or directory is not available
> cpuset_memory_pressure 1 TFAIL: Couldn't remove subdir -
> Signed-off-by: Hao Zeng <zenghao@kylinos.cn>
> Suggested-by: Petr Vorel <pvorel@suse.cz>
> ---
> testcases/kernel/controllers/cpuset/cpuset_funcs.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/testcases/kernel/controllers/cpuset/cpuset_funcs.sh b/testcases/kernel/controllers/cpuset/cpuset_funcs.sh
> index 87ba7da1f..0cfa0c17e 100755
> --- a/testcases/kernel/controllers/cpuset/cpuset_funcs.sh
> +++ b/testcases/kernel/controllers/cpuset/cpuset_funcs.sh
> @@ -184,7 +184,7 @@ cleanup()
> echo $CHILDREN_VALUE > $CLONE_CHILDREN
> echo $SCHED_LB_VALUE > $SCHED_LB
> - find "$CPUSET" -type d | sort | sed -n '2,$p' | tac | while read subdir
> + find "$CPUSET" -type d | sort | sed -n '2,$p' | tac | while read -r subdir
Is it testcases/kernel/controllers/cpuctl_fj/run_cpuctl_test_fj.sh working
without -r ? I'd expect it'd be also needed (it was in your v1 patch [1]).
I only didn't want to take
testcases/open_posix_testsuite/scripts/generate-makefiles.sh because it does not
work with /dev/cpuset/.
Kind regards,
Petr
[1] https://lore.kernel.org/ltp/6b2a7ceb.4466.1874a537430.Coremail.crawler2015@163.com/
> do
> while read pid
> do
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [LTP] [PATCH v2] testcases:Fix the failure of shell script to get path
2023-05-06 18:55 ` Petr Vorel
@ 2023-05-08 1:43 ` Hao Zeng
0 siblings, 0 replies; 3+ messages in thread
From: Hao Zeng @ 2023-05-08 1:43 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp
On Sat, 2023-05-06 at 20:55 +0200, Petr Vorel wrote:
Hi Petr,
Sorry, this one was an oversight on my part. It has been added and
submitted again.
Best regards
Hao
> Hi Hao,
>
> > 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
> > rmdir: delete
> > '/dev/cpuset/machine.slice/machine-
> > qemux2d157x2dzhx2dsxf.scope/vcpu7'
> > Failure: The file or directory is not available
> > cpuset_memory_pressure 1 TFAIL: Couldn't remove subdir -
> > /opt/ltp/testcases/bin/cpuset_funcs.sh:line178:
> > /dev/cpuset/machine.slice/machine-
> > qemux2d157x2dzhx2dsxf.scope/vcpu7/tasks:
> > The file or directory is not available
> > rmdir: delete
> > '/dev/cpuset/machine.slice/machine-
> > qemux2d157x2dzhx2dsxf.scope/vcpu7'
> > Failure: The file or directory is not available
> > cpuset_memory_pressure 1 TFAIL: Couldn't remove subdir -
>
> > Signed-off-by: Hao Zeng <zenghao@kylinos.cn>
> > Suggested-by: Petr Vorel <pvorel@suse.cz>
> > ---
> > testcases/kernel/controllers/cpuset/cpuset_funcs.sh | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> > diff --git a/testcases/kernel/controllers/cpuset/cpuset_funcs.sh
> > b/testcases/kernel/controllers/cpuset/cpuset_funcs.sh
> > index 87ba7da1f..0cfa0c17e 100755
> > --- a/testcases/kernel/controllers/cpuset/cpuset_funcs.sh
> > +++ b/testcases/kernel/controllers/cpuset/cpuset_funcs.sh
> > @@ -184,7 +184,7 @@ cleanup()
> > echo $CHILDREN_VALUE > $CLONE_CHILDREN
> > echo $SCHED_LB_VALUE > $SCHED_LB
>
> > - find "$CPUSET" -type d | sort | sed -n '2,$p' | tac | while
> > read subdir
> > + find "$CPUSET" -type d | sort | sed -n '2,$p' | tac | while
> > read -r subdir
>
> Is it testcases/kernel/controllers/cpuctl_fj/run_cpuctl_test_fj.sh
> working
> without -r ? I'd expect it'd be also needed (it was in your v1 patch
> [1]).
>
> I only didn't want to take
> testcases/open_posix_testsuite/scripts/generate-makefiles.sh because
> it does not
> work with /dev/cpuset/.
>
> Kind regards,
> Petr
>
> [1]
> https://lore.kernel.org/ltp/6b2a7ceb.4466.1874a537430.Coremail.crawler2015@163.com/
> > do
> > while read pid
> > do
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-05-08 1:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-06 9:27 [LTP] [PATCH v2] testcases:Fix the failure of shell script to get path Hao Zeng
2023-05-06 18:55 ` Petr Vorel
2023-05-08 1:43 ` Hao Zeng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).