mirror of
				https://github.com/saltstack-formulas/cron-formula.git
				synced 2025-11-04 12:33:33 +01:00 
			
		
		
		
	test(saltcheck): add support for random values
				
					
				
			This commit is contained in:
		
							parent
							
								
									3d0dcb2e43
								
							
						
					
					
						commit
						007970f935
					
				@ -27,14 +27,20 @@ validate_cron.{{ task }}_exists:
 | 
			
		||||
{#-       Note: `special` is `spec` in the module #}
 | 
			
		||||
{%-       for section in ['minute', 'hour', 'daymonth', 'month', 'dayweek', 'comment', 'spec'] %}
 | 
			
		||||
{%-         if section in task_options %}
 | 
			
		||||
{%-           set assertion = 'assertEqual' %}
 | 
			
		||||
{%-           set expected = task_options.get(section) %}
 | 
			
		||||
{%-           if expected == 'random' %}
 | 
			
		||||
{%-             set assertion = 'assertLessEqual' %}
 | 
			
		||||
{%-             set expected = 0 %}
 | 
			
		||||
{%-           endif %}
 | 
			
		||||
validate_cron.{{ task }}_{{ section }}:
 | 
			
		||||
  module_and_function: cron.get_entry
 | 
			
		||||
  args:
 | 
			
		||||
    - {{ task_options.user|d('root') }}
 | 
			
		||||
    - {{ task }}
 | 
			
		||||
  assertion: assertEqual
 | 
			
		||||
  assertion: {{ assertion }}
 | 
			
		||||
  assertion_section: {{ section }}
 | 
			
		||||
  expected-return: '{{ task_options.get(section) }}'
 | 
			
		||||
  expected-return: '{{ expected }}'
 | 
			
		||||
{%-         endif %}
 | 
			
		||||
{%-       endfor %}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user