diff options
author | Tanguy Leroux <tlrx.dev@gmail.com> | 2016-11-15 15:19:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-15 15:19:34 +0100 |
commit | aa871f839a9cc1a5ad11b76bc974efa21a1bdd2c (patch) | |
tree | bb99b84bc62a50be1ec87fb13928b65e5cf505eb /Vagrantfile | |
parent | d6c2b4f7c578a6013dfd57806e011030d1647482 (diff) |
[Tests] Do not pass all env vars to sudo (#21562)
In #21348 the command executed to run the packaging tests has been changed to "sudo -E bats ...", forcing all environment variables from the vagrant user to be passed to the `sudo` command. This breaks a test on opensuse-13 (the one where it checks that elasticsearch cannot be started when `java` is not found) because all the PATH from the user is passed to the sudo command.
This commit restores the previous behavior while allowing only necessary testing environment variables to be passed using a /etc/sudoers.d file.
Diffstat (limited to 'Vagrantfile')
-rw-r--r-- | Vagrantfile | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Vagrantfile b/Vagrantfile index 592f0fdc4a..47b4249bc3 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -280,5 +280,15 @@ export BATS_UTILS=/project/build/bats/utils export BATS_TESTS=/project/build/bats/tests export BATS_ARCHIVES=/project/build/bats/archives VARS + cat \<\<SUDOERS_VARS > /etc/sudoers.d/elasticsearch_vars +Defaults env_keep += "ZIP" +Defaults env_keep += "TAR" +Defaults env_keep += "RPM" +Defaults env_keep += "DEB" +Defaults env_keep += "BATS" +Defaults env_keep += "BATS_UTILS" +Defaults env_keep += "BATS_TESTS" +Defaults env_keep += "BATS_ARCHIVES" +SUDOERS_VARS SHELL end |