Revision 48bba9de test/py/ganeti.hypervisor.hv_xen_unittest.py

b/test/py/ganeti.hypervisor.hv_xen_unittest.py
30 30

  
31 31
from ganeti import constants
32 32
from ganeti import objects
33
from ganeti import pathutils
33 34
from ganeti import hypervisor
34 35
from ganeti import utils
35 36
from ganeti import errors
......
491 492
      self.fail("Unhandled command: %s" % (cmd, ))
492 493

  
493 494
    return self._SuccessCommand(output, cmd)
494
    #return self._FailingCommand(cmd)
495 495

  
496 496
  def _MakeInstance(self):
497 497
    # Copy default parameters
......
519 519

  
520 520
  def testStartInstance(self):
521 521
    (inst, disks) = self._MakeInstance()
522
    pathutils.LOG_XEN_DIR = self.tmpdir
522 523

  
523 524
    for failcreate in [False, True]:
524 525
      for paused in [False, True]:
......
537 538
        if failcreate:
538 539
          self.assertRaises(errors.HypervisorError, hv.StartInstance,
539 540
                            inst, disks, paused)
541
          # Check whether a stale config file is left behind
542
          self.assertFalse(os.path.exists(cfgfile))
540 543
        else:
541 544
          hv.StartInstance(inst, disks, paused)
542

  
543
        # Check if configuration was updated
544
        lines = utils.ReadFile(cfgfile).splitlines()
545
          # Check if configuration was updated
546
          lines = utils.ReadFile(cfgfile).splitlines()
545 547

  
546 548
        if constants.HV_VNC_PASSWORD_FILE in inst.hvparams:
547 549
          self.assertTrue(("vncpasswd = '%s'" % self.vncpw) in lines)

Also available in: Unified diff