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

[Xen-devel] [PATCH][XM-TEST] Add sanity checks

To: Xen Developers <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH][XM-TEST] Add sanity checks
From: Dan Smith <danms@xxxxxxxxxx>
Date: Wed, 23 Nov 2005 12:14:40 -0800
Delivery-date: Wed, 23 Nov 2005 20:14:43 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)
This patch adds some sanity checks that are run before firing off the
whole suite.  This should help prevent people from submitting bad
reports that are due to incorrect ramdisk configurations.

Signed-off-by: Dan Smith <danms@xxxxxxxxxx>
# HG changeset patch
# User dan@xxxxxxxxxxxxxxxxxxxxxxxxxx
# Node ID 7dd4ef9cd2c4fba89f300d173986a34a76b6995c
# Parent  14d733e5e1d014e302d72fb78df1428ee08e3ce3
Add sanity checks that let us know if there are any problems before
we run the entire suite

diff -r 14d733e5e1d0 -r 7dd4ef9cd2c4 tools/xm-test/configure.ac
--- a/tools/xm-test/configure.ac        Wed Nov 23 13:15:35 2005
+++ b/tools/xm-test/configure.ac        Wed Nov 23 18:54:52 2005
@@ -35,6 +35,7 @@
     Makefile 
     ramdisk/Makefile
     tests/Makefile
+    tests/_sanity/Makefile
     tests/block-list/Makefile
     tests/block-create/Makefile
     tests/block-destroy/Makefile
diff -r 14d733e5e1d0 -r 7dd4ef9cd2c4 tools/xm-test/runtest.sh
--- a/tools/xm-test/runtest.sh  Wed Nov 23 13:15:35 2005
+++ b/tools/xm-test/runtest.sh  Wed Nov 23 18:54:52 2005
@@ -83,6 +83,15 @@
     # See if xend is running
     if ! xm list >/dev/null 2>&1; then
        echo "'xm list' failed: is xend running?"
+       exit 1
+    fi
+
+    # Run a few sample tests to make sure things are working
+    # before we take the plunge
+    echo "Running sanity checks..."
+    make -C tests/_sanity check 2>&1 | grep REASON
+    if [ $? -eq 0 ]; then
+       echo "Sanity checks failed"
        exit 1
     fi
 
@@ -119,7 +128,7 @@
 # Run the tests
 run_tests() {
     output=$1
-    echo Running tests...
+    echo Running real tests...
     TEST_VERBOSE=1 make -k check > $output 2>&1
 }
 
diff -r 14d733e5e1d0 -r 7dd4ef9cd2c4 tools/xm-test/tests/_sanity/01_domu_proc.py
--- /dev/null   Wed Nov 23 13:15:35 2005
+++ b/tools/xm-test/tests/_sanity/01_domu_proc.py       Wed Nov 23 18:54:52 2005
@@ -0,0 +1,34 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2005
+# Author: Dan Smith <danms@xxxxxxxxxx>
+
+#
+# Test that the library and ramdisk are working to the point
+# that we can start a DomU and read /proc
+#
+
+from XmTestLib import *
+
+import re
+
+domain = XmTestDomain()
+
+try:
+    domain.start()
+except DomainError, e:
+    FAIL(str(e))
+
+try:
+    console = XmConsole(domain.getName())
+    console.sendInput("foo")
+    run = console.runCmd("cat /proc/cpuinfo")
+except ConsoleError, e:
+    FAIL(str(e))
+
+if run["return"] != 0:
+    FAIL("Unable to read /proc/cpuinfo")
+
+if not re.search("processor", run["output"]):
+    print run["output"]
+    FAIL("/proc/cpuinfo looks wrong!")
diff -r 14d733e5e1d0 -r 7dd4ef9cd2c4 tools/xm-test/tests/_sanity/Makefile.am
--- /dev/null   Wed Nov 23 13:15:35 2005
+++ b/tools/xm-test/tests/_sanity/Makefile.am   Wed Nov 23 18:54:52 2005
@@ -0,0 +1,21 @@
+
+SUBDIRS =
+
+TESTS = 01_domu_proc.test 
+
+XFAIL_TESTS = 
+
+EXTRA_DIST = $(TESTS) $(XFAIL_TESTS)
+
+TESTS_ENVIRONMENT=@TENV@
+
+%.test: %.py
+       cp $< $@
+       chmod +x $@
+
+clean-local: am_config_clean-local
+
+am_config_clean-local:
+       rm -f *test
+       rm -f *log
+       rm -f *~
-- 
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms@xxxxxxxxxx
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>