View Javadoc

1   /**
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.hadoop.hbase.mapreduce;
19  
20  import org.apache.hadoop.hbase.HBaseTestingUtility;
21  import org.apache.hadoop.hbase.LargeTests;
22  import org.apache.hadoop.hbase.security.UserProvider;
23  import org.apache.hadoop.hbase.security.access.AccessControlLists;
24  import org.apache.hadoop.hbase.security.access.SecureTestUtil;
25  
26  import org.junit.BeforeClass;
27  import org.junit.Test;
28  import org.junit.experimental.categories.Category;
29  
30  
31  /**
32   * Reruns TestSecureLoadIncrementalHFilesSplitRecovery
33   * using LoadIncrementalHFiles in secure mode.
34   * This suite is unable to verify the security handoff/turnover
35   * as miniCluster is running as system user thus has root privileges
36   * and delegation tokens don't seem to work on miniDFS.
37   *
38   * Thus SecureBulkload can only be completely verified by running
39   * integration tests against a secure cluster. This suite is still
40   * invaluable as it verifies the other mechanisms that need to be
41   * supported as part of a LoadIncrementalFiles call.
42   */
43  @Category(LargeTests.class)
44  public class TestSecureLoadIncrementalHFilesSplitRecovery extends TestLoadIncrementalHFilesSplitRecovery {
45  
46    //This "overrides" the parent static method
47    //make sure they are in sync
48    @BeforeClass
49    public static void setupCluster() throws Exception {
50      util = new HBaseTestingUtility();
51      // set the always on security provider
52      UserProvider.setUserProviderForTesting(util.getConfiguration(),
53        HadoopSecurityEnabledUserProviderForTesting.class);
54      // setup configuration
55      SecureTestUtil.enableSecurity(util.getConfiguration());
56  
57      util.startMiniCluster();
58  
59      // Wait for the ACL table to become available
60      util.waitTableEnabled(AccessControlLists.ACL_TABLE_NAME.getName());
61    }
62  
63    //Disabling this test as it does not work in secure mode
64    @Test
65    @Override
66    public void testBulkLoadPhaseFailure() {
67    }
68  }
69