Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micbar committed Oct 4, 2022
1 parent cbdebd2 commit fe36433
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/storage/utils/decomposedfs/node/locks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit fe36433

Please sign in to comment.