1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.hadoop.hbase.regionserver.wal;
19
20 import org.apache.hadoop.conf.Configuration;
21 import org.apache.hadoop.hbase.HConstants;
22 import org.apache.hadoop.hbase.testclassification.MediumTests;
23 import org.apache.hadoop.hbase.io.crypto.KeyProviderForTesting;
24 import org.apache.hadoop.hbase.wal.WAL.Reader;
25 import org.apache.hadoop.hbase.wal.WALProvider.Writer;
26
27 import org.junit.BeforeClass;
28 import org.junit.experimental.categories.Category;
29
30 @Category(MediumTests.class)
31 public class TestSecureWALReplay extends TestWALReplay {
32
33 @BeforeClass
34 public static void setUpBeforeClass() throws Exception {
35 Configuration conf = TestWALReplay.TEST_UTIL.getConfiguration();
36 conf.set(HConstants.CRYPTO_KEYPROVIDER_CONF_KEY, KeyProviderForTesting.class.getName());
37 conf.set(HConstants.CRYPTO_MASTERKEY_NAME_CONF_KEY, "hbase");
38 conf.setClass("hbase.regionserver.hlog.reader.impl", SecureProtobufLogReader.class,
39 Reader.class);
40 conf.setClass("hbase.regionserver.hlog.writer.impl", SecureProtobufLogWriter.class,
41 Writer.class);
42 conf.setBoolean(HConstants.ENABLE_WAL_ENCRYPTION, true);
43 TestWALReplay.setUpBeforeClass();
44 }
45
46 }