mirror of
				https://github.com/ansible-collections/community.general.git
				synced 2025-10-24 21:14:00 -07:00 
			
		
		
		
	[PR #6908/ea6fb9da backport][stable-7] snap: add param "dangerous" (#6944)
snap: add param "dangerous" (#6908)
* snap: add param "dangerous"
* adjusted run_command out for simple test case
* add changelog frag
(cherry picked from commit ea6fb9da8f)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
	
	
This commit is contained in:
		
					parent
					
						
							
								15b950f1cf
							
						
					
				
			
			
				commit
				
					
						bb80ff6aee
					
				
			
		
					 7 changed files with 159 additions and 11 deletions
				
			
		|  | @ -395,11 +395,46 @@ issue_6803_kubectl_out = ( | |||
| ) | ||||
| 
 | ||||
| TEST_CASES = [ | ||||
|     ModuleTestCase( | ||||
|         id="simple case", | ||||
|         input={"name": ["hello-world"]}, | ||||
|         output=dict(changed=True, snaps_installed=["hello-world"]), | ||||
|         run_command_calls=[ | ||||
|             RunCmdCall( | ||||
|                 command=['/testbin/snap', 'info', 'hello-world'], | ||||
|                 environ={'environ_update': {'LANGUAGE': 'C', 'LC_ALL': 'C'}, 'check_rc': False}, | ||||
|                 rc=0, | ||||
|                 out='name: hello-world\n', | ||||
|                 err="", | ||||
|             ), | ||||
|             RunCmdCall( | ||||
|                 command=['/testbin/snap', 'list'], | ||||
|                 environ={'environ_update': {'LANGUAGE': 'C', 'LC_ALL': 'C'}, 'check_rc': False}, | ||||
|                 rc=0, | ||||
|                 out="", | ||||
|                 err="", | ||||
|             ), | ||||
|             RunCmdCall( | ||||
|                 command=['/testbin/snap', 'install', 'hello-world'], | ||||
|                 environ={'environ_update': {'LANGUAGE': 'C', 'LC_ALL': 'C'}, 'check_rc': False}, | ||||
|                 rc=0, | ||||
|                 out="hello-world (12345/stable) v12345 from Canonical** installed\n", | ||||
|                 err="", | ||||
|             ), | ||||
|         ] | ||||
|     ), | ||||
|     ModuleTestCase( | ||||
|         id="issue_6803", | ||||
|         input={"name": ["microk8s", "kubectl"], "classic": True}, | ||||
|         output=dict(changed=True, snaps_installed=["microk8s", "kubectl"]), | ||||
|         run_command_calls=[ | ||||
|             RunCmdCall( | ||||
|                 command=['/testbin/snap', 'info', 'microk8s', 'kubectl'], | ||||
|                 environ={'environ_update': {'LANGUAGE': 'C', 'LC_ALL': 'C'}, 'check_rc': False}, | ||||
|                 rc=0, | ||||
|                 out='name: microk8s\n---\nname: kubectl\n', | ||||
|                 err="", | ||||
|             ), | ||||
|             RunCmdCall( | ||||
|                 command=['/testbin/snap', 'list'], | ||||
|                 environ={'environ_update': {'LANGUAGE': 'C', 'LC_ALL': 'C'}, 'check_rc': False}, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue