19099: Update tests to new crunchrun.Gateway fields.
[arvados.git] / lib / crunchrun / container_gateway.go
index 62979da21b38c69f3d83189b90988d71806d8dc5..01457015e16f1870bf4adf4785b8f9c08cec10d5 100644 (file)
@@ -36,6 +36,13 @@ type GatewayTarget interface {
        IPAddress() (string, error)
 }
 
+type GatewayTargetStub struct{}
+
+func (GatewayTargetStub) IPAddress() (string, error) { return "127.0.0.1", nil }
+func (GatewayTargetStub) InjectCommand(ctx context.Context, detachKeys, username string, usingTTY bool, cmd []string) (*exec.Cmd, error) {
+       return exec.CommandContext(ctx, cmd[0], cmd[1:]...), nil
+}
+
 type Gateway struct {
        ContainerUUID string
        Address       string // listen host:port; if port=0, Start() will change it to the selected port