Skip to content

tests: improve cloud environment compatibility#1615

Open
ikerexxe wants to merge 7 commits intoshadow-maint:masterfrom
ikerexxe:test-fedora-ci
Open

tests: improve cloud environment compatibility#1615
ikerexxe wants to merge 7 commits intoshadow-maint:masterfrom
ikerexxe:test-fedora-ci

Conversation

@ikerexxe
Copy link
Copy Markdown
Collaborator

This PR enhances the system tests to work reliably in cloud VM environments by addressing two main compatibility issues:

  1. Mount point handling: fixed /home directory restoration when /home is a separate mount point.
  2. UID and GID consistency: addressed test failures caused by different default UID allocation between containers (starting at 1000) and cloud VMs (where 1000 is typically occupied by system users like ubuntu or ec2-user).

Fixes:

  1. Use selective /home cleanup instead of attempting to remove mounted directories.
  2. Added CI user creation (UID 1000) in all distribution containers to simulate cloud VMs.
  3. Updated test assertions across all affected test files to expect UID/GID 1001+ instead of 1000.

@ikerexxe ikerexxe marked this pull request as ready for review April 24, 2026 12:46
Copy link
Copy Markdown
Member

@hallyn hallyn left a comment

Choose a reason for hiding this comment

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

LGTM, except, as I said out of band, I think it might be more robust to have the ansible jobs which create the ci user check which uids are in use. But it's not critical, can wait for later, no objection to merging this.

…ount point

Handle cases where /home is mounted separately by using selective
cleanup instead of attempting to remove the mount point, which causes
"Device or resource busy" errors in cloud environments.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Create a 'ci' user in all distribution-specific ansible roles to
simulate cloud VM environments where ID 1000 is already taken. This
ensures that test users start the ID assignment at 1001, making
container tests consistent with cloud CI environments.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Update test assertions to expect ID 1001 instead of 1000 to match
the new container environment where a CI user occupies ID 1000.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Update test assertions to expect GID 1001 instead of 1000 to match
the new container environment where a CI user occupies ID 1000.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Update test assertions to expect ID 1001 instead of 1000 to match
the new container environment where a CI user occupies ID 1000.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Update test assertions to expect ID 1001 instead of 1000 to match
the new container environment where a CI user occupies ID 1000.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Update test assertion to expect GID 1002 instead of 1001 to match
the new container environment where a CI user occupies ID 1000.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
@ikerexxe
Copy link
Copy Markdown
Collaborator Author

LGTM, except, as I said out of band, I think it might be more robust to have the ansible jobs which create the ci user check which uids are in use. But it's not critical, can wait for later, no objection to merging this.

Updated to take this into account. Take a look when you have a moment.

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.

2 participants