public async Task CopyWhenOneAlreadyThereAsPart() { // The whole thing is already there. _ssh.CreateRepro(); _ssh.CreateDS("ds1", "f1.root", "f2.root"); var ssh2 = new UtilsForBuildingLinuxDatasets(); ssh2.RemotePath += "2"; ssh2.CreateRepro(); ssh2.CreateDS("ds1", "f1.root", "f2.root"); ssh2.RemoveFileInDS("ds1", "f1.root"); ssh2.AddFileToDS("ds1", "f1.root.part"); var p1 = new PlaceLinuxRemote("test", _ssh.RemotePath, _ssh.RemoteHostInfo); var p2 = new PlaceLinuxRemote("test", ssh2.RemotePath, _ssh.RemoteHostInfo); DataSetManager.ResetDSM(p1, p2); var fileList = new Uri[] { new Uri("gridds://ds1/f1.root"), new Uri("gridds://ds1/f2.root") }; await p1.CopyToAsync(p2, fileList); Assert.IsTrue(await p2.HasFileAsync(fileList[0])); Assert.IsTrue(await p2.HasFileAsync(fileList[1])); }
public void CopyWhenAlreadyThere() { // The whole thing is already there. _ssh.CreateRepro(); _ssh.CreateDS("ds1", "f1.root", "f2.root"); var ssh2 = new UtilsForBuildingLinuxDatasets(); ssh2.RemotePath += "2"; ssh2.CreateRepro(); ssh2.CreateDS("ds1", "f1.root", "f2.root"); var p1 = new PlaceLinuxRemote("test", _ssh.RemotePath, _ssh.RemoteHostInfo); var p2 = new PlaceLinuxRemote("test", ssh2.RemotePath, _ssh.RemoteHostInfo); var fileList = new Uri[] { new Uri("gridds://ds1/f1.root"), new Uri("gridds://ds1/f2.root") }; p1.CopyTo(p2, fileList); Assert.IsTrue(p2.HasFile(fileList[0])); var allfiles = ssh2.GetAllFilesInRepro("ds1"); foreach (var f in allfiles) { Console.WriteLine(f); } Assert.AreEqual(1, allfiles.Where(l => l.Contains("f1.root")).Count()); }
public void CanSourceCopyFromSelf() { _ssh = new UtilsForBuildingLinuxDatasets("LinuxRemoteTestTunnel"); var p1 = new PlaceLinuxRemote("test1", _ssh.RemotePath, _ssh.RemoteHostInfo); var p2 = new PlaceLinuxRemote("test1", _ssh.RemotePath, _ssh.RemoteHostInfo); Assert.IsTrue(p1.CanSourceCopy(p2)); }
public void CanNotSourceCopyFromSomeoneSomewhereElse() { var _ssh1 = new UtilsForBuildingLinuxDatasets("LinuxRemoteTestTunnel"); var p1 = new PlaceLinuxRemote("test1", _ssh1.RemotePath, _ssh1.RemoteHostInfo); var _ssh2 = new UtilsForBuildingLinuxDatasets(); var p2 = new PlaceLinuxRemote("test1", _ssh2.RemotePath, _ssh2.RemoteHostInfo); DataSetManager.ResetDSM(p1, p2); Assert.IsFalse(p2.CanSourceCopy(p1)); }
public async Task CopyFromViaTunnelWithPassword() { _ssh = new UtilsForBuildingLinuxDatasets("LinuxRemoteTestTunnelBigData"); _ssh.CreateRepro(); var p1 = new PlaceLinuxRemote("test", _ssh.RemotePath, _ssh.RemoteHostInfo); var sshRemote = new UtilsForBuildingLinuxDatasets(); sshRemote.CreateRepro(); sshRemote.CreateDS("ds1", "f1.root", "f2.root"); var p2 = new PlaceLinuxRemote("test", sshRemote.RemotePath, sshRemote.RemoteHostInfo); DataSetManager.ResetDSM(p1, p2); var fileList = new Uri[] { new Uri("gridds://ds1/f1.root"), new Uri("gridds://ds1/f2.root") }; await p1.CopyFromAsync(p2, fileList); Assert.IsTrue(await p1.HasFileAsync(fileList[0])); }
public async Task CopyOneFilesTunnel() { // Should be setup to deal with about 4 GB of data in one file. _ssh = new UtilsForBuildingLinuxDatasets("LinuxRemoteTestTunnelBigData"); _ssh.CreateRepro(); var local_p = new PlaceLinuxRemote("test", _ssh.RemotePath, _ssh.RemoteHostInfo); var grid_p = new PlaceGRID("test-GRID", local_p); DataSetManager.ResetDSM(local_p, grid_p); var uris = new Uri[] { new Uri($"gridds://{_good_dsname}/{_good_dsfile_1}"), }; await grid_p.CopyToAsync(local_p, uris); var files = await local_p.GetListOfFilesForDataSetAsync(_good_dsname); Assert.AreEqual(197, files.Length); Assert.IsTrue(await local_p.HasFileAsync(uris[0])); }
public async Task GetExistingDatasetFileListTunnel() { _ssh = new UtilsForBuildingLinuxDatasets("LinuxRemoteTestTunnel"); await GetExistingDatasetFileList(); }
public void TestSetup() { _ssh = new UtilsForBuildingLinuxDatasets(); DataSetManager.ResetDSM(); }
public void CanCopyToProperLocationTunnel() { _ssh = new UtilsForBuildingLinuxDatasets("LinuxRemoteTestTunnel"); CanCopyToProperLocation(); }
public async Task GetReproDatasetFileListForBadDSTunnel() { _ssh = new UtilsForBuildingLinuxDatasets("LinuxRemoteTestTunnel"); await GetReproDatasetFileListForBadDS(); }
public async Task HasFileMissingDatasetTunnel() { _ssh = new UtilsForBuildingLinuxDatasets("LinuxRemoteTestTunnel"); await HasFileMissingDataset(); }