From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rdlvv-0005na-0j for qemu-devel@nongnu.org; Thu, 22 Dec 2011 11:56:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rdlvr-0000mp-0l for qemu-devel@nongnu.org; Thu, 22 Dec 2011 11:55:54 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:65289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rdlvq-0000mc-TZ for qemu-devel@nongnu.org; Thu, 22 Dec 2011 11:55:50 -0500 Received: by iagj37 with SMTP id j37so15614843iag.4 for ; Thu, 22 Dec 2011 08:55:50 -0800 (PST) Message-ID: <4EF36111.9000503@codemonkey.ws> Date: Thu, 22 Dec 2011 10:55:45 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <1324563805-4285-1-git-send-email-aliguori@us.ibm.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qemu-test: add virtio-serial test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bradbury Cc: Anthony Liguori , qemu-devel@nongnu.org On 12/22/2011 09:46 AM, Alex Bradbury wrote: > On 22 December 2011 14:23, Anthony Liguori wrote: >> This is a pretty simple test that just confirms that virtio-serial shows up and >> is writable. It also tests the alias for virtio-serial-pci. >> >> Signed-off-by: Anthony Liguori >> --- >> tests/virtio-serial.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 files changed, 52 insertions(+), 0 deletions(-) >> create mode 100755 tests/virtio-serial.sh >> >> diff --git a/tests/virtio-serial.sh b/tests/virtio-serial.sh >> new file mode 100755 >> index 0000000..e95ae6e >> --- /dev/null >> +++ b/tests/virtio-serial.sh >> @@ -0,0 +1,52 @@ >> +#!/bin/sh >> + >> +canary="** waiting for... **" >> + >> +in_host() { >> + tmpchr=$tmpdir/chr.log > > By far the most common error likely to appear in any of these test > scripts is insufficient shell quoting causing e.g. breakages when the > scripts are run from a directory with spaces. Having looked at > qemu-test, I see that $tmpdir is set to .tmp-$$ and so can never > contain spaces, and so it's fine to not quote the variable expansion. > That said, perhaps it would make it easier to review scripts and less > likely for these issues to creep in to the codebase if there was a > blanket rule that all variable expansions be quoted? In general, I try to be very careful about that. The only time tests ever refer to filenames is relative to tmpdir and as you've noted, tmpdir purposefully cannot have a space in it. So I don't think it's going to be a problem. I can't see an immediate reason why tests should use anything outside of tmpdir. Regards, Anthony Liguori > > Alex >