vagrant-cachier-ng/spec/acceptance/sanity_check.bats
Fabio Rehm 8efb8daf07 Implement some initial sanity checks using Bats
Somehow related to GH-1
2013-08-13 23:51:13 -03:00

45 lines
1.1 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
}