MCPcopy Index your code
hub / github.com/ContainerSSH/ContainerSSH / ConfigureBackend

Method ConfigureBackend

e2e_framework_test.go:173–201  ·  view source on GitHub ↗
(backend config.Backend)

Source from the content-addressed store, hash-verified

171}
172
173func (c *testContext) ConfigureBackend(backend config.Backend) {
174 t := c.T
175 t.Helper()
176
177 t.Logf("Configuring %s backend...", backend)
178 c.cfg.Backend = backend
179 switch backend {
180 case config.BackendKubernetes:
181 kube := test.Kubernetes(t)
182 c.cfg.Kubernetes.Connection.ServerName = kube.ServerName
183 c.cfg.Kubernetes.Connection.Host = kube.Host
184 c.cfg.Kubernetes.Connection.CAData = kube.CACert
185 c.cfg.Kubernetes.Connection.KeyData = kube.UserKey
186 c.cfg.Kubernetes.Connection.CertData = kube.UserCert
187 case config.BackendSSHProxy:
188 proxy := test.SSH(t)
189 c.cfg.SSHProxy.Server = proxy.Host()
190 c.cfg.SSHProxy.Port = uint16(proxy.Port())
191 c.cfg.SSHProxy.Username = proxy.Username()
192 c.cfg.SSHProxy.Password = proxy.Password()
193 c.cfg.SSHProxy.AllowedHostKeyFingerprints = []string{
194 proxy.FingerprintSHA256(),
195 }
196 c.cfg.SSHProxy.HostKeyAlgorithms = config.MustSSHKeyAlgoListFromStringList(
197 proxy.HostKeyAlgorithms(),
198 )
199 }
200 t.Logf("Configured %s backend.", backend)
201}
202
203func (c *testContext) LoginViaSSH() {
204 t := c.T

Callers

nothing calls this directly

Calls 10

KubernetesFunction · 0.92
SSHFunction · 0.92
LogfMethod · 0.65
HostMethod · 0.65
PortMethod · 0.65
UsernameMethod · 0.65
PasswordMethod · 0.65
FingerprintSHA256Method · 0.65
HostKeyAlgorithmsMethod · 0.65

Tested by

no test coverage detected