MCPcopy
hub / github.com/passteque/gluetun / Test_Service_runCommand

Function Test_Service_runCommand

internal/portforward/service/command_test.go:14–29  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func Test_Service_runCommand(t *testing.T) {
15 t.Parallel()
16 ctrl := gomock.NewController(t)
17
18 ctx := context.Background()
19 cmder := command.New()
20 const commandTemplate = `/bin/sh -c "echo {{PORTS}}-{{PORT}}-{{VPN_INTERFACE}}"`
21 ports := []uint16{1234, 5678}
22 const vpnInterface = "tun0"
23 logger := NewMockLogger(ctrl)
24 logger.EXPECT().Info("1234,5678-1234-tun0")
25
26 err := runCommand(ctx, cmder, logger, commandTemplate, ports, vpnInterface)
27
28 require.NoError(t, err)
29}

Callers

nothing calls this directly

Calls 5

EXPECTMethod · 0.95
NewFunction · 0.92
runCommandFunction · 0.85
NewMockLoggerFunction · 0.70
InfoMethod · 0.65

Tested by

no test coverage detected