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-changelog

[Xen-changelog] This patch adds a new test that attempts to save and res

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] This patch adds a new test that attempts to save and restore a domain
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 09 Nov 2005 17:52:08 +0000
Delivery-date: Wed, 09 Nov 2005 17:52:28 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID b0b8541264106b3b79c9d90672482543dcbfac14
# Parent  003339f0fcb22207f6dd1172b65101cf54303137
This patch adds a new test that attempts to save and restore a domain
with a block device attached.  It starts up a domain, mounts a block
device, writes data to it, saves, restores, and then verifies that the
block device can still be read.

Signed-off-by: Dan Smith <danms@xxxxxxxxxx>

diff -r 003339f0fcb2 -r b0b854126410 tools/xm-test/tests/restore/Makefile.am
--- a/tools/xm-test/tests/restore/Makefile.am   Wed Nov  9 11:38:46 2005
+++ b/tools/xm-test/tests/restore/Makefile.am   Wed Nov  9 11:39:05 2005
@@ -2,7 +2,8 @@
 
 TESTS = 01_restore_basic_pos.test \
        02_restore_badparm_neg.test \
-       03_restore_badfilename_neg.test
+       03_restore_badfilename_neg.test \
+       04_restore_withdevices_pos.test
 
 XFAIL_TESTS = 
 
diff -r 003339f0fcb2 -r b0b854126410 
tools/xm-test/tests/restore/04_restore_withdevices_pos.py
--- /dev/null   Wed Nov  9 11:38:46 2005
+++ b/tools/xm-test/tests/restore/04_restore_withdevices_pos.py Wed Nov  9 
11:39:05 2005
@@ -0,0 +1,72 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2005
+# Author: Dan Smith <danms@xxxxxxxxxx>
+
+from XmTestLib import *
+
+domain = XmTestDomain()
+
+domain.configAddDisk("phy:/dev/ram0", "hda1", "w")
+
+s, o = traceCommand("mkfs /dev/ram0")
+if s != 0:
+    FAIL("Unable to mkfs /dev/ram0 in dom0")
+
+try:
+    domain.start()
+except DomainError, e:
+    FAIL(str(e))
+
+try:
+    console = XmConsole(domain.getName())
+    console.sendInput("foo")
+
+    run = console.runCmd("mount /dev/hda1 /mnt")
+    if run["return"] != 0:
+        FAIL("Unable to mount /dev/hda1")
+
+    run = console.runCmd("echo bar > /mnt/foo")
+    if run["return"] != 0:
+        FAIL("Unable to write to block device!")
+
+except ConsoleError, e:
+    FAIL(str(e))
+
+console.closeConsole()
+
+try:
+    s, o = traceCommand("xm save %s /tmp/test.state" % domain.getName(),
+                        timeout=30)
+except TimeoutError, e:
+    FAIL(str(e))
+
+if s != 0:
+    FAIL("xm save exited with %i != 0" % s)
+
+# Let things settle
+time.sleep(15)
+
+try:
+    s, o = traceCommand("xm restore /tmp/test.state",
+                        timeout=30)
+except TimeoutError, e:
+    FAIL(str(e))
+
+if s != 0:
+    FAIL("xm restore exited with %i != 0" % s)
+
+try:
+    console = XmConsole(domain.getName())
+
+    run = console.runCmd("ls | grep proc")
+    if run["return"] != 0:
+        FAIL("ls failed on restored domain")
+    
+    run = console.runCmd("cat /mnt/foo | grep bar")
+    if run["return"] != 0:
+        FAIL("Unable to read from block device")
+
+except ConsoleError, e:
+    FAIL(str(e))
+        

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] This patch adds a new test that attempts to save and restore a domain, Xen patchbot -unstable <=