diff mbox series

[2/2] qemu-iotests: check socket_scm_helper is available

Message ID 20171219163713.31383-3-f4bug@amsat.org
State New
Headers show
Series qemu-iotests: add missing make rule for socket_scm_helper | expand

Commit Message

Philippe Mathieu-Daudé Dec. 19, 2017, 4:37 p.m. UTC
This now throws a more helpful error message when not found:

  tests/qemu-iotests$ ./check 045
  QEMU          -- "/qemu/build/x86_64-softmmu/qemu-system-x86_64" -nodefaults -machine accel=qtest
  QEMU_IMG      -- "/qemu/build/qemu-img"
  QEMU_IO       -- "/qemu/build/qemu-io"  --cache writeback -f raw
  QEMU_NBD      -- "/qemu/build/qemu-nbd"
  TEST_DIR      -- /qemu/build/tests/qemu-iotests/scratch
  SOCKET_SCM_HELPER --

  045 1s ... [failed, exit status 1] - output mismatch (see 045.out.bad)
  -...........
  +......EE.EE
  +======================================================================
  +ERROR: test_add_fd (__main__.TestSCMFd)
  +----------------------------------------------------------------------
  +Traceback (most recent call last):
  +  File "045", line 147, in test_add_fd
  +    self._send_fd_by_SCM()
  +  File "045", line 143, in _send_fd_by_SCM
  +    ret = self.vm.send_fd_scm(image0)
  +  File "/source/qemu/tests/qemu-iotests/../../scripts/qemu.py", line 125, in send_fd_scm
  +    self._socket_scm_helper)
  +QEMUMachineError: socket_scm_helper does not exist
  +
   ----------------------------------------------------------------------
  Failures: 045
  Failed 1 of 1 tests

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 tests/qemu-iotests/check | 2 ++
 1 file changed, 2 insertions(+)

Comments

Max Reitz Jan. 29, 2018, 3:10 p.m. UTC | #1
On 2017-12-19 17:37, Philippe Mathieu-Daudé wrote:
> This now throws a more helpful error message when not found:
> 
>   tests/qemu-iotests$ ./check 045
>   QEMU          -- "/qemu/build/x86_64-softmmu/qemu-system-x86_64" -nodefaults -machine accel=qtest
>   QEMU_IMG      -- "/qemu/build/qemu-img"
>   QEMU_IO       -- "/qemu/build/qemu-io"  --cache writeback -f raw
>   QEMU_NBD      -- "/qemu/build/qemu-nbd"
>   TEST_DIR      -- /qemu/build/tests/qemu-iotests/scratch
>   SOCKET_SCM_HELPER --
> 
>   045 1s ... [failed, exit status 1] - output mismatch (see 045.out.bad)
>   -...........
>   +......EE.EE
>   +======================================================================
>   +ERROR: test_add_fd (__main__.TestSCMFd)
>   +----------------------------------------------------------------------
>   +Traceback (most recent call last):
>   +  File "045", line 147, in test_add_fd
>   +    self._send_fd_by_SCM()
>   +  File "045", line 143, in _send_fd_by_SCM
>   +    ret = self.vm.send_fd_scm(image0)
>   +  File "/source/qemu/tests/qemu-iotests/../../scripts/qemu.py", line 125, in send_fd_scm
>   +    self._socket_scm_helper)
>   +QEMUMachineError: socket_scm_helper does not exist
>   +
>    ----------------------------------------------------------------------
>   Failures: 045
>   Failed 1 of 1 tests
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  tests/qemu-iotests/check | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
> index e6b6ff7a04..a2c0bab1cc 100755
> --- a/tests/qemu-iotests/check
> +++ b/tests/qemu-iotests/check
> @@ -597,6 +597,8 @@ fi
>  if [ -x "$build_iotests/socket_scm_helper" ]
>  then
>      export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
> +else
> +    _init_error "socket_scm_helper not found"
>  fi

Hmm... I'm not so sure about this.  Now if you don't have
socket_scm_helper for some reason and you want to run a test that does
not need it, you cannot do that anymore (but currently you can).

OTOH, I'm not sure how important that use case is.  Usually, you can run
the iotests only if you can build the socket_scm_helper, too.

Also, the error message you mention in the commit message is exactly
what I get without this patch.  Your patch just changes it to
“socket_scm_helper not found”.  So even if nobody really would care
about the “regression”, I don't quite see the point of this change...

Max
diff mbox series

Patch

diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index e6b6ff7a04..a2c0bab1cc 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -597,6 +597,8 @@  fi
 if [ -x "$build_iotests/socket_scm_helper" ]
 then
     export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
+else
+    _init_error "socket_scm_helper not found"
 fi
 
 default_machine=$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//p')