bpo-31904: skip some tests of changing owner in _test_all_chown_common() on VxWorks by pxinwr · Pull Request #23716 · python/cpython

Conversation

@pxinwr

On VxWorks root user id is 1 and 0 means no login user. It also allows non-root user to chown() to root. So related test on VxWorks is invalid. Skip them.

https://bugs.python.org/issue31904

vstinner

# On VxWorks root user id is 1 and 0 means no login user. It also
# allows non-root user to chown() to root.
if sys.platform != "vxworks":
if uid == 0:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would the test work if you test for "uid == 1" on VxWorks?

Something like:

root_uid = (0 if sys.platform != "vxworks" else 1)
if uid == root_uid: ...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modified accordingly.

vstinner

Co-authored-by: Victor Stinner <vstinner@python.org>

@vstinner

The updated PR is less intrusive, thanks. I merged it.

adorilson pushed a commit to adorilson/cpython that referenced this pull request

Mar 13, 2021

@pxinwr pxinwr deleted the fix-issue-31904-chown branch

May 7, 2021 07:42

Labels

tests

Tests in the Lib/test dir