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

Tycho Andersen tycho.andersen at canonical.com
Mon Nov 30 11:02:35 PST 2015


On Mon, Nov 30, 2015 at 01:43:29PM +0300, Andrew Vagin wrote:
> 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.

Actually looking at it a bit closer, it seems that we should drop this
all together (and doing so doesn't manifest the error I saw which
caused me to add it). I think rm that fails because we didn't umount
means that fini() wasn't called on some path. Does that make sense?

Tycho

> >  	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