Skip to content

Conversation

@ricardobranco777
Copy link
Contributor

@ricardobranco777 ricardobranco777 commented Dec 20, 2025

The test for issue #19800 depended on finding a system user with an octal UID. This approach was fragile because system users found on the host may have a different UID in the testing image.

Use the rootless user ID instead which is likely to be octal anyway as new user IDs start with 1000.

Related failure:
https://openqa-assets.opensuse.org/tests/5535030/file/podman-bats-user-local.tap.txt

not ok 88 [030] podman run --hostuser tests # in 1306 ms
# tags: ci:parallel
# (from function `bail-now' in file test/system/helpers.bash, line 187,
#  from function `is' in file test/system/helpers.bash, line 1112,
#  in test file test/system/030-run.bats, line 910)
#   `is "$output" "$octal_userid"' failed
# 
# [09:01:00.631245040] $ /usr/bin/podman run --rm quay.io/libpod/testimage:20241011 grep bernhard /etc/passwd
# [09:01:00.967856561] [ rc=1 (expected) ]
# 
# [09:01:00.973939665] $ /usr/bin/podman run --hostuser=bernhard --rm quay.io/libpod/testimage:20241011 grep bernhard /etc/passwd
# [09:01:01.291043165] bernhard:*:1000:1000:bernhard:/home/podman:/bin/sh
# 
# [09:01:01.301488137] $ /usr/bin/podman run --user=sshd --hostuser=sshd --rm quay.io/libpod/testimage:20241011 id -u
# [09:01:01.651440214] 22
# #/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# #|     FAIL: podman run --user=sshd --hostuser=sshd --rm quay.io/libpod/testimage:20241011 id -u
# #| expected: '476'
# #|   actual: '22'
# #\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# # [teardown]

Checklist

Ensure you have completed the following checklist for your pull request to be reviewed:

  • Certify you wrote the patch or otherwise have the right to pass it on as an open-source patch by signing all
    commits. (git commit -s). (If needed, use git commit -s --amend). The author email must match
    the sign-off email address. See CONTRIBUTING.md
    for more information.
  • Referenced issues using Fixes: #00000 in commit message (if applicable)
  • Tests have been added/updated (or no tests are needed)
  • Documentation has been updated (or no documentation changes are needed)
  • All commits pass make validatepr (format/lint checks)
  • Release note entered in the section below (or None if no user-facing changes)

Does this PR introduce a user-facing change?

None

The test for issue containers#19800 depended on finding a system user with an
octal UID. This approach was fragile because system users found on the
host may have a different UID in the testing image.

Use the rootless user ID instead which is likely to be octal anyway as
new user IDs start with 1000.

Signed-off-by: Ricardo Branco <[email protected]>
@ricardobranco777
Copy link
Contributor Author

@packit-as-a-service
Copy link

[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant