public void ServiceCommandsWithMultipleRepos()
        {
            GVFSFunctionalTestEnlistment enlistment1 = this.CreateNewEnlistment();
            GVFSFunctionalTestEnlistment enlistment2 = this.CreateNewEnlistment();

            string[] repoRootList = new string[] { enlistment1.EnlistmentRoot, enlistment2.EnlistmentRoot };

            GVFSProcess gvfsProcess1 = new GVFSProcess(
                Path.Combine(TestContext.CurrentContext.TestDirectory, Properties.Settings.Default.PathToGVFS),
                enlistment1.EnlistmentRoot,
                enlistment1.LocalCacheRoot);

            GVFSProcess gvfsProcess2 = new GVFSProcess(
                Path.Combine(TestContext.CurrentContext.TestDirectory, Properties.Settings.Default.PathToGVFS),
                enlistment2.EnlistmentRoot,
                enlistment2.LocalCacheRoot);

            this.RunServiceCommandAndCheckOutput("--list-mounted", expectedRepoRoots: repoRootList);
            this.RunServiceCommandAndCheckOutput("--unmount-all", expectedRepoRoots: repoRootList);

            // Check both are unmounted
            gvfsProcess1.IsEnlistmentMounted().ShouldEqual(false);
            gvfsProcess2.IsEnlistmentMounted().ShouldEqual(false);

            this.RunServiceCommandAndCheckOutput("--list-mounted", EmptyRepoList);
            this.RunServiceCommandAndCheckOutput("--unmount-all", EmptyRepoList);
            this.RunServiceCommandAndCheckOutput("--mount-all", expectedRepoRoots: repoRootList);

            // Check both are mounted
            gvfsProcess1.IsEnlistmentMounted().ShouldEqual(true);
            gvfsProcess2.IsEnlistmentMounted().ShouldEqual(true);

            this.RunServiceCommandAndCheckOutput("--list-mounted", expectedRepoRoots: repoRootList);
        }
        private void DeleteNugetConfig()
        {
            GVFSProcess gvfs = new GVFSProcess(GVFSTestConfig.PathToGVFS, enlistmentRoot: null, localCacheRoot: null);

            gvfs.DeleteConfig(NugetFeedURLKey);
            gvfs.DeleteConfig(NugetFeedPackageNameKey);
        }
        public void ServiceCommandsWithMountAndUnmount()
        {
            GVFSFunctionalTestEnlistment enlistment1 = this.CreateNewEnlistment();

            string[] repoRootList = new string[] { enlistment1.EnlistmentRoot };

            GVFSProcess gvfsProcess1 = new GVFSProcess(
                GVFSTestConfig.PathToGVFS,
                enlistment1.EnlistmentRoot,
                enlistment1.LocalCacheRoot);

            this.RunServiceCommandAndCheckOutput("--list-mounted", expectedRepoRoots: repoRootList);

            gvfsProcess1.Unmount();

            this.RunServiceCommandAndCheckOutput("--list-mounted", EmptyRepoList, unexpectedRepoRoots: repoRootList);
            this.RunServiceCommandAndCheckOutput("--unmount-all", EmptyRepoList, unexpectedRepoRoots: repoRootList);
            this.RunServiceCommandAndCheckOutput("--mount-all", EmptyRepoList, unexpectedRepoRoots: repoRootList);

            // Check that it is still unmounted
            gvfsProcess1.IsEnlistmentMounted().ShouldEqual(false);

            gvfsProcess1.Mount();

            this.RunServiceCommandAndCheckOutput("--unmount-all", expectedRepoRoots: repoRootList);
            this.RunServiceCommandAndCheckOutput("--mount-all", expectedRepoRoots: repoRootList);
        }
Exemple #4
0
        private void ReadNugetConfig(out string feedUrl, out string feedName)
        {
            GVFSProcess gvfs = new GVFSProcess(GVFSTestConfig.PathToGVFS, enlistmentRoot: null, localCacheRoot: null);

            feedUrl  = gvfs.ReadConfig("upgrade.feedurl");
            feedName = gvfs.ReadConfig("upgrade.feedpackagename");
        }
Exemple #5
0
        private void WriteNugetConfig(string feedUrl, string feedName)
        {
            GVFSProcess gvfs = new GVFSProcess(GVFSTestConfig.PathToGVFS, enlistmentRoot: null, localCacheRoot: null);

            gvfs.WriteConfig("upgrade.feedurl", feedUrl);
            gvfs.WriteConfig("upgrade.feedpackagename", feedName);
        }
Exemple #6
0
        private void DeleteNugetConfig()
        {
            GVFSProcess gvfs = new GVFSProcess(GVFSTestConfig.PathToGVFS, enlistmentRoot: null, localCacheRoot: null);

            gvfs.DeleteConfig("upgrade.feedurl");
            gvfs.DeleteConfig("upgrade.feedpackagename");
        }
 public void Setup()
 {
     this.gvfsProcess    = new GVFSProcess(this.Enlistment);
     this.allDirectories = Directory.GetDirectories(this.Enlistment.RepoRoot, "*", SearchOption.AllDirectories)
                           .Where(x => !x.Contains(Path.DirectorySeparatorChar + ".git" + Path.DirectorySeparatorChar))
                           .ToArray();
     this.directoriesInMainFolder = Directory.GetDirectories(Path.Combine(this.Enlistment.RepoRoot, this.mainSparseFolder));
 }
        private void ReadNugetConfig(out string feedUrl, out string feedName)
        {
            GVFSProcess gvfs = new GVFSProcess(GVFSTestConfig.PathToGVFS, enlistmentRoot: null, localCacheRoot: null);

            // failOnError is set to false because gvfs config read can exit with
            // GenericError when the key-value is not available in config file. That
            // is normal.
            feedUrl  = gvfs.ReadConfig(NugetFeedURLKey, failOnError: false);
            feedName = gvfs.ReadConfig(NugetFeedPackageNameKey, failOnError: false);
        }
Exemple #9
0
        public void SetupTest()
        {
            GVFSProcess gvfsProcess = new GVFSProcess(
                Path.Combine(TestContext.CurrentContext.TestDirectory, Properties.Settings.Default.PathToGVFS),
                this.Enlistment.EnlistmentRoot);

            if (!gvfsProcess.IsEnlistmentMounted())
            {
                gvfsProcess.Mount();
            }
        }
Exemple #10
0
        public void SetupTest()
        {
            GVFSProcess gvfsProcess = new GVFSProcess(
                GVFSTestConfig.PathToGVFS,
                this.Enlistment.EnlistmentRoot,
                Path.Combine(this.Enlistment.EnlistmentRoot, ".gvfs"));

            if (!gvfsProcess.IsEnlistmentMounted())
            {
                gvfsProcess.Mount();
            }
        }
        private void WriteNugetConfig(string feedUrl, string feedName)
        {
            GVFSProcess gvfs = new GVFSProcess(GVFSTestConfig.PathToGVFS, enlistmentRoot: null, localCacheRoot: null);

            if (!string.IsNullOrEmpty(feedUrl))
            {
                gvfs.WriteConfig(NugetFeedURLKey, feedUrl);
            }

            if (!string.IsNullOrEmpty(feedName))
            {
                gvfs.WriteConfig(NugetFeedPackageNameKey, feedName);
            }
        }
Exemple #12
0
        private void RunServiceCommandAndCheckOutput(string argument, string[] expectedRepoRoots, string[] unexpectedRepoRoots = null)
        {
            GVFSProcess gvfsProcess = new GVFSProcess(
                Path.Combine(TestContext.CurrentContext.TestDirectory, Properties.Settings.Default.PathToGVFS),
                null);

            string result = gvfsProcess.RunServiceVerb(argument);

            result.ShouldContain(expectedRepoRoots);

            if (unexpectedRepoRoots != null)
            {
                result.ShouldNotContain(false, unexpectedRepoRoots);
            }
        }
        private void RunServiceCommandAndCheckOutput(string argument, string[] expectedRepoRoots, string[] unexpectedRepoRoots = null)
        {
            GVFSProcess gvfsProcess = new GVFSProcess(
                GVFSTestConfig.PathToGVFS,
                enlistmentRoot: null,
                localCacheRoot: null);

            string result = gvfsProcess.RunServiceVerb(argument);

            result.ShouldContain(expectedRepoRoots);

            if (unexpectedRepoRoots != null)
            {
                result.ShouldNotContain(false, unexpectedRepoRoots);
            }
        }
Exemple #14
0
 public void Setup()
 {
     this.gvfsProcess             = new GVFSProcess(this.Enlistment);
     this.allRootDirectories      = Directory.GetDirectories(this.Enlistment.RepoRoot);
     this.directoriesInMainFolder = Directory.GetDirectories(Path.Combine(this.Enlistment.RepoRoot, this.mainSparseFolder));
 }