[CRIU] [PATCH] zdtm: improve checking file descriptors and memory regions

Christopher Covington cov at codeaurora.org
Tue Oct 28 14:41:17 PDT 2014


On 10/28/2014 04:35 PM, Andrew Vagin wrote:
> On Tue, Oct 28, 2014 at 11:54:16AM -0400, Christopher Covington wrote:
>> Hi Andrey,
>>
>> On 10/28/2014 05:12 AM, Andrey Vagin wrote:
>>> Now we check them for all test processes

Reviewed-by: Christopher Covington <cov at codeaurora.org>

>>> Signed-off-by: Andrey Vagin <avagin at openvz.org>
>>> ---
>>>  test/Makefile |  2 +-
>>>  test/zdtm.sh  | 30 +++++++++++++++++++-----------
>>>  2 files changed, 20 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/test/Makefile b/test/Makefile
>>> index 9ab8f3d..aa27f53 100644
>>> --- a/test/Makefile
>>> +++ b/test/Makefile
>>> @@ -61,5 +61,5 @@ mount_cgroups: .FORCE
>>>  
>>>  $(TST): zdtm_ct mount_cgroups .FORCE
>>>  	./zdtm.sh --ct ${ZDTM_ARGS} $(@) &> $(subst /,_,$@).log; \
>>> -	{ ret=$$?; flock Makefile cat $(subst /,_,$@).log; exit $$ret; }
>>> +	{ ret=$$?; fname=$(subst /,_,$@).log; flock Makefile cat $$fname; unlink $$fname; exit $$ret; }
>>>  .PHONY: zdtm_ns
>>> diff --git a/test/zdtm.sh b/test/zdtm.sh
>>> index 191acdf..0f7609a 100755
>>> --- a/test/zdtm.sh
>>> +++ b/test/zdtm.sh
>>> @@ -451,17 +451,29 @@ stop_test()
>>>  
>>>  save_fds()
>>>  {
>>> -	test -n "$PIDNS" && return 0
>>> -	ls -l /proc/$1/fd | sed 's/\(-> \(pipe\|socket\)\):.*/\1/' | sed -e 's/\/.nfs[0-9a-zA-Z]*/.nfs-silly-rename/' | awk '{ print $9,$10,$11; }' > $2
>>> +	test -z "$PIDNS" && return 0
>>> +	truncate --size 0 $2
>>
>> Busybox doesn't have truncate. Can you use `echo -n > $2`?
> 
> Sure. The updated version is attached. Thanks.
> 


-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


More information about the CRIU mailing list