Beispiel #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]));
        }
Beispiel #2
0
        public async Task HasFileGoodFile()
        {
            _ssh.CreateRepro();
            _ssh.CreateDS("ds1", "f1.root", "f2.root");
            var p = new PlaceLinuxRemote("test", _ssh.RemotePath, _ssh.RemoteHostInfo);

            DataSetManager.ResetDSM(p);

            Assert.IsTrue(await p.HasFileAsync(new Uri("gridds://ds1/f1.root")));
        }
Beispiel #3
0
        public async Task CopyToTwoStep()
        {
            _ssh.CreateRepro();
            _ssh.CreateDS("ds1", "f1.root", "f2.root");
            var p1 = new PlaceLinuxRemote("test1", _ssh.RemotePath, _ssh.RemoteHostInfo);

            _ssh.CreateRepro(_ssh.RemotePath + "2");
            var p2 = new PlaceLinuxRemote("test2", _ssh.RemotePath + "2", _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.Take(1).ToArray());

            Assert.IsTrue(await p2.HasFileAsync(fileList[0]));
            Assert.IsFalse(await p2.HasFileAsync(fileList[1]));

            await p1.CopyToAsync(p2, fileList.Skip(1).ToArray());

            Assert.IsTrue(await p2.HasFileAsync(fileList[1]));
        }
Beispiel #4
0
        public async Task HasPartFileInDataset()
        {
            _ssh.CreateRepro();
            _ssh.CreateDS("ds1", "f1.root", "f2.root");
            _ssh.RemoveFileInDS("ds1", "f1.root");
            _ssh.AddFileToDS("ds1", "f1.root.part");
            var p = new PlaceLinuxRemote("test", _ssh.RemotePath, _ssh.RemoteHostInfo);

            DataSetManager.ResetDSM(p);

            Assert.IsFalse(await p.HasFileAsync(new Uri("gridds://ds1/f1.root")));
        }
Beispiel #5
0
        public async Task CopyTwoFiles()
        {
            _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}"),
                new Uri($"gridds://{_good_dsname}/{_good_dsfile_2}"),
            };

            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]));
            Assert.IsTrue(await local_p.HasFileAsync(uris[1]));
        }
Beispiel #6
0
        public async Task CopyToSCPTarget()
        {
            // Build remote dataset up on linux
            _ssh.CreateRepro();
            var place1 = new PlaceLinuxRemote("test1", _ssh.RemotePath, _ssh.RemoteHostInfo);

            var repro1 = BuildRepro("repro2");

            BuildDatset(repro1, "ds1", "f1.root", "f2.root");
            var place2 = new PlaceLocalWindowsDisk("test1", repro1);

            DataSetManager.ResetDSM(place1, place2);

            var uris = new Uri[] { new Uri("gridds://ds1/f1.root"), new Uri("gridds://ds1/f2.root") };
            await place2.CopyToAsync(place1, uris);

            var files = await place1.GetListOfFilesForDataSetAsync("ds1");

            Assert.AreEqual(2, files.Length);
            Assert.IsTrue(await place1.HasFileAsync(uris[0]));
            Assert.IsTrue(await place1.HasFileAsync(uris[1]));
        }
Beispiel #7
0
        public async Task LinuxRemoteCopyToFromBadDS()
        {
            _ssh.CreateRepro();
            _ssh.CreateDS("ds1", "f1.root", "f2.root");
            var p1 = new PlaceLinuxRemote("test", _ssh.RemotePath, _ssh.RemoteHostInfo);
            var p2 = new PlaceLinuxRemote("test", _ssh.RemotePath + "2", _ssh.RemoteHostInfo);

            DataSetManager.ResetDSM(p1, p2);

            var fileList = new Uri[] { new Uri("gridds://ds2/f1.root"), new Uri("gridds://ds2/f2.root") };
            await p1.CopyToAsync(p2, fileList);

            Assert.IsTrue(await p2.HasFileAsync(fileList[0]));
        }
Beispiel #8
0
        public async Task CopyFrom()
        {
            _ssh.CreateRepro();
            _ssh.CreateDS("ds1", "f1.root", "f2.root");
            var p1 = new PlaceLinuxRemote("test1", _ssh.RemotePath, _ssh.RemoteHostInfo);
            var p2 = new PlaceLinuxRemote("test2", _ssh.RemotePath + "2", _ssh.RemoteHostInfo);

            DataSetManager.ResetDSM(p1, p2);

            var fileList = new Uri[] { new Uri("gridds://ds1/f1.root"), new Uri("gridds://ds1/f2.root") };
            await p2.CopyFromAsync(p1, fileList);

            Assert.IsTrue(await p2.HasFileAsync(fileList[0]));
            Assert.AreEqual(2, (await p2.GetListOfFilesForDataSetAsync("ds1")).Length);
        }
Beispiel #9
0
        public async Task CopyToWithMissingFile()
        {
            _ssh.CreateRepro();
            _ssh.CreateDS("ds1", "f1.root", "f2.root");
            _ssh.RemoveFileInDS("ds1", "f1.root");
            var p1 = new PlaceLinuxRemote("test", _ssh.RemotePath, _ssh.RemoteHostInfo);
            var p2 = new PlaceLinuxRemote("test", _ssh.RemotePath + "2", _ssh.RemoteHostInfo);

            DataSetManager.ResetDSM(p1, p2);

            var fileList = new Uri[] { new Uri("gridds://ds1/f1.root"), new Uri("gridds://ds1/f2.root") };
            // This should fail because there is a missing file and we've explicitly requested both files to be copied.
            await p1.CopyToAsync(p2, fileList);

            Assert.IsTrue(await p2.HasFileAsync(fileList[0]));
        }
Beispiel #10
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]));
        }
Beispiel #11
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]));
        }