source: trunk/packages/xen-3.1/xen-3.1/tools/xm-test/tests/block-create/11_block_attach_shared_dom0.py @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

  • Property svn:mime-type set to text/script
File size: 891 bytes
Line 
1#!/usr/bin/python
2
3# Copyright (C) International Business Machines Corp., 2005
4# Author: Dan Smith <danms@us.ibm.com>
5
6from XmTestLib import *
7
8if ENABLE_HVM_SUPPORT:
9    SKIP("Block-attach not supported for HVM domains")
10
11# Mount /dev/ram0
12
13s, o = traceCommand("mkfs /dev/ram0")
14if s != 0:
15    FAIL("Unable to mkfs /dev/ram0")
16
17s, o = traceCommand("mkdir -p mnt");
18if s != 0:
19    FAIL("Unable to create ./mnt")
20
21s, o = traceCommand("mount /dev/ram0 mnt -o rw")
22if s != 0:
23    FAIL("Unable to mount /dev/ram0 on ./mnt")
24
25# Now try to start a DomU with write access to /dev/ram0
26
27config = {"disk":"phy:/dev/ram0,xvda1,w"}
28
29domain = XmTestDomain(extraConfig=config);
30
31try:
32    domain.start()
33    s, o = traceCommand("umount mnt")
34    FAIL("Bug #331: Started a DomU with write access to a rw mounted block device")
35except DomainError, e:
36    s, o = traceCommand("umount mnt")
37
38domain.destroy()
Note: See TracBrowser for help on using the repository browser.