Exemple #1
0
        public void canCloneSnapshots()
        {
            string testPrefix = Guid.NewGuid().ToString();

            FreeNASWithCaching foo = new FreeNASWithCaching(nashostname, nasusername, naspassword);

            // Make a test datastore to export
            using (SSHExecutor exec = new SSHExecutor(nashostname, nasusername, naspassword))
            {
                exec.startExecutable("zfs", "create -V 10MB test/" + testPrefix);
            }

            snapshot snap = foo.createSnapshot("test/" + testPrefix, "snapshot-of-" + testPrefix);

            Assert.AreEqual(1, foo.getSnapshots().Count(x => x.id == snap.id));
            foo.cloneSnapshot(snap, "test/clone-of-" + testPrefix);
        }