Skip to content

Commit 900b085

Browse files
author
tphoney
committed
pin apt for unit tests
Revert "fixing the unit test." This reverts commit b8fa36a.
1 parent b8fa36a commit 900b085

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

.fixtures.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
fixtures:
22
repositories:
3-
apt: "https://github.com/puppetlabs/puppetlabs-apt.git"
3+
apt:
4+
repo: "https://github.com/puppetlabs/puppetlabs-apt.git"
5+
branch: "1.8.x"
46
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
57
firewall: "https://github.com/puppetlabs/puppetlabs-firewall.git"
68
concat: "https://github.com/puppetlabs/puppetlabs-concat.git"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ spec/fixtures/
66
.bundle/
77
coverage/
88
.idea/
9+
log/
910
*.iml

manifests/server/role.pp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
$environment = []
3232
}
3333

34-
# Set the defaults for the postgresql_psql resource
3534
Postgresql_psql {
3635
db => $db,
3736
port => $port,
@@ -44,13 +43,11 @@
4443
],
4544
}
4645

47-
postgresql_psql { "Check for existence of role '${username}'":
46+
postgresql_psql { "CREATE ROLE ${username} ENCRYPTED PASSWORD ****":
4847
command => "CREATE ROLE \"${username}\" ${password_sql} ${login_sql} ${createrole_sql} ${createdb_sql} ${superuser_sql} ${replication_sql} CONNECTION LIMIT ${connection_limit}",
4948
unless => "SELECT rolname FROM pg_roles WHERE rolname='${username}'",
50-
require => Class['Postgresql::Server'],
5149
environment => $environment,
52-
db => $db,
53-
port => $port,
50+
require => Class['Postgresql::Server'],
5451
}
5552

5653
postgresql_psql {"ALTER ROLE \"${username}\" ${superuser_sql}":

spec/spec_helper_acceptance.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def psql(psql_cmd, user = 'postgres', exit_codes = [0,1], &block)
9999
end
100100

101101
on host, puppet('module','install','puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
102-
on host, puppet('module','install','puppetlabs-apt'), { :acceptable_exit_codes => [0,1] }
102+
on host, puppet('module','install','puppetlabs-apt', '--version', '1.8.0', '--force'), { :acceptable_exit_codes => [0,1] }
103103
on host, puppet('module','install','--force','puppetlabs-concat'), { :acceptable_exit_codes => [0,1] }
104104
end
105105

spec/unit/defines/server/role_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
end
2929

3030
it { is_expected.to contain_postgresql__server__role('test') }
31-
it 'should Check for existence of role "test"' do
32-
is_expected.to contain_postgresql_psql("Check for existence of role 'test'").with({
31+
it 'should have create role for "test" user with password as ****' do
32+
is_expected.to contain_postgresql_psql('CREATE ROLE test ENCRYPTED PASSWORD ****').with({
3333
'command' => "CREATE ROLE \"test\" ENCRYPTED PASSWORD '$NEWPGPASSWD' LOGIN NOCREATEROLE NOCREATEDB NOSUPERUSER CONNECTION LIMIT -1",
3434
'environment' => "NEWPGPASSWD=new-pa$s",
3535
'unless' => "SELECT rolname FROM pg_roles WHERE rolname='test'",

0 commit comments

Comments
 (0)