mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-01 14:02:51 +00:00
hostinfo: fix testing in container (#14330)
Previously this unit test failed if it was run in a container. Update the assert to focus on exactly the condition we are trying to assert: the package type should only be 'container' if we use the build tag. Updates #14317 Signed-off-by: Tom Proctor <tomhjp@users.noreply.github.com>
This commit is contained in:
parent
c2761162a0
commit
06c5e83c20
@ -35,8 +35,12 @@ remotes/origin/QTSFW_5.0.0`
|
||||
}
|
||||
}
|
||||
|
||||
func TestInContainer(t *testing.T) {
|
||||
if got := inContainer(); !got.EqualBool(false) {
|
||||
t.Errorf("inContainer = %v; want false due to absence of ts_package_container build tag", got)
|
||||
func TestPackageTypeNotContainer(t *testing.T) {
|
||||
var got string
|
||||
if packageType != nil {
|
||||
got = packageType()
|
||||
}
|
||||
if got == "container" {
|
||||
t.Fatal("packageType = container; should only happen if build tag ts_package_container is set")
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user