mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-24 16:58:05 +00:00
Stuff
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
d900f48d38
commit
8ee35c9c22
@ -43,11 +43,11 @@ func (s *IntegrationCLITestSuite) SetupTest() {
|
|||||||
s.FailNow(fmt.Sprintf("Could not connect to docker: %s", err), "")
|
s.FailNow(fmt.Sprintf("Could not connect to docker: %s", err), "")
|
||||||
}
|
}
|
||||||
|
|
||||||
if pnetwork, err := s.pool.CreateNetwork("headscale-test"); err == nil {
|
network, err := GetFirstOrCreateNetwork(&s.pool, headscaleNetwork)
|
||||||
s.network = *pnetwork
|
if err != nil {
|
||||||
} else {
|
s.FailNow(fmt.Sprintf("Failed to create or get network: %s", err), "")
|
||||||
s.FailNow(fmt.Sprintf("Could not create network: %s", err), "")
|
|
||||||
}
|
}
|
||||||
|
s.network = network
|
||||||
|
|
||||||
headscaleBuildOptions := &dockertest.BuildOptions{
|
headscaleBuildOptions := &dockertest.BuildOptions{
|
||||||
Dockerfile: "Dockerfile",
|
Dockerfile: "Dockerfile",
|
||||||
@ -64,12 +64,12 @@ func (s *IntegrationCLITestSuite) SetupTest() {
|
|||||||
Mounts: []string{
|
Mounts: []string{
|
||||||
fmt.Sprintf("%s/integration_test/etc:/etc/headscale", currentPath),
|
fmt.Sprintf("%s/integration_test/etc:/etc/headscale", currentPath),
|
||||||
},
|
},
|
||||||
|
Cmd: []string{"headscale", "serve"},
|
||||||
|
Networks: []*dockertest.Network{&s.network},
|
||||||
ExposedPorts: []string{"8080/tcp"},
|
ExposedPorts: []string{"8080/tcp"},
|
||||||
PortBindings: map[docker.Port][]docker.PortBinding{
|
PortBindings: map[docker.Port][]docker.PortBinding{
|
||||||
"8080/tcp": {{HostPort: "8080"}},
|
"8080/tcp": {{HostPort: "8080"}},
|
||||||
},
|
},
|
||||||
Networks: []*dockertest.Network{&s.network},
|
|
||||||
Cmd: []string{"headscale", "serve"},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err = s.pool.RemoveContainerByName(headscaleHostname)
|
err = s.pool.RemoveContainerByName(headscaleHostname)
|
||||||
|
@ -19,6 +19,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
headscaleNetwork = "headscale-test"
|
||||||
headscaleHostname = "headscale"
|
headscaleHostname = "headscale"
|
||||||
DOCKER_EXECUTE_TIMEOUT = 10 * time.Second
|
DOCKER_EXECUTE_TIMEOUT = 10 * time.Second
|
||||||
)
|
)
|
||||||
|
@ -95,7 +95,7 @@ func (s *IntegrationDERPTestSuite) SetupSuite() {
|
|||||||
s.FailNow(fmt.Sprintf("Could not connect to docker: %s", err), "")
|
s.FailNow(fmt.Sprintf("Could not connect to docker: %s", err), "")
|
||||||
}
|
}
|
||||||
|
|
||||||
network, err := GetFirstOrCreateNetwork(&s.pool, "headscale-test")
|
network, err := GetFirstOrCreateNetwork(&s.pool, headscaleNetwork)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.FailNow(fmt.Sprintf("Failed to create or get network: %s", err), "")
|
s.FailNow(fmt.Sprintf("Failed to create or get network: %s", err), "")
|
||||||
}
|
}
|
||||||
@ -120,6 +120,7 @@ func (s *IntegrationDERPTestSuite) SetupSuite() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
headscaleOptions := &dockertest.RunOptions{
|
headscaleOptions := &dockertest.RunOptions{
|
||||||
|
|
||||||
Name: headscaleDerpHostname,
|
Name: headscaleDerpHostname,
|
||||||
Mounts: []string{
|
Mounts: []string{
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
|
@ -230,11 +230,11 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
|||||||
s.FailNow(fmt.Sprintf("Could not connect to docker: %s", err), "")
|
s.FailNow(fmt.Sprintf("Could not connect to docker: %s", err), "")
|
||||||
}
|
}
|
||||||
|
|
||||||
if pnetwork, err := s.pool.CreateNetwork("headscale-test"); err == nil {
|
network, err := GetFirstOrCreateNetwork(&s.pool, headscaleNetwork)
|
||||||
s.network = *pnetwork
|
if err != nil {
|
||||||
} else {
|
s.FailNow(fmt.Sprintf("Failed to create or get network: %s", err), "")
|
||||||
s.FailNow(fmt.Sprintf("Could not create network: %s", err), "")
|
|
||||||
}
|
}
|
||||||
|
s.network = network
|
||||||
|
|
||||||
headscaleBuildOptions := &dockertest.BuildOptions{
|
headscaleBuildOptions := &dockertest.BuildOptions{
|
||||||
Dockerfile: "Dockerfile",
|
Dockerfile: "Dockerfile",
|
||||||
|
@ -96,7 +96,7 @@ func (s *IntegrationOIDCTestSuite) SetupSuite() {
|
|||||||
s.FailNow(fmt.Sprintf("Could not connect to docker: %s", err), "")
|
s.FailNow(fmt.Sprintf("Could not connect to docker: %s", err), "")
|
||||||
}
|
}
|
||||||
|
|
||||||
network, err := GetFirstOrCreateNetwork(&s.pool, "headscale-test")
|
network, err := GetFirstOrCreateNetwork(&s.pool, headscaleNetwork)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
s.FailNow(fmt.Sprintf("Failed to create or get network: %s", err), "")
|
s.FailNow(fmt.Sprintf("Failed to create or get network: %s", err), "")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user