@Test
  public void testServiceKerberosEnabledTest() throws Exception {
    String serviceName = "HDFS";
    Service s = serviceFactory.createNew(cluster, serviceName, repositoryVersion);
    cluster.addService(s);

    Service service = cluster.getService(serviceName);
    Assert.assertNotNull(service);


    Map<String, Map<String, String>> map = new HashMap<>();

    Assert.assertFalse(service.isKerberosEnabled(null));

    Assert.assertFalse(service.isKerberosEnabled(map));

    map.put("core-site", Collections.singletonMap("hadoop.security.authentication", "none"));
    map.put("hdfs-site", Collections.singletonMap("hadoop.security.authentication", "none"));
    Assert.assertFalse(service.isKerberosEnabled(map));

    map.put("core-site", Collections.singletonMap("hadoop.security.authentication", "kerberos"));
    map.put("hdfs-site", Collections.singletonMap("hadoop.security.authentication", "none"));
    Assert.assertTrue(service.isKerberosEnabled(map));

    map.put("core-site", Collections.singletonMap("hadoop.security.authentication", "none"));
    map.put("hdfs-site", Collections.singletonMap("hadoop.security.authentication", "kerberos"));
    Assert.assertTrue(service.isKerberosEnabled(map));

    map.put("core-site", Collections.singletonMap("hadoop.security.authentication", "kerberos"));
    map.put("hdfs-site", Collections.singletonMap("hadoop.security.authentication", "kerberos"));
    Assert.assertTrue(service.isKerberosEnabled(map));

  }
Tests the kerberosEnabledTest value set in the HDFS metainfo file (stacks/HDP/0.1/services/HDFS/metainfo.xml):
<pre>
{
  "or": [
    {
      "equals": [
        "core-site/hadoop.security.authentication",
        "kerberos"
      ]
    },
    {
      "equals": [
        "hdfs-site/hadoop.security.authentication",
        "kerberos"
      ]
    }
  ]
}
</pre>
ambari-server/src/test/java/org/apache/ambari/server/state/ServiceTest.java