summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLihua Zhao <44661095+LihuaZhao@users.noreply.github.com>2019-04-17 15:41:33 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-04-17 15:41:33 (GMT)
commit693c104ae74feea11f0b51176dc91ecd153230c0 (patch)
treec6c288722c8748ee2c9d237b8b13c7a3e70c9f33
parent2954550818e5c23a082e6279eb326168230ebf04 (diff)
downloadcpython-693c104ae74feea11f0b51176dc91ecd153230c0.zip
cpython-693c104ae74feea11f0b51176dc91ecd153230c0.tar.gz
cpython-693c104ae74feea11f0b51176dc91ecd153230c0.tar.bz2
bpo-31904: Port test_resource to VxWorks (GH-12719)
Skip tests cases setting RLIMIT_FSIZE and RLIMIT_CPU on VxWorks.
-rw-r--r--Doc/library/resource.rst2
-rw-r--r--Lib/test/test_resource.py4
-rw-r--r--Misc/NEWS.d/next/Tests/2019-04-08-09-24-36.bpo-31904.ab03ea.rst1
3 files changed, 7 insertions, 0 deletions
diff --git a/Doc/library/resource.rst b/Doc/library/resource.rst
index 2ed15c1..3573da7 100644
--- a/Doc/library/resource.rst
+++ b/Doc/library/resource.rst
@@ -76,6 +76,8 @@ this module for those platforms.
``setrlimit`` may also raise :exc:`error` if the underlying system call
fails.
+ VxWorks only supports setting :data:`RLIMIT_NOFILE`.
+
.. function:: prlimit(pid, resource[, limits])
Combines :func:`setrlimit` and :func:`getrlimit` in one function and
diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
index 62c7963..e5ece52 100644
--- a/Lib/test/test_resource.py
+++ b/Lib/test/test_resource.py
@@ -16,6 +16,8 @@ class ResourceTest(unittest.TestCase):
self.assertRaises(TypeError, resource.setrlimit)
self.assertRaises(TypeError, resource.setrlimit, 42, 42, 42)
+ @unittest.skipIf(sys.platform == "vxworks",
+ "setting RLIMIT_FSIZE is not supported on VxWorks")
def test_fsize_ismax(self):
try:
(cur, max) = resource.getrlimit(resource.RLIMIT_FSIZE)
@@ -110,6 +112,8 @@ class ResourceTest(unittest.TestCase):
pass
# Issue 6083: Reference counting bug
+ @unittest.skipIf(sys.platform == "vxworks",
+ "setting RLIMIT_CPU is not supported on VxWorks")
def test_setrusage_refcount(self):
try:
limits = resource.getrlimit(resource.RLIMIT_CPU)
diff --git a/Misc/NEWS.d/next/Tests/2019-04-08-09-24-36.bpo-31904.ab03ea.rst b/Misc/NEWS.d/next/Tests/2019-04-08-09-24-36.bpo-31904.ab03ea.rst
new file mode 100644
index 0000000..2b36101
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2019-04-08-09-24-36.bpo-31904.ab03ea.rst
@@ -0,0 +1 @@
+Port test_resource to VxWorks: skip tests cases setting RLIMIT_FSIZE and RLIMIT_CPU.