qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Alex Bradbury <asb@asbradbury.org>
Cc: Anthony Liguori <aliguori@us.ibm.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-test: add virtio-serial test
Date: Thu, 22 Dec 2011 10:55:45 -0600	[thread overview]
Message-ID: <4EF36111.9000503@codemonkey.ws> (raw)
In-Reply-To: <CA+wH297K5o=o+b+UOU4+UhSOJwdiUqE8qQxf5Y4z+3UR9RnMLA@mail.gmail.com>

On 12/22/2011 09:46 AM, Alex Bradbury wrote:
> On 22 December 2011 14:23, Anthony Liguori<aliguori@us.ibm.com>  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<aliguori@us.ibm.com>
>> ---
>>   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
>

      parent reply	other threads:[~2011-12-22 16:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-22 14:23 [Qemu-devel] [PATCH] qemu-test: add virtio-serial test Anthony Liguori
2011-12-22 15:46 ` Alex Bradbury
2011-12-22 15:58   ` Eric Blake
2011-12-22 16:20     ` Alex Bradbury
2011-12-22 16:55   ` Anthony Liguori [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EF36111.9000503@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=aliguori@us.ibm.com \
    --cc=asb@asbradbury.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).