private static void RunBeforeAnyTests() { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { GSDServiceProcess.InstallService(); string statusCacheVersionTokenPath = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData, Environment.SpecialFolderOption.Create), "GSD", "GSD.Service", "EnableGitStatusCacheToken.dat"); if (!File.Exists(statusCacheVersionTokenPath)) { File.WriteAllText(statusCacheVersionTokenPath, string.Empty); } } }
public void ServiceStartsPrjFltService() { if (!GSDTestConfig.TestGSDOnPath) { Assert.Ignore("Skipping test, test only enabled when --test-gvfs-on-path is set"); } this.Enlistment.UnmountGSD(); StopPrjFlt(); GSDServiceProcess.StopService(); GSDServiceProcess.StartService(); ServiceController controller = new ServiceController("prjflt"); controller.WaitForStatus(ServiceControllerStatus.Running, TimeSpan.FromSeconds(10)); controller.Status.ShouldEqual(ServiceControllerStatus.Running); this.Enlistment.MountGSD(); }
private static void RunAfterAllTests() { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { string serviceLogFolder = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "GSD", GSDServiceProcess.TestServiceName, "Logs"); Console.WriteLine("GSD.Service logs at '{0}' attached below.\n\n", serviceLogFolder); foreach (string filename in TestResultsHelper.GetAllFilesInDirectory(serviceLogFolder)) { TestResultsHelper.OutputFileContents(filename); } GSDServiceProcess.UninstallService(); } PrintTestCaseStats.PrintRunTimeStats(); }
private void RestartService() { GSDServiceProcess.StopService(); GSDServiceProcess.StartService(); }