View Javadoc

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