@Test
  public void testValidateAgentHostnamesOn() {
    Properties ambariProperties = new Properties();
    ambariProperties.setProperty(Configuration.SRVR_AGENT_HOSTNAME_VALIDATE.getKey(), "true");
    Configuration conf = new Configuration(ambariProperties);
    Assert.assertTrue(conf.validateAgentHostnames());
    Assert.assertEquals("true", conf.getConfigsMap().get(Configuration.SRVR_AGENT_HOSTNAME_VALIDATE.getKey()));
  }
ambari.properties contains "security.agent.hostname.validate=true" option
ambari-server/src/test/java/org/apache/ambari/server/configuration/ConfigurationTest.java