()
| 122 | |
| 123 | @pytest.mark.skip(reason="Cluster created with terraform have untrusted certificate") |
| 124 | def 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', |
nothing calls this directly
no test coverage detected