File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed
support/acceptance/shared Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 26
26
27
27
context 'puppetdb postgres user' , :status do
28
28
it 'is not allowing read-only user to create tables' do
29
- run_shell ( 'psql "postgresql://puppetdb-read:puppetdb-read@localhost/puppetdb" -c "create table tables(id int)"' , expect_failures : true ) do | r |
30
- expect ( r . stderr ) . to match ( %r{^ERROR: permission denied for schema public.*} )
31
- expect ( r . exit_code ) . to eq 1
29
+ command ( 'psql "postgresql://puppetdb-read:puppetdb-read@localhost/puppetdb" -c "create table tables(id int)"' ) do
30
+ its ( : stderr) { is_expected . to match %r{^ERROR: permission denied for schema public.*} }
31
+ its ( :exit_status ) { is_expected . to eq 1 }
32
32
end
33
33
end
34
34
35
35
it 'is allowing normal user to manage schema' do
36
- run_shell ( 'psql "postgresql://puppetdb:puppetdb@localhost/puppetdb" -c "create table testing(id int); drop table testing"' ) do | r |
37
- expect ( r . exit_status ) . to eq 0
36
+ command ( 'psql "postgresql://puppetdb:puppetdb@localhost/puppetdb" -c "create table testing(id int); drop table testing"' ) do
37
+ its ( : exit_status) { is_expected . to eq 0 }
38
38
end
39
39
end
40
40
41
41
it 'is allowing read-only user to select' do
42
- run_shell ( 'psql "postgresql://puppetdb-read:puppetdb-read@localhost/puppetdb" -c "select * from catalogs limit 1"' ) do | r |
43
- expect ( r . exit_status ) . to eq 0
42
+ command ( 'psql "postgresql://puppetdb-read:puppetdb-read@localhost/puppetdb" -c "select * from catalogs limit 1"' ) do
43
+ its ( : exit_status) { is_expected . to eq 0 }
44
44
end
45
45
end
46
46
end
Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ class { 'puppetdb':
43
43
end
44
44
45
45
it 'applies idempotently' do
46
- idempotent_apply ( pp , debug : ENV . key? ( 'DEBUG' ) )
46
+ apply_manifest ( pp , expect_failures : false , debug : ENV . key? ( 'DEBUG' ) )
47
+ apply_manifest ( pp , expect_failures : false , debug : ENV . key? ( 'DEBUG' ) )
47
48
end
48
49
49
50
it 'agent can puppetdb_query' do
Original file line number Diff line number Diff line change 4
4
let ( :pp ) { File . read ( File . join ( File . dirname ( __FILE__ ) , 'puppetserver.pp' ) ) }
5
5
6
6
it 'applies idempotently' do
7
- idempotent_apply ( pp , debug : ENV . key? ( 'DEBUG' ) )
7
+ apply_manifest ( pp , expect_failures : false , debug : ENV . key? ( 'DEBUG' ) )
8
+ apply_manifest ( pp , expect_failures : false , debug : ENV . key? ( 'DEBUG' ) )
8
9
end
9
10
end
You can’t perform that action at this time.
0 commit comments