diff --git a/qa/vagrant/src/test/resources/packaging/scripts/plugin_test_cases.bash b/qa/vagrant/src/test/resources/packaging/scripts/plugin_test_cases.bash index 4f3bced276f..ad05c893499 100644 --- a/qa/vagrant/src/test/resources/packaging/scripts/plugin_test_cases.bash +++ b/qa/vagrant/src/test/resources/packaging/scripts/plugin_test_cases.bash @@ -125,6 +125,18 @@ fi remove_jvm_example } +@test "[$GROUP] fail if java executable is not found" { + [ "$GROUP" == "TAR PLUGINS" ] || skip "Test case only supported by TAR PLUGINS" + export JAVA=$(which java) + + sudo chmod -x $JAVA + run "$ESHOME/bin/plugin" + sudo chmod +x $JAVA + + [ "$status" -eq 1 ] + [ "$output" = "Could not find any executable java binary. Please install java in your PATH or set JAVA_HOME" ] +} + # Note that all of the tests from here to the end of the file expect to be run # in sequence and don't take well to being run one at a time. @test "[$GROUP] install jvm-example plugin" {