Revision 1b045f5d test/ganeti.utils_unittest.py

b/test/ganeti.utils_unittest.py
1148 1148
    self.assertFileMode(self.tmpname, 0644)
1149 1149

  
1150 1150

  
1151
class TestGetMounts(unittest.TestCase):
1152
  """Test case for GetMounts()."""
1153

  
1154
  TESTDATA = (
1155
    "rootfs /     rootfs rw 0 0\n"
1156
    "none   /sys  sysfs  rw,nosuid,nodev,noexec,relatime 0 0\n"
1157
    "none   /proc proc   rw,nosuid,nodev,noexec,relatime 0 0\n")
1158

  
1159
  def setUp(self):
1160
    self.tmpfile = tempfile.NamedTemporaryFile()
1161
    utils.WriteFile(self.tmpfile.name, data=self.TESTDATA)
1162

  
1163
  def testGetMounts(self):
1164
    self.assertEqual(utils.GetMounts(filename=self.tmpfile.name),
1165
      [
1166
        ("rootfs", "/", "rootfs", "rw"),
1167
        ("none", "/sys", "sysfs", "rw,nosuid,nodev,noexec,relatime"),
1168
        ("none", "/proc", "proc", "rw,nosuid,nodev,noexec,relatime"),
1169
      ])
1170

  
1171

  
1151 1172
class TestShellQuoting(unittest.TestCase):
1152 1173
  """Test case for shell quoting functions"""
1153 1174

  

Also available in: Unified diff