|
| 1 | +require 'spec_helper_acceptance' |
| 2 | + |
| 3 | +describe 'docker::machine' do |
| 4 | + context 'with default parameters', do |
| 5 | + let(:pp) do |
| 6 | + <<-EOS |
| 7 | + include docker::machine |
| 8 | + EOS |
| 9 | + end |
| 10 | + |
| 11 | + it 'applies with no errors' do |
| 12 | + apply_manifest(pp, catch_failures: true) |
| 13 | + end |
| 14 | + |
| 15 | + it 'is idempotent' do |
| 16 | + apply_manifest(pp, catch_changes: true) |
| 17 | + end |
| 18 | + |
| 19 | + describe file('/usr/local/bin/docker-machine-0.16.1') do |
| 20 | + its('owner') { should eq 'root' } |
| 21 | + its('mode') { should cmp '0755' } |
| 22 | + it { should be_file } |
| 23 | + end |
| 24 | + |
| 25 | + describe file('/usr/local/bin/docker-machine') do |
| 26 | + its('link_path') { should eq '/usr/local/bin/docker-machine-0.16.1' } |
| 27 | + it { should be_symlink } |
| 28 | + end |
| 29 | + |
| 30 | + it 'is installed and working' do |
| 31 | + shell('docker-machine --help', acceptable_exit_codes: [0]) |
| 32 | + end |
| 33 | + end |
| 34 | + |
| 35 | + context 'with url => https://gitlab-docker-machine-downloads.s3.amazonaws.com/v0.16.2-gitlab.3/docker-machine', do |
| 36 | + let(:pp) do |
| 37 | + <<-EOS |
| 38 | + class { 'docker::machine': |
| 39 | + version => '0.16.2-gitlab.3', |
| 40 | + url => 'https://gitlab-docker-machine-downloads.s3.amazonaws.com/v0.16.2-gitlab.3/docker-machine', |
| 41 | + } |
| 42 | + EOS |
| 43 | + end |
| 44 | + |
| 45 | + it 'applies with no errors' do |
| 46 | + apply_manifest(pp, catch_failures: true) |
| 47 | + end |
| 48 | + |
| 49 | + it 'is idempotent' do |
| 50 | + apply_manifest(pp, catch_changes: true) |
| 51 | + end |
| 52 | + |
| 53 | + describe file('/usr/local/bin/docker-machine-0.16.2-gitlab.3') do |
| 54 | + its('owner') { should eq 'root' } |
| 55 | + its('mode') { should cmp '0755' } |
| 56 | + it { should be_file } |
| 57 | + end |
| 58 | + |
| 59 | + describe file('/usr/local/bin/docker-machine') do |
| 60 | + its('link_path') { should eq '/usr/local/bin/docker-machine-0.16.2-gitlab.3' } |
| 61 | + it { should be_symlink } |
| 62 | + end |
| 63 | + |
| 64 | + it 'is installed and working' do |
| 65 | + shell('docker-machine --help', acceptable_exit_codes: [0]) |
| 66 | + end |
| 67 | + end |
| 68 | +end |
0 commit comments