def testParseMountData(self): test_data = r""" rootfs / rootfs rw 0 0 [email protected]:/users/arnie /home/arnie/remote fuse.sshfs rw,nosuid,nodev,max_read=65536 0 0 /dev/sr0 /media/USB\040Drive vfat ro,nosuid,nodev """ exports = StringIO.StringIO(test_data) parser = config_file.MtabParser() results = list(parser.Parse(None, exports, None)) self.assertEqual("rootfs", results[0].device) self.assertEqual("/", results[0].mount_point) self.assertEqual("rootfs", results[0].type) self.assertTrue(results[0].options.rw) self.assertFalse(results[0].options.ro) self.assertEqual("[email protected]:/users/arnie", results[1].device) self.assertEqual("/home/arnie/remote", results[1].mount_point) self.assertEqual("fuse.sshfs", results[1].type) self.assertTrue(results[1].options.rw) self.assertTrue(results[1].options.nosuid) self.assertTrue(results[1].options.nodev) self.assertEqual(["65536"], results[1].options.max_read) self.assertEqual("/dev/sr0", results[2].device) self.assertEqual("/media/USB Drive", results[2].mount_point) self.assertEqual("vfat", results[2].type) self.assertTrue(results[2].options.ro) self.assertTrue(results[2].options.nosuid) self.assertTrue(results[2].options.nodev)
def setUpClass(cls): super(LinuxMountsTests, cls).setUpClass() cls.LoadCheck("mounts.yaml") cls.parser = config_file.MtabParser()
def setUpClass(cls): cls.LoadCheck("mounts.yaml") cls.parser = config_file.MtabParser()