Revision 3eb073a6

b/test/py/ganeti.hypervisor.hv_xen_unittest.py
76 76
                      constants.CPU_PINNING_ALL_XEN))
77 77

  
78 78

  
79
class TestGetCommand(testutils.GanetiTestCase):
80
  def testDefault(self):
81
    expected_cmd = "xm"
82
    hv = hv_xen.XenHypervisor()
83
    self.assertEqual(hv._GetCommand(), expected_cmd)
84

  
85
  def testCommandExplicit(self):
86
    """Test the case when the command is given as class parameter explicitly.
87

  
88
    """
89
    expected_cmd = "xl"
90
    hv = hv_xen.XenHypervisor(_cmd=constants.XEN_CMD_XL)
91
    self.assertEqual(hv._GetCommand(), expected_cmd)
92

  
93
  def testCommandInvalid(self):
94
    """Test the case an invalid command is given as class parameter explicitly.
95

  
96
    """
97
    hv = hv_xen.XenHypervisor(_cmd="invalidcommand")
98
    self.assertRaises(errors.ProgrammerError, hv._GetCommand, None)
99

  
100

  
79 101
class TestParseXmList(testutils.GanetiTestCase):
80 102
  def test(self):
81 103
    data = testutils.ReadTestData("xen-xm-list-4.0.1-dom0-only.txt")

Also available in: Unified diff