tests: convert stack_construction.yml to assert_equal.

issue510
David Wilson 6 years ago
parent 4256d2aa4b
commit 8891b48080

@ -4,7 +4,7 @@
# 'connection stack' -- this is just a list of dictionaries specifying a # 'connection stack' -- this is just a list of dictionaries specifying a
# sequence of proxied Router connection methods and their kwargs used to # sequence of proxied Router connection methods and their kwargs used to
# establish the connection. That list is passed to ContextService, which loops # establish the connection. That list is passed to ContextService, which loops
# over the stack specifying via=(None or previous entry) for each connection # over the stack specifying via=(null or previous entry) for each connection
# method. # method.
# mitogen_get_stack is a magic action that returns the stack, so we can test # mitogen_get_stack is a magic action that returns the stack, so we can test
@ -35,14 +35,14 @@
- mitogen_get_stack: - mitogen_get_stack:
register: out register: out
- assert: - assert_equal:
that: | left: out.result
out.result == [ right: [
{ {
"kwargs": { "kwargs": {
"connect_timeout": 10, "connect_timeout": 10,
"doas_path": None, "doas_path": null,
"password": None, "password": null,
"python_path": ["/usr/bin/python"], "python_path": ["/usr/bin/python"],
"username": "normal-user", "username": "normal-user",
}, },
@ -59,19 +59,19 @@
- mitogen_get_stack: - mitogen_get_stack:
delegate_to: cd-alias delegate_to: cd-alias
register: out register: out
- assert: - assert_equal:
that: | left: out.result
out.result == [ right: [
{ {
'kwargs': { 'kwargs': {
'check_host_keys': 'ignore', 'check_host_keys': 'ignore',
'connect_timeout': 10, 'connect_timeout': 10,
'hostname': 'alias-host', 'hostname': 'alias-host',
'identities_only': False, 'identities_only': False,
'identity_file': None, 'identity_file': null,
'password': None, 'password': null,
'port': None, 'port': null,
'python_path': None, 'python_path': null,
'ssh_args': [ 'ssh_args': [
'-o', '-o',
'ForwardAgent=yes', 'ForwardAgent=yes',
@ -80,7 +80,7 @@
'-o', '-o',
'ControlPersist=60s', 'ControlPersist=60s',
], ],
'ssh_debug_level': None, 'ssh_debug_level': null,
'ssh_path': 'ssh', 'ssh_path': 'ssh',
'username': 'alias-user', 'username': 'alias-user',
}, },
@ -96,18 +96,18 @@
- mitogen_get_stack: - mitogen_get_stack:
register: out register: out
- assert: - assert_equal:
that: | left: out.result
out.result == [ right: [
{ {
'kwargs': { 'kwargs': {
'check_host_keys': 'ignore', 'check_host_keys': 'ignore',
'connect_timeout': 10, 'connect_timeout': 10,
'hostname': 'alias-host', 'hostname': 'alias-host',
'identities_only': False, 'identities_only': False,
'identity_file': None, 'identity_file': null,
'password': None, 'password': null,
'port': None, 'port': null,
'python_path': ['/usr/bin/python'], 'python_path': ['/usr/bin/python'],
'ssh_args': [ 'ssh_args': [
'-o', '-o',
@ -117,7 +117,7 @@
'-o', '-o',
'ControlPersist=60s', 'ControlPersist=60s',
], ],
'ssh_debug_level': None, 'ssh_debug_level': null,
'ssh_path': 'ssh', 'ssh_path': 'ssh',
'username': 'alias-user', 'username': 'alias-user',
}, },
@ -133,15 +133,15 @@
- mitogen_get_stack: - mitogen_get_stack:
register: out register: out
- assert: - assert_equal:
that: | left: out.result
out.result == [ right: [
{ {
'kwargs': { 'kwargs': {
'connect_timeout': 10, 'connect_timeout': 10,
'doas_path': None, 'doas_path': null,
'password': None, 'password': null,
'python_path': None, 'python_path': null,
'username': 'normal-user', 'username': 'normal-user',
}, },
'method': 'doas', 'method': 'doas',
@ -152,9 +152,9 @@
'connect_timeout': 10, 'connect_timeout': 10,
'hostname': 'cd-normal-normal', 'hostname': 'cd-normal-normal',
'identities_only': False, 'identities_only': False,
'identity_file': None, 'identity_file': null,
'password': None, 'password': null,
'port': None, 'port': null,
'python_path': ['/usr/bin/python'], 'python_path': ['/usr/bin/python'],
'ssh_args': [ 'ssh_args': [
'-o', '-o',
@ -164,9 +164,9 @@
'-o', '-o',
'ControlPersist=60s', 'ControlPersist=60s',
], ],
'ssh_debug_level': None, 'ssh_debug_level': null,
'ssh_path': 'ssh', 'ssh_path': 'ssh',
'username': None, 'username': null,
}, },
'method': 'ssh', 'method': 'ssh',
}, },
@ -180,19 +180,19 @@
- mitogen_get_stack: - mitogen_get_stack:
register: out register: out
- assert: - assert_equal:
that: | left: out.result
out.result == [ right: [
{ {
'kwargs': { 'kwargs': {
'check_host_keys': 'ignore', 'check_host_keys': 'ignore',
'connect_timeout': 10, 'connect_timeout': 10,
'hostname': 'alias-host', 'hostname': 'alias-host',
'identities_only': False, 'identities_only': False,
'identity_file': None, 'identity_file': null,
'password': None, 'password': null,
'port': None, 'port': null,
'python_path': None, 'python_path': null,
'ssh_args': [ 'ssh_args': [
'-o', '-o',
'ForwardAgent=yes', 'ForwardAgent=yes',
@ -201,7 +201,7 @@
'-o', '-o',
'ControlPersist=60s', 'ControlPersist=60s',
], ],
'ssh_debug_level': None, 'ssh_debug_level': null,
'ssh_path': 'ssh', 'ssh_path': 'ssh',
'username': 'alias-user', 'username': 'alias-user',
}, },
@ -213,9 +213,9 @@
'connect_timeout': 10, 'connect_timeout': 10,
'hostname': 'cd-normal-alias', 'hostname': 'cd-normal-alias',
'identities_only': False, 'identities_only': False,
'identity_file': None, 'identity_file': null,
'password': None, 'password': null,
'port': None, 'port': null,
'python_path': ['/usr/bin/python'], 'python_path': ['/usr/bin/python'],
'ssh_args': [ 'ssh_args': [
'-o', '-o',
@ -225,9 +225,9 @@
'-o', '-o',
'ControlPersist=60s', 'ControlPersist=60s',
], ],
'ssh_debug_level': None, 'ssh_debug_level': null,
'ssh_path': 'ssh', 'ssh_path': 'ssh',
'username': None, 'username': null,
}, },
'method': 'ssh', 'method': 'ssh',
}, },
@ -241,15 +241,15 @@
- mitogen_get_stack: - mitogen_get_stack:
register: out register: out
- assert: - assert_equal:
that: | left: out.result
out.result == [ right: [
{ {
'kwargs': { 'kwargs': {
'connect_timeout': 10, 'connect_timeout': 10,
'doas_path': None, 'doas_path': null,
'password': None, 'password': null,
'python_path': None, 'python_path': null,
'username': 'normal-user', 'username': 'normal-user',
}, },
'method': 'doas', 'method': 'doas',
@ -260,9 +260,9 @@
'connect_timeout': 10, 'connect_timeout': 10,
'hostname': 'cd-newuser-normal-normal', 'hostname': 'cd-newuser-normal-normal',
'identities_only': False, 'identities_only': False,
'identity_file': None, 'identity_file': null,
'password': None, 'password': null,
'port': None, 'port': null,
'python_path': ['/usr/bin/python'], 'python_path': ['/usr/bin/python'],
'ssh_args': [ 'ssh_args': [
'-o', '-o',
@ -272,7 +272,7 @@
'-o', '-o',
'ControlPersist=60s', 'ControlPersist=60s',
], ],
'ssh_debug_level': None, 'ssh_debug_level': null,
'ssh_path': 'ssh', 'ssh_path': 'ssh',
'username': 'newuser-normal-normal-user', 'username': 'newuser-normal-normal-user',
}, },
@ -289,19 +289,19 @@
- mitogen_get_stack: - mitogen_get_stack:
delegate_to: cd-alias delegate_to: cd-alias
register: out register: out
- assert: - assert_equal:
that: | left: out.result
out.result == [ right: [
{ {
'kwargs': { 'kwargs': {
'check_host_keys': 'ignore', 'check_host_keys': 'ignore',
'connect_timeout': 10, 'connect_timeout': 10,
'hostname': 'alias-host', 'hostname': 'alias-host',
'identities_only': False, 'identities_only': False,
'identity_file': None, 'identity_file': null,
'password': None, 'password': null,
'port': None, 'port': null,
'python_path': None, 'python_path': null,
'ssh_args': [ 'ssh_args': [
'-o', '-o',
'ForwardAgent=yes', 'ForwardAgent=yes',
@ -310,7 +310,7 @@
'-o', '-o',
'ControlPersist=60s', 'ControlPersist=60s',
], ],
'ssh_debug_level': None, 'ssh_debug_level': null,
'ssh_path': 'ssh', 'ssh_path': 'ssh',
'username': 'alias-user', 'username': 'alias-user',
}, },
@ -326,12 +326,12 @@
- local_action: mitogen_get_stack - local_action: mitogen_get_stack
register: out register: out
- assert: - assert_equal:
that: | left: out.result
out.result == [ right: [
{ {
'kwargs': { 'kwargs': {
'python_path': None 'python_path': null
}, },
'method': 'local', 'method': 'local',
}, },
@ -345,15 +345,15 @@
- mitogen_get_stack: - mitogen_get_stack:
register: out register: out
- assert: - assert_equal:
that: | left: out.result
out.result == [ right: [
{ {
'kwargs': { 'kwargs': {
'connect_timeout': 10, 'connect_timeout': 10,
'doas_path': None, 'doas_path': null,
'password': None, 'password': null,
'python_path': None, 'python_path': null,
'username': 'normal-user', 'username': 'normal-user',
}, },
'method': 'doas', 'method': 'doas',
@ -361,8 +361,8 @@
{ {
'kwargs': { 'kwargs': {
'connect_timeout': 10, 'connect_timeout': 10,
'doas_path': None, 'doas_path': null,
'password': None, 'password': null,
'python_path': ['/usr/bin/python'], 'python_path': ['/usr/bin/python'],
'username': 'newuser-doas-normal-user', 'username': 'newuser-doas-normal-user',
}, },

Loading…
Cancel
Save