Skip to content

Commit 7c4baa6

Browse files
(maint) Merge up db67fb3 to master
Generated by CI * commit 'db67fb3badc383cd9a20f62a53ff3cfdce3953c2': (packaging) Updating manpage file for 5.5.x (maint) fix resource assertions Conflicts: man/man8/puppet-ca.8 man/man8/puppet-cert.8 man/man8/puppet-certificate.8 man/man8/puppet-certificate_request.8 man/man8/puppet-certificate_revocation_list.8 man/man8/puppet-master.8
2 parents 5f8a2e2 + db67fb3 commit 7c4baa6

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

acceptance/lib/puppet/acceptance/service_utils.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ def ensure_service_on_host(host, service, status, &block)
8383
# @param block [Proc] optional: block to verify service state
8484
# @return None
8585
def assert_service_status_on_host(host, service, status, &block)
86-
ensure_status = "ensure => '#{status[:ensure]}'" if status[:ensure]
87-
enable_status = "enable => '#{status[:enable]}'" if status[:enable]
86+
ensure_status = "ensure.+=> '#{status[:ensure]}'" if status[:ensure]
87+
enable_status = "enable.+=> '#{status[:enable]}'" if status[:enable]
8888

8989
on host, puppet_resource('service', service) do
9090
assert_match(/'#{service}'.+#{ensure_status}.+#{enable_status}/m, stdout, "Service status does not match expectation #{status}")

acceptance/tests/resource/service/launchd_provider.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ def launchctl_assert_status(host, service, expect_running)
8484
step "Start the service on #{agent} when service is stopped, and check outoput" do
8585
on agent, puppet_resource('service', svc, 'ensure=stopped')
8686
on agent, puppet_resource('service', svc, 'ensure=running') do |result|
87-
assert_match(/service { '#{svc}':\n ensure => 'running',\n}$/, stdout, 'Service status change failed')
87+
assert_match(/service { '#{svc}':\n ensure.+=> 'running',\n}$/, stdout, 'Service status change failed')
8888
end
8989
end
9090

9191
# switching from running to stopped should output the correct status of the service and not 'absent'
9292
step "Start the service on #{agent} when service is running, and check outoput" do
9393
on agent, puppet_resource('service', svc, 'ensure=running')
9494
on agent, puppet_resource('service', svc, 'ensure=stopped') do |result|
95-
assert_match(/service { '#{svc}':\n ensure => 'stopped',\n}$/, stdout, 'Service status change failed')
95+
assert_match(/service { '#{svc}':\n ensure.+=> 'stopped',\n}$/, stdout, 'Service status change failed')
9696
end
9797
end
9898

acceptance/tests/resource/service/smf_basic_tests.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
step "SMF: ensure you can query the service with the ral" do
4747
on(agent, puppet("resource service tstapp")) do
48-
assert_match( /ensure => 'running'/, result.stdout, "err: #{agent}")
48+
assert_match( /ensure.+=> 'running'/, result.stdout, "err: #{agent}")
4949
end
5050
end
5151

acceptance/tests/resource/service/ticket_5024_systemd_enabling_masked_service.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@
7878
step "Masking the #{package_name[platform]} service"
7979
apply_manifest_on(agent, manifest_service_masked, :catch_failures => true)
8080
on(agent, puppet_resource('service', package_name[platform])) do
81-
assert_match(/ensure => 'stopped'/, stdout, "Expected #{package_name[platform]} service to be stopped")
82-
assert_match(/enable => 'false'/, stdout, "Expected #{package_name[platform]} service to be masked")
81+
assert_match(/ensure.+=> 'stopped'/, stdout, "Expected #{package_name[platform]} service to be stopped")
82+
assert_match(/enable.+=> 'false'/, stdout, "Expected #{package_name[platform]} service to be masked")
8383
on(agent, "readlink #{masked_symlink_systemd}") do
8484
assert_equal('/dev/null', stdout.chomp, "Expected service symlink to point to /dev/null")
8585
end
@@ -88,8 +88,8 @@
8888
step "Enabling the #{package_name[platform]} service"
8989
apply_manifest_on(agent, manifest_service_enabled, :catch_failures => true)
9090
on(agent, puppet_resource('service', package_name[platform])) do
91-
assert_match(/ensure => 'running'/, stdout, "Expected #{package_name[platform]} service to be running")
92-
assert_match(/enable => 'true'/, stdout, "Expected #{package_name[platform]} service to be enabled")
91+
assert_match(/ensure.+=> 'running'/, stdout, "Expected #{package_name[platform]} service to be running")
92+
assert_match(/enable.+=> 'true'/, stdout, "Expected #{package_name[platform]} service to be enabled")
9393
on(agent, "readlink #{symlink_systemd}") do
9494
assert_equal(init_script_systemd, stdout.chomp, "Expected service symlink to point to systemd init script")
9595
end

0 commit comments

Comments
 (0)