summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael E Brown <mebrown@michaels-house.net>2008-03-09 12:09:00 -0500
committerMichael E Brown <mebrown@michaels-house.net>2008-03-09 12:09:00 -0500
commit97d9d11d4c68648efe347049afe68e538d250f56 (patch)
tree1de47d8046e4e657727dfc589637c4ad1c23232a
parent94d02f3cf940d0e9e1f23ec0e8845f33105fc8fc (diff)
downloadmock-97d9d11d4c68648efe347049afe68e538d250f56.tar.gz
mock-97d9d11d4c68648efe347049afe68e538d250f56.tar.xz
mock-97d9d11d4c68648efe347049afe68e538d250f56.zip
add support for shm
-rw-r--r--py/mock/backend.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/py/mock/backend.py b/py/mock/backend.py
index 6726deb..3cc0a9f 100644
--- a/py/mock/backend.py
+++ b/py/mock/backend.py
@@ -269,6 +269,7 @@ class Root(object):
# files in /dev
mock.util.rmtree(self.makeChrootPath("dev"))
mock.util.mkdirIfAbsent(self.makeChrootPath("dev", "pts"))
+ mock.util.mkdirIfAbsent(self.makeChrootPath("dev", "shm"))
prevMask = os.umask(0000)
devFiles = (
(stat.S_IFCHR | 0666, os.makedev(1, 3), "dev/null"),
@@ -295,13 +296,17 @@ class Root(object):
os.umask(prevMask)
# mount/umount
- umntCmd = 'umount -n %s' % self.makeChrootPath('/dev/pts')
- if umntCmd not in self.umountCmds:
- self.umountCmds.append(umntCmd)
-
- mntCmd = 'mount -n -t devpts mock_chroot_devpts %s' % self.makeChrootPath('/dev/pts')
- if mntCmd not in self.mountCmds:
- self.mountCmds.append(mntCmd)
+ for devUnmtCmd in (
+ 'umount -n %s' % self.makeChrootPath('/dev/pts'),
+ 'umount -n %s' % self.makeChrootPath('/dev/shm') ):
+ if devUnmtCmd not in self.umountCmds:
+ self.umountCmds.append(devUnmtCmd)
+
+ for devMntCmd in (
+ 'mount -n -t devpts mock_chroot_devpts %s' % self.makeChrootPath('/dev/pts'),
+ 'mount -n -t tmpfs mock_chroot_shmfs %s' % self.makeChrootPath('/dev/shm') ):
+ if devMntCmd not in self.mountCmds:
+ self.mountCmds.append(devMntCmd)
# bad hack
# comment out decorator here so we dont get double exceptions in the root log