Ejemplo n.º 1
0
        public virtual void TestClientAndServerDoNotHaveCommonQop()
        {
            HdfsConfiguration clusterConf = CreateSecureConfig("privacy");

            StartCluster(clusterConf);
            HdfsConfiguration clientConf = new HdfsConfiguration(clusterConf);

            clientConf.Set(DFSConfigKeys.DfsDataTransferProtectionKey, "authentication");
            exception.Expect(typeof(IOException));
            exception.ExpectMessage("could only be replicated to 0 nodes");
            DoTest(clientConf);
        }
Ejemplo n.º 2
0
        /// <summary>Test rename a non-existing snapshot</summary>
        /// <exception cref="System.Exception"/>
        public virtual void TestRenameNonExistingSnapshot()
        {
            DFSTestUtil.CreateFile(hdfs, file1, Blocksize, Replication, seed);
            // Create snapshot for sub1
            SnapshotTestHelper.CreateSnapshot(hdfs, sub1, "s1");
            exception.Expect(typeof(SnapshotException));
            string error = "The snapshot wrongName does not exist for directory " + sub1.ToString
                               ();

            exception.ExpectMessage(error);
            hdfs.RenameSnapshot(sub1, "wrongName", "s2");
        }
Ejemplo n.º 3
0
        public virtual void TestDoPreUpgradeIOError()
        {
            FilePath    storageDir = new FilePath(TestEditLog.TestDir, "preupgradeioerror");
            IList <URI> editUris   = Sharpen.Collections.SingletonList(storageDir.ToURI());
            NNStorage   storage    = TestEditLog.SetupEdits(editUris, 5);

            Storage.StorageDirectory sd = storage.DirIterator(NNStorage.NameNodeDirType.Edits
                                                              ).Next();
            NUnit.Framework.Assert.IsNotNull(sd);
            // Change storage directory so that renaming current to previous.tmp fails.
            FileUtil.SetWritable(storageDir, false);
            FileJournalManager jm = null;

            try
            {
                jm = new FileJournalManager(conf, sd, storage);
                exception.Expect(typeof(IOException));
                if (NativeCodeLoader.IsNativeCodeLoaded())
                {
                    exception.ExpectMessage("failure in native rename");
                }
                jm.DoPreUpgrade();
            }
            finally
            {
                IOUtils.Cleanup(Log, jm);
                // Restore permissions on storage directory and make sure we can delete.
                FileUtil.SetWritable(storageDir, true);
                FileUtil.FullyDelete(storageDir);
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// We expect an AclException, and we want the exception text to state the
 /// configuration key that controls ACL support.
 /// </summary>
 private void ExpectException()
 {
     exception.Expect(typeof(AclException));
     exception.ExpectMessage(DFSConfigKeys.DfsNamenodeAclsEnabledKey);
 }