Skip to content

Commit 9a0dea6

Browse files
authored
bpo-31904: Skip some tests of changing owner in _test_all_chown_common() on VxWorks (GH-23716)
1 parent e1e3c2d commit 9a0dea6

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Lib/test/test_posix.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -724,11 +724,20 @@ def check_stat(uid, gid):
724724
chown_func(first_param, uid, -1)
725725
check_stat(uid, gid)
726726

727-
if uid == 0:
727+
if sys.platform == "vxworks":
728+
# On VxWorks, root user id is 1 and 0 means no login user:
729+
# both are super users.
730+
is_root = (uid in (0, 1))
731+
else:
732+
is_root = (uid == 0)
733+
if is_root:
728734
# Try an amusingly large uid/gid to make sure we handle
729735
# large unsigned values. (chown lets you use any
730736
# uid/gid you like, even if they aren't defined.)
731737
#
738+
# On VxWorks uid_t is defined as unsigned short. A big
739+
# value greater than 65535 will result in underflow error.
740+
#
732741
# This problem keeps coming up:
733742
# http://bugs.python.org/issue1747858
734743
# http://bugs.python.org/issue4591
@@ -738,7 +747,7 @@ def check_stat(uid, gid):
738747
# This part of the test only runs when run as root.
739748
# Only scary people run their tests as root.
740749

741-
big_value = 2**31
750+
big_value = (2**31 if sys.platform != "vxworks" else 2**15)
742751
chown_func(first_param, big_value, big_value)
743752
check_stat(big_value, big_value)
744753
chown_func(first_param, -1, -1)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Skip some tests in _test_all_chown_common() on VxWorks.

0 commit comments

Comments
 (0)