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] Make the 04_restore test verify that two block devices a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Make the 04_restore test verify that two block devices and two nics are
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 10 Nov 2005 17:06:11 +0000
Delivery-date: Thu, 10 Nov 2005 17:07:09 +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 danms@xxxxxxxxxx
# Node ID 0c3335a98f0b2b9043cd6d5373e70fdbf3fd0a82
# Parent  7562dc888468808604de3a9614e8c517f6798b90
Make the 04_restore test verify that two block devices and two nics are
restored to a working state and that the nics retain their configuration.

diff -r 7562dc888468 -r 0c3335a98f0b 
tools/xm-test/tests/restore/04_restore_withdevices_pos.py
--- a/tools/xm-test/tests/restore/04_restore_withdevices_pos.py Thu Nov 10 
10:48:05 2005
+++ b/tools/xm-test/tests/restore/04_restore_withdevices_pos.py Thu Nov 10 
10:48:05 2005
@@ -5,13 +5,20 @@
 
 from XmTestLib import *
 
-domain = XmTestDomain()
+import re
+
+domain = XmTestDomain(extraOpts={"nics":2})
 
 domain.configAddDisk("phy:/dev/ram0", "hda1", "w")
+domain.configAddDisk("phy:/dev/ram1", "hdb2", "w")
 
 s, o = traceCommand("mke2fs -q /dev/ram0")
 if s != 0:
     FAIL("Unable to mke2fs /dev/ram0 in dom0")
+
+s, o = traceCommand("mke2fs -q /dev/ram1")
+if s != 0:
+    FAIL("Unable to mke2fs /dev/ram1 in dom0")
 
 try:
     domain.start()
@@ -22,13 +29,38 @@
     console = XmConsole(domain.getName())
     console.sendInput("foo")
 
-    run = console.runCmd("mount /dev/hda1 /mnt")
+    run = console.runCmd("mkdir /mnt/a /mnt/b")
+    if run["return"] != 0:
+        FAIL("Unable to mkdir /mnt/a /mnt/b")
+
+    run = console.runCmd("mount /dev/hda1 /mnt/a")
     if run["return"] != 0:
         FAIL("Unable to mount /dev/hda1")
 
-    run = console.runCmd("echo bar > /mnt/foo")
+    run = console.runCmd("mount /dev/hdb2 /mnt/b")
     if run["return"] != 0:
-        FAIL("Unable to write to block device!")
+        FAIL("Unable to mount /dev/hdb2")
+
+    run = console.runCmd("echo hda1 > /mnt/a/foo")
+    if run["return"] != 0:
+        FAIL("Unable to write to block device hda1!")
+
+    run = console.runCmd("echo hdb2 > /mnt/b/foo")
+    if run["return"] != 0:
+        FAIL("Unable to write to block device hdb2!")
+
+    run = console.runCmd("ifconfig eth0 169.254.0.1 netmask 255.255.255.0")
+    if run["return"] != 0:
+        FAIL("Unable to configure DomU's eth0")
+
+    run = console.runCmd("ifconfig eth1 169.254.1.1 netmask 255.255.255.0")
+    if run["return"] != 0:
+        FAIL("Unable to configure DomU's eth1")
+
+    run = console.runCmd("ifconfig lo 127.0.0.1")
+    if run["return"] != 0:
+        FAIL("Unable to configure DomU's lo")
+
 
 except ConsoleError, e:
     FAIL(str(e))
@@ -63,9 +95,31 @@
     if run["return"] != 0:
         FAIL("ls failed on restored domain")
     
-    run = console.runCmd("cat /mnt/foo | grep bar")
+    run = console.runCmd("cat /mnt/a/foo")
     if run["return"] != 0:
-        FAIL("Unable to read from block device")
+        FAIL("Unable to read from block device hda1")
+    if not re.search("hda1", run["output"]):
+        FAIL("Failed to read correct data from hda1")
+
+    run = console.runCmd("cat /mnt/b/foo")
+    if run["return"] != 0:
+        FAIL("Unable to read from block device hdb2")
+    if not re.search("hdb2", run["output"]):
+        FAIL("Failed to read correct data from hdb2")
+
+    run = console.runCmd("ifconfig")
+    if not re.search("eth0", run["output"]):
+        FAIL("DomU's eth0 disappeared")
+    if not re.search("169.254.0.1", run["output"]):
+        FAIL("DomU's eth0 lost its IP")
+    if not re.search("eth1", run["output"]):
+        FAIL("DomU's eth1 disappeared")
+    if not re.search("169.254.1.1", run["output"]):
+        FAIL("DomU's eth1 lost its IP")
+    if not re.search("Loopback", run["output"]):
+        FAIL("DomU's lo disappeared")
+    if not re.search("127.0.0.1", run["output"]):
+        FAIL("DomU's lo lost its IP")
 
 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] Make the 04_restore test verify that two block devices and two nics are, Xen patchbot -unstable <=