aboutsummaryrefslogtreecommitdiff
path: root/actions/policy_test.go
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2021-12-23 11:39:08 -0600
committerEric Biggers <ebiggers@google.com>2021-12-23 11:44:13 -0600
commit6ebd5a54eae2dfb16b66da649e75848fe6030b7f (patch)
tree35560cae2edcc7ad7206412c2df9d98b2eef6a65 /actions/policy_test.go
parent57be034ce4700fb07c10b771628c1c63d8483d09 (diff)
cmd/fscrypt: don't load protector in remove-protector-from-policy
Make remove-protector-from-policy work even if the protector cannot be loaded (for example, due to having been deleted already). Fixes https://github.com/google/fscrypt/issues/258 Fixes https://github.com/google/fscrypt/issues/272
Diffstat (limited to 'actions/policy_test.go')
-rw-r--r--actions/policy_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/actions/policy_test.go b/actions/policy_test.go
index 11c9c3e..07943b8 100644
--- a/actions/policy_test.go
+++ b/actions/policy_test.go
@@ -114,7 +114,7 @@ func TestPolicyGoodRemoveProtector(t *testing.T) {
t.Fatal(err)
}
- err = pol.RemoveProtector(pro1)
+ err = pol.RemoveProtector(pro1.Descriptor())
if err != nil {
t.Error(err)
}
@@ -135,11 +135,11 @@ func TestPolicyBadRemoveProtector(t *testing.T) {
}
defer cleanupProtector(pro2)
- if pol.RemoveProtector(pro2) == nil {
+ if pol.RemoveProtector(pro2.Descriptor()) == nil {
t.Error("we should not be able to remove a protector we did not add")
}
- if pol.RemoveProtector(pro1) == nil {
+ if pol.RemoveProtector(pro1.Descriptor()) == nil {
t.Error("we should not be able to remove all the protectors from a policy")
}
}