util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests: don't lock fd 1 (stdout)
@ 2018-03-06 23:38 Ruediger Meier
  2018-03-06 23:45 ` Ruediger Meier
  2018-03-07 10:42 ` Karel Zak
  0 siblings, 2 replies; 5+ messages in thread
From: Ruediger Meier @ 2018-03-06 23:38 UTC (permalink / raw)
  To: util-linux

From: Ruediger Meier <ruediger.meier@ga-group.nl>

On debian-kfreebsd we've locked stdout which messed up our test logs. Using
/proc/*/fd/ is not portable. Even ts_init's test for "/proc/self/fd"
does not help because /proc/*/fd behaves strange here:

  $ ls -l  /proc/$$/fd
  lr--r--r-- 1 rudi user 0 Mar  6 23:11 /proc/2194/fd -> unknown
  $ file /proc/$$/fd
  /proc/2194/fd: broken symbolic link to `unknown'
  ## wtf?
  $ test -d /proc/$$/fd; echo $?
  0
  $ ls -l  /proc/$$/fd/
  ls: cannot access /proc/2194/fd/: No such file or directory
  ## but
  $ ls -l  /proc/self/fd/
  total 0
  cr-xr-xr-x 1 root root 0, 3 Mar  6 19:39 0
  cr-xr-xr-x 1 root root 0, 4 Mar  6 19:39 1
  cr-xr-xr-x 1 root root 0, 5 Mar  6 19:39 2
  cr-xr-xr-x 1 root root 0, 6 Mar  6 19:39 3

After this patch we are still using /proc/*/fd in ts_get_lock_fd(). This
should be removed too I guess.

This is how this patch changes the test output:

--- /tmp/a      2018-03-06 22:31:15.000000000 +0000
+++ /tmp/b      2018-03-06 22:30:34.000000000 +0000
@@ -178,7 +178,7 @@
         blkid: partitions probing: [06] sgi                  ... OK
         blkid: partitions probing: [07] sun                  ... OK
         blkid: partitions probing                            ... OK (all 7 sub-tests PASSED)
-ls: cannot access /proc/66215/fd/: No such file or directory
+        blkid: mbr-wholedisk                                 ... SKIPPED (missing scsi_debug module (dry-run))
         blkid: MD raid0 (whole-disks)                        ... SKIPPED (losetup not found)
         blkid: MD raid1 (last partition)                     ... SKIPPED (missing in PATH: mdadm)
         blkid: MD raid1 (whole-disks)                        ... SKIPPED (losetup not found)
@@ -343,11 +343,11 @@
         dmesg: facilities                                    ... SKIPPED (test_dmesg not found)
         dmesg: indentation                                   ... SKIPPED (test_dmesg not found)
         eject: umount                                        ... SKIPPED (eject not found)
-ls: cannot access /proc/69561/fd/: No such file or directory
-ls: cannot access /proc/69609/fd/: No such file or directory
+        fdisk: align 512/4K                                  ... SKIPPED (missing scsi_debug module (dry-run))
+        fdisk: align 512/4K +alignment_offset                ... SKIPPED (missing scsi_debug module (dry-run))
         fdisk: align 512/4K +MD                              ... SKIPPED (missing in PATH: mdadm)
         fdisk: align 512/512                                 ... SKIPPED (losetup not found)
-ls: cannot access /proc/69727/fd/: No such file or directory
+        fdisk: align 512/512 +topology                       ... SKIPPED (missing scsi_debug module (dry-run))
         fdisk: nested BSD                                    ... OK
         fdisk: GPT                                           ... OK
         fdisk: gpt-resize                                    ... SKIPPED (losetup not found)
@@ -557,8 +557,8 @@
      libmount: tab files-py: [10] find-target3               ... OK
      libmount: tab files-py: [11] find-pair                  ... OK
      libmount: tab files-py                                  ... OK (all 11 sub-tests PASSED)
-ls: cannot access /proc/75670/fd/: No such file or directory
-ls: cannot access /proc/75718/fd/: No such file or directory
+     libmount: tags                                          ... SKIPPED (missing scsi_debug module (dry-run))
+     libmount: tags-py                                       ... SKIPPED (missing scsi_debug module (dry-run))
      libmount: tab update: [01] utab-mount                   ... OK
      libmount: tab update: [02] utab-move                    ... OK
      libmount: tab update: [03] utab-remount                 ... OK
@@ -709,12 +709,12 @@
        script: options                                       ... SKIPPED (test_script not found)
        script: race conditions                               ... SKIPPED (script not found)
        script: replay                                        ... SKIPPED (script not found)
-ls: cannot access /proc/79755/fd/: No such file or directory
-ls: cannot access /proc/79803/fd/: No such file or directory
-ls: cannot access /proc/79851/fd/: No such file or directory
-ls: cannot access /proc/79899/fd/: No such file or directory
-ls: cannot access /proc/79947/fd/: No such file or directory
-ls: cannot access /proc/79995/fd/: No such file or directory
+       sfdisk: MBR                                           ... SKIPPED (missing scsi_debug module (dry-run))
+       sfdisk: GPT                                           ... SKIPPED (missing scsi_debug module (dry-run))
+       sfdisk: movedata                                      ... SKIPPED (missing scsi_debug module (dry-run))
+       sfdisk: resize                                        ... SKIPPED (missing scsi_debug module (dry-run))
+       sfdisk: GPT                                           ... SKIPPED (missing scsi_debug module (dry-run))
+       sfdisk: wipe                                          ... SKIPPED (missing scsi_debug module (dry-run))
          sha1: sha1                                          ... OK
        swapon: by devname                                    ... SKIPPED (swapon not found)
        swapon: fix page size                                 ... SKIPPED (swapon not found)
@@ -739,7 +739,7 @@
          uuid: uuidgen                                       ... OK
          uuid: uuidparse                                     ... OK
          uuid: uuid_parser                                   ... OK
-ls: cannot access /proc/81134/fd/: No such file or directory
+       wipefs: wipefs                                        ... SKIPPED (missing scsi_debug module (dry-run))

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
 tests/expected/rename/basic |  1 -
 tests/functions.sh          | 22 ++++++++++++++++++++--
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/tests/expected/rename/basic b/tests/expected/rename/basic
index 8a7a1d804..2c549a270 100644
--- a/tests/expected/rename/basic
+++ b/tests/expected/rename/basic
@@ -1,4 +1,3 @@
 `rename_basic.1' -> `rename_test.1'
 `rename_basic.2' -> `rename_test.2'
 `rename_basic.3' -> `rename_test.3'
-what is rename_basic.? doing here?
diff --git a/tests/functions.sh b/tests/functions.sh
index d1c97e0b6..8cc148fb8 100644
--- a/tests/functions.sh
+++ b/tests/functions.sh
@@ -226,6 +226,8 @@ function ts_init_env {
 	local mydir=$(ts_abspath ${0%/*})
 	local tmp
 
+	shopt -s nullglob
+
 	LANG="POSIX"
 	LANGUAGE="POSIX"
 	LC_ALL="POSIX"
@@ -697,7 +699,7 @@ function ts_get_lock_fd {
         local proc=$1
         local lockfile=$2
 
-        for fd in $(ls /proc/$proc/fd); do
+        for fd in /proc/$proc/fd/*; do
                 file=$(readlink "/proc/$proc/fd/$fd")
                 if [ x"$file" = x"$lockfile" ]; then
                         echo "$fd"
@@ -707,6 +709,22 @@ function ts_get_lock_fd {
         return 1
 }
 
+# https://stackoverflow.com/questions/41603787/how-to-find-next-available-file-descriptor-in-bash
+function ts_find_free_fd()
+{
+	local rco
+	local rci
+	for fd in {0..200}; do
+		rco="$(true 2>/dev/null >&${fd}; echo $?)"
+		rci="$(true 2>/dev/null <&${fd}; echo $?)"
+		if [[ "${rco}${rci}" = "11" ]]; then
+			echo "$fd"
+			return 0
+		fi
+	done
+	return 1
+}
+
 function ts_lock {
 	local resource="$1"
 	local lockfile="${TS_LOCKDIR}/${resource}.lock"
@@ -723,7 +741,7 @@ function ts_lock {
 		return 0
 	fi
 
-	fd=$(( $(ls /proc/$$/fd/ | sort | tail -1) + 1))
+	fd=$(ts_find_free_fd) || ts_skip "failed to find lock fd"
 
 	eval "exec $fd>$lockfile"
 	flock --exclusive --timeout 30 $fd || ts_skip "failed to lock $resource"
-- 
2.13.6


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

* Re: [PATCH] tests: don't lock fd 1 (stdout)
  2018-03-06 23:38 [PATCH] tests: don't lock fd 1 (stdout) Ruediger Meier
@ 2018-03-06 23:45 ` Ruediger Meier
  2018-03-07 10:42 ` Karel Zak
  1 sibling, 0 replies; 5+ messages in thread
From: Ruediger Meier @ 2018-03-06 23:45 UTC (permalink / raw)
  To: util-linux

On Wednesday 07 March 2018, Ruediger Meier wrote:
> From: Ruediger Meier <ruediger.meier@ga-group.nl>
>
> On debian-kfreebsd we've locked stdout which messed up our test logs.
> Using /proc/*/fd/ is not portable. Even ts_init's test for
> "/proc/self/fd" does not help because /proc/*/fd behaves strange
> here:
>
>   $ ls -l  /proc/$$/fd
>   lr--r--r-- 1 rudi user 0 Mar  6 23:11 /proc/2194/fd -> unknown
>   $ file /proc/$$/fd
>   /proc/2194/fd: broken symbolic link to `unknown'
>   ## wtf?
>   $ test -d /proc/$$/fd; echo $?
>   0
>   $ ls -l  /proc/$$/fd/
>   ls: cannot access /proc/2194/fd/: No such file or directory
>   ## but
>   $ ls -l  /proc/self/fd/
>   total 0
>   cr-xr-xr-x 1 root root 0, 3 Mar  6 19:39 0
>   cr-xr-xr-x 1 root root 0, 4 Mar  6 19:39 1
>   cr-xr-xr-x 1 root root 0, 5 Mar  6 19:39 2
>   cr-xr-xr-x 1 root root 0, 6 Mar  6 19:39 3
>
> After this patch we are still using /proc/*/fd in ts_get_lock_fd().
> This should be removed too I guess.
>
> This is how this patch changes the test output:
>
> --- /tmp/a      2018-03-06 22:31:15.000000000 +0000
> +++ /tmp/b      2018-03-06 22:30:34.000000000 +0000
> @@ -178,7 +178,7 @@
>          blkid: partitions probing: [06] sgi                  ... OK
>          blkid: partitions probing: [07] sun                  ... OK
>          blkid: partitions probing                            ... OK
> (all 7 sub-tests PASSED) -ls: cannot access /proc/66215/fd/: No such
> file or directory +        blkid: mbr-wholedisk                      
>           ... SKIPPED (missing scsi_debug module (dry-run)) blkid: MD
> raid0 (whole-disks)                        ... SKIPPED (losetup not
> found) blkid: MD raid1 (last partition)                     ...
> SKIPPED (missing in PATH: mdadm) blkid: MD raid1 (whole-disks)       
>                 ... SKIPPED (losetup not found) @@ -343,11 +343,11 @@
>          dmesg: facilities                                    ...
> SKIPPED (test_dmesg not found) dmesg: indentation                    
>               ... SKIPPED (test_dmesg not found) eject: umount       
>                                 ... SKIPPED (eject not found) -ls:
> cannot access /proc/69561/fd/: No such file or directory -ls: cannot
> access /proc/69609/fd/: No such file or directory +        fdisk:
> align 512/4K                                  ... SKIPPED (missing
> scsi_debug module (dry-run)) +        fdisk: align 512/4K
> +alignment_offset                ... SKIPPED (missing scsi_debug
> module (dry-run)) fdisk: align 512/4K +MD                            
>  ... SKIPPED (missing in PATH: mdadm) fdisk: align 512/512           
>                      ... SKIPPED (losetup not found) -ls: cannot
> access /proc/69727/fd/: No such file or directory +        fdisk:
> align 512/512 +topology                       ... SKIPPED (missing
> scsi_debug module (dry-run)) fdisk: nested BSD                       
>             ... OK fdisk: GPT                                        
>   ... OK fdisk: gpt-resize                                    ...
> SKIPPED (losetup not found) @@ -557,8 +557,8 @@
>       libmount: tab files-py: [10] find-target3               ... OK
>       libmount: tab files-py: [11] find-pair                  ... OK
>       libmount: tab files-py                                  ... OK
> (all 11 sub-tests PASSED) -ls: cannot access /proc/75670/fd/: No such
> file or directory -ls: cannot access /proc/75718/fd/: No such file or
> directory +     libmount: tags                                       
>   ... SKIPPED (missing scsi_debug module (dry-run)) +     libmount:
> tags-py                                       ... SKIPPED (missing
> scsi_debug module (dry-run)) libmount: tab update: [01] utab-mount   
>                ... OK libmount: tab update: [02] utab-move           
>         ... OK libmount: tab update: [03] utab-remount               
>  ... OK @@ -709,12 +709,12 @@
>         script: options                                       ...
> SKIPPED (test_script not found) script: race conditions              
>                 ... SKIPPED (script not found) script: replay        
>                                ... SKIPPED (script not found) -ls:
> cannot access /proc/79755/fd/: No such file or directory -ls: cannot
> access /proc/79803/fd/: No such file or directory -ls: cannot access
> /proc/79851/fd/: No such file or directory -ls: cannot access
> /proc/79899/fd/: No such file or directory -ls: cannot access
> /proc/79947/fd/: No such file or directory -ls: cannot access
> /proc/79995/fd/: No such file or directory +       sfdisk: MBR       
>                                    ... SKIPPED (missing scsi_debug
> module (dry-run)) +       sfdisk: GPT                                
>           ... SKIPPED (missing scsi_debug module (dry-run)) +      
> sfdisk: movedata                                      ... SKIPPED
> (missing scsi_debug module (dry-run)) +       sfdisk: resize         
>                               ... SKIPPED (missing scsi_debug module
> (dry-run)) +       sfdisk: GPT                                       
>    ... SKIPPED (missing scsi_debug module (dry-run)) +       sfdisk:
> wipe                                          ... SKIPPED (missing
> scsi_debug module (dry-run)) sha1: sha1                              
>            ... OK swapon: by devname                                 
>   ... SKIPPED (swapon not found) swapon: fix page size               
>                  ... SKIPPED (swapon not found) @@ -739,7 +739,7 @@
>           uuid: uuidgen                                       ... OK
>           uuid: uuidparse                                     ... OK
>           uuid: uuid_parser                                   ... OK
> -ls: cannot access /proc/81134/fd/: No such file or directory
> +       wipefs: wipefs                                        ...
> SKIPPED (missing scsi_debug module (dry-run))
>
> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
>
> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
> ---
>  tests/expected/rename/basic |  1 -
>  tests/functions.sh          | 22 ++++++++++++++++++++--
>  2 files changed, 20 insertions(+), 3 deletions(-)
>
> diff --git a/tests/expected/rename/basic
> b/tests/expected/rename/basic index 8a7a1d804..2c549a270 100644
> --- a/tests/expected/rename/basic
> +++ b/tests/expected/rename/basic
> @@ -1,4 +1,3 @@
>  `rename_basic.1' -> `rename_test.1'
>  `rename_basic.2' -> `rename_test.2'
>  `rename_basic.3' -> `rename_test.3'
> -what is rename_basic.? doing here?
> diff --git a/tests/functions.sh b/tests/functions.sh
> index d1c97e0b6..8cc148fb8 100644
> --- a/tests/functions.sh
> +++ b/tests/functions.sh
> @@ -226,6 +226,8 @@ function ts_init_env {
>  	local mydir=$(ts_abspath ${0%/*})
>  	local tmp
>
> +	shopt -s nullglob
> +
>  	LANG="POSIX"
>  	LANGUAGE="POSIX"
>  	LC_ALL="POSIX"
> @@ -697,7 +699,7 @@ function ts_get_lock_fd {
>          local proc=$1
>          local lockfile=$2
>
> -        for fd in $(ls /proc/$proc/fd); do
> +        for fd in /proc/$proc/fd/*; do
>                  file=$(readlink "/proc/$proc/fd/$fd")
>                  if [ x"$file" = x"$lockfile" ]; then
>                          echo "$fd"
> @@ -707,6 +709,22 @@ function ts_get_lock_fd {
>          return 1
>  }
>
> +#
> https://stackoverflow.com/questions/41603787/how-to-find-next-availab
>le-file-descriptor-in-bash +function ts_find_free_fd()
> +{
> +	local rco
> +	local rci
> +	for fd in {0..200}; do

Maybe we should use {3..200} to safe a few loops in 99.9% of all runs. 

> +		rco="$(true 2>/dev/null >&${fd}; echo $?)"
> +		rci="$(true 2>/dev/null <&${fd}; echo $?)"
> +		if [[ "${rco}${rci}" = "11" ]]; then
> +			echo "$fd"
> +			return 0
> +		fi
> +	done
> +	return 1
> +}
> +
>  function ts_lock {
>  	local resource="$1"
>  	local lockfile="${TS_LOCKDIR}/${resource}.lock"
> @@ -723,7 +741,7 @@ function ts_lock {
>  		return 0
>  	fi
>
> -	fd=$(( $(ls /proc/$$/fd/ | sort | tail -1) + 1))
> +	fd=$(ts_find_free_fd) || ts_skip "failed to find lock fd"
>
>  	eval "exec $fd>$lockfile"
>  	flock --exclusive --timeout 30 $fd || ts_skip "failed to lock
> $resource"

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

* Re: [PATCH] tests: don't lock fd 1 (stdout)
  2018-03-06 23:38 [PATCH] tests: don't lock fd 1 (stdout) Ruediger Meier
  2018-03-06 23:45 ` Ruediger Meier
@ 2018-03-07 10:42 ` Karel Zak
  2018-03-07 11:48   ` Ruediger Meier
  2018-03-07 14:31   ` Ruediger Meier
  1 sibling, 2 replies; 5+ messages in thread
From: Karel Zak @ 2018-03-07 10:42 UTC (permalink / raw)
  To: Ruediger Meier; +Cc: util-linux

On Wed, Mar 07, 2018 at 12:38:07AM +0100, Ruediger Meier wrote:
> This is how this patch changes the test output:
> 
> --- /tmp/a      2018-03-06 22:31:15.000000000 +0000
> +++ /tmp/b      2018-03-06 22:30:34.000000000 +0000

git-am had really difficult time to accept to your patch with patch in the patch
comment :-)

> index d1c97e0b6..8cc148fb8 100644
> --- a/tests/functions.sh
> +++ b/tests/functions.sh
> @@ -226,6 +226,8 @@ function ts_init_env {
>  	local mydir=$(ts_abspath ${0%/*})
>  	local tmp
>  
> +	shopt -s nullglob
> +

1) It seems it breaks ts/ipcs/limits:ipcs_limits_check(), the sed
   arguments in the line

    "echo \$(cat /proc/sys/kernel/shmall) / 1024 \* $PAGE_SIZE | bc -l | sed 's/\..*//'"

are ignored, so with eval it calls

    eval echo '$(cat' '/proc/sys/kernel/shmall)' / 1024 '\*' 4096 '|' bc -l '|' sed

I have added

    shopt -u nullglob 

to the function to fix the problem. It seems it works.


2) I see

            mount: btrfs (fstab)                  ...
                : btrfs                       ... OK
                : auto                        ... SKIPPED (failed to lock fstab)


 and with ./run.sh --parallel I see another "failed to lock" messages :-(


Maybe we can use --nolocks for debian-kfreebsd (TS_NOLOCKS in
tests/functions.sh).

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

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

* Re: [PATCH] tests: don't lock fd 1 (stdout)
  2018-03-07 10:42 ` Karel Zak
@ 2018-03-07 11:48   ` Ruediger Meier
  2018-03-07 14:31   ` Ruediger Meier
  1 sibling, 0 replies; 5+ messages in thread
From: Ruediger Meier @ 2018-03-07 11:48 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

On Wednesday 07 March 2018, Karel Zak wrote:
> On Wed, Mar 07, 2018 at 12:38:07AM +0100, Ruediger Meier wrote:
> > This is how this patch changes the test output:
> >
> > --- /tmp/a      2018-03-06 22:31:15.000000000 +0000
> > +++ /tmp/b      2018-03-06 22:30:34.000000000 +0000
>
> git-am had really difficult time to accept to your patch with patch
> in the patch comment :-)

Oops.

> > index d1c97e0b6..8cc148fb8 100644
> > --- a/tests/functions.sh
> > +++ b/tests/functions.sh
> > @@ -226,6 +226,8 @@ function ts_init_env {
> >  	local mydir=$(ts_abspath ${0%/*})
> >  	local tmp
> >
> > +	shopt -s nullglob
> > +
>
> 1) It seems it breaks ts/ipcs/limits:ipcs_limits_check(), the sed
>    arguments in the line

Ah sorry, I've checked the tests only on that bsd box. I will review 
again and do it without "shopt -s nullglob". It's confusing anyways for 
test writers if the bash uses non-default options.

>     "echo \$(cat /proc/sys/kernel/shmall) / 1024 \* $PAGE_SIZE | bc
> -l | sed 's/\..*//'"
>
> are ignored, so with eval it calls
>
>     eval echo '$(cat' '/proc/sys/kernel/shmall)' / 1024 '\*' 4096 '|'
> bc -l '|' sed
>
> I have added
>
>     shopt -u nullglob
>
> to the function to fix the problem. It seems it works.
>
>
> 2) I see
>
>             mount: btrfs (fstab)                  ...
>
>                 : btrfs                       ... OK
>                 : auto                        ... SKIPPED (failed to
>                 : lock fstab)
>
>  and with ./run.sh --parallel I see another "failed to lock" messages
> :-(

Hm, I had never really tried --parallel root checks yet because the 
non-deterministic behavior regarding udevadm and my NFS /home is 
already complicated enough for my taste ;)

Are the files unlocked automatically if we exit the test without calling 
ts_unlock?

BTW could it be better to use our own ./flock instead of the global one? 
And maybe it's possible to print separate messages for "failed to lock" 
and "timeout lock".

>
> Maybe we can use --nolocks for debian-kfreebsd (TS_NOLOCKS in
> tests/functions.sh).

Well, I had already tried to check whether /proc/*/fd is behaving like 
we expect. But seems difficult to find out. Maybe just the stupid way, 
like:

  if root && ! Linux; then parallel=1 
  if ! Linux; then TS_NOLOCKS=yes

cu,
Rudi


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

* Re: [PATCH] tests: don't lock fd 1 (stdout)
  2018-03-07 10:42 ` Karel Zak
  2018-03-07 11:48   ` Ruediger Meier
@ 2018-03-07 14:31   ` Ruediger Meier
  1 sibling, 0 replies; 5+ messages in thread
From: Ruediger Meier @ 2018-03-07 14:31 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

On Wednesday 07 March 2018, Karel Zak wrote:
> On Wed, Mar 07, 2018 at 12:38:07AM +0100, Ruediger Meier wrote:
> > This is how this patch changes the test output:
> >
> > --- /tmp/a      2018-03-06 22:31:15.000000000 +0000
> > +++ /tmp/b      2018-03-06 22:30:34.000000000 +0000
>
> git-am had really difficult time to accept to your patch with patch
> in the patch comment :-)
>
> > index d1c97e0b6..8cc148fb8 100644
> > --- a/tests/functions.sh
> > +++ b/tests/functions.sh
> > @@ -226,6 +226,8 @@ function ts_init_env {
> >  	local mydir=$(ts_abspath ${0%/*})
> >  	local tmp
> >
> > +	shopt -s nullglob
> > +
>
> 1) It seems it breaks ts/ipcs/limits:ipcs_limits_check(), the sed
>    arguments in the line
>
>     "echo \$(cat /proc/sys/kernel/shmall) / 1024 \* $PAGE_SIZE | bc
> -l | sed 's/\..*//'"
>
> are ignored, so with eval it calls
>
>     eval echo '$(cat' '/proc/sys/kernel/shmall)' / 1024 '\*' 4096 '|'
> bc -l '|' sed
>
> I have added
>
>     shopt -u nullglob
>
> to the function to fix the problem. It seems it works.
>
>
> 2) I see
>
>             mount: btrfs (fstab)                  ...
>
>                 : btrfs                       ... OK
>                 : auto                        ... SKIPPED (failed to
>                 : lock fstab)
>
>  and with ./run.sh --parallel I see another "failed to lock" messages
> :-(

This seems independent of my patch. The test-suite does not survive when 
flock timeouts after 30s because then ts_cleanup_on_exit() may use 
resources (e.g. rmmod scsi_debug) while not having the lock. You will 
see it even better when using

  flock --exclusive --timeout 1

I'm going to fix that and send patches.

>
> Maybe we can use --nolocks for debian-kfreebsd (TS_NOLOCKS in
> tests/functions.sh).

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

end of thread, other threads:[~2018-03-07 14:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-06 23:38 [PATCH] tests: don't lock fd 1 (stdout) Ruediger Meier
2018-03-06 23:45 ` Ruediger Meier
2018-03-07 10:42 ` Karel Zak
2018-03-07 11:48   ` Ruediger Meier
2018-03-07 14:31   ` Ruediger Meier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).