@@ -81,19 +81,16 @@ def launchctl_assert_status(host, service, expect_running)
81
81
end
82
82
83
83
# switching from stopped to running should output the correct status of the service and not 'absent'
84
- step "Start the service on #{ agent } when service is stopped, and check outoput " do
84
+ step "Start the service on #{ agent } when service is stopped, and check output " do
85
85
on agent , puppet_resource ( 'service' , svc , 'ensure=stopped' )
86
- on agent , puppet_resource ( 'service' , svc , 'ensure=running' ) do |result |
87
- assert_match ( /service { '#{ svc } ':\n ensure.+=> 'running',\n }$/ , stdout , 'Service status change failed' )
88
- end
86
+ on agent , puppet_resource ( 'service' , svc , 'ensure=running' )
87
+ assert_service_status_on_host ( agent , svc , { :ensure => 'running' } )
89
88
end
90
89
91
- # switching from running to stopped should output the correct status of the service and not 'absent'
92
- step "Start the service on #{ agent } when service is running, and check outoput " do
90
+ # switching from running to stopped should output the correct status of the service and not 'absent'
91
+ step "Stop the service on #{ agent } when service is running, and check output " do
93
92
on agent , puppet_resource ( 'service' , svc , 'ensure=running' )
94
- on agent , puppet_resource ( 'service' , svc , 'ensure=stopped' ) do |result |
95
- assert_match ( /service { '#{ svc } ':\n ensure.+=> 'stopped',\n }$/ , stdout , 'Service status change failed' )
96
- end
93
+ on agent , puppet_resource ( 'service' , svc , 'ensure=stopped' )
94
+ assert_service_status_on_host ( agent , svc , { :ensure => 'stopped' } )
97
95
end
98
-
99
96
end
0 commit comments