[CRIU] [PATCH] zdtm: don't run file_locks* tests simultaneously

Andrew Vagin avagin at odin.com
Thu Sep 17 07:37:50 PDT 2015


On Thu, Sep 17, 2015 at 02:25:34PM +0300, Pavel Emelyanov wrote:
> On 09/16/2015 06:41 PM, Andrew Vagin wrote:
> > /proc/locks can contains the same locks twice, if someone
> > releases a lock when we are reading this file.
> > 
> > Signed-off-by: Andrew Vagin <avagin at openvz.org>
> > ---
> >  test/zdtm.sh | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/test/zdtm.sh b/test/zdtm.sh
> > index f12156a..89b3ec3 100755
> > --- a/test/zdtm.sh
> > +++ b/test/zdtm.sh
> > @@ -1173,7 +1173,11 @@ if [ $SPECIFIED_NAME_USED -eq 1 ]; then
> >  		exit 1
> >  	fi
> >  	$CRIU check -v0 --feature "mnt_id" || export ZDTM_NOSUBNS=1
> > -	run_test $1 || case_error $1
> > +	# don't run file_locks* tests simultaneously
> > +	(
> > +		expr $1 : ".*file_locks" > /dev/null && flock 10
> > +		run_test $1 10<&-
> > +	) 10<zdtm.sh || case_error $1
> 
> O_O
> 
> What?

We lock zdtm.sh when one of *file_locks* tests is executed, so they can
not be executed simultaneously.


> 
> >  else
> >  	if [ $# -eq 0 ]; then
> >  		pattern='.*'
> > 
> 


More information about the CRIU mailing list