def set_mount_points(self, points, read_access=True):
"""
This method prepares a fake mounts file containing the
mount points specified in the C{points} list of strings. This file
can then be used by referencing C{self.mount_file}.
If C{read_access} is set to C{False}, then all mount points will
yield a permission denied error when inspected.
"""
self.read_access = read_access
content = "\n".join("/dev/sda%d %s ext4 rw 0 0" % (i, point)
for i, point in enumerate(points))
f = open(self.mount_file, "w")
f.write(content)
f.close()
for point in points:
self.stat_results[point] = os.statvfs_result(
(4096, 0, 1000, 500, 0, 0, 0, 0, 0, 0))
评论列表
文章目录