Skip to content

Commit

Permalink
Add a unit test to ensure bacula::director::console works as expeced
Browse files Browse the repository at this point in the history
  • Loading branch information
smortex committed Jun 20, 2024
1 parent 493e2bf commit fa8ff5a
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions spec/defines/director_console_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# frozen_string_literal: true

require 'spec_helper'

describe 'bacula::director::console' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) { facts }

let(:pre_condition) { 'include bacula' }

context 'with default parameters' do
let(:title) { 'Monitoring' }

let(:params) do
{
password: 'monitoring_password',
}
end

it { is_expected.to contain_concat__fragment('bacula-director-console-Monitoring').with(content: <<~FRAGMENT) }
Console {
Name = Monitoring
Password = "monitoring_password"
CatalogACL = *all*
CommandACL = list
}
FRAGMENT
end

context 'with all parameters set' do
let(:title) { 'restricted-user' }

let(:params) do
{
password: 'A different UntrustedUser',
jobacl: 'Restricted Client Save',
clientacl: 'restricted-client',
storageacl: 'second-storage',
scheduleacl: 'weekly-schedule',
poolacl: 'backup-pool',
filesetacl: "Restricted Client's FileSet",
catalogacl: 'RestrictedCatalog',
commandacl: %w[run restore],
whereacl: '/',
}
end

it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) }

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bacula::director::console on redhat-7-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bacula::director::console on redhat-8-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bacula::director::console on redhat-9-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bacula::director::console on centos-7-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bacula::director::console on centos-8-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bacula::director::console on centos-9-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bacula::director::console on debian-11-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bacula::director::console on debian-12-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bacula::director::console on ubuntu-20.04-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

bacula::director::console on ubuntu-22.04-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bacula::director::console on redhat-7-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bacula::director::console on redhat-8-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bacula::director::console on redhat-9-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bacula::director::console on centos-7-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bacula::director::console on centos-8-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bacula::director::console on centos-9-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bacula::director::console on debian-11-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bacula::director::console on debian-12-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bacula::director::console on ubuntu-20.04-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet

Check failure on line 49 in spec/defines/director_console_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

bacula::director::console on ubuntu-22.04-x86_64 with all parameters set is expected to contain Concat::Fragment[bacula-director-console-restricted-user] with content supplied string Failure/Error: it { is_expected.to contain_concat__fragment('bacula-director-console-restricted-user').with(content: <<~FRAGMENT) } Console { Name = restricted-user Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client StorageACL = second-storage ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet expected that the catalogue would contain Concat::Fragment[bacula-director-console-restricted-user] with content set to supplied string Diff: @@ -3,7 +3,7 @@ Password = "A different UntrustedUser" JobACL = Restricted Client Save ClientACL = restricted-client - StorageACL = second-storage + StorageACL = weekly-schedule ScheduleACL = weekly-schedule PoolACL = backup-pool FileSetACL = Restricted Client's FileSet
Console {
Name = restricted-user
Password = "A different UntrustedUser"
JobACL = Restricted Client Save
ClientACL = restricted-client
StorageACL = second-storage
ScheduleACL = weekly-schedule
PoolACL = backup-pool
FileSetACL = Restricted Client's FileSet
CatalogACL = RestrictedCatalog
CommandACL = run, restore
WhereACL = /
}
FRAGMENT
end
end
end
end

0 comments on commit fa8ff5a

Please sign in to comment.