public void RunLegacyUpdate() { _installer.Install(new Dictionary <string, string> { { Constants.XenToolsSetupExecutablePath, String.Format("/S /norestart /D={0}", Constants.XenToolsPath) } }); _serviceRestarter.Restart("xensvc"); if (_serviceRestarter.ServiceExists("XenServerVssProvider")) { _serviceRestarter.Restart("XenServerVssProvider"); } }
public ExecutableResult Execute(string value) { try { Statics.ShouldPollXenStore = false; _logger.Log(String.Format("XenTools Update value: {0}\r\nWill resume in 60 seconds", value)); _sleeper.Sleep(60); var agentUpdateInfo = _agentUpdateMessageHandler.Handle(value); _downloader.Download(agentUpdateInfo.url, Constants.XenToolsReleasePackage); _checksumValidator.Validate(agentUpdateInfo.signature, Constants.XenToolsReleasePackage); _unzipper.Unzip(Constants.XenToolsReleasePackage, Constants.XenToolsUnzipPath, ""); _installer.Install(new Dictionary <string, string> { { Constants.XenToolsSetupExecutablePath, String.Format("/S /norestart /D={0}", Constants.XenToolsPath) } }); _serviceRestarter.Restart("xensvc"); if (_serviceRestarter.ServiceExists("XenServerVssProvider")) { _serviceRestarter.Restart("XenServerVssProvider"); } return(new ExecutableResult()); } catch (Exception ex) { _logger.Log(String.Format("Exception was : {0}\nStackTrace Was: {1}", ex.Message, ex.StackTrace)); return(new ExecutableResult { Error = new List <string> { "Update failed" }, ExitCode = "1" }); } finally { Statics.ShouldPollXenStore = true; _finalizer.Finalize(new List <string> { Constants.XenToolsUnzipPath, Constants.XenToolsReleasePackage }); } }
public void should_be_true_if_service_exists() { Assert.IsTrue(_serviceRestarter.ServiceExists("eventlog")); }