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 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]));
        }
Ejemplo n.º 3
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]));
        }
Ejemplo n.º 4
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]));
        }
Ejemplo n.º 5
0
        public async Task CopyToViaTunnelWithPassword()
        {
            _ssh = new UtilsForBuildingLinuxDatasets("LinuxRemoteTestTunnelBigData");
            _ssh.CreateRepro();
            _ssh.CreateDS("ds1", "f1.root", "f2.root");
            var p1 = new PlaceLinuxRemote("test", _ssh.RemotePath, _ssh.RemoteHostInfo);

            var sshRemote = new UtilsForBuildingLinuxDatasets();

            sshRemote.CreateRepro();
            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.CopyToAsync(p2, fileList);

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