diff --git a/qa/vagrant/src/test/resources/packaging/scripts/20_tar_package.bats b/qa/vagrant/src/test/resources/packaging/scripts/20_tar_package.bats index 3b5acc75d57..7139306aece 100644 --- a/qa/vagrant/src/test/resources/packaging/scripts/20_tar_package.bats +++ b/qa/vagrant/src/test/resources/packaging/scripts/20_tar_package.bats @@ -72,6 +72,17 @@ setup() { verify_archive_installation } +@test "[TAR] elasticsearch fails if java executable is not found" { + export JAVA=$(which java) + + sudo chmod -x $JAVA + run "$ESHOME/bin/elasticsearch" + 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" ] +} + ################################## # Check that Elasticsearch is working ##################################