File: test_fcntl

package info (click to toggle)
pypy3 7.3.11%2Bdfsg-2%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 201,024 kB
  • sloc: python: 1,950,308; ansic: 517,580; sh: 21,417; asm: 14,419; cpp: 4,263; makefile: 4,228; objc: 761; xml: 530; exp: 499; javascript: 314; pascal: 244; lisp: 45; csh: 11; awk: 4
file content (38 lines) | stat: -rw-r--r-- 1,382 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: Stefano Rivera <stefanor@debian.org>
Date: Thu, 24 Sep 2020 12:41:52 -0700
Subject: Tests: Ignore lease failure in fcntl tests

Fail on tmpfs on Linux 4.19. Fixed in 5.7 possibly earlier (5.3?).

Forwarded: not-needed
---
 pypy/module/fcntl/test/test_fcntl.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/pypy/module/fcntl/test/test_fcntl.py b/pypy/module/fcntl/test/test_fcntl.py
index eed6f8f..136ae9a 100644
--- a/pypy/module/fcntl/test/test_fcntl.py
+++ b/pypy/module/fcntl/test/test_fcntl.py
@@ -19,6 +19,7 @@ class AppTestFcntl:
         cls.w_tmp = cls.space.wrap(tmpprefix)
 
     def test_fcntl(self):
+        import errno
         import fcntl
         import os
         import sys
@@ -112,8 +113,12 @@ class AppTestFcntl:
 
             # test leases
             assert fcntl.fcntl(f, fcntl.F_GETLEASE) == fcntl.F_UNLCK
-            fcntl.fcntl(f, fcntl.F_SETLEASE, fcntl.F_WRLCK)
-            assert fcntl.fcntl(f, fcntl.F_GETLEASE) == fcntl.F_WRLCK
+            try:
+                fcntl.fcntl(f, fcntl.F_SETLEASE, fcntl.F_WRLCK)
+                assert fcntl.fcntl(f, fcntl.F_GETLEASE) == fcntl.F_WRLCK
+            except IOError as e:
+                if e.errno != errno.EAGAIN:
+                    raise
         else:
             # this tests should fail under BSD
             # with "Inappropriate ioctl for device"