public void DttLoadingSystemSettings() { Console.WriteLine("Install AT"); BehaviorsRegression.CleanMachine(); AT.Install(); Thread.Sleep(DelayAfterInstall); Console.WriteLine("Stop services"); Service.Stop(NunitSettings.ServiceDttName); var dttLog = GetTextDTTLog().Replace(" ", "").Replace("/n", ""); var systemSettings = File.ReadAllText(SystemSettings.FilePath).Replace(" ", "").Replace("/n", ""); Console.WriteLine("Check that systemsettings.xml present in dtt log."); Assert.IsTrue(dttLog.Contains(systemSettings)); Console.WriteLine("Clean machine"); BehaviorsRegression.CleanMachine(); }
public void DttLockedFilesToTransfer() { Console.WriteLine("Create packets."); BehaviorsRegression.CleanMachine(); CreateUserDirectory(); CreateSamplePackets(); Console.WriteLine("Open files for edit."); var file1 = File.Open(Path.Combine(PathToPacketsAT, NamePacket), FileMode.Open); var file2 = File.Open(Path.Combine(DttRegression.PathToVideoAT, NameVideo), FileMode.Open); Console.WriteLine("Install AT."); AT.Install(); Service.Stop(NunitSettings.ServiceDttName); Assert.IsFalse(File.Exists(Path.Combine(DttRegression.PathToPacketsDTT, NamePacket)), "Couldn't find transfered file:" + NamePacket); if (ScreenRecording == "ON") { Assert.IsFalse(File.Exists(Path.Combine(DttRegression.PathToRecordingDTT, NameVideo)), "Couldn't find transfered file:" + NameVideo); } Service.Start(NunitSettings.ServiceDttName); Console.WriteLine("Close files."); file1.Close(); file2.Close(); Thread.Sleep(Delay); Service.Stop(NunitSettings.ServiceDttName); Thread.Sleep(Delay); Console.WriteLine("Check packets is transferred after stop Dtt."); Assert.IsTrue(File.Exists(Path.Combine(DttRegression.PathToPacketsDTT, NamePacket)), "Couldn't find transfered file:" + NamePacket); if (ScreenRecording == "ON") { Assert.IsTrue(File.Exists(Path.Combine(DttRegression.PathToRecordingDTT, NameVideo)), "Couldn't find transfered file:" + NameVideo); } Console.WriteLine("Clean machine"); BehaviorsRegression.CleanMachine(); }
public void ExtensionsCorruptedSystemSettings() { //TODO: to be refactored - file copy has to be in try-finaly clause Console.WriteLine("Change systemsettings.xml"); BehaviorsRegression.CleanMachine(); var xmlFile = File.ReadAllText(SystemSettings.FilePath); File.Copy(SystemSettings.FilePath, Path.Combine(NunitSettings.InstallFileLocation, NunitSettings.SystemSettingsNameFile.Replace(".xml", "1.xml")), true); string[] lines = { xmlFile, "<First line", "<Second line", "//>Third line" }; System.IO.File.WriteAllLines(SystemSettings.FilePath, lines); Console.WriteLine("Install AT"); AT.Install(); Thread.Sleep(timeToWait); Assert.IsFalse(AT.OsrExists(), "OSR process is started without project path."); Console.WriteLine("Clean machine."); BehaviorsRegression.CleanMachine(); File.Copy(Path.Combine(NunitSettings.InstallFileLocation, NunitSettings.SystemSettingsNameFile.Replace(".xml", "1.xml")), SystemSettings.FilePath, true); }
public void InstallerNo3RdpartDependencies() { Console.WriteLine("Install AT"); BehaviorsRegression.CleanMachine(); AT.Install(); Console.WriteLine("Check services"); CheckProcessAndServicesStarted(); Assert.IsTrue(AT.OpenSpanDriverServiceExists(), "OpenSpanDriverService isn't started."); Assert.IsTrue(AT.OpenSpanServiceExists(), "OpenSpanService isn't started."); Console.WriteLine("Check folders"); AT.DirectoryExists(_dttPath); //Identify win7 or winXp Assert.IsTrue(_major != 5 ? AT.DirectoryExists(_win7LocationData) : AT.DirectoryExists(_winXpAnd2003LocationData)); Console.WriteLine("Uninstall"); AT.UninstallAt(_locationInstalFile); }
public void ExtensionsIncorrectPathToKey() { Console.WriteLine("Change systemsettings.xml"); BehaviorsRegression.CleanMachine(); using (var systemSettings = new SystemSettings()) { systemSettings.keyRingPath = "incorrect path"; } Console.WriteLine("Install AT"); AT.Install(); Thread.Sleep(timeToWait); Assert.IsFalse(AT.OsrExists(), "OSR process is started without project path."); StopAllServices(); Console.WriteLine("Check os runtime log file"); Assert.IsTrue(GetContentOfLog(nameOSRunTimeLog).Contains(errorMessageEmptyPathToKey.Replace(" ", "")) || GetContentOfLog(nameOSRunTimeLog).Contains(errorMessageEmptyPathToKeyXP.Replace(" ", "")), "Incorrect error in osruntime log file. Path to pubring key."); Console.WriteLine("Clean machine."); BehaviorsRegression.CleanMachine(); }
public void ExtensionsPacketsStore() { Console.WriteLine("Clean machine."); BehaviorsRegression.CleanMachine(); using (var systemSettings = new SystemSettings()) { systemSettings.rawDataStoragePackets = NunitSettings.TempFolder; systemSettings.packetDuration = 5; } Console.WriteLine("Install AT"); AT.Install(); Thread.Sleep(30000); Console.WriteLine("Check number of packets in custom folder."); var packets = AT.GetContentOfFolder(NunitSettings.TempFolder, "*.packet"); Assert.IsTrue(packets.Count >= 8, "Incorrect quantity of packets:" + packets.Count); Console.WriteLine("Clean machine."); BehaviorsRegression.CleanMachine(); }
public void TestInstallerCleanUninstall() { Console.WriteLine("Install AT"); BehaviorsRegression.CleanMachine(); SetPacketDurationAT(5); AT.Install(); Console.WriteLine("Check services"); CheckProcessAndServicesStarted(); Console.WriteLine("Check folders"); Thread.Sleep(DelayInstall + 10000); Assert.IsTrue(AT.DirectoryExists(_dttPath)); //Identify win7 or winXp Assert.IsTrue(_major != 5 ? AT.DirectoryExists(_win7LocationData) : AT.DirectoryExists(_winXpAnd2003LocationData), "Folder isn't created properly."); Console.WriteLine("Uninstall check services and folders"); AT.UninstallAt(_locationInstalFile); CheckProcessAndServicesAbsent(); Assert.IsFalse(AT.DirectoryExists(DttRegression.PathToPacket), "Folder isn't removed properly."); }
public static void Main(string[] args) { Console.WriteLine("Install AT"); cleanMachine(); AT.Install(); Thread.Sleep(10000); Console.WriteLine("RunScript"); for (int i = 1; i < PerformanceSettings.QuantityConnection; i++) { Thread.Sleep(PerformanceSettings.DelayBetweenThread); Thread thread = new Thread(new ThreadStart(MultiThreadCopy.CopyToShareFolder)); thread.Name = "first" + i; thread.Start(); Console.WriteLine("Thread " + i + " is started!"); } Console.WriteLine("ALL " + PerformanceSettings.QuantityConnection + "connection is running. Start measure data on machine with share folder!"); Thread.Sleep(5000000); Console.WriteLine("Clean Machine"); cleanMachine(); }
public void ExtensionsPacketsSizeInvalid() { Console.WriteLine("Clean machine and edit SystemSettings.xml."); BehaviorsRegression.CleanMachine(); using (var systemSettings = new SystemSettings()) { systemSettings.packetSize = -10; } Console.WriteLine("Install AT and check services."); AT.Install(); Thread.Sleep(timeToWait); Assert.IsFalse(AT.OsrExists(), "OSR process started with incorrect packet duration."); StopAllServices(); Console.WriteLine("Check osrun time log file."); var errorNegativePacketSize = "System.ArgumentException: Invalid desired packet size parameter."; Assert.IsTrue(GetContentOfLog(nameOSRunTimeLog).Contains(errorNegativePacketSize.Replace(" ", "")), "Incorrect error in osruntime log file. Negative value in packet size."); Console.WriteLine("Clean machine."); BehaviorsRegression.CleanMachine(); }
public void DttPollPeriodZero() { BehaviorsRegression.CleanMachine(); Console.WriteLine("Set poll period = 0 and Install AT"); CreateUserDirectory(); CreateSamplePackets(); using (var systemSettings = new SystemSettings()) { systemSettings.dttPollPeriod = 0; } Console.WriteLine("Install AT"); AT.Install(); Console.WriteLine("Check Dtt is stopped."); Assert.IsFalse(Directory.Exists(NunitSettings.DttPath)); //TODO new BUG //Qusetion //Assert.IsFalse(Service.Exists(NunitSettings.NameServiceDtt())); Console.WriteLine("Clean machine"); BehaviorsRegression.CleanMachine(); }
public void DttTransferringFilesDuringServiceStop() { Console.WriteLine("Set poll period 200 for dtt."); BehaviorsRegression.CleanMachine(); using (var systemSettings = new SystemSettings()) { systemSettings.dttPollPeriod = 200; } Console.WriteLine("Install AT."); AT.Install(); CreateUserDirectory(); CreateSamplePackets(); Console.WriteLine("Check packets not transferred."); Assert.IsTrue(File.Exists(Path.Combine(PathToPacketsAT, NamePacket))); Assert.IsTrue(File.Exists(Path.Combine(DttRegression.PathToVideoAT, NameVideo))); Console.WriteLine("Check packets is transferred after stop Dtt."); Service.Stop(NunitSettings.ServiceDttName); Assert.IsFalse(File.Exists(Path.Combine(PathToPacketsAT, NamePacket))); if (ScreenRecording == "ON") { Assert.IsFalse(File.Exists(Path.Combine(DttRegression.PathToVideoAT, NameVideo))); } Assert.IsTrue(File.Exists(Path.Combine(DttRegression.PathToPacketsDTT, NamePacket)), "Couldn't find transfered file:" + NamePacket); if (ScreenRecording == "ON") { Assert.IsTrue(File.Exists(Path.Combine(DttRegression.PathToRecordingDTT, NameVideo)), "Couldn't find transfered file:" + NameVideo); } Console.WriteLine("Clean machine"); BehaviorsRegression.CleanMachine(); }
private void InstallATCheckService() { AT.Install(); InstallerRegression.CheckProcessAndServicesStarted(); }