Fix variable for container name
This commit is contained in:
parent
c0846978ed
commit
a2d1b88b80
|
@ -19,6 +19,10 @@ import (
|
|||
"github.com/stretchr/testify/suite"
|
||||
)
|
||||
|
||||
const (
|
||||
headscaleCLIContainerName = "headscale-cli"
|
||||
)
|
||||
|
||||
type IntegrationCLITestSuite struct {
|
||||
suite.Suite
|
||||
stats *suite.SuiteInformation
|
||||
|
@ -65,7 +69,7 @@ func (s *IntegrationCLITestSuite) SetupTest() {
|
|||
}
|
||||
|
||||
headscaleOptions := &dockertest.RunOptions{
|
||||
Name: "headscale-cli",
|
||||
Name: headscaleCLIContainerName,
|
||||
Mounts: []string{
|
||||
fmt.Sprintf("%s/integration_test/etc:/etc/headscale", currentPath),
|
||||
},
|
||||
|
@ -74,9 +78,15 @@ func (s *IntegrationCLITestSuite) SetupTest() {
|
|||
Platform: platform,
|
||||
}
|
||||
|
||||
err = s.pool.RemoveContainerByName(headscaleHostname)
|
||||
err = s.pool.RemoveContainerByName(headscaleCLIContainerName)
|
||||
if err != nil {
|
||||
s.FailNow(fmt.Sprintf("Could not remove existing container before building test: %s", err), "")
|
||||
s.FailNow(
|
||||
fmt.Sprintf(
|
||||
"Could not remove existing container before building test: %s",
|
||||
err,
|
||||
),
|
||||
"",
|
||||
)
|
||||
}
|
||||
|
||||
fmt.Println("Creating headscale container")
|
||||
|
|
|
@ -29,7 +29,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
headscaleHostname = "headscale-derp"
|
||||
headscaleDerpContainerName = "headscale-derp"
|
||||
namespaceName = "derpnamespace"
|
||||
totalContainers = 3
|
||||
)
|
||||
|
@ -119,7 +119,7 @@ func (s *IntegrationDERPTestSuite) SetupSuite() {
|
|||
}
|
||||
|
||||
headscaleOptions := &dockertest.RunOptions{
|
||||
Name: headscaleHostname,
|
||||
Name: headscaleDerpContainerName,
|
||||
Mounts: []string{
|
||||
fmt.Sprintf(
|
||||
"%s/integration_test/etc_embedded_derp:/etc/headscale",
|
||||
|
@ -135,9 +135,15 @@ func (s *IntegrationDERPTestSuite) SetupSuite() {
|
|||
Platform: platform,
|
||||
}
|
||||
|
||||
err = s.pool.RemoveContainerByName(headscaleHostname)
|
||||
err = s.pool.RemoveContainerByName(headscaleDerpContainerName)
|
||||
if err != nil {
|
||||
s.FailNow(fmt.Sprintf("Could not remove existing container before building test: %s", err), "")
|
||||
s.FailNow(
|
||||
fmt.Sprintf(
|
||||
"Could not remove existing container before building test: %s",
|
||||
err,
|
||||
),
|
||||
"",
|
||||
)
|
||||
}
|
||||
|
||||
log.Println("Creating headscale container")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//go:build integration
|
||||
s/go:build integration
|
||||
// +build integration
|
||||
|
||||
package headscale
|
||||
|
@ -30,6 +30,10 @@ import (
|
|||
"tailscale.com/ipn/ipnstate"
|
||||
)
|
||||
|
||||
const (
|
||||
headscaleContainerName = "headscale"
|
||||
)
|
||||
|
||||
type IntegrationTestSuite struct {
|
||||
suite.Suite
|
||||
stats *suite.SuiteInformation
|
||||
|
@ -252,7 +256,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
|||
Platform: platform,
|
||||
}
|
||||
|
||||
err = s.pool.RemoveContainerByName(headscaleHostname)
|
||||
err = s.pool.RemoveContainerByName(headscaleContainerName)
|
||||
if err != nil {
|
||||
s.FailNow(fmt.Sprintf("Could not remove existing container before building test: %s", err), "")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue