public async Task BashRunSimpleROOTWithRelatuveOutputFile() { var loc = new FileInfo("special/junk.root"); if (loc.Directory.Exists) { loc.Directory.Delete(true); } loc.Directory.Refresh(); var cmds = new StringBuilder(); cmds.AppendLine("{gSystem->mkdir(\"special\"); TFile *f = TFile::Open(\"special/junk.root\", \"RECREATE\"); exit(0);}"); List <string> results = new List <string>(); RemoteBashExecutor.AddLogEndpoint(s => { results.Add(s); Console.WriteLine(s); }); await RemoteBashHelpers.RunROOTInBashAsync(File.ReadAllLines("testmachine.txt").First(), "test", cmds.ToString(), new DirectoryInfo("."), filesToReceive : new[] { loc }); // Basically, there should be no crash. Assert.IsFalse(results.Where(s => s.Contains("Error")).Any()); // And the file should come back loc.Refresh(); Assert.IsTrue(loc.Exists); }
public void TestSetup() { TestUtils.ResetLINQLibrary(); CommandLineCommonExecutor.ResetCommandLineExecutor(); RemoteBashExecutor.ResetRemoteBashExecutor(); ntuple.Reset(); }
public async Task BashRunBasicCommand() { string bashCmds = "ls\n"; List <string> results = new List <string>(); RemoteBashExecutor.AddLogEndpoint(s => results.Add(s)); await RemoteBashHelpers.RunBashCommandAsync(File.ReadAllLines("testmachine.txt").First(), "testmeout", bashCmds, s => Console.WriteLine(s), verbose : true); Assert.AreNotEqual(0, results.Count); }
public async Task BashRunSimpleROOT() { var cmds = new StringBuilder(); cmds.AppendLine("{TH1F *h = new TH1F(\"hi\", \"there\", 10, 0.0, 10.0);"); cmds.AppendLine("h->Print();}"); List <string> results = new List <string>(); RemoteBashExecutor.AddLogEndpoint(s => results.Add(s)); await RemoteBashHelpers.RunROOTInBashAsync(File.ReadAllLines("testmachine.txt").First(), "test", cmds.ToString(), new System.IO.DirectoryInfo(System.IO.Path.GetTempPath())); Assert.AreNotEqual(0, results.Count); }
public async Task BashRunSimpleROOTWithInputFile() { var f = ROOTNET.NTFile.Open("junk.root", "RECREATE"); f.Close(); var cmds = new StringBuilder(); cmds.AppendLine("{TFile *f = TFile::Open(\"junk.root\", \"READ\"); exit(0);}"); List <string> results = new List <string>(); RemoteBashExecutor.AddLogEndpoint(s => results.Add(s)); await RemoteBashHelpers.RunROOTInBashAsync(File.ReadAllLines("testmachine.txt").First(), "test", cmds.ToString(), new System.IO.DirectoryInfo(System.IO.Path.GetTempPath()), filesToSend : new[] { new FileInfo("junk.root") }); // Basically, there should be no crash. Assert.IsFalse(results.Where(s => s.Contains("Error")).Any()); }
public void Cleanup() { RemoteBashExecutor.ResetCommandLineExecutor(); RemoteBashExecutor.ResetRemoteBashExecutor(); }
public void TestCleanup() { TestUtils.ResetLINQLibrary(); MEFUtilities.MyClassDone(); RemoteBashExecutor.ResetRemoteBashExecutor(); }