tstest/integration: add --accept-risk=all to tailscale down

The test would fail if I was running it over SSH.

Signed-off-by: Maisem Ali <maisem@tailscale.com>
pull/6436/head
Maisem Ali 2 years ago committed by Brad Fitzpatrick
parent 0480a925c1
commit 41dd49391f

@ -18,6 +18,7 @@ import (
var ( var (
riskTypes []string riskTypes []string
riskLoseSSH = registerRiskType("lose-ssh") riskLoseSSH = registerRiskType("lose-ssh")
riskAll = registerRiskType("all")
) )
func registerRiskType(riskType string) string { func registerRiskType(riskType string) string {
@ -35,7 +36,7 @@ func registerAcceptRiskFlag(f *flag.FlagSet, acceptedRisks *string) {
// risks in acceptedRisks. // risks in acceptedRisks.
func isRiskAccepted(riskType, acceptedRisks string) bool { func isRiskAccepted(riskType, acceptedRisks string) bool {
for _, r := range strings.Split(acceptedRisks, ",") { for _, r := range strings.Split(acceptedRisks, ",") {
if r == riskType { if r == riskType || r == riskAll {
return true return true
} }
} }

@ -846,7 +846,7 @@ func (n *testNode) MustUp(extraArgs ...string) {
func (n *testNode) MustDown() { func (n *testNode) MustDown() {
t := n.env.t t := n.env.t
t.Logf("Running down ...") t.Logf("Running down ...")
if err := n.Tailscale("down").Run(); err != nil { if err := n.Tailscale("down", "--accept-risk=all").Run(); err != nil {
t.Fatalf("down: %v", err) t.Fatalf("down: %v", err)
} }
} }

Loading…
Cancel
Save