@Test
  public void testUserShouldNotDoDDLOpOnLabelsTable() throws Exception {
    Admin admin = TEST_UTIL.getAdmin();
    try {
      admin.disableTable(LABELS_TABLE_NAME);
      fail("Lables table should not get disabled by user.");
    } catch (Exception e) {
    }
    try {
      admin.deleteTable(LABELS_TABLE_NAME);
      fail("Lables table should not get disabled by user.");
    } catch (Exception e) {
    }
    try {
      ColumnFamilyDescriptor columnFamilyDescriptor =
        ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes("testFamily")).build();
      admin.addColumnFamily(LABELS_TABLE_NAME, columnFamilyDescriptor);
      fail("Lables table should not get altered by user.");
    } catch (Exception e) {
    }
    try {
      admin.deleteColumnFamily(LABELS_TABLE_NAME, VisibilityConstants.LABELS_TABLE_FAMILY);
      fail("Lables table should not get altered by user.");
    } catch (Exception e) {
    }
    try {
      ColumnFamilyDescriptor familyDescriptor =
        ColumnFamilyDescriptorBuilder.newBuilder(VisibilityConstants.LABELS_TABLE_FAMILY)
          .setBloomFilterType(BloomType.ROWCOL).build();
      admin.modifyColumnFamily(LABELS_TABLE_NAME, familyDescriptor);
      fail("Lables table should not get altered by user.");
    } catch (Exception e) {
    }
    try {
      TableDescriptorBuilder tableDescriptorBuilder =
        TableDescriptorBuilder.newBuilder(LABELS_TABLE_NAME);
      ColumnFamilyDescriptor columnFamilyDescriptor =
        ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes("f1")).build();
      tableDescriptorBuilder.setColumnFamily(columnFamilyDescriptor);
      columnFamilyDescriptor =
        ColumnFamilyDescriptorBuilder.newBuilder(Bytes.toBytes("f2")).build();
      tableDescriptorBuilder.setColumnFamily(columnFamilyDescriptor);
      admin.modifyTable(tableDescriptorBuilder.build());
      fail("Lables table should not get altered by user.");
    } catch (Exception e) {
    }
  }
Base test class for visibility labels basic features
hbase-server/src/test/java/org/apache/hadoop/hbase/security/visibility/TestVisibilityLabels.java