From 848835f6e3e57e4c3e196c181b91fec8b5adb405 Mon Sep 17 00:00:00 2001 From: Dave Try Date: Mon, 8 Jan 2018 07:00:42 +1000 Subject: [PATCH 1/2] adding in pass_hash param for test environment --- spec/defines/registry_spec.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/defines/registry_spec.rb b/spec/defines/registry_spec.rb index 0331e878..8060be76 100644 --- a/spec/defines/registry_spec.rb +++ b/spec/defines/registry_spec.rb @@ -10,51 +10,51 @@ :kernelrelease => '3.2.0-4-amd64', :operatingsystemmajrelease => '8', } } - let(:params) { { 'version' => '17.06' } } + let(:params) { { 'version' => '17.06', 'pass_hash' => 'test1234' } } it { should contain_exec('localhost:5000 auth') } context 'with ensure => present' do - let(:params) { { 'ensure' => 'absent', 'version' => '17.06' } } + let(:params) { { 'ensure' => 'absent', 'version' => '17.06', 'pass_hash' => 'test1234' } } it { should contain_exec('localhost:5000 auth').with_command('docker logout localhost:5000') } end context 'with ensure => present' do - let(:params) { { 'ensure' => 'present', 'version' => '17.06' } } + let(:params) { { 'ensure' => 'present', 'version' => '17.06', 'pass_hash' => 'test1234' } } it { should contain_exec('localhost:5000 auth').with_command('docker login localhost:5000') } end context 'with ensure => present and username => user1' do - let(:params) { { 'ensure' => 'present', 'username' => 'user1', 'version' => '17.06' } } + let(:params) { { 'ensure' => 'present', 'username' => 'user1', 'version' => '17.06', 'pass_hash' => 'test1234' } } it { should contain_exec('localhost:5000 auth').with_command('docker login localhost:5000') } end context 'with ensure => present and password => secret' do - let(:params) { { 'ensure' => 'present', 'password' => 'secret', 'version' => '17.06' } } + let(:params) { { 'ensure' => 'present', 'password' => 'secret', 'version' => '17.06', 'pass_hash' => 'test1234' } } it { should contain_exec('localhost:5000 auth').with_command('docker login localhost:5000') } end context 'with ensure => present and email => user1@example.io' do - let(:params) { { 'ensure' => 'present', 'email' => 'user1@example.io', 'version' => '17.06' } } + let(:params) { { 'ensure' => 'present', 'email' => 'user1@example.io', 'version' => '17.06', 'pass_hash' => 'test1234' } } it { should contain_exec('localhost:5000 auth').with_command('docker login localhost:5000') } end context 'with ensure => present and username => user1, and password => secret and email => user1@example.io' do - let(:params) { { 'ensure' => 'present', 'username' => 'user1', 'password' => 'secret', 'email' => 'user1@example.io', 'version' => '17.06' } } + let(:params) { { 'ensure' => 'present', 'username' => 'user1', 'password' => 'secret', 'email' => 'user1@example.io', 'version' => '17.06', 'pass_hash' => 'test1234' } } it { should contain_exec('localhost:5000 auth').with_command("docker login -u 'user1' -p \"${password}\" localhost:5000").with_environment('password=secret') } end context 'with ensure => present and username => user1, and password => secret and email => user1@example.io and version < 1.11.0' do - let(:params) { { 'ensure' => 'present', 'username' => 'user1', 'password' => 'secret', 'email' => 'user1@example.io', 'version' => '1.9.0' } } + let(:params) { { 'ensure' => 'present', 'username' => 'user1', 'password' => 'secret', 'email' => 'user1@example.io', 'version' => '1.9.0', 'pass_hash' => 'test1234' } } it { should contain_exec('localhost:5000 auth').with_command("docker login -u 'user1' -p \"${password}\" -e 'user1@example.io' localhost:5000").with_environment('password=secret') } end context 'with username => user1, and password => secret' do - let(:params) { { 'username' => 'user1', 'password' => 'secret', 'version' => '17.06' } } + let(:params) { { 'username' => 'user1', 'password' => 'secret', 'version' => '17.06', 'pass_hash' => 'test1234' } } it { should contain_exec('localhost:5000 auth').with_command("docker login -u 'user1' -p \"${password}\" localhost:5000").with_environment('password=secret') } end context 'with username => user1, and password => secret and local_user => testuser' do - let(:params) { { 'username' => 'user1', 'password' => 'secret', 'local_user' => 'testuser', 'version' => '17.06' } } + let(:params) { { 'username' => 'user1', 'password' => 'secret', 'local_user' => 'testuser', 'version' => '17.06', 'pass_hash' => 'test1234' } } it { should contain_exec('localhost:5000 auth').with_command("docker login -u 'user1' -p \"${password}\" localhost:5000").with_user('testuser').with_environment('password=secret') } end From 2ec531a93a2c54939636dfff676ac5faa437085f Mon Sep 17 00:00:00 2001 From: Dave Try Date: Mon, 8 Jan 2018 07:10:31 +1000 Subject: [PATCH 2/2] fixing rakefile --- Rakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Rakefile b/Rakefile index aa488d1c..68698f38 100644 --- a/Rakefile +++ b/Rakefile @@ -69,4 +69,5 @@ task :test => [ :syntax, :lint, :metadata_lint, + :spec, ]