Patchwork iotests: Resolve test failures caused by hostname

login
register
mail settings
Submitter Andreas Färber
Date April 20, 2012, 10:50 a.m.
Message ID <1334919024-21978-1-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/154011/
State New
Headers show

Comments

Andreas Färber - April 20, 2012, 10:50 a.m.
`hostname -s` may output an errror:
hostname: Name or service not known
This causes all tests to fail for `make check-block`.

Suppress such error messages, letting the tests succeed.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 tests/qemu-iotests/common.config |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Kevin Wolf - April 20, 2012, 10:59 a.m.
Am 20.04.2012 12:50, schrieb Andreas Färber:
> `hostname -s` may output an errror:
> hostname: Name or service not known
> This causes all tests to fail for `make check-block`.
> 
> Suppress such error messages, letting the tests succeed.
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>

Thanks, applied to the block branch.

Kevin
Stefan Weil - April 20, 2012, 11:36 a.m.
Am 20.04.2012 12:59, schrieb Kevin Wolf:
> Am 20.04.2012 12:50, schrieb Andreas Färber:
>> `hostname -s` may output an errror:
>> hostname: Name or service not known
>> This causes all tests to fail for `make check-block`.
>>
>> Suppress such error messages, letting the tests succeed.
>>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>
> Thanks, applied to the block branch.
>
> Kevin

Do we really need the '-s'? There are versions of hostname
which don't support the '-s' option (for example on MinGW).

Stefan

Patch

diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index a220684..df082e7 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -36,7 +36,7 @@  export LANG=C
 
 PATH=".:$PATH"
 
-HOST=`hostname -s`
+HOST=`hostname -s 2> /dev/null`
 HOSTOS=`uname -s`
 
 EMAIL=root@localhost    # where auto-qa will send its status messages