@@ -724,11 +724,20 @@ def check_stat(uid, gid):
724
724
chown_func (first_param , uid , - 1 )
725
725
check_stat (uid , gid )
726
726
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 :
728
734
# Try an amusingly large uid/gid to make sure we handle
729
735
# large unsigned values. (chown lets you use any
730
736
# uid/gid you like, even if they aren't defined.)
731
737
#
738
+ # On VxWorks uid_t is defined as unsigned short. A big
739
+ # value greater than 65535 will result in underflow error.
740
+ #
732
741
# This problem keeps coming up:
733
742
# http://bugs.python.org/issue1747858
734
743
# http://bugs.python.org/issue4591
@@ -738,7 +747,7 @@ def check_stat(uid, gid):
738
747
# This part of the test only runs when run as root.
739
748
# Only scary people run their tests as root.
740
749
741
- big_value = 2 ** 31
750
+ big_value = ( 2 ** 31 if sys . platform != "vxworks" else 2 ** 15 )
742
751
chown_func (first_param , big_value , big_value )
743
752
check_stat (big_value , big_value )
744
753
chown_func (first_param , - 1 , - 1 )
0 commit comments