diff options
author | awilliam@xenbuild.aw <awilliam@xenbuild.aw> | 2006-11-10 11:11:04 -0700 |
---|---|---|
committer | awilliam@xenbuild.aw <awilliam@xenbuild.aw> | 2006-11-10 11:11:04 -0700 |
commit | 8eb135484ec9d5cd6e647a5aaaee667866052664 (patch) | |
tree | 1ade1e601050b3ca474a18679a1183f0d40451cb /tools/xm-test | |
parent | 23a577ea38b06dc33c321a65f3e1eb2c9df38750 (diff) | |
parent | acff088125bb38f2b9e40f49ae9a9159e183b129 (diff) | |
download | xen-8eb135484ec9d5cd6e647a5aaaee667866052664.tar.gz xen-8eb135484ec9d5cd6e647a5aaaee667866052664.tar.bz2 xen-8eb135484ec9d5cd6e647a5aaaee667866052664.zip |
merge with xen-unstable.hg
Diffstat (limited to 'tools/xm-test')
36 files changed, 276 insertions, 158 deletions
diff --git a/tools/xm-test/configure.ac b/tools/xm-test/configure.ac index 7eeeb76eab..87df5cd6bd 100644 --- a/tools/xm-test/configure.ac +++ b/tools/xm-test/configure.ac @@ -1,7 +1,7 @@ # xm-test configure.ac input script # Basic header information -AC_INIT([xm-test], [1.0.0]) +AC_INIT([xm-test], [1.1.0]) AM_INIT_AUTOMAKE([1.7 foreign]) MK=''; AC_SUBST(MK) @@ -11,11 +11,10 @@ AC_PROG_CC #AC_PROG_INSTALL AC_CHECK_PROG([LILO], lilo, lilo, "no", [$PATH]) -# Right now, we can assume that the lib/ and ramdisk/ directories -# are two levels above the tests +# Right now, we can assume that the lib/ directory +# is two levels above the tests TESTLIB=../../lib -RD_PATH=../../ramdisk -TENV="PYTHONPATH=$PYTHONPATH:$TESTLIB RD_PATH=$RD_PATH" +TENV="PYTHONPATH=$PYTHONPATH:$TESTLIB" AC_ARG_ENABLE(hvm-support, [[ --enable-hvm-support enable hardware virtual machine assist]], diff --git a/tools/xm-test/lib/XmTestLib/arch.py b/tools/xm-test/lib/XmTestLib/arch.py index 5625a53546..331ede5414 100644 --- a/tools/xm-test/lib/XmTestLib/arch.py +++ b/tools/xm-test/lib/XmTestLib/arch.py @@ -71,7 +71,6 @@ ia_ParavirtDefaults = {"memory" : 64, ia_HVMDefaults = {"memory" : 64, "vcpus" : 1, "acpi" : 0, - "apic" : 0, "disk" : ["file:%s/disk.img,ioemu:%s,w!" % (getRdPath(), BLOCK_ROOT_DEV)], "kernel" : "/usr/lib/xen/boot/hvmloader", diff --git a/tools/xm-test/lib/XmTestReport/arch.py b/tools/xm-test/lib/XmTestReport/arch.py index e4fd16273d..965e7fb9c6 100644 --- a/tools/xm-test/lib/XmTestReport/arch.py +++ b/tools/xm-test/lib/XmTestReport/arch.py @@ -28,6 +28,7 @@ _uname_to_arch_map = { "i486" : "x86", "i586" : "x86", "i686" : "x86", + "x86_64": "x86_64", "ia64" : "ia64", "ppc" : "powerpc", "ppc64" : "powerpc", @@ -37,6 +38,9 @@ _arch = _uname_to_arch_map.get(os.uname()[4], "Unknown") if _arch == "x86": cpuValues = {"model_name" : "Unknown", "flags" : "Unknown"} +elif _arch == "x86_64": + cpuValues = {"model_name" : "Unknown", + "flags" : "Unknown"} elif _arch == "ia64": cpuValues = {"arch" : "Unknown", "features" : "Unknown"} diff --git a/tools/xm-test/ramdisk/Makefile.am b/tools/xm-test/ramdisk/Makefile.am index dd7f5ec058..14bfc9267c 100644 --- a/tools/xm-test/ramdisk/Makefile.am +++ b/tools/xm-test/ramdisk/Makefile.am @@ -4,7 +4,7 @@ # Download a pre-built ramdisk. # INITRD = <Directory to download ramdisk from> # -# make initrd: +# make initrd.img: # # Make a ramdisk from scratch. # BR_URL = <The URL of the Buildroot source code> @@ -17,9 +17,9 @@ INITRD ?= http://xm-test.xensource.com/ramdisks BR_ARCH ?= $(shell uname -m | sed -e s/i.86/i386/ -e 's/ppc\(64\)*/powerpc/') @MK@ifdef BR_SNAPSHOT - BR_URL = http://buildroot.uclibc.org/downloads/snapshots/buildroot-snapshot.tar.bz2 +@MK@ BR_URL = http://buildroot.uclibc.org/downloads/snapshots/buildroot-snapshot.tar.bz2 @MK@else - BR_URL ?= http://xm-test.xensource.com/ramdisks/buildroot-20061023.tar.bz2 +@MK@ BR_URL = http://xm-test.xensource.com/ramdisks/buildroot-20061023.tar.bz2 @MK@endif BR_TAR = $(notdir $(BR_URL)) diff --git a/tools/xm-test/ramdisk/README-XenSource-initrd-1.0-img b/tools/xm-test/ramdisk/README-XenSource-initrd-1.0-img index a77476a4a6..80ac26be79 100644 --- a/tools/xm-test/ramdisk/README-XenSource-initrd-1.0-img +++ b/tools/xm-test/ramdisk/README-XenSource-initrd-1.0-img @@ -7,7 +7,8 @@ suitable for use with Xen's xm-test regression testing suite. They has been built and provided by XenSource, for the convenience of Xen users. xm-test initrds may be mixed across minor xm-test versions, but not across major versions; this initrd is suitable for all 1.0.x versions of xm-test (as -shipped with Xen 3.0.4 and the unstable tree leading up to that release). +shipped with the Xen unstable tree for a short while between Xen 3.0.3 and +Xen 3.0.4). In order to use one of these initrds, run "./autogen; ./configure; make existing" inside the xm-test directory, and the appropriate initrd for your diff --git a/tools/xm-test/ramdisk/README-XenSource-initrd-1.1-img b/tools/xm-test/ramdisk/README-XenSource-initrd-1.1-img new file mode 100644 index 0000000000..526c601ccc --- /dev/null +++ b/tools/xm-test/ramdisk/README-XenSource-initrd-1.1-img @@ -0,0 +1,45 @@ +XenSource xm-test 1.1 initrds +============================= + +http://xm-test.xensource.com/ramdisks/initrd-1.1-i386.img and +http://xm-test.xensource.com/ramdisks/initrd-1.1-powerpc.img are initrds +suitable for use with Xen's xm-test regression testing suite. They has been +built and provided by XenSource, for the convenience of Xen users. xm-test +initrds may be mixed across minor xm-test versions, but not across major +versions; this initrd is suitable for all 1.1.x versions of xm-test (as +shipped with Xen 3.0.4 and the unstable tree leading up to that release). + +In order to use one of these initrds, run "./autogen; ./configure; make +existing" inside the xm-test directory, and the appropriate initrd for your +architecture will be downloaded automatically. Alternatively, if you have +already downloaded that file, place it into the xm-test/ramdisk directory and +run the same command. In either case, runtest.sh can then be used as normal. +See xm-test/README for more details. + +These initrds were built using the infrastructure provided by xm-test. Each +is a full guest operating system and filesystem, and as such includes a large +number of pieces of software. The source code for the majority of these are +included in full inside the file +http://xm-test.xensource.com/ramdisks/<INITRD>-buildroot.tar.bz2, where +<INITRD> is either initrd-1.1-i386 or initrd-1.1-powerpc as appropriate, or +alongside this file. Copyright statements and licences are contained therein. +The remaining source code is included in the Xen distribution, at +http://www.xensource.com/xen/downloads/archives.html. The configurations used +for BusyBox, uClibc, and Buildroot are available as +http://xm-test.xensource.com/ramdisks/<INITRD>-busybox-config, +http://xm-test.xensource.com/ramdisks/<INITRD>-uClibc-config, and +http://xm-test.xensource.com/ramdisks/<INITRD>-buildroot-config respectively, +or alongside this file. + +XenSource and the Xen contributors are grateful to the authors of these +software packages for their contributions to free and open-source software. + + +Buildroot and BusyBox are Copyright (c) Erik Andersen <andersen@codepoet.org>. +BusyBox is licensed under the GNU General Public License (GPL). A copy of +this license is available in the file GPL-2, +http://xm-test.xensource.com/ramdisks/GPL-2, or alongside this file. + +uClibc is licensed under the GNU Lesser General Public License (LGPL). A copy +of this license is available in the file +http://xm-test.xensource.com/ramdisks/LGPL-2, or alongside this file. diff --git a/tools/xm-test/ramdisk/make-release.sh b/tools/xm-test/ramdisk/make-release.sh new file mode 100644 index 0000000000..5aa3831181 --- /dev/null +++ b/tools/xm-test/ramdisk/make-release.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +if [ "$1" == "" ] +then + arch="" +elif [ "$1" == "powerpc" ] +then + arch="BR_ARCH=powerpc" +else + echo "Invalid architecture specified." >&2 + exit 1 +fi + +set -eu + +tempdir=$(mktemp -d) + +dir=$(dirname "$0") + +cd $(dirname "$dir") + +./autogen +./configure + +cd "$dir" + +rm -Rf buildroot +make $arch initrd.img + +initrd=$(readlink "initrd.img") +prefix=$(basename "$initrd" ".img") +arch=$(echo "$prefix" | sed -e 's/.*-//') + +cp "$initrd" "$tempdir" + +cp "buildroot/.config" "$tempdir/$prefix-buildroot-config" +cp "buildroot/package/busybox/busybox.config" "$tempdir/$prefix-busybox-config" +cp "buildroot/toolchain/uClibc/uClibc.config" "$tempdir/$prefix-uClibc-config" + +mv "buildroot" "$tempdir/buildroot-$arch" +cd $tempdir +rm -Rf "buildroot-$arch"/toolchain_build* +rm -Rf "buildroot-$arch"/build_* +tar cjf "$prefix-buildroot.tar.bz2" "buildroot-$arch" +rm -Rf "buildroot-$arch" + +echo -e "\n\nYour release is in $tempdir." diff --git a/tools/xm-test/ramdisk/patches/buildroot/add_xvd_devices.patch b/tools/xm-test/ramdisk/patches/buildroot/add_xvd_devices.patch new file mode 100644 index 0000000000..25d073da68 --- /dev/null +++ b/tools/xm-test/ramdisk/patches/buildroot/add_xvd_devices.patch @@ -0,0 +1,13 @@ +--- buildroot/target/generic/device_table.txt~ 2006-10-26 17:38:04.000000000 +1000 ++++ buildroot/target/generic/device_table.txt 2006-10-26 17:37:08.000000000 +1000 +@@ -169,3 +169,10 @@ + #/dev/mcd b 640 0 0 23 0 0 0 - + #/dev/optcd b 640 0 0 17 0 0 0 - + ++# Xen Virtual Block Devices ++/dev/xvda b 640 0 0 202 0 0 0 - ++/dev/xvda b 640 0 0 202 1 1 1 4 ++/dev/xvdb b 640 0 0 202 16 0 0 - ++/dev/xvdb b 640 0 0 202 17 1 1 4 ++/dev/xvdc b 640 0 0 202 32 0 0 - ++/dev/xvdc b 640 0 0 202 33 1 1 4 diff --git a/tools/xm-test/runtest.sh b/tools/xm-test/runtest.sh index 7008972fae..22c0736bf2 100755 --- a/tools/xm-test/runtest.sh +++ b/tools/xm-test/runtest.sh @@ -78,7 +78,13 @@ runnable_tests() { eval $(./lib/XmTestReport/xmtest.py) ARCH=$(uname -m | sed -e s/i.86/i386/ -e 's/ppc\(64\)*/powerpc/') rrdver="initrd-${XM_TEST_MAJ}.${XM_TEST_MIN}-${ARCH}.img" - if [ "$realrd" != "$rrdver" ]; then + exp_flag=0 + realarch=`echo $realrd | awk -F- '{print $3}' | awk -F. '{print $1}'` + rrdarch=`echo $rrdver | awk -F- '{print $3}' | awk -F. '{print $1}'` + if [ "$realarch" = "i386" -a "$rrdarch" = "x86_64" ]; then + exp_flag=1 + fi + if [ $exp_flag -eq 0 -a "$realrd" != "$rrdver" ]; then echo "Error: ramdisk/initrd.img is from an old version, or is not for this " echo "architecture ($ARCH)." echo "You need to build a ramdisk from at least ${XM_TEST_MAJ}.${XM_TEST_MIN}" @@ -135,7 +141,11 @@ get_contact_info() { run_tests() { groupentered=$1 output=$2 + report=$3 + startfile=${report}.start + stopfile=${report}.stop + date -R > $startfile exec < grouptest/$groupentered while read casename testlist; do echo Running $casename tests... @@ -149,6 +159,7 @@ run_tests() { fi done + date -R > $stopfile } @@ -158,7 +169,10 @@ make_text_reports() { failures=$2 output=$3 reportfile=$4 + report=$5 summary=summary.tmp + startfile=${report}.start + stopfile=${report}.stop echo "Making PASS/FAIL report ($passfail)..." cat $OUTPUT | egrep '(REASON|PASS|FAIL|XPASS|XFAIL|SKIP)' | perl -pe 's/^(PASS|FAIL|XPASS|XFAIL)(.+)$/$1$2\n/' > $passfail @@ -169,7 +183,12 @@ make_text_reports() { NUMFAIL=`grep -c FAIL $output` NUMXPASS=`grep -c XPASS $output` NUMXFAIL=`grep -c XFAIL $output` + START=`cat $startfile` + STOP=`cat $stopfile` cat > $summary << EOF +Xm-test timing summary: + Run Started : $START + Run Stoped : $STOP Xm-test execution summary: PASS: $NUMPASS FAIL: $NUMFAIL @@ -296,8 +315,8 @@ if [ "$run" != "no" ]; then if [ "$unsafe" = "no" ]; then make_environment_report $OSREPORTTEMP $PROGREPORTTEMP fi - run_tests $GROUPENTERED $OUTPUT - make_text_reports $PASSFAIL $FAILURES $OUTPUT $TXTREPORT + run_tests $GROUPENTERED $OUTPUT $REPORT + make_text_reports $PASSFAIL $FAILURES $OUTPUT $TXTREPORT $REPORT if [ "$unsafe" = "no" ]; then make_result_report $OUTPUT $RESULTREPORTTEMP cat $OSREPORTTEMP $PROGREPORTTEMP $RESULTREPORTTEMP > $XMLREPORT diff --git a/tools/xm-test/tests/block-create/01_block_attach_device_pos.py b/tools/xm-test/tests/block-create/01_block_attach_device_pos.py index 13e6a5efb8..5bbf1232b3 100644 --- a/tools/xm-test/tests/block-create/01_block_attach_device_pos.py +++ b/tools/xm-test/tests/block-create/01_block_attach_device_pos.py @@ -32,12 +32,12 @@ except ConsoleError, e: FAIL(str(e)) -block_attach(domain, "phy:ram1", "sdb1") +block_attach(domain, "phy:ram1", "xvda1") -try: - run = console.runCmd("cat /proc/partitions") +try: + run = console.runCmd("cat /proc/partitions") except ConsoleError, e: - FAIL(str(e)) + FAIL(str(e)) # Close the console domain.closeConsole() @@ -45,5 +45,5 @@ domain.closeConsole() # Stop the domain (nice shutdown) domain.stop() -if not re.search("sdb1",run["output"]): +if not re.search("xvda1",run["output"]): FAIL("Device is not actually connected to the domU") diff --git a/tools/xm-test/tests/block-create/02_block_attach_file_device_pos.py b/tools/xm-test/tests/block-create/02_block_attach_file_device_pos.py index b4e7c6974a..e70f58398b 100644 --- a/tools/xm-test/tests/block-create/02_block_attach_file_device_pos.py +++ b/tools/xm-test/tests/block-create/02_block_attach_file_device_pos.py @@ -32,10 +32,10 @@ except ConsoleError, e: FAIL(str(e)) -block_attach(domain, "file:/dev/ram1", "sdb2") +block_attach(domain, "file:/dev/ram1", "xvda1") try: - run = console.runCmd("cat /proc/partitions") + run = console.runCmd("cat /proc/partitions") except ConsoleError, e: FAIL(str(e)) @@ -45,5 +45,5 @@ domain.closeConsole() # Stop the domain (nice shutdown) domain.stop() -if not re.search("sdb2",run["output"]): - FAIL("Device is not actually connected to the domU") +if not re.search("xvda1",run["output"]): + FAIL("Device is not actually connected to the domU") diff --git a/tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py b/tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py index 6d9eb513fe..2e258840c4 100644 --- a/tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py +++ b/tools/xm-test/tests/block-create/04_block_attach_device_repeatedly_pos.py @@ -30,14 +30,14 @@ except ConsoleError, e: FAIL(str(e)) for i in range(10): - status, output = traceCommand("xm block-attach %s phy:ram1 sdb1 w" % domain.getName()) - if i == 0 and status != 0: - FAIL("xm block attach returned invalid %i != 0" % status) - if i > 0 and status == 0: - FAIL("xm block-attach (repeat) returned invalid %i > 0" % status) - run = console.runCmd("cat /proc/partitions") - if not re.search("sdb1", run['output']): - FAIL("Device is not actually attached to domU") + status, output = traceCommand("xm block-attach %s phy:ram1 xvda1 w" % domain.getName()) + if i == 0 and status != 0: + FAIL("xm block attach returned invalid %i != 0" % status) + if i > 0 and status == 0: + FAIL("xm block-attach (repeat) returned invalid %i > 0" % status) + run = console.runCmd("cat /proc/partitions") + if not re.search("xvda1", run['output']): + FAIL("Device is not actually attached to domU") # Close the console domain.closeConsole() diff --git a/tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py b/tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py index db406fecd4..325e160937 100644 --- a/tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py +++ b/tools/xm-test/tests/block-create/05_block_attach_and_dettach_device_repeatedly_pos.py @@ -32,15 +32,15 @@ except ConsoleError, e: for i in range(10): - block_attach(domain, "phy:ram1", "sdb1") - run = console.runCmd("cat /proc/partitions") - if not re.search("sdb1", run["output"]): - FAIL("Failed to attach block device: /proc/partitions does not show that!") - - block_detach(domain, "sdb1") - run = console.runCmd("cat /proc/partitions") - if re.search("sdb1", run["output"]): - FAIL("Failed to dettach block device: /proc/partitions still showing that!") + block_attach(domain, "phy:ram1", "xvda1") + run = console.runCmd("cat /proc/partitions") + if not re.search("xvda1", run["output"]): + FAIL("Failed to attach block device: /proc/partitions does not show that!") + + block_detach(domain, "xvda1") + run = console.runCmd("cat /proc/partitions") + if re.search("xvda1", run["output"]): + FAIL("Failed to dettach block device: /proc/partitions still showing that!") # Close the console domain.closeConsole() diff --git a/tools/xm-test/tests/block-create/06_block_attach_baddomain_neg.py b/tools/xm-test/tests/block-create/06_block_attach_baddomain_neg.py index edfeba1643..958b13e1ea 100644 --- a/tools/xm-test/tests/block-create/06_block_attach_baddomain_neg.py +++ b/tools/xm-test/tests/block-create/06_block_attach_baddomain_neg.py @@ -8,13 +8,11 @@ from XmTestLib import * if ENABLE_HVM_SUPPORT: SKIP("Block-attach not supported for HVM domains") -status, output = traceCommand("xm block-attach NOT-EXIST phy:ram1 sdb1 w") +status, output = traceCommand("xm block-attach NOT-EXIST phy:ram1 xvda1 w") eyecatcher = "Error" where = output.find(eyecatcher) if status == 0: - FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status ) + FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status ) elif where == -1: - FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output ) - - + FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output ) diff --git a/tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py b/tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py index f2043d7dd3..3e9f0f2514 100644 --- a/tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py +++ b/tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py @@ -30,18 +30,18 @@ except ConsoleError, e: FAIL(str(e)) -status, output = traceCommand("xm block-attach %s phy:NOT-EXIST sdb1 w" % domain.getName()) +status, output = traceCommand("xm block-attach %s phy:NOT-EXIST xvda1 w" % domain.getName()) eyecatcher = "Error" where = output.find(eyecatcher) if status == 0: - FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status ) + FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status ) elif where == -1: - FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output ) + FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output ) try: - run = console.runCmd("cat /proc/partitions") + run = console.runCmd("cat /proc/partitions") except ConsoleError, e: - FAIL(str(e)) + FAIL(str(e)) # Close the console domain.closeConsole() @@ -49,5 +49,5 @@ domain.closeConsole() # Stop the domain (nice shutdown) domain.stop() -if re.search("sdb1",run["output"]): - FAIL("Non existent Device was connected to the domU") +if re.search("xvda1",run["output"]): + FAIL("Non existent Device was connected to the domU") diff --git a/tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py b/tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py index b1c776d71a..802e101147 100644 --- a/tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py +++ b/tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py @@ -29,18 +29,18 @@ except ConsoleError, e: saveLog(console.getHistory()) FAIL(str(e)) -status, output = traceCommand("xm block-attach %s file:/dev/NOT-EXIST sdb1 w" % domain.getName()) +status, output = traceCommand("xm block-attach %s file:/dev/NOT-EXIST xvda1 w" % domain.getName()) eyecatcher = "Error" where = output.find(eyecatcher) if status == 0: - FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status ) + FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status ) elif where == -1: - FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output ) - + FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output ) + try: - run = console.runCmd("cat /proc/partitions") + run = console.runCmd("cat /proc/partitions") except ConsoleError, e: - FAIL(str(e)) + FAIL(str(e)) # Close the console domain.closeConsole() @@ -48,5 +48,5 @@ domain.closeConsole() # Stop the domain (nice shutdown) domain.stop() -if re.search("sdb1",run["output"]): - FAIL("Non existent Device was connected to the domU") +if re.search("xvda1",run["output"]): + FAIL("Non existent Device was connected to the domU") diff --git a/tools/xm-test/tests/block-create/09_block_attach_and_dettach_device_check_data_pos.py b/tools/xm-test/tests/block-create/09_block_attach_and_dettach_device_check_data_pos.py index b997379a25..b97b70c499 100644 --- a/tools/xm-test/tests/block-create/09_block_attach_and_dettach_device_check_data_pos.py +++ b/tools/xm-test/tests/block-create/09_block_attach_and_dettach_device_check_data_pos.py @@ -12,7 +12,7 @@ if ENABLE_HVM_SUPPORT: SKIP("Block-attach not supported for HVM domains") # Create a domain (default XmTestDomain, with our ramdisk) -domain = XmTestDomain() +domain = XmTestDomain(extraConfig={"extra":"rw"}) try: console = domain.start() @@ -35,27 +35,27 @@ if s != 0: FAIL("mke2fs returned %i != 0" % s) for i in range(10): - block_attach(domain, "phy:ram1", "hda1") - run = console.runCmd("cat /proc/partitions") - if not re.search("hda1", run["output"]): - FAIL("Failed to attach block device: /proc/partitions does not show that!") - - console.runCmd("mkdir -p /mnt/hda1; mount /dev/hda1 /mnt/hda1") - - if i: - run = console.runCmd("cat /mnt/hda1/myfile | grep %s" % (i-1)) - if run['return']: - FAIL("File created was lost or not updated!") - - console.runCmd("echo \"%s\" > /mnt/hda1/myfile" % i) - run = console.runCmd("cat /mnt/hda1/myfile") - print run['output'] - console.runCmd("umount /mnt/hda1") - - block_detach(domain, "hda1") - run = console.runCmd("cat /proc/partitions") - if re.search("hda1", run["output"]): - FAIL("Failed to dettach block device: /proc/partitions still showing that!") + block_attach(domain, "phy:ram1", "xvda1") + run = console.runCmd("cat /proc/partitions") + if not re.search("xvda1", run["output"]): + FAIL("Failed to attach block device: /proc/partitions does not show that!") + + console.runCmd("mkdir -p /mnt/xvda1; mount /dev/xvda1 /mnt/xvda1") + + if i: + run = console.runCmd("cat /mnt/xvda1/myfile | grep %s" % (i-1)) + if run['return']: + FAIL("File created was lost or not updated!") + + console.runCmd("echo \"%s\" > /mnt/xvda1/myfile" % i) + run = console.runCmd("cat /mnt/xvda1/myfile") + print run['output'] + console.runCmd("umount /mnt/xvda1") + + block_detach(domain, "xvda1") + run = console.runCmd("cat /proc/partitions") + if re.search("xvda1", run["output"]): + FAIL("Failed to dettach block device: /proc/partitions still showing that!") # Close the console domain.closeConsole() diff --git a/tools/xm-test/tests/block-create/10_block_attach_dettach_multiple_devices.py b/tools/xm-test/tests/block-create/10_block_attach_dettach_multiple_devices.py index 833f75c21a..3ac6078388 100644 --- a/tools/xm-test/tests/block-create/10_block_attach_dettach_multiple_devices.py +++ b/tools/xm-test/tests/block-create/10_block_attach_dettach_multiple_devices.py @@ -15,7 +15,7 @@ from XmTestLib.block_utils import * def availableRamdisks(): i = 0 while os.access("/dev/ram%d" % i, os.F_OK ): - i += 1 + i += 1 return i @@ -36,7 +36,7 @@ def detach(devname): return -2, "Failed to detach block device: /proc/partitions still showing that!" return 0, None - + if ENABLE_HVM_SUPPORT: SKIP("Block-attach not supported for HVM domains") @@ -69,22 +69,22 @@ while i < ramdisks or devices: op = random.randint(0,1) # 1 = attach, 0 = detach if (not devices or op) and i < ramdisks: i += 1 - devname = "/dev/hda%d" % i - phy = "/dev/ram%d" % i - print "Attaching %s to %s" % (devname, phy) - status, msg = attach( phy, devname ) - if status: - FAIL(msg) - else: - devices.append(devname) + devname = "/dev/xvda%d" % i + phy = "/dev/ram%d" % i + print "Attaching %s to %s" % (devname, phy) + status, msg = attach( phy, devname ) + if status: + FAIL(msg) + else: + devices.append(devname) elif devices: devname = random.choice(devices) - devices.remove(devname) - print "Detaching %s" % devname - status, msg = detach(devname) - if status: - FAIL(msg) + devices.remove(devname) + print "Detaching %s" % devname + status, msg = detach(devname) + if status: + FAIL(msg) # Close the console domain.closeConsole() diff --git a/tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py b/tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py index 43f55e234c..1b8a289394 100644 --- a/tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py +++ b/tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py @@ -24,7 +24,7 @@ if s != 0: # Now try to start a DomU with write access to /dev/ram0 -config = {"disk":"phy:/dev/ram0,hda1,w"} +config = {"disk":"phy:/dev/ram0,xvda1,w"} domain = XmTestDomain(extraConfig=config); diff --git a/tools/xm-test/tests/block-create/12_block_attach_shared_domU.py b/tools/xm-test/tests/block-create/12_block_attach_shared_domU.py index 362e5039e8..79c9571f8c 100644 --- a/tools/xm-test/tests/block-create/12_block_attach_shared_domU.py +++ b/tools/xm-test/tests/block-create/12_block_attach_shared_domU.py @@ -8,7 +8,7 @@ from XmTestLib import * if ENABLE_HVM_SUPPORT: SKIP("Block-attach not supported for HVM domains") -config = {"disk":"phy:/dev/ram0,hda1,w"} +config = {"disk":"phy:/dev/ram0,xvda1,w"} dom1 = XmTestDomain(extraConfig=config) dom2 = XmTestDomain(dom1.getName() + "-2", diff --git a/tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py b/tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py index 835dfa9b1d..1d056841cc 100644 --- a/tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py +++ b/tools/xm-test/tests/block-destroy/01_block-destroy_btblock_pos.py @@ -9,7 +9,7 @@ from XmTestLib.block_utils import block_detach if ENABLE_HVM_SUPPORT: SKIP("Block-detach not supported for HVM domains") -config = {"disk":"phy:/dev/ram0,hda1,w"} +config = {"disk":"phy:/dev/ram0,xvda1,w"} domain = XmTestDomain(extraConfig=config) try: @@ -21,7 +21,7 @@ except DomainError, e: try: console.setHistorySaveCmds(value=True) - run = console.runCmd("cat /proc/partitions | grep hda1") + run = console.runCmd("cat /proc/partitions | grep xvda1") run2 = console.runCmd("cat /proc/partitions") except ConsoleError, e: FAIL(str(e)) @@ -29,10 +29,10 @@ except ConsoleError, e: if run["return"] != 0: FAIL("block device isn't attached; can't detach!") -block_detach(domain, "hda1") +block_detach(domain, "xvda1") try: - run = console.runCmd("cat /proc/partitions | grep hda1") + run = console.runCmd("cat /proc/partitions | grep xvda1") except ConsoleError, e: saveLog(console.getHistory()) FAIL(str(e)) diff --git a/tools/xm-test/tests/block-destroy/02_block-destroy_rtblock_pos.py b/tools/xm-test/tests/block-destroy/02_block-destroy_rtblock_pos.py index 47ff9a6fe5..cf6329228a 100644 --- a/tools/xm-test/tests/block-destroy/02_block-destroy_rtblock_pos.py +++ b/tools/xm-test/tests/block-destroy/02_block-destroy_rtblock_pos.py @@ -18,9 +18,9 @@ except DomainError, e: print e.extra FAIL("Unable to create domain") -block_attach(domain, "phy:/dev/ram0", "hda1") +block_attach(domain, "phy:/dev/ram0", "xvda1") try: - run = console.runCmd("cat /proc/partitions | grep hda1") + run = console.runCmd("cat /proc/partitions | grep xvda1") except ConsoleError, e: saveLog(console.getHistory()) FAIL(str(e)) @@ -28,9 +28,9 @@ except ConsoleError, e: if run["return"] != 0: FAIL("Failed to verify that block dev is attached") -block_detach(domain, "hda1") +block_detach(domain, "xvda1") try: - run = console.runCmd("cat /proc/partitions | grep hda1") + run = console.runCmd("cat /proc/partitions | grep xvda1") except ConsoleError, e: saveLog(console.getHistory()) FAIL(str(e)) diff --git a/tools/xm-test/tests/block-destroy/04_block-destroy_nonattached_neg.py b/tools/xm-test/tests/block-destroy/04_block-destroy_nonattached_neg.py index eea2027771..d7df7ac317 100644 --- a/tools/xm-test/tests/block-destroy/04_block-destroy_nonattached_neg.py +++ b/tools/xm-test/tests/block-destroy/04_block-destroy_nonattached_neg.py @@ -19,7 +19,7 @@ except DomainError, e: print e.extra FAIL("Unable to create domain") -status, output = traceCommand("xm block-detach %s sda1" % domain.getId()) +status, output = traceCommand("xm block-detach %s xvda1" % domain.getId()) eyecatcher1 = "Error:" eyecatcher2 = "Traceback" diff --git a/tools/xm-test/tests/block-destroy/05_block-destroy_byname_pos.py b/tools/xm-test/tests/block-destroy/05_block-destroy_byname_pos.py index d77e587c33..7e3d9904da 100644 --- a/tools/xm-test/tests/block-destroy/05_block-destroy_byname_pos.py +++ b/tools/xm-test/tests/block-destroy/05_block-destroy_byname_pos.py @@ -9,7 +9,7 @@ from XmTestLib.block_utils import block_detach if ENABLE_HVM_SUPPORT: SKIP("Block-detach not supported for HVM domains") -config = {"disk":"phy:/dev/ram0,hda1,w"} +config = {"disk":"phy:/dev/ram0,xvda1,w"} domain = XmTestDomain(extraConfig=config) try: @@ -20,7 +20,7 @@ except DomainError, e: FAIL("Unable to create domain") try: - run = console.runCmd("cat /proc/partitions | grep hda1") + run = console.runCmd("cat /proc/partitions | grep xvda1") run2 = console.runCmd("cat /proc/partitions") except ConsoleError, e: FAIL(str(e)) @@ -28,10 +28,10 @@ except ConsoleError, e: if run["return"] != 0: FAIL("block device isn't attached; can't detach!") -block_detach(domain, "hda1") +block_detach(domain, "xvda1") try: - run = console.runCmd("cat /proc/partitions | grep hda1") + run = console.runCmd("cat /proc/partitions | grep xvda1") except ConsoleError, e: saveLog(console.getHistory()) FAIL(str(e)) diff --git a/tools/xm-test/tests/block-destroy/06_block-destroy_check_list_pos.py b/tools/xm-test/tests/block-destroy/06_block-destroy_check_list_pos.py index 38d60a92c1..292db063d6 100644 --- a/tools/xm-test/tests/block-destroy/06_block-destroy_check_list_pos.py +++ b/tools/xm-test/tests/block-destroy/06_block-destroy_check_list_pos.py @@ -12,7 +12,7 @@ def checkXmLongList(domain): s, o = traceCommand("xm list --long %s" % domain.getName()) if s != 0: FAIL("xm list --long <dom> failed") - if re.search("hda1", o): + if re.search("xvda1", o): return True else: return False @@ -27,12 +27,12 @@ try: except DomainError,e: FAIL(str(e)) -block_attach(domain, "phy:/dev/ram0", "hda1") +block_attach(domain, "phy:/dev/ram0", "xvda1") if not checkXmLongList(domain): - FAIL("xm long list does not show that hda1 was attached") + FAIL("xm long list does not show that xvda1 was attached") -block_detach(domain, "hda1") +block_detach(domain, "xvda1") if checkXmLongList(domain): - FAIL("xm long list does not show that hda1 was removed") + FAIL("xm long list does not show that xvda1 was removed") diff --git a/tools/xm-test/tests/block-integrity/01_block_device_read_verify.py b/tools/xm-test/tests/block-integrity/01_block_device_read_verify.py index b4f03da628..28531f1559 100644 --- a/tools/xm-test/tests/block-integrity/01_block_device_read_verify.py +++ b/tools/xm-test/tests/block-integrity/01_block_device_read_verify.py @@ -33,10 +33,10 @@ s, o = traceCommand("md5sum /dev/ram1") dom0_md5sum_match = re.search(r"^[\dA-Fa-f]{32}", o, re.M) -block_attach(domain, "phy:ram1", "hda1") +block_attach(domain, "phy:ram1", "xvda1") try: - run = console.runCmd("md5sum /dev/hda1") + run = console.runCmd("md5sum /dev/xvda1") except ConsoleError, e: FAIL(str(e)) diff --git a/tools/xm-test/tests/block-integrity/02_block_device_write_verify.py b/tools/xm-test/tests/block-integrity/02_block_device_write_verify.py index f8fa19aa8b..ed791a008a 100644 --- a/tools/xm-test/tests/block-integrity/02_block_device_write_verify.py +++ b/tools/xm-test/tests/block-integrity/02_block_device_write_verify.py @@ -28,12 +28,12 @@ except DomainError, e: console.setHistorySaveCmds(value=True) -block_attach(domain, "phy:ram1", "hda1") +block_attach(domain, "phy:ram1", "xvda1") console.setTimeout(120) try: - run = console.runCmd("dd if=/dev/urandom bs=512 count=`cat /sys/block/hda1/size` | tee /dev/hda1 | md5sum") + run = console.runCmd("dd if=/dev/urandom bs=512 count=`cat /sys/block/xvda1/size` | tee /dev/xvda1 | md5sum") except ConsoleError, e: FAIL(str(e)) diff --git a/tools/xm-test/tests/block-list/01_block-list_pos.py b/tools/xm-test/tests/block-list/01_block-list_pos.py index 05df76c189..2b19208d97 100644 --- a/tools/xm-test/tests/block-list/01_block-list_pos.py +++ b/tools/xm-test/tests/block-list/01_block-list_pos.py @@ -11,7 +11,7 @@ from XmTestLib import * if ENABLE_HVM_SUPPORT: SKIP("Block-list not supported for HVM domains") -config = {"disk":"phy:/dev/ram0,hda1,w"} +config = {"disk":"phy:/dev/ram0,xvda1,w"} domain = XmTestDomain(extraConfig=config) try: @@ -22,7 +22,7 @@ except DomainError, e: FAIL("Unable to create domain") status, output = traceCommand("xm block-list %s" % domain.getId()) -eyecatcher = "769" +eyecatcher = "51713" where = output.find(eyecatcher) if status != 0: FAIL("xm block-list returned bad status, expected 0, status is %i" % status) @@ -31,7 +31,7 @@ elif where < 0: #Verify the block device on DomainU try: - run = console.runCmd("cat /proc/partitions | grep hda1") + run = console.runCmd("cat /proc/partitions | grep xvda1") except ConsoleError, e: saveLog(console.getHistory()) FAIL(str(e)) diff --git a/tools/xm-test/tests/block-list/02_block-list_attachbd_pos.py b/tools/xm-test/tests/block-list/02_block-list_attachbd_pos.py index 256b44d951..8ad0df3a0c 100644 --- a/tools/xm-test/tests/block-list/02_block-list_attachbd_pos.py +++ b/tools/xm-test/tests/block-list/02_block-list_attachbd_pos.py @@ -22,11 +22,11 @@ except DomainError, e: FAIL("Unable to create domain") #Attach one virtual block device to domainU -block_attach(domain, "phy:/dev/ram0", "hda1") +block_attach(domain, "phy:/dev/ram0", "xvda1") #Verify block-list on Domain0 status, output = traceCommand("xm block-list %s" % domain.getId()) -eyecatcher = "769" +eyecatcher = "51713" where = output.find(eyecatcher) if status != 0: FAIL("xm block-list returned bad status, expected 0, status is %i" % status) @@ -35,7 +35,7 @@ elif where < 0 : #Verify attached block device on DomainU try: - run = console.runCmd("cat /proc/partitions | grep hda1") + run = console.runCmd("cat /proc/partitions | grep xvda1") except ConsoleError, e: saveLog(console.getHistory()) FAIL(str(e)) diff --git a/tools/xm-test/tests/block-list/03_block-list_anotherbd_pos.py b/tools/xm-test/tests/block-list/03_block-list_anotherbd_pos.py index 1556b065ef..b128ec1bba 100644 --- a/tools/xm-test/tests/block-list/03_block-list_anotherbd_pos.py +++ b/tools/xm-test/tests/block-list/03_block-list_anotherbd_pos.py @@ -11,7 +11,7 @@ from XmTestLib import * if ENABLE_HVM_SUPPORT: SKIP("Block-list not supported for HVM domains") -config = {"disk":"phy:/dev/ram0,hda1,w"} +config = {"disk":"phy:/dev/ram0,xvda1,w"} domain = XmTestDomain(extraConfig=config) try: @@ -26,14 +26,14 @@ if status != 0: FAIL("Fail to list block device") #Add another virtual block device to the domain -status, output = traceCommand("xm block-attach %s phy:/dev/ram1 hda2 w" % domain.getId()) +status, output = traceCommand("xm block-attach %s phy:/dev/ram1 xvda2 w" % domain.getId()) if status != 0: FAIL("Fail to attach block device") #Verify block-list on Domain0 status, output = traceCommand("xm block-list %s" % domain.getId()) -eyecatcher1 = "769" -eyecatcher2 = "770" +eyecatcher1 = "51713" +eyecatcher2 = "51714" where1 = output.find(eyecatcher1) where2 = output.find(eyecatcher2) if status != 0: @@ -43,7 +43,7 @@ elif (where1 < 0) and (where2 < 0): #Verify attached block device on DomainU try: - run = console.runCmd("cat /proc/partitions | grep hda1;cat /proc/partitions | grep hda2") + run = console.runCmd("cat /proc/partitions | grep xvda1;cat /proc/partitions | grep xvda2") except ConsoleError, e: saveLog(console.getHistory()) FAIL(str(e)) diff --git a/tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py b/tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py index db2c54104d..8d3bf08c42 100644 --- a/tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py +++ b/tools/xm-test/tests/block-list/06_block-list_checkremove_pos.py @@ -22,39 +22,39 @@ if s != 0: if o: FAIL("block-list without devices reported something!") -block_attach(domain, "phy:/dev/ram0", "hda1") +block_attach(domain, "phy:/dev/ram0", "xvda1") s, o = traceCommand("xm block-list %s" % domain.getName()) if s != 0: FAIL("block-list failed") -if o.find("769") == -1: +if o.find("51713") == -1: FAIL("block-list didn't show the block device I just attached!") -block_attach(domain, "phy:/dev/ram1", "hda2") +block_attach(domain, "phy:/dev/ram1", "xvda2") s, o = traceCommand("xm block-list %s" % domain.getName()) if s != 0: FAIL("block-list failed") -if o.find("770") == -1: +if o.find("51714") == -1: FAIL("block-list didn't show the other block device I just attached!") -block_detach(domain, "hda1") +block_detach(domain, "xvda1") s, o = traceCommand("xm block-list %s" % domain.getName()) if s != 0: FAIL("block-list failed after detaching a device") -if o.find("769") != -1: - FAIL("hda1 still shown in block-list after detach!") -if o.find("770") == -1: - FAIL("hda2 not shown after detach of hda1!") +if o.find("51713") != -1: + FAIL("xvda1 still shown in block-list after detach!") +if o.find("51714") == -1: + FAIL("xvda2 not shown after detach of xvda1!") -block_detach(domain, "hda2") +block_detach(domain, "xvda2") s, o = traceCommand("xm block-list %s" % domain.getName()) if s != 0: FAIL("block-list failed after detaching another device") -if o.find("770") != -1: - FAIL("hda2 still shown in block-list after detach!") +if o.find("51714") != -1: + FAIL("xvda2 still shown in block-list after detach!") if o: FAIL("block-list still shows something after all devices detached!") diff --git a/tools/xm-test/tests/create/07_create_mem64_pos.py b/tools/xm-test/tests/create/07_create_mem64_pos.py index ae2f84adb1..1a27d55722 100644 --- a/tools/xm-test/tests/create/07_create_mem64_pos.py +++ b/tools/xm-test/tests/create/07_create_mem64_pos.py @@ -42,7 +42,7 @@ if eyecatcher1 != "True": FAIL("Failed to verify that a 64MB domain started") eyecatcher2 = getDomMem(domain_mem64.getName()) -if eyecatcher2 != 64: +if eyecatcher2 not in range(62, 65): FAIL("Started domain with 64MB, but it got %i MB" % eyecatcher2) #stop the domain (nice shutdown) diff --git a/tools/xm-test/tests/create/08_create_mem128_pos.py b/tools/xm-test/tests/create/08_create_mem128_pos.py index 0d50006b36..85d35173c7 100644 --- a/tools/xm-test/tests/create/08_create_mem128_pos.py +++ b/tools/xm-test/tests/create/08_create_mem128_pos.py @@ -42,7 +42,7 @@ if eyecatcher1 != "True": FAIL("Failed to verify that a 128MB domain started") eyecatcher2 = getDomMem(domain_mem128.getName()) -if eyecatcher2 != 128: +if eyecatcher2 not in range(126, 129): FAIL("Started domain with 128MB, but it got %i MB" % eyecatcher2) #stop the domain (nice shutdown) diff --git a/tools/xm-test/tests/create/09_create_mem256_pos.py b/tools/xm-test/tests/create/09_create_mem256_pos.py index c926d62de8..28db3dade2 100644 --- a/tools/xm-test/tests/create/09_create_mem256_pos.py +++ b/tools/xm-test/tests/create/09_create_mem256_pos.py @@ -42,7 +42,7 @@ if eyecatcher1 != "True": FAIL("Failed to verify that a 256MB domain started") eyecatcher2 = getDomMem(domain_mem256.getName()) -if eyecatcher2 != 256: +if eyecatcher2 not in range(254, 257): FAIL("Started domain with 256MB, but it got %i MB" % eyecatcher2) #stop the domain (nice shutdown) diff --git a/tools/xm-test/tests/create/14_create_blockroot_pos.py b/tools/xm-test/tests/create/14_create_blockroot_pos.py index 58eeb2b9b3..79dd622b5a 100644 --- a/tools/xm-test/tests/create/14_create_blockroot_pos.py +++ b/tools/xm-test/tests/create/14_create_blockroot_pos.py @@ -18,17 +18,12 @@ rdpath = getRdPath() # print "Using %s" % output if ENABLE_HVM_SUPPORT: - domain = XmTestDomain(name="14_create_blockroot") + config = None else: - config = {"memory" : "64", - "root" : "/dev/hda1", - "name" : "14_create_blockroot", - "kernel" : getDefaultKernel(), + config = {"root" : "/dev/hda1", "disk" : "file:%s/initrd.img,hda1,w" % rdpath } - domConfig = XenConfig() - domConfig.setOpts(config) - domain = XenDomain(name=domConfig.getOpt("name"), config=domConfig) +domain = XmTestDomain(name="14_create_blockroot", extraConfig=config) try: console = domain.start() diff --git a/tools/xm-test/tests/network-attach/04_network_attach_baddomain_neg.py b/tools/xm-test/tests/network-attach/04_network_attach_baddomain_neg.py index 838d66c32a..f69adb6e82 100644 --- a/tools/xm-test/tests/network-attach/04_network_attach_baddomain_neg.py +++ b/tools/xm-test/tests/network-attach/04_network_attach_baddomain_neg.py @@ -10,8 +10,6 @@ status, output = traceCommand("xm network-attach NOT-EXIST") eyecatcher = "Error" where = output.find(eyecatcher) if status == 0: - FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status ) + FAIL("xm network-attach returned bad status, expected non 0, status is: %i" % status ) elif where == -1: - FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output ) - - + FAIL("xm network-attach returned bad output, expected Error, output is: %s" % output ) |