public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] memcg_control: fix mem_process not moved to cgroup
@ 2015-07-20 14:47 Vladimir Davydov
  2015-07-28 10:55 ` Jan Stancek
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Davydov @ 2015-07-20 14:47 UTC (permalink / raw)
  To: ltp-list

$! is not set after ( cmd & )

This bug was introduced by commit 49010e502a74c ("Replace pushd // popd
with cd calls.").

Since we create a sub-shell in test_proc_kill only to preserve PWD,
let's change this to cd $OLDPWD. In contrast to pushd/popd this will
work in busybox.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
---
 testcases/kernel/controllers/memcg/control/memcg_control_test.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/testcases/kernel/controllers/memcg/control/memcg_control_test.sh b/testcases/kernel/controllers/memcg/control/memcg_control_test.sh
index fa50516ba71b..168efe3ee35c 100644
--- a/testcases/kernel/controllers/memcg/control/memcg_control_test.sh
+++ b/testcases/kernel/controllers/memcg/control/memcg_control_test.sh
@@ -54,7 +54,9 @@ FAIL=1
 # Check if the test process is killed on crossing boundary
 test_proc_kill()
 {
-	( cd $TMP && mem_process -m $PROC_MEM & )
+	cd $TMP
+	mem_process -m $PROC_MEM &
+	cd $OLDPWD
 	sleep 1
 	echo $! > tasks
 
-- 
2.1.4


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] memcg_control: fix mem_process not moved to cgroup
  2015-07-20 14:47 [LTP] [PATCH] memcg_control: fix mem_process not moved to cgroup Vladimir Davydov
@ 2015-07-28 10:55 ` Jan Stancek
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Stancek @ 2015-07-28 10:55 UTC (permalink / raw)
  To: Vladimir Davydov; +Cc: ltp-list



----- Original Message -----
> From: "Vladimir Davydov" <vdavydov@parallels.com>
> To: ltp-list@lists.sourceforge.net
> Sent: Monday, 20 July, 2015 4:47:11 PM
> Subject: [LTP] [PATCH] memcg_control: fix mem_process not moved to cgroup
> 
> $! is not set after ( cmd & )
> 
> This bug was introduced by commit 49010e502a74c ("Replace pushd // popd
> with cd calls.").
> 
> Since we create a sub-shell in test_proc_kill only to preserve PWD,
> let's change this to cd $OLDPWD. In contrast to pushd/popd this will
> work in busybox.
> 
> Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>

Pushed.

Thank you,
Jan

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-28 10:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-20 14:47 [LTP] [PATCH] memcg_control: fix mem_process not moved to cgroup Vladimir Davydov
2015-07-28 10:55 ` Jan Stancek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox