Skip to content

Commit d0a58ba

Browse files
committed
[TEST] Add /tmp install cleanup
For elastic#26741
1 parent e6c646c commit d0a58ba

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Vagrantfile

+11-5
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,13 @@ def linux_common(config,
250250
config.vm.provision 'markerfile', type: 'shell', inline: <<-SHELL
251251
touch /etc/is_vagrant_vm
252252
SHELL
253+
254+
# This prevents leftovers from previous tests using the
255+
# same VM from messing up the current test
256+
config.vm.provision 'clean es installs in tmp', run: 'always', type: 'shell', inline: <<-SHELL
257+
rm -rf /tmp/elasticsearch*
258+
SHELL
259+
253260
sh_set_prompt config, name
254261
sh_install_deps(
255262
config,
@@ -392,11 +399,6 @@ Defaults env_keep += "BATS_ARCHIVES"
392399
SUDOERS_VARS
393400
chmod 0440 /etc/sudoers.d/elasticsearch_vars
394401
SHELL
395-
# This prevents leftovers from previous tests using the
396-
# same VM from messing up the current test
397-
config.vm.provision "clean_tmp", run: "always", type: "shell", inline: <<-SHELL
398-
rm -rf /tmp/elasticsearch*
399-
SHELL
400402
end
401403

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

412+
config.vm.provision 'clean es installs in tmp', run: 'always', type: 'shell', inline: <<-SHELL
413+
Remove-Item -Recurse -Force C:\\tmp\\elasticsearch*
414+
SHELL
415+
410416
config.vm.provision 'set prompt', type: 'shell', inline: <<-SHELL
411417
$ErrorActionPreference = "Stop"
412418
$ps_prompt = 'function Prompt { "#{name}:$($ExecutionContext.SessionState.Path.CurrentLocation)>" }'

0 commit comments

Comments
 (0)