File tree Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Expand file tree Collapse file tree 2 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 37
37
cert => ' /tmp/foo2.example.com.crt' ,
38
38
out_pass => ' mahje1Qu' ,
39
39
}
40
+
41
+ # same as above, just no password for the X509/pkcs12
42
+ openssl::certificate::x509 { 'foo3.example.com' :
43
+ ensure => present ,
44
+ country => ' CH' ,
45
+ organization => ' Example.com' ,
46
+ commonname => ' foo3.example.com' ,
47
+ base_dir => ' /tmp' ,
48
+ owner => ' nobody' ,
49
+ # This is just to speed up CI - use 2048 or more in production
50
+ key_size => 1024,
51
+ }
52
+ -> openssl::export::pkcs12 { ' export3.pkcs12' :
53
+ ensure => ' present' ,
54
+ basedir => ' /tmp' ,
55
+ pkey => ' /tmp/foo3.example.com.key' ,
56
+ cert => ' /tmp/foo3.example.com.crt' ,
57
+ }
58
+
59
+ # same as above, just with password for the X509 / no password for pkcs12
60
+ openssl::certificate::x509 { 'foo4.example.com' :
61
+ ensure => present ,
62
+ country => ' CH' ,
63
+ organization => ' Example.com' ,
64
+ commonname => ' foo4.example.com' ,
65
+ base_dir => ' /tmp' ,
66
+ owner => ' nobody' ,
67
+ password => ' mahje1Qu' ,
68
+ # This is just to speed up CI - use 2048 or more in production
69
+ key_size => 1024,
70
+ }
71
+ -> openssl::export::pkcs12 { ' export4.pkcs12' :
72
+ ensure => ' present' ,
73
+ basedir => ' /tmp' ,
74
+ pkey => ' /tmp/foo4.example.com.key' ,
75
+ cert => ' /tmp/foo4.example.com.crt' ,
76
+ in_pass => ' mahje1Qu' ,
77
+ }
Original file line number Diff line number Diff line change 10
10
it { expect ( file ( '/tmp/foo2.example.com.crt' ) ) . to be_file . and ( have_attributes ( owner : 'nobody' , group : 'root' ) ) }
11
11
it { expect ( file ( '/tmp/foo2.example.com.key' ) ) . to be_file . and ( have_attributes ( owner : 'nobody' , group : 'root' ) ) }
12
12
it { expect ( file ( '/tmp/export2.pkcs12.p12' ) ) . to be_file . and ( have_attributes ( owner : 'root' , group : 'root' ) ) }
13
+ it { expect ( file ( '/tmp/foo3.example.com.crt' ) ) . to be_file . and ( have_attributes ( owner : 'nobody' , group : 'root' ) ) }
14
+ it { expect ( file ( '/tmp/foo3.example.com.key' ) ) . to be_file . and ( have_attributes ( owner : 'nobody' , group : 'root' ) ) }
15
+ it { expect ( file ( '/tmp/export3.pkcs12.p12' ) ) . to be_file . and ( have_attributes ( owner : 'root' , group : 'root' ) ) }
16
+ it { expect ( file ( '/tmp/foo4.example.com.crt' ) ) . to be_file . and ( have_attributes ( owner : 'nobody' , group : 'root' ) ) }
17
+ it { expect ( file ( '/tmp/foo4.example.com.key' ) ) . to be_file . and ( have_attributes ( owner : 'nobody' , group : 'root' ) ) }
18
+ it { expect ( file ( '/tmp/export4.pkcs12.p12' ) ) . to be_file . and ( have_attributes ( owner : 'root' , group : 'root' ) ) }
13
19
end
14
20
# rubocop:disable RSpec/RepeatedExampleGroupBody
15
21
describe file ( '/tmp/export.pkcs12.p12' ) do
19
25
describe file ( '/tmp/export2.pkcs12.p12' ) do
20
26
its ( :size ) { is_expected . to be > 0 }
21
27
end
28
+
29
+ describe file ( '/tmp/export3.pkcs12.p12' ) do
30
+ its ( :size ) { is_expected . to be > 0 }
31
+ end
32
+
33
+ describe file ( '/tmp/export4.pkcs12.p12' ) do
34
+ its ( :size ) { is_expected . to be > 0 }
35
+ end
22
36
# rubocop:enable RSpec/RepeatedExampleGroupBody
23
37
end
You can’t perform that action at this time.
0 commit comments