public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Amos Kong <akong@redhat.com>
Cc: autotest@test.kernel.org, kvm@vger.kernel.org
Subject: Re: [RFC PATCH] KVM-test: Add subtest: usb
Date: Mon, 01 Aug 2011 09:33:57 +0200	[thread overview]
Message-ID: <4E3656E5.4070000@redhat.com> (raw)
In-Reply-To: <20110729045302.16386.89319.stgit@t>

On 07/29/11 06:53, Amos Kong wrote:
> This test adds a usb storage for the guest, and do some check from monitor and
> inside the guest.
> It's not very stable, could you help to review if something is wrong?

"Not stable" means what exactly?

> +    output = session.get_command_output("lsusb")
> +    #no bus specified, default using "usb.0" for "usb-storage"
> +    if "ID 0000:0000" not in output:
> +        logging.debug(output)
> +        raise error.TestFail("No 'ID 0000:0000' in the output of 'lsusb'")

You can use "lsusb -v" here, then you get something better to match. 
Also lsusb does some more usb requests then.  Should also check for 
errors in the lsusb output.

> +    output = session.get_command_output("fdisk -l")
> +    if params.get("fdisk_string") not in output:
> +        logging.debug(output)
> +        raise error.TestFail("Could not realise the usb device")
> +
> +    error.context("Formating usb disk")
> +    dev_list = session.get_command_output("ls /dev/sd[a-z]")
> +    session.cmd("yes |mkfs %s" % dev_list.split()[-1],
> +                timeout=int(params.get("format_timeout")))

You can look at /dev/disk/by-path/ to figure which /dev/sd<x> the usb 
flashdrive is.

cheers,
   Gerd

  reply	other threads:[~2011-08-01  7:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29  4:53 [RFC PATCH] KVM-test: Add subtest: usb Amos Kong
2011-08-01  7:33 ` Gerd Hoffmann [this message]
2011-08-02 11:10   ` Amos Kong
2011-08-02 14:24     ` Gerd Hoffmann
2011-08-02 11:47   ` [PATCH v2] " Amos Kong
2011-08-03  5:43     ` [PATCH v3] " Amos Kong

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=4E3656E5.4070000@redhat.com \
    --to=kraxel@redhat.com \
    --cc=akong@redhat.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm@vger.kernel.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