static boolean shouldRun(String script, String healthScript) {
    if (healthScript == null || healthScript.trim().isEmpty()) {
      LOG.info("Missing location for the node health check script \"{}\".",
          script);
      return false;
    }
    File f = new File(healthScript);
    if (!f.exists()) {
      LOG.warn("File {} for script \"{}\" does not exist.",
          healthScript, script);
      return false;
    }
    if (!FileUtil.canExecute(f)) {
      LOG.warn("File {} for script \"{}\" can not be executed.",
          healthScript, script);
      return false;
    }
    return true;
  }
@Test
  public void testNodeHealthScriptShouldRun() throws IOException {
    assertFalse("Node health script should start",
        NodeHealthScriptRunner.shouldRun("script",
            nodeHealthscriptFile.getAbsolutePath()));
    writeNodeHealthScriptFile("", false);
    // Node health script should not start if the node health script is not
    // executable.
    assertFalse("Node health script should start",
        NodeHealthScriptRunner.shouldRun("script",
            nodeHealthscriptFile.getAbsolutePath()));
    writeNodeHealthScriptFile("", true);
    assertTrue("Node health script should start",
        NodeHealthScriptRunner.shouldRun("script",
            nodeHealthscriptFile.getAbsolutePath()));
  }