mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-12 04:57:36 +00:00
Working on migrate DERP tests to scenarios
This commit is contained in:
@@ -52,6 +52,7 @@ type HeadscaleInContainer struct {
|
||||
|
||||
// optional config
|
||||
port int
|
||||
extraPorts []string
|
||||
aclPolicy *headscale.ACLPolicy
|
||||
env map[string]string
|
||||
tlsCert []byte
|
||||
@@ -108,6 +109,13 @@ func WithPort(port int) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithExtraPorts exposes additional ports on the container (e.g. 3478/udp for STUN)
|
||||
func WithExtraPorts(ports []string) Option {
|
||||
return func(hsic *HeadscaleInContainer) {
|
||||
hsic.extraPorts = ports
|
||||
}
|
||||
}
|
||||
|
||||
// WithTestName sets a name for the test, this will be reflected
|
||||
// in the Docker container name.
|
||||
func WithTestName(testName string) Option {
|
||||
@@ -187,7 +195,7 @@ func New(
|
||||
|
||||
runOptions := &dockertest.RunOptions{
|
||||
Name: hsic.hostname,
|
||||
ExposedPorts: []string{portProto},
|
||||
ExposedPorts: append([]string{portProto}, hsic.extraPorts...),
|
||||
Networks: []*dockertest.Network{network},
|
||||
// Cmd: []string{"headscale", "serve"},
|
||||
// TODO(kradalby): Get rid of this hack, we currently need to give us some
|
||||
|
Reference in New Issue
Block a user