MCPcopy Create free account
hub / github.com/dcos/dcos-cli / test_plugin_invocation_tls

Function test_plugin_invocation_tls

tests/integration/test_plugin.py:124–157  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122
123@pytest.mark.skip(reason="Cluster created with terraform have untrusted certificate")
124def test_plugin_invocation_tls():
125 with setup_cluster(scheme='https'):
126 _install_test_plugin()
127
128 code, out, _ = exec_cmd(['dcos', 'config', 'show', 'core.ssl_verify'])
129 assert code == 0
130 ca_path = out.rstrip()
131
132 code, out, err = exec_cmd(['dcos', 'test'])
133 assert code == 0
134 out = json.loads(out)
135
136 assert out['env'].get('DCOS_TLS_INSECURE') is None
137 assert out['env'].get('DCOS_TLS_CA_PATH') == ca_path
138
139 code, _, _ = exec_cmd(['dcos', 'config', 'set', 'core.ssl_verify', 'False'])
140 assert code == 0
141
142 code, out, err = exec_cmd(['dcos', 'test'])
143 assert code == 0
144 out = json.loads(out)
145
146 assert out['env'].get('DCOS_TLS_INSECURE') == '1'
147 assert out['env'].get('DCOS_TLS_CA_PATH') is None
148
149 with setup_cluster(scheme='http'):
150 _install_test_plugin()
151
152 code, out, err = exec_cmd(['dcos', 'test'])
153 assert code == 0
154 out = json.loads(out)
155
156 assert out['env'].get('DCOS_TLS_INSECURE') == '1'
157 assert out['env'].get('DCOS_TLS_CA_PATH') is None
158
159
160@pytest.mark.skipif(sys.platform == 'win32',

Callers

nothing calls this directly

Calls 3

setup_clusterFunction · 0.85
_install_test_pluginFunction · 0.85
exec_cmdFunction · 0.85

Tested by

no test coverage detected