예제 #1
0
        public async Task CopyTo()
        {
            var repro1 = BuildRepro("repro1");

            BuildDatset(repro1, "ds1", "f1.root", "f2.root");
            var repro2 = BuildRepro("repro2");

            var place1 = new PlaceLocalWindowsDisk("test1", repro1);
            var place2 = new PlaceLocalWindowsDisk("test2", repro2);

            DataSetManager.ResetDSM(place1, place2);

            Assert.IsNull(await place2.GetListOfFilesForDataSetAsync("ds1"));
            await place1.CopyToAsync(place2, (await place1.GetListOfFilesForDataSetAsync("ds1")).Select(f => new Uri($"gridds://ds1/{f}")).ToArray());

            Assert.AreEqual(2, (await place2.GetListOfFilesForDataSetAsync("ds1")).Length);
        }
예제 #2
0
        public async Task GetDSFileListForNonExistingDataset()
        {
            var repro = BuildRepro("ExistingFileInExistingDataset");

            BuildDatset(repro, "ds1", "f1.root", "f2.root");
            var place = new PlaceLocalWindowsDisk("test", repro);
            var files = await place.GetListOfFilesForDataSetAsync("ds2");

            Assert.IsNull(files);
        }
예제 #3
0
        public async Task FileNameColonsAreIgnored()
        {
            var repro = BuildRepro("repro");

            BuildDatset(repro, "ds1", "f1.root", "f2.root");
            AddNamespaceToDatasetText(repro, "ds1", "user.gwatts");
            var place = new PlaceLocalWindowsDisk("test", repro);
            var files = await place.GetListOfFilesForDataSetAsync("ds1");

            Assert.AreEqual("f1.root", files[0]);
            Assert.AreEqual("f2.root", files[1]);
        }
예제 #4
0
        public async Task GetDSFileListForExistingDatasetButMissingOneFile()
        {
            var repro = BuildRepro("ExistingFileInExistingDataset");

            BuildDatset(repro, "ds1", "f1.root", "f2.root");
            File.Delete($"{repro.FullName}\\ds1\\files\\f1.root");
            var place = new PlaceLocalWindowsDisk("test", repro);
            var files = await place.GetListOfFilesForDataSetAsync("ds1");

            Assert.IsNotNull(files);
            Assert.AreEqual(2, files.Length);
            Assert.AreEqual("f1.root", files[0]);
            Assert.AreEqual("f2.root", files[1]);
        }
예제 #5
0
        public async Task CopyFromSCPTarget()
        {
            // Build remote dataset up on linux
            _ssh.CreateRepro();
            _ssh.CreateDS("ds1", "f1.root", "f2.root");
            var place1 = new PlaceLinuxRemote("test1", _ssh.RemotePath, _ssh.RemoteHostInfo);

            var repro1 = BuildRepro("repro2");
            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.CopyFromAsync(place1, uris);

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

            Assert.AreEqual(2, files.Length);
            Assert.IsTrue(await place2.HasFileAsync(uris[0]));
            Assert.IsTrue(await place2.HasFileAsync(uris[1]));
        }