001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hbase.tool;
019
020import org.apache.hadoop.hbase.HBaseClassTestRule;
021import org.apache.hadoop.hbase.HBaseTestingUtility;
022import org.apache.hadoop.hbase.security.HadoopSecurityEnabledUserProviderForTesting;
023import org.apache.hadoop.hbase.security.UserProvider;
024import org.apache.hadoop.hbase.security.access.PermissionStorage;
025import org.apache.hadoop.hbase.security.access.SecureTestUtil;
026import org.apache.hadoop.hbase.testclassification.LargeTests;
027import org.apache.hadoop.hbase.testclassification.MiscTests;
028import org.junit.BeforeClass;
029import org.junit.ClassRule;
030import org.junit.Test;
031import org.junit.experimental.categories.Category;
032
033/**
034 * Reruns TestSecureLoadIncrementalHFilesSplitRecovery using LoadIncrementalHFiles in secure mode.
035 * This suite is unable to verify the security handoff/turnove as miniCluster is running as system
036 * user thus has root privileges and delegation tokens don't seem to work on miniDFS.
037 * <p>
038 * Thus SecureBulkload can only be completely verified by running integration tests against a secure
039 * cluster. This suite is still invaluable as it verifies the other mechanisms that need to be
040 * supported as part of a LoadIncrementalFiles call.
041 */
042@Category({ MiscTests.class, LargeTests.class })
043public class TestSecureLoadIncrementalHFilesSplitRecovery
044  extends TestLoadIncrementalHFilesSplitRecovery {
045
046  @ClassRule
047  public static final HBaseClassTestRule CLASS_RULE =
048    HBaseClassTestRule.forClass(TestSecureLoadIncrementalHFilesSplitRecovery.class);
049
050  // This "overrides" the parent static method
051  // make sure they are in sync
052  @BeforeClass
053  public static void setupCluster() throws Exception {
054    util = new HBaseTestingUtility();
055    // set the always on security provider
056    UserProvider.setUserProviderForTesting(util.getConfiguration(),
057      HadoopSecurityEnabledUserProviderForTesting.class);
058    // setup configuration
059    SecureTestUtil.enableSecurity(util.getConfiguration());
060
061    util.startMiniCluster();
062
063    // Wait for the ACL table to become available
064    util.waitTableEnabled(PermissionStorage.ACL_TABLE_NAME);
065  }
066
067  // Disabling this test as it does not work in secure mode
068  @Test
069  @Override
070  public void testBulkLoadPhaseFailure() {
071  }
072}