Received: from eggs.gnu.org ([2001:4830:134:3::10]:50166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bcBEX-0005KT-2F for qemu-devel@nongnu.org; Tue, 23 Aug 2016 08:55:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bcBEW-0007Bm-3w for qemu-devel@nongnu.org; Tue, 23 Aug 2016 08:55:12 -0400 References: <20160819131202.19369-1-mreitz@redhat.com> <874m6blnfa.fsf@oc4731375738.ibm.com> From: Max Reitz Message-ID: <31b27429-bde0-016b-ce2a-ff965571fa61@redhat.com> Date: Tue, 23 Aug 2016 08:55:02 -0400 MIME-Version: 1.0 In-Reply-To: <874m6blnfa.fsf@oc4731375738.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.8] iotests: Do not rely on unavailable domains in 162 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sascha Silbe , qemu-block@nongnu.org Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi On 2016-08-23 at 07:44, Sascha Silbe wrote: > Dear Max, > > Max Reitz writes: > > [tests/qemu-iotests/162] > [...] >> +# (We need to set up a server here, because the error message for "Connection >> +# refused" does not contain the destination port) >> +$QEMU_NBD -p 42424 -f raw null-co:// & >> +sleep 0.5 >> +$QEMU_IMG info 'json:{"driver": "nbd", "host": "localhost", "port": 42424}' \ >> + | grep '^image' > > Using a fixed port number means multiple users won't be able to run this > in parallel. That it's only open for a short time actually makes the > issue a bit worse as it's hard to understand just why the test failed > intermittently. > > Is there a way to have qemu-nbd use a random port and print the port > number? Good idea. We can just let the script generate a random port; $(($RANDOM+32768)) should do the trick. Max