[CRIU] [PATCH v2 1/3] zdtm.py: suppress umount output

Andrew Vagin avagin at virtuozzo.com
Mon Nov 30 02:43:29 PST 2015


On Tue, Nov 24, 2015 at 02:28:16PM -0700, Tycho Andersen wrote:
> This clutters up the test stdout.
> 
> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
> ---
>  test/zdtm.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/test/zdtm.py b/test/zdtm.py
> index b9bcb4f..f571e67 100755
> --- a/test/zdtm.py
> +++ b/test/zdtm.py
> @@ -44,7 +44,8 @@ tests_root = None
>  
>  def clean_tests_root():
>  	global tests_root
> -	subprocess.call(["umount", tests_root])
> +	with open(os.devnull, "rw") as null:
> +		subprocess.call(["umount", tests_root], stdout=null, stderr=null)

I don't like the idea to hide errors. I would like to suggest to track
when smth is mounted in tests_root and call umount only in this case.

>  	if tests_root:
>  		os.rmdir(tests_root)
>  
> -- 
> 2.6.2
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list