Skip to content

Commit

Permalink
[TEST] Add /tmp install cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
andyb-elastic committed Dec 8, 2017
1 parent e6c646c commit d0a58ba
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ def linux_common(config,
config.vm.provision 'markerfile', type: 'shell', inline: <<-SHELL
touch /etc/is_vagrant_vm
SHELL

# This prevents leftovers from previous tests using the
# same VM from messing up the current test
config.vm.provision 'clean es installs in tmp', run: 'always', type: 'shell', inline: <<-SHELL
rm -rf /tmp/elasticsearch*
SHELL

sh_set_prompt config, name
sh_install_deps(
config,
Expand Down Expand Up @@ -392,11 +399,6 @@ Defaults env_keep += "BATS_ARCHIVES"
SUDOERS_VARS
chmod 0440 /etc/sudoers.d/elasticsearch_vars
SHELL
# This prevents leftovers from previous tests using the
# same VM from messing up the current test
config.vm.provision "clean_tmp", run: "always", type: "shell", inline: <<-SHELL
rm -rf /tmp/elasticsearch*
SHELL
end

def windows_common(config, name)
Expand All @@ -407,6 +409,10 @@ def windows_common(config, name)
New-Item C:/is_vagrant_vm -ItemType file -Force | Out-Null
SHELL

config.vm.provision 'clean es installs in tmp', run: 'always', type: 'shell', inline: <<-SHELL
Remove-Item -Recurse -Force C:\\tmp\\elasticsearch*
SHELL

config.vm.provision 'set prompt', type: 'shell', inline: <<-SHELL
$ErrorActionPreference = "Stop"
$ps_prompt = 'function Prompt { "#{name}:$($ExecutionContext.SessionState.Path.CurrentLocation)>" }'
Expand Down

0 comments on commit d0a58ba

Please sign in to comment.