vagrant-cachier-ng/spec/acceptance/sanity_check.bats
Darragh Bailey 7807d2bbaa Allow explicit disabling of auto detected buckets
Add config option to identify buckets that should not be automatically
enabled with using `config.cache.auto_detect = true`.

After turning on the auto_detect behaviour, with this change you can
now explicitly disable any bucket type through your Vagrantfile e.g.
`config.cache.disable = :chef_gem`.

Fixes #115
2015-03-03 11:36:17 +00:00

62 lines
1.4 KiB
Bash

#!/usr/bin/env bats
load test_helper
@test "Vagrantfile without cachier statement does not blow up when bringing the VM up" {
configure_env "no-cachier-simple.rb"
vagrant_up
[ "$status" -eq 0 ]
vagrant_destroy
configure_env "no-cachier-with-provisioning.rb"
vagrant_up
[ "$status" -eq 0 ]
vagrant_destroy
}
@test "Vagrantfile with cachier auto_detect statement does not blow up when bringing the VM up" {
configure_env "auto-detect.rb"
vagrant_up
[ "$status" -eq 0 ]
vagrant_destroy
}
@test "APT cache bucket configures the cache dir properly and keeps cache dir around" {
configure_env "auto-detect-with-provisioning.rb"
# Make sure cache dir does not exist
test ! -d tmp/.vagrant/machines/default/cache/apt
vagrant_up
[ "$status" -eq 0 ]
# Make sure packages are being cached
test -d tmp/.vagrant/machines/default/cache/apt
FILES=(`ls tmp/.vagrant/machines/default/cache/apt/git*.deb`)
[ ${#FILES[@]} -gt 0 ]
vagrant_destroy
# Make sure packages are not removed between machine rebuilds
FILES=(`ls tmp/.vagrant/machines/default/cache/apt/git*.deb`)
[ ${#FILES[@]} -gt 0 ]
empty_cache
}
@test "APT cache bucket disabled skips the cache dir properly" {
configure_env "auto-detect-disable-apt.rb"
test ! -d tmp/.vagrant/machines/default/cache/apt
vagrant_up
[ "$status" -eq 0 ]
# Make sure cache dir does not exist
test ! -d tmp/.vagrant/machines/default/cache/apt
vagrant_destroy
empty_cache
}