Add docker provider spec tests
This commit is contained in:
parent
ea786eeb60
commit
da7f957a46
@ -4,19 +4,19 @@
|
||||
# Guest boxes to use for vagrant-spec
|
||||
GUEST_BOXES = {
|
||||
'hashicorp/bionic64' => '1.0.282',
|
||||
'hashicorp-vagrant/ubuntu-16.04' => '1.0.1',
|
||||
'hashicorp-vagrant/centos-7.4' => '1.0.2',
|
||||
'hashicorp-vagrant/windows-10' => '1.0.0',
|
||||
'spox/osx-10.12' => '0.0.1'
|
||||
# 'hashicorp-vagrant/ubuntu-16.04' => '1.0.1',
|
||||
# 'hashicorp-vagrant/centos-7.4' => '1.0.2',
|
||||
# 'hashicorp-vagrant/windows-10' => '1.0.0',
|
||||
# 'spox/osx-10.12' => '0.0.1'
|
||||
}
|
||||
|
||||
# Host boxes to run vagrant-spec
|
||||
HOST_BOXES = {
|
||||
'hashicorp/bionic64' => '1.0.282',
|
||||
'hashicorp-vagrant/ubuntu-16.04' => '1.0.1',
|
||||
'hashicorp-vagrant/centos-7.4' => '1.0.2',
|
||||
'hashicorp-vagrant/windows-10' => '1.0.0',
|
||||
'spox/osx-10.12' => '0.0.1'
|
||||
# 'hashicorp-vagrant/ubuntu-16.04' => '1.0.1',
|
||||
# 'hashicorp-vagrant/centos-7.4' => '1.0.2',
|
||||
# 'hashicorp-vagrant/windows-10' => '1.0.0',
|
||||
# 'spox/osx-10.12' => '0.0.1'
|
||||
}
|
||||
|
||||
# Not all boxes are named by their specific "platform"
|
||||
@ -24,8 +24,8 @@ HOST_BOXES = {
|
||||
PLATFORM_SCRIPT_MAPPING = {
|
||||
"ubuntu" => "ubuntu",
|
||||
"bionic" => "ubuntu",
|
||||
"centos" => "centos",
|
||||
"windows" => "windows"
|
||||
# "centos" => "centos",
|
||||
# "windows" => "windows"
|
||||
}
|
||||
|
||||
# Determine what providers to test
|
||||
@ -42,6 +42,9 @@ vagrantcloud_token = ENV["VAGRANT_CLOUD_TOKEN"]
|
||||
|
||||
# Download copies of the guest boxes for testing if missing
|
||||
enabled_providers.each do |provider_name|
|
||||
|
||||
next if provider_name == "docker"
|
||||
|
||||
guest_boxes.each do |guest_box, box_version|
|
||||
box_owner, box_name = guest_box.split('/')
|
||||
box_path = File.join(File.dirname(__FILE__), "./boxes/#{guest_box.sub('/', '_')}.#{provider_name}.#{box_version}.box")
|
||||
|
||||
11
test/vagrant-spec/configs/vagrant-spec.config.docker.rb
Normal file
11
test/vagrant-spec/configs/vagrant-spec.config.docker.rb
Normal file
@ -0,0 +1,11 @@
|
||||
require_relative "../../acceptance/base"
|
||||
|
||||
Vagrant::Spec::Acceptance.configure do |c|
|
||||
c.component_paths << File.expand_path("../test/acceptance", __FILE__)
|
||||
c.skeleton_paths << File.expand_path("../test/acceptance/skeletons", __FILE__)
|
||||
# Allow for slow setup to still pass
|
||||
c.assert_retries = 15
|
||||
c.provider "docker",
|
||||
box: ENV["VAGRANT_SPEC_DOCKER_IMAGE"],
|
||||
contexts: ["provider-context/docker"]
|
||||
end
|
||||
8
test/vagrant-spec/scripts/ubuntu-run.docker.sh
Normal file
8
test/vagrant-spec/scripts/ubuntu-run.docker.sh
Normal file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
export VAGRANT_SPEC_DOCKER_IMAGE="${VAGRANT_SPEC_DOCKER_IMAGE}"
|
||||
vagrant vagrant-spec ${VAGRANT_SPEC_ARGS} /vagrant/test/vagrant-spec/configs/vagrant-spec.config.docker.rb
|
||||
result=$?
|
||||
|
||||
exit $result
|
||||
14
test/vagrant-spec/scripts/ubuntu-setup.docker.sh
Normal file
14
test/vagrant-spec/scripts/ubuntu-setup.docker.sh
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -xe
|
||||
|
||||
apt-get update
|
||||
apt-get install -qq -y --force-yes curl apt-transport-https
|
||||
apt-get purge -qq -y lxc-docker* || true
|
||||
curl -sSL https://get.docker.com/ | sh
|
||||
|
||||
pushd /vagrant
|
||||
|
||||
dpkg -i vagrant_*_x86_64.deb
|
||||
vagrant plugin install ./vagrant-spec.gem
|
||||
|
||||
popd
|
||||
Loading…
x
Reference in New Issue
Block a user