

def testParseMountData(self):
    test_data = '\n    rootfs / rootfs rw 0 0\n    arnie@host.example.org:/users/arnie /home/arnie/remote fuse.sshfs rw,nosuid,nodev,max_read=65536 0 0\n    /dev/sr0 /media/USB\\040Drive vfat ro,nosuid,nodev\n    '
    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('arnie@host.example.org:/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)

dataset/ETHPy150Open google/grr/grr/parsers/config_file_test.py MtabParserTests.testParseMountData/original