MCPcopy Index your code
hub / github.com/foxcpp/maddy / Port

Method Port

tests/t.go:146–156  ·  view source on GitHub ↗

Port allocates the random TCP port for use by test. It will made accessible in the configuration via environment variables with name in the form TEST_PORT_name. If there is a port with name remote_smtp, it will be passed as the value for the -debug.smtpport parameter.

(name string)

Source from the content-addressed store, hash-verified

144// If there is a port with name remote_smtp, it will be passed as the value for
145// the -debug.smtpport parameter.
146func (t *T) Port(name string) uint16 {
147 if port := t.ports[name]; port != 0 {
148 return port
149 }
150
151 // TODO: Try to bind on port to test its usability.
152 port := rand.Int31n(45536) + 20000
153 t.ports[name] = uint16(port)
154 t.portsRev[uint16(port)] = name
155 return uint16(port)
156}
157
158func (t *T) Env(kv string) {
159 t.env = append(t.env, kv)

Callers 15

TestConcurrencyLimitFunction · 0.95
TestPerIPConcurrencyFunction · 0.95
TestImapsqlDeliveryFunction · 0.95
TestImapsqlDeliveryMapFunction · 0.95
TestImapsqlAuthMapFunction · 0.95
TestLMTPClient_Issue308Function · 0.95
TestLDAPInjectionFilterFunction · 0.95
TestDovecotSASLClientFunction · 0.95

Calls

no outgoing calls

Tested by 15

TestConcurrencyLimitFunction · 0.76
TestPerIPConcurrencyFunction · 0.76
TestImapsqlDeliveryFunction · 0.76
TestImapsqlDeliveryMapFunction · 0.76
TestImapsqlAuthMapFunction · 0.76
TestLMTPClient_Issue308Function · 0.76
TestLDAPInjectionFilterFunction · 0.76
TestDovecotSASLClientFunction · 0.76