diff --git a/qa/vagrant/src/test/resources/packaging/tests/60_systemd.bats b/qa/vagrant/src/test/resources/packaging/tests/60_systemd.bats index 269fcfd6f6d..97087b0ae2e 100644 --- a/qa/vagrant/src/test/resources/packaging/tests/60_systemd.bats +++ b/qa/vagrant/src/test/resources/packaging/tests/60_systemd.bats @@ -219,3 +219,20 @@ setup() { systemctl unmask systemd-sysctl.service } + +@test "[SYSTEMD] service file sets limits" { + clean_before_test + install_package + systemctl start elasticsearch.service + wait_for_elasticsearch_status + local pid=$(cat /var/run/elasticsearch/elasticsearch.pid) + local max_file_size=$(cat /proc/$pid/limits | grep "Max file size" | awk '{ print $4 }') + [ "$max_file_size" == "unlimited" ] + local max_processes=$(cat /proc/$pid/limits | grep "Max processes" | awk '{ print $3 }') + [ "$max_processes" == "4096" ] + local max_open_files=$(cat /proc/$pid/limits | grep "Max open files" | awk '{ print $4 }') + [ "$max_open_files" == "65536" ] + local max_address_space=$(cat /proc/$pid/limits | grep "Max address space" | awk '{ print $4 }') + [ "$max_address_space" == "unlimited" ] + systemctl stop elasticsearch.service +}