aboutsummaryrefslogtreecommitdiff
path: root/filesystem/filesystem_test.go
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2020-01-29 18:46:57 -0800
committerGitHub <noreply@github.com>2020-01-29 18:46:57 -0800
commit0f06c53388f8b020e1a0d48af2f5e334c4ec2aca (patch)
tree16f75a173808cfffd4153adf488f86b440a099ca /filesystem/filesystem_test.go
parent9927ab8426e765db8de304e9f99ba5c520b5018c (diff)
parent2d7229eb2a97c845d73a65ff9dd3368056c255a6 (diff)
Merge pull request #192 from ebiggers/cleanup-on-error
Clean up policies and protectors on error
Diffstat (limited to 'filesystem/filesystem_test.go')
-rw-r--r--filesystem/filesystem_test.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go
index b85ead5..4bed96a 100644
--- a/filesystem/filesystem_test.go
+++ b/filesystem/filesystem_test.go
@@ -351,9 +351,19 @@ func TestLinkedProtector(t *testing.T) {
}
// Add the link to the second filesystem
- if err = fakeMnt.AddLinkedProtector(protector.ProtectorDescriptor, realMnt); err != nil {
+ var isNewLink bool
+ if isNewLink, err = fakeMnt.AddLinkedProtector(protector.ProtectorDescriptor, realMnt); err != nil {
t.Fatal(err)
}
+ if !isNewLink {
+ t.Fatal("Link was not new")
+ }
+ if isNewLink, err = fakeMnt.AddLinkedProtector(protector.ProtectorDescriptor, realMnt); err != nil {
+ t.Fatal(err)
+ }
+ if isNewLink {
+ t.Fatal("Link was new")
+ }
// Get the protector though the second system
_, err = fakeMnt.GetRegularProtector(protector.ProtectorDescriptor)