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, ] 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