Ejemplo n.º 1
0
        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]));
        }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
        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]));
        }
Ejemplo n.º 6
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]));
        }
Ejemplo n.º 7
0
 public async Task GetExistingDatasetFileListTunnel()
 {
     _ssh = new UtilsForBuildingLinuxDatasets("LinuxRemoteTestTunnel");
     await GetExistingDatasetFileList();
 }
Ejemplo n.º 8
0
 public void TestSetup()
 {
     _ssh = new UtilsForBuildingLinuxDatasets();
     DataSetManager.ResetDSM();
 }
Ejemplo n.º 9
0
 public void CanCopyToProperLocationTunnel()
 {
     _ssh = new UtilsForBuildingLinuxDatasets("LinuxRemoteTestTunnel");
     CanCopyToProperLocation();
 }
Ejemplo n.º 10
0
 public async Task GetReproDatasetFileListForBadDSTunnel()
 {
     _ssh = new UtilsForBuildingLinuxDatasets("LinuxRemoteTestTunnel");
     await GetReproDatasetFileListForBadDS();
 }
Ejemplo n.º 11
0
 public async Task HasFileMissingDatasetTunnel()
 {
     _ssh = new UtilsForBuildingLinuxDatasets("LinuxRemoteTestTunnel");
     await HasFileMissingDataset();
 }