Skip to content

Commit

Permalink
test flock
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoucheng361 authored and davies committed Nov 28, 2023
1 parent a612e08 commit 52d7c7d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/meta/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,12 @@ func testLocks(t *testing.T, m Meta) {
if st := m.Flock(ctx, inode, o1, syscall.F_RDLCK, false); st != 0 {
t.Fatalf("flock rlock: %s", st)
}
if st := m.Flock(ctx, inode, 2, syscall.F_RDLCK, false); st != 0 {
t.Fatalf("flock rlock: %s", st)
}
if st := m.Flock(ctx, inode, 2, syscall.F_UNLCK, false); st != 0 {
t.Fatalf("flock unlock: %s", st)
}
if st := m.Flock(ctx, inode, o1, syscall.F_WRLCK, false); st != 0 {
t.Fatalf("flock wlock: %s", st)
}
Expand Down

0 comments on commit 52d7c7d

Please sign in to comment.