]> granicus.if.org Git - python/commitdiff
bpo-31904: Port test_resource to VxWorks (GH-12719)
authorLihua Zhao <44661095+LihuaZhao@users.noreply.github.com>
Wed, 17 Apr 2019 15:41:33 +0000 (23:41 +0800)
committerVictor Stinner <vstinner@redhat.com>
Wed, 17 Apr 2019 15:41:33 +0000 (17:41 +0200)
Skip tests cases setting RLIMIT_FSIZE and RLIMIT_CPU on VxWorks.

Doc/library/resource.rst
Lib/test/test_resource.py
Misc/NEWS.d/next/Tests/2019-04-08-09-24-36.bpo-31904.ab03ea.rst [new file with mode: 0644]

index 2ed15c136736689e58597e105889a49a3a08798d..3573da7ea2d71609057303dc0df3954ff27b8698 100644 (file)
@@ -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
index 62c7963fe6999f2a58529067d4d5a050655e6879..e5ece5284cf15ba9f75e5e531a09f8c6088aa8d4 100644 (file)
@@ -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 (file)
index 0000000..2b36101
--- /dev/null
@@ -0,0 +1 @@
+Port test_resource to VxWorks: skip tests cases setting RLIMIT_FSIZE and RLIMIT_CPU.