Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
693aa80a
Commit
693aa80a
authored
Sep 13, 2019
by
Gregory P. Smith
Committed by
T. Wouters
Sep 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-36046: Fix buildbot failures (GH-16091)
Varying user/group/permission check needs on platforms.
parent
0519d497
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
Lib/test/test_subprocess.py
Lib/test/test_subprocess.py
+17
-3
No files found.
Lib/test/test_subprocess.py
View file @
693aa80a
...
@@ -1588,6 +1588,18 @@ class RunFuncTestCase(BaseTestCase):
...
@@ -1588,6 +1588,18 @@ class RunFuncTestCase(BaseTestCase):
f"
{
stacks
}
```"
)
f"
{
stacks
}
```"
)
def
_get_test_grp_name
():
for
name_group
in
(
'staff'
,
'nogroup'
,
'grp'
):
if
grp
:
try
:
grp
.
getgrnam
(
name_group
)
except
KeyError
:
continue
return
name_group
else
:
raise
unittest
.
SkipTest
(
'No identified group name to use for this test on this platform.'
)
@
unittest
.
skipIf
(
mswindows
,
"POSIX specific tests"
)
@
unittest
.
skipIf
(
mswindows
,
"POSIX specific tests"
)
class
POSIXProcessTestCase
(
BaseTestCase
):
class
POSIXProcessTestCase
(
BaseTestCase
):
...
@@ -1762,8 +1774,10 @@ class POSIXProcessTestCase(BaseTestCase):
...
@@ -1762,8 +1774,10 @@ class POSIXProcessTestCase(BaseTestCase):
[
sys
.
executable
,
"-c"
,
[
sys
.
executable
,
"-c"
,
"import os; print(os.getuid())"
],
"import os; print(os.getuid())"
],
user
=
user
)
user
=
user
)
except
PermissionError
:
# errno.EACCES
pass
except
OSError
as
e
:
except
OSError
as
e
:
if
e
.
errno
!=
errno
.
EPERM
:
if
e
.
errno
not
in
(
errno
.
EACCES
,
errno
.
EPERM
)
:
raise
raise
else
:
else
:
if
isinstance
(
user
,
str
):
if
isinstance
(
user
,
str
):
...
@@ -1789,7 +1803,7 @@ class POSIXProcessTestCase(BaseTestCase):
...
@@ -1789,7 +1803,7 @@ class POSIXProcessTestCase(BaseTestCase):
def
test_group
(
self
):
def
test_group
(
self
):
gid
=
os
.
getegid
()
gid
=
os
.
getegid
()
group_list
=
[
65534
if
gid
!=
65534
else
65533
]
group_list
=
[
65534
if
gid
!=
65534
else
65533
]
name_group
=
"nogroup"
if
sys
.
platform
!=
'darwin'
else
"staff"
name_group
=
_get_test_grp_name
()
if
grp
is
not
None
:
if
grp
is
not
None
:
group_list
.
append
(
name_group
)
group_list
.
append
(
name_group
)
...
@@ -1830,7 +1844,7 @@ class POSIXProcessTestCase(BaseTestCase):
...
@@ -1830,7 +1844,7 @@ class POSIXProcessTestCase(BaseTestCase):
def
test_extra_groups
(
self
):
def
test_extra_groups
(
self
):
gid
=
os
.
getegid
()
gid
=
os
.
getegid
()
group_list
=
[
65534
if
gid
!=
65534
else
65533
]
group_list
=
[
65534
if
gid
!=
65534
else
65533
]
name_group
=
"nogroup"
if
sys
.
platform
!=
'darwin'
else
"staff"
name_group
=
_get_test_grp_name
()
perm_error
=
False
perm_error
=
False
if
grp
is
not
None
:
if
grp
is
not
None
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment