From fe36433a8fa5f1eeaca691842bbd267fe65f265e Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Tue, 4 Oct 2022 13:34:27 +0200 Subject: [PATCH] Add unit tests --- pkg/storage/utils/decomposedfs/node/locks_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/storage/utils/decomposedfs/node/locks_test.go b/pkg/storage/utils/decomposedfs/node/locks_test.go index 8d30a6b011..9f359e84cb 100644 --- a/pkg/storage/utils/decomposedfs/node/locks_test.go +++ b/pkg/storage/utils/decomposedfs/node/locks_test.go @@ -214,6 +214,13 @@ var _ = Describe("Node locks", func() { err := n.RefreshLock(env.Ctx, newLock, "") Expect(err).ToNot(HaveOccurred()) }) + + It("refreshes the lock and unlocks with the new lock", func() { + err := n.RefreshLock(env.Ctx, newLock, lockByUser.LockId) + Expect(err).ToNot(HaveOccurred()) + err = n.Unlock(env.Ctx, newLock) + Expect(err).ToNot(HaveOccurred()) + }) }) Describe("Unlock", func() { @@ -330,6 +337,13 @@ var _ = Describe("Node locks", func() { err := n.RefreshLock(env.Ctx, newLock, "") Expect(err).ToNot(HaveOccurred()) }) + It("refreshes the lock and unlocks it with the new lock", func() { + newLock.LockId = "somethingnew" + err := n.RefreshLock(env.Ctx, newLock, lockByApp.LockId) + Expect(err).ToNot(HaveOccurred()) + err = n.Unlock(env.Ctx, newLock) + Expect(err).ToNot(HaveOccurred()) + }) }) Describe("Unlock", func() {