WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 9/9] xl: new "check-xl-disk-parse" test script fo

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 9/9] xl: new "check-xl-disk-parse" test script for disk parser
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Fri, 3 Jun 2011 11:38:11 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 03 Jun 2011 03:38:44 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1307037346-31251-10-git-send-email-ian.jackson@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <1307037346-31251-1-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1307037346-31251-2-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1307037346-31251-3-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1307037346-31251-4-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1307037346-31251-5-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1307037346-31251-6-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1307037346-31251-7-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1307037346-31251-8-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1307037346-31251-9-git-send-email-ian.jackson@xxxxxxxxxxxxx> <1307037346-31251-10-git-send-email-ian.jackson@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Thu, 2011-06-02 at 18:55 +0100, Ian Jackson wrote:
> This runs "xl block-attach -N 1 <some strings>" for various sets of
> strings and checks that the output is as expected.

Does this work if there is no dom1? It looks like the
domain_qualifier_to_domid will fail before you get to produce any
output.

block-attach should work on dom0 (more so for dry run), which most
likely does exist ;-).

Ian.

> 
> Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
> ---
>  tools/libxl/check-xl-disk-parse |   82 
> +++++++++++++++++++++++++++++++++++++++
>  1 files changed, 82 insertions(+), 0 deletions(-)
>  create mode 100755 tools/libxl/check-xl-disk-parse
> 
> diff --git a/tools/libxl/check-xl-disk-parse b/tools/libxl/check-xl-disk-parse
> new file mode 100755
> index 0000000..caaff9d
> --- /dev/null
> +++ b/tools/libxl/check-xl-disk-parse
> @@ -0,0 +1,82 @@
> +#!/bin/bash
> +
> +set -e
> +
> +fprefix=tmp.check-xl-disk-parse
> +
> +expected () {
> +    cat >$fprefix.expected
> +}
> +
> +failures=0
> +
> +one () {
> +    expected_rc=$1; shift
> +    printf "test case %s...\n" "$*"
> +    set +e
> +    LD_LIBRARY_PATH=.:../libxc:../xenstore \
> +        ./xl block-attach -N 1 "$@" </dev/null >$fprefix.actual 2>/dev/null
> +    actual_rc=$?
> +    diff -u $fprefix.expected $fprefix.actual
> +    diff_rc=$?
> +    set -e
> +    if [ $actual_rc != $expected_rc ] || [ $diff_rc != 0 ]; then
> +        echo >&2 "test case \`$*' failed ($actual_rc $diff_rc)"
> +        failures=$(( $failures + 1 ))
> +    fi
> +}
> +
> +complete () {
> +    if [ "$failures" = 0 ]; then
> +        echo all ok.; exit 0
> +    else
> +        echo "$failures tests failed."; exit 1
> +    fi
> +}
> +
> +e=255
> +
> +
> +#---------- test data ----------
> +#
> +# culled from docs/misc/xl-disk-configuration.txt
> +
> +expected </dev/null
> +one $e foo
> +
> +expected <<END
> +disk.backend_domid = 0
> +disk.pdev_path =     /dev/vg/guest-volume
> +disk.vdev =          hda
> +disk.backend =       0
> +disk.format =        4
> +disk.script =        (null)
> +disk.removable =     0
> +disk.readwrite =     1
> +disk.is_cdrom =      0
> +END
> +one 0 /dev/vg/guest-volume,,hda
> +one 0 /dev/vg/guest-volume,raw,hda,rw
> +one 0 "format=raw, vdev=hda, access=rw, target=/dev/vg/guest-volume"
> +one 0  format=raw  vdev=hda  access=rw  target=/dev/vg/guest-volume
> +one 0 raw:/dev/vg/guest-volume,hda,w
> +
> +expected <<END
> +disk.backend_domid = 0
> +disk.pdev_path =     /root/image.iso
> +disk.vdev =          hdc
> +disk.backend =       0
> +disk.format =        4
> +disk.script =        (null)
> +disk.removable =     1
> +disk.readwrite =     0
> +disk.is_cdrom =      1
> +END
> +one 0 /root/image.iso,,hdc,cdrom
> +one 0 /root/image.iso,,hdc,,cdrom
> +one 0 /root/image.iso,raw,hdc,devtype=cdrom
> +one 0 "format=raw, vdev=hdc, access=ro, devtype=cdrom, 
> target=/root/image.iso"
> +one 0  format=raw  vdev=hdc  access=ro  devtype=cdrom  target=/root/image.iso
> +one 0 raw:/root/image.iso,hdc:cdrom,ro
> +
> +complete



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>