-
-
Notifications
You must be signed in to change notification settings - Fork 34k
bpo-31904: Add posix module support for VxWorks RTOS #12118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
cce75ba
f548045
b41b4d0
3462991
8de1134
7354c9f
8668612
6f8e048
961f435
86091ad
5ea0755
30e9049
cf1a844
728165f
36e955f
3716550
c14d326
a508f47
201212d
da73b91
b380c49
7ada2ad
eb063a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1419,9 +1419,20 @@ def test_urandom_failure(self): | |
| import errno | ||
| import os | ||
| import resource | ||
|
|
||
| soft_limit, hard_limit = resource.getrlimit(resource.RLIMIT_NOFILE) | ||
| resource.setrlimit(resource.RLIMIT_NOFILE, (1, hard_limit)) | ||
| try: | ||
| resource.setrlimit(resource.RLIMIT_NOFILE, (1, hard_limit)) | ||
| except (ValueError,OSError): | ||
| for i in range(1, hard_limit + 1): | ||
| try: | ||
| os.open(os.devnull, os.O_RDONLY) | ||
| except OSError as e: | ||
| if e.errno == errno.EMFILE: | ||
| break | ||
| else: | ||
| continue | ||
| else: | ||
| pass | ||
| try: | ||
| os.urandom(16) | ||
| except OSError as e: | ||
|
|
@@ -1517,7 +1528,8 @@ def mock_execve(name, *args): | |
| os.execve = orig_execve | ||
| os.defpath = orig_defpath | ||
|
|
||
|
|
||
| @unittest.skipUnless(hasattr(os, 'execv'), | ||
| "No os.execv or os.execve function to test.") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: please align the string to the start of hasattr.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
| class ExecTests(unittest.TestCase): | ||
| @unittest.skipIf(USING_LINUXTHREADS, | ||
| "avoid triggering a linuxthreads bug: see issue #4970") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Improve the test_urandom_failure. | ||
| Skip the ExecTests test cases in test_os.py for VxWorks. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dislike this code. If the limit is high (ex: larger than 1024), the test can take a lot of time.
I suggest to simply skip the test on VxWorks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following your comments, skip this test on VxWorks. By default the RLIMIT_NOFILE on VxWorks is 8. But on other OS, perhaps there will be the issues you concerned.