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.HBaseTestingUtil;
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 TestBulkLoadHFilesSplitRecovery using BulkLoadHFiles in secure mode. This suite is unable
035 * to verify the security handoff/turnove as miniCluster is running as system user thus has root
036 * 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 TestSecureBulkLoadHFilesSplitRecovery extends TestBulkLoadHFilesSplitRecovery {
044
045  @ClassRule
046  public static final HBaseClassTestRule CLASS_RULE =
047    HBaseClassTestRule.forClass(TestSecureBulkLoadHFilesSplitRecovery.class);
048
049  // This "overrides" the parent static method
050  // make sure they are in sync
051  @BeforeClass
052  public static void setupCluster() throws Exception {
053    util = new HBaseTestingUtil();
054    // set the always on security provider
055    UserProvider.setUserProviderForTesting(util.getConfiguration(),
056      HadoopSecurityEnabledUserProviderForTesting.class);
057    // setup configuration
058    SecureTestUtil.enableSecurity(util.getConfiguration());
059
060    util.startMiniCluster();
061
062    // Wait for the ACL table to become available
063    util.waitTableEnabled(PermissionStorage.ACL_TABLE_NAME);
064  }
065
066  // Disabling this test as it does not work in secure mode
067  @Test
068  @Override
069  public void testBulkLoadPhaseFailure() {
070  }
071}