Example #1
0
  def testIsInsideVm(self):
    osutils.WriteFile(self.model_file, "VBOX")
    self.assertTrue(osutils.IsInsideVm())
    self.assertEqual(self.mock_glob.call_args[0][0],
                     "/sys/block/*/device/model")

    osutils.WriteFile(self.model_file, "VMware")
    self.assertTrue(osutils.IsInsideVm())
Example #2
0
 def testIsNotInsideVm(self):
   osutils.WriteFile(self.model_file, "ST1000DM000-1CH1")
   self.assertFalse(osutils.IsInsideVm())