Skip to content

Commit

Permalink
(SIMP-10739) Update documentation and acc. tests
Browse files Browse the repository at this point in the history
Updated the acceptance tests (which I cannot run, so gosh I hope they
work) to use the newer convention for user/password specification.
  • Loading branch information
greatflyingsteve committed Aug 12, 2022
1 parent 74b1113 commit b5b4b43
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion manifests/server/section.pp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
$secretsfile_lines = $user_pass
.map |$line| { "${line}\n" }
} else {
$secretsfile_lines = Hash.assert_type($auth_users) |$ex, $act| {
$secretsfile_lines = Hash.assert_type($auth_users) |$ex, $act| {
$auth_users.reduce({}) |$hash, $user| { $hash + { $user => undef } }
}.map |$username, $maybe_password| {
$password = $maybe_password ? {
Expand Down
3 changes: 1 addition & 2 deletions spec/acceptance/suites/default/10_server_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
}
rsync::server::section { 'test':
auth_users => ['test_user'],
user_pass => ['test_user:test_pass'],
auth_users => { 'test_user' => 'test_pass' },
comment => 'A test system',
hosts_allow => ['#{server1_ip}', '#{server2_ip}'],
path => '/srv/rsync/test',
Expand Down
18 changes: 8 additions & 10 deletions spec/acceptance/suites/default/20_server_client_stunnel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,10 @@
}
rsync::server::section { 'test':
auth_users => ['test_user'],
user_pass => ['test_user:test_pass'],
comment => 'A test system',
path => '/srv/rsync/test',
require => File['/srv/rsync/test/test_file_srvcli2_server1']
auth_users => { 'test_user' => 'test_pass' },
comment => 'A test system',
path => '/srv/rsync/test',
require => File['/srv/rsync/test/test_file_srvcli2_server1']
}
stunnel::connection { 'rsync':
Expand Down Expand Up @@ -88,11 +87,10 @@
}
rsync::server::section { 'test':
auth_users => ['test_user'],
user_pass => ['test_user:test_pass'],
comment => 'A test system',
path => '/srv/rsync/test',
require => File['/srv/rsync/test/test_file_srvcli2_server2']
auth_users => { 'test_user' => 'test_pass' },
comment => 'A test system',
path => '/srv/rsync/test',
require => File['/srv/rsync/test/test_file_srvcli2_server2']
}
stunnel::connection { 'rsync':
Expand Down
2 changes: 1 addition & 1 deletion types/auth_users.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @summary Validator for rsync::server::auth_users
#
type Rsync::Auth_users = Variant[
Array[String[1]],
Array[String[1]],
Hash[String[1], Optional[String]]
]

0 comments on commit b5b4b43

Please sign in to comment.