| 1 |
From: Stefano Rivera <[email protected]> |
| 2 |
Date: Thu, 24 Sep 2020 12:41:52 -0700 |
| 3 |
Subject: Tests: Ignore lease failure in fcntl tests |
| 4 |
|
| 5 |
Fail on tmpfs on Linux 4.19. Fixed in 5.7 possibly earlier (5.3?). |
| 6 |
|
| 7 |
Forwarded: not-needed |
| 8 |
--- |
| 9 |
pypy/module/fcntl/test/test_fcntl.py | 9 +++++++-- |
| 10 |
1 file changed, 7 insertions(+), 2 deletions(-) |
| 11 |
|
| 12 |
diff --git a/pypy/module/fcntl/test/test_fcntl.py b/pypy/module/fcntl/test/test_fcntl.py |
| 13 |
index eed6f8f..136ae9a 100644 |
| 14 |
--- a/pypy/module/fcntl/test/test_fcntl.py |
| 15 |
+++ b/pypy/module/fcntl/test/test_fcntl.py |
| 16 |
@@ -19,6 +19,7 @@ class AppTestFcntl: |
| 17 |
cls.w_tmp = cls.space.wrap(tmpprefix) |
| 18 |
|
| 19 |
def test_fcntl(self): |
| 20 |
+ import errno |
| 21 |
import fcntl |
| 22 |
import os |
| 23 |
import sys |
| 24 |
@@ -112,8 +113,12 @@ class AppTestFcntl: |
| 25 |
|
| 26 |
# test leases |
| 27 |
assert fcntl.fcntl(f, fcntl.F_GETLEASE) == fcntl.F_UNLCK |
| 28 |
- fcntl.fcntl(f, fcntl.F_SETLEASE, fcntl.F_WRLCK) |
| 29 |
- assert fcntl.fcntl(f, fcntl.F_GETLEASE) == fcntl.F_WRLCK |
| 30 |
+ try: |
| 31 |
+ fcntl.fcntl(f, fcntl.F_SETLEASE, fcntl.F_WRLCK) |
| 32 |
+ assert fcntl.fcntl(f, fcntl.F_GETLEASE) == fcntl.F_WRLCK |
| 33 |
+ except IOError as e: |
| 34 |
+ if e.errno != errno.EAGAIN: |
| 35 |
+ raise |
| 36 |
else: |
| 37 |
# this tests should fail under BSD |
| 38 |
# with "Inappropriate ioctl for device" |