def test_vm_recovery(self): service_start('vdsmd') # two VMs: # #0 dies: # it goes down and then VDSM restarts; the VM stats # must conserve the exit* fields unchanged across VDSM restarts. # #1 disappears: # it goes down while VDSM is down: must be reported as down. with self.running_vms(2, customize_vm) as vms: os.kill(vms[0].pid, signal.SIGTERM) self._waitForShutdown(vms[0].id) stats_before = vms[0].stats() pid = vms[1].pid service_stop('vdsmd') os.kill(pid, signal.SIGTERM) service_start('vdsmd') self.ensure_vdsm_started() stats_after = vms[0].stats() self.assertEqual(stats_after['status'], vmstatus.DOWN) for field in ('status', 'exitReason', 'exitMessage'): self.assertEqual(stats_before[field], stats_after[field]) self.assertEqual(vms[1].stats()['status'], vmstatus.DOWN)
def service_down_test(self): service_stop('vdsmd') vdsm_version = run_command(['rpm', '-q', 'vdsm']) downgrade_vdsm(el7_ovirt36_repo) upgrade_vdsm() self.assertEqual(run_command(['rpm', '-q', 'vdsm']), vdsm_version) self.assertEqual(service_status('vdsmd'), 1)
def test_service_down(self): service_stop('vdsmd') vdsm_version = commands.run(['rpm', '-q', 'vdsm']) downgrade_vdsm(el7_ovirt36_repo) upgrade_vdsm() assert commands.run(['rpm', '-q', 'vdsm']) == vdsm_version assert service_status('vdsmd') == 1
def libvirt_configure_services_restart(*args): """ Managing restart of related services """ service.service_stop("supervdsmd") service.service_stop("libvirtd") service.service_start("libvirtd") service.service_start("supervdsmd") return 0