mirror of
https://github.com/juanfont/headscale.git
synced 2025-01-04 00:09:34 +01:00
Make sure mock container is removed before started
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
6b67584d47
commit
4904ccc3c3
@ -25,7 +25,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
oidcHeadscaleHostname = "headscale"
|
oidcHeadscaleHostname = "headscale-oidc"
|
||||||
|
oidcMockHostname = "headscale-mock-oidc"
|
||||||
oidcNamespaceName = "oidcnamespace"
|
oidcNamespaceName = "oidcnamespace"
|
||||||
totalOidcContainers = 3
|
totalOidcContainers = 3
|
||||||
)
|
)
|
||||||
@ -113,8 +114,7 @@ func (s *IntegrationOIDCTestSuite) SetupSuite() {
|
|||||||
|
|
||||||
s.Suite.T().Log("Setting up mock OIDC")
|
s.Suite.T().Log("Setting up mock OIDC")
|
||||||
mockOidcOptions := &dockertest.RunOptions{
|
mockOidcOptions := &dockertest.RunOptions{
|
||||||
Name: "mockoidc",
|
Name: oidcMockHostname,
|
||||||
Hostname: "mockoidc",
|
|
||||||
Cmd: []string{"headscale", "mockoidc"},
|
Cmd: []string{"headscale", "mockoidc"},
|
||||||
ExposedPorts: []string{"10000/tcp"},
|
ExposedPorts: []string{"10000/tcp"},
|
||||||
Networks: []*dockertest.Network{&s.network},
|
Networks: []*dockertest.Network{&s.network},
|
||||||
@ -133,6 +133,18 @@ func (s *IntegrationOIDCTestSuite) SetupSuite() {
|
|||||||
ContextDir: ".",
|
ContextDir: ".",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = s.pool.RemoveContainerByName(oidcMockHostname)
|
||||||
|
if err != nil {
|
||||||
|
s.FailNow(
|
||||||
|
fmt.Sprintf(
|
||||||
|
"Could not remove existing container before building test: %s",
|
||||||
|
err,
|
||||||
|
),
|
||||||
|
"",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if pmockoidc, err := s.pool.BuildAndRunWithBuildOptions(
|
if pmockoidc, err := s.pool.BuildAndRunWithBuildOptions(
|
||||||
headscaleBuildOptions,
|
headscaleBuildOptions,
|
||||||
mockOidcOptions,
|
mockOidcOptions,
|
||||||
|
Loading…
Reference in New Issue
Block a user