aboutsummaryrefslogtreecommitdiffstats
path: root/spec/classes/tripleo_profile_base_docker_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/classes/tripleo_profile_base_docker_spec.rb')
-rw-r--r--spec/classes/tripleo_profile_base_docker_spec.rb59
1 files changed, 57 insertions, 2 deletions
diff --git a/spec/classes/tripleo_profile_base_docker_spec.rb b/spec/classes/tripleo_profile_base_docker_spec.rb
index b52fe24..0b988f6 100644
--- a/spec/classes/tripleo_profile_base_docker_spec.rb
+++ b/spec/classes/tripleo_profile_base_docker_spec.rb
@@ -27,7 +27,10 @@ describe 'tripleo::profile::base::docker' do
it { is_expected.to contain_package('docker') }
it { is_expected.to contain_service('docker') }
it {
- is_expected.to contain_augeas('docker-sysconfig').with_changes(['rm INSECURE_REGISTRY'])
+ is_expected.to contain_augeas('docker-sysconfig').with_changes([
+ 'rm INSECURE_REGISTRY',
+ "set OPTIONS '\"--log-driver=journald --signature-verification=false\"'",
+ ])
}
end
@@ -42,7 +45,10 @@ describe 'tripleo::profile::base::docker' do
it { is_expected.to contain_package('docker') }
it { is_expected.to contain_service('docker') }
it {
- is_expected.to contain_augeas('docker-sysconfig').with_changes(["set INSECURE_REGISTRY '\"--insecure-registry foo:8787\"'"])
+ is_expected.to contain_augeas('docker-sysconfig').with_changes([
+ "set INSECURE_REGISTRY '\"--insecure-registry foo:8787\"'",
+ "set OPTIONS '\"--log-driver=journald --signature-verification=false\"'",
+ ])
}
end
@@ -69,6 +75,55 @@ describe 'tripleo::profile::base::docker' do
}
end
+ context 'with step 1 and docker_options configured' do
+ let(:params) { {
+ :docker_options => '--log-driver=syslog',
+ :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-sysconfig').with_changes([
+ "rm INSECURE_REGISTRY",
+ "set OPTIONS '\"--log-driver=syslog\"'",
+ ])
+ }
+ end
+
+ context 'with step 1 and storage_options configured' do
+ let(:params) { {
+ :step => 1,
+ :storage_options => '-s devicemapper',
+ } }
+
+ 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-sysconfig-storage').with_changes([
+ "set DOCKER_STORAGE_OPTIONS '\" #{params[:storage_options]}\"'",
+ ])
+ }
+ end
+
+ context 'with step 1 and configure_storage disabled' do
+ let(:params) { {
+ :step => 1,
+ :configure_storage => false,
+ } }
+
+ 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-sysconfig-storage').with_changes([
+ "rm DOCKER_STORAGE_OPTIONS",
+ ])
+ }
+ end
+
end
on_supported_os.each do |os, facts|