Skip to content

Commit b1facf8

Browse files
committed
add acceptance test
1 parent 92caaba commit b1facf8

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

spec/acceptance/journal_spec.rb

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# frozen_string_literal: true
2+
3+
require 'spec_helper_acceptance'
4+
5+
describe 'systemd with remote/upload journal' do
6+
context 'configure journal remote/upload' do
7+
let(:manifest) do
8+
<<~PUPPET
9+
package { 'openssl':
10+
ensure => 'installed',
11+
before => Exec['generate-key'],
12+
}
13+
exec { 'generate-key':
14+
path => ['/bin','/sbin','/usr/bin','/usr/sbin'],
15+
command => 'openssl req -x509 -sha256 -nodes -newkey rsa:1024 -keyout key.pem -out cert.pem -subj "/CN=localhost"',
16+
cwd => '/tmp',
17+
creates => '/tmp/cert.pem',
18+
before => Class['systemd'],
19+
}
20+
class { 'systemd':
21+
manage_journal_upload => false,
22+
manage_journal_remote => true,
23+
journal_upload_settings => {
24+
'URL' => 'https://127.0.0.1',
25+
},
26+
journal_remote_settings => {
27+
'ServerKeyFile' => '/tmp/key.pem',
28+
'ServerCertificateFile' => '/tmp/cert.pem',
29+
},
30+
}
31+
PUPPET
32+
end
33+
34+
it 'works idempotently with no errors' do
35+
apply_manifest(manifest, catch_failures: true)
36+
apply_manifest(manifest, catch_changes: true)
37+
end
38+
end
39+
end

0 commit comments

Comments
 (0)