aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2017-04-07 16:21:39 -0400
committerDan Prince <dprince@redhat.com>2017-04-08 08:48:01 -0400
commit936aece1de21a5c333b93d711444200c00e2419f (patch)
tree4565bbc674c38a76ebab00f6c0b2bbae67a2da38 /spec
parent2ec381a47504208bc2192e3fbb570c638886c5bc (diff)
Add registry_mirror to base::docker profile
This patch adds a new registry_mirror option to help configure /etc/docker/daemon.json so that we can make use of HTTP docker mirrors within upstream TripleO CI (infra). Change-Id: I4b966e9b9b174ca5a6f57974185e0149ea12f232
Diffstat (limited to 'spec')
-rw-r--r--spec/classes/tripleo_profile_base_docker_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/classes/tripleo_profile_base_docker_spec.rb b/spec/classes/tripleo_profile_base_docker_spec.rb
index 587cc29..b52fe24 100644
--- a/spec/classes/tripleo_profile_base_docker_spec.rb
+++ b/spec/classes/tripleo_profile_base_docker_spec.rb
@@ -54,6 +54,21 @@ describe 'tripleo::profile::base::docker' do
it_raises 'a Puppet::Error', /You must provide a \$docker_namespace in order to configure insecure registry/
end
+
+ context 'with step 1 and registry_mirror configured' do
+ let(:params) { {
+ :registry_mirror => 'http://foo/bar',
+ :step => 1,
+ } }
+
+ it { is_expected.to contain_class('tripleo::profile::base::docker') }
+ it { is_expected.to contain_package('docker') }
+ it { is_expected.to contain_service('docker') }
+ it {
+ is_expected.to contain_augeas('docker-daemon.json').with_changes(['set dict/entry[. = "registry-mirrors"] "registry-mirrors', "set dict/entry[. = \"registry-mirrors\"]/array/string \"http://foo/bar\""])
+ }
+ end
+
end
on_supported_os.each do |os, facts|