diff --git a/hscontrol/policy/policy_test.go b/hscontrol/policy/policy_test.go index 05129a7b..69da4274 100644 --- a/hscontrol/policy/policy_test.go +++ b/hscontrol/policy/policy_test.go @@ -1587,6 +1587,10 @@ func TestSSHPolicyRules(t *testing.T) { wantSSH *tailcfg.SSHPolicy expectErr bool errorMessage string + + // There are some tests that will not pass on V1 since we do not + // have the same kind of error handling as V2, so we skip them. + skipV1 bool }{ { name: "group-to-user", @@ -1764,6 +1768,7 @@ func TestSSHPolicyRules(t *testing.T) { }`, expectErr: true, errorMessage: "not supported", + skipV1: true, }, { name: "check-period-specified", @@ -1829,6 +1834,7 @@ func TestSSHPolicyRules(t *testing.T) { }`, expectErr: true, errorMessage: `SSH action "invalid" is not valid, must be accept or check`, + skipV1: true, }, { name: "invalid-check-period", @@ -1847,6 +1853,7 @@ func TestSSHPolicyRules(t *testing.T) { }`, expectErr: true, errorMessage: "not a valid duration string", + skipV1: true, }, { name: "multiple-ssh-users-with-autogroup", @@ -1895,6 +1902,7 @@ func TestSSHPolicyRules(t *testing.T) { }`, expectErr: true, errorMessage: "autogroup \"autogroup:invalid\" is not supported", + skipV1: true, }, } @@ -1902,6 +1910,10 @@ func TestSSHPolicyRules(t *testing.T) { for idx, pmf := range PolicyManagerFuncsForTest([]byte(tt.policy)) { version := idx + 1 t.Run(fmt.Sprintf("%s-v%d", tt.name, version), func(t *testing.T) { + if version == 1 && tt.skipV1 { + t.Skip() + } + var pm PolicyManager var err error pm, err = pmf(users, append(tt.peers, &tt.targetNode))