From: Dan Smith <danms@us.ibm.com>
To: Xen Developers <xen-devel@lists.xensource.com>
Subject: [PATCH][XM-TEST] Add tests for bug #331
Date: Tue, 22 Nov 2005 12:58:02 -0800 [thread overview]
Message-ID: <87acfwmmcl.fsf@theine.beaverton.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 123 bytes --]
This patch adds tests that detect bug 331 (Prevent sharing of block
devices).
Signed-off-by: Dan Smith <danms@us.ibm.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: bug331.patch --]
[-- Type: text/x-patch, Size: 2637 bytes --]
# HG changeset patch
# User dan@guaranine.beaverton.ibm.com
# Node ID 7f743a7d7916a26ec02de95c1436cf5e5178c2a7
# Parent 393256b2ead0c883e2095479e1c66d2e34d18a10
Add tests for bug #331
diff -r 393256b2ead0 -r 7f743a7d7916 tools/xm-test/tests/block-create/Makefile.am
--- a/tools/xm-test/tests/block-create/Makefile.am Tue Nov 22 18:10:50 2005
+++ b/tools/xm-test/tests/block-create/Makefile.am Tue Nov 22 20:53:14 2005
@@ -8,7 +8,9 @@
06_block_attach_baddomain_neg.test \
07_block_attach_baddevice_neg.test \
08_block_attach_bad_filedevice_neg.test \
- 09_block_attach_and_dettach_device_check_data_pos.test
+ 09_block_attach_and_dettach_device_check_data_pos.test \
+ 11_block_attach_shared_dom0.test \
+ 12_block_attach_shared_domU.test
DISABLED =
diff -r 393256b2ead0 -r 7f743a7d7916 tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py
--- /dev/null Tue Nov 22 18:10:50 2005
+++ b/tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py Tue Nov 22 20:53:14 2005
@@ -0,0 +1,32 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2005
+# Author: Dan Smith <danms@us.ibm.com>
+
+from XmTestLib import *
+
+# Mount /dev/ram0
+
+s, o = traceCommand("mkfs /dev/ram0")
+if s != 0:
+ FAIL("Unable to mkfs /dev/ram0")
+
+s, o = traceCommand("mkdir -p mnt");
+if s != 0:
+ FAIL("Unable to create ./mnt")
+
+s, o = traceCommand("mount /dev/ram0 mnt -o rw")
+if s != 0:
+ FAIL("Unable to mount /dev/ram0 on ./mnt")
+
+# Now try to start a DomU with write access to /dev/ram0
+
+domain = XmTestDomain();
+domain.configAddDisk("phy:/dev/ram0", "hda1", "w")
+
+try:
+ domain.start()
+ s, o = traceCommand("umount mnt")
+ FAIL("Bug #331: Started a DomU with write access to a rw mounted block device")
+except DomainError, e:
+ s, o = traceCommand("umount mnt")
diff -r 393256b2ead0 -r 7f743a7d7916 tools/xm-test/tests/block-create/12_block_attach_shared_domU.py
--- /dev/null Tue Nov 22 18:10:50 2005
+++ b/tools/xm-test/tests/block-create/12_block_attach_shared_domU.py Tue Nov 22 20:53:14 2005
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+
+# Copyright (C) International Business Machines Corp., 2005
+# Author: Dan Smith <danms@us.ibm.com>
+
+from XmTestLib import *
+
+dom1 = XmTestDomain()
+dom2 = XmTestDomain(dom1.getName() + "-2")
+
+dom1.configAddDisk("phy:/dev/ram0", "hda1", "w")
+dom2.configAddDisk("phy:/dev/ram0", "hda1", "w")
+
+try:
+ dom1.start()
+except DomainError, e:
+ FAIL("Unable to start domain")
+
+try:
+ dom2.start()
+ FAIL("Bug #331: Started a DomU with write access to an in-use block device")
+except DomainError, e:
+ pass
+
[-- Attachment #3: Type: text/plain, Size: 88 bytes --]
--
Dan Smith
IBM Linux Technology Center
Open Hypervisor Team
email: danms@us.ibm.com
[-- Attachment #4: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2005-11-22 20:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-22 20:58 Dan Smith [this message]
2005-11-23 11:32 ` [PATCH][XM-TEST] Add tests for bug #331 Ewan Mellor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87acfwmmcl.fsf@theine.beaverton.ibm.com \
--to=danms@us.ibm.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.