mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
parent
3f8e0db572
commit
d6d9e36359
3 changed files with 44 additions and 0 deletions
|
@ -0,0 +1,11 @@
|
|||
test:
|
||||
test.succeed_with_changes:
|
||||
- name: test
|
||||
- listen_in:
|
||||
- test: service
|
||||
|
||||
service:
|
||||
test.succeed_without_changes:
|
||||
- names:
|
||||
- nginx
|
||||
- crond
|
|
@ -0,0 +1,11 @@
|
|||
test:
|
||||
test.succeed_with_changes:
|
||||
- name: test
|
||||
|
||||
service:
|
||||
test.succeed_without_changes:
|
||||
- names:
|
||||
- nginx
|
||||
- crond
|
||||
- listen:
|
||||
- test: test
|
|
@ -1156,6 +1156,28 @@ class StateModuleTest(ModuleCase, SaltReturnAssertsMixin):
|
|||
listener_state = 'cmd_|-listener_test_listening_resolution_two_|-echo "Successful listen resolution"_|-mod_watch'
|
||||
self.assertIn(listener_state, state_run)
|
||||
|
||||
def test_listen_in_requisite_resolution_names(self):
|
||||
'''
|
||||
Verify listen_in requisite lookups use ID declaration to check for changes
|
||||
and resolves magic names state variable
|
||||
'''
|
||||
|
||||
# Only run the state once and keep the return data
|
||||
state_run = self.run_function('state.sls', mods='requisites.listen_in_names')
|
||||
self.assertIn('test_|-listener_service_|-nginx_|-mod_watch', state_run)
|
||||
self.assertIn('test_|-listener_service_|-crond_|-mod_watch', state_run)
|
||||
|
||||
def test_listen_requisite_resolution_names(self):
|
||||
'''
|
||||
Verify listen requisite lookups use ID declaration to check for changes
|
||||
and resolves magic names state variable
|
||||
'''
|
||||
|
||||
# Only run the state once and keep the return data
|
||||
state_run = self.run_function('state.sls', mods='requisites.listen_names')
|
||||
self.assertIn('test_|-listener_service_|-nginx_|-mod_watch', state_run)
|
||||
self.assertIn('test_|-listener_service_|-crond_|-mod_watch', state_run)
|
||||
|
||||
def test_issue_30820_requisite_in_match_by_name(self):
|
||||
'''
|
||||
This tests the case where a requisite_in matches by name instead of ID
|
||||
|
|
Loading…
Add table
Reference in a new issue