Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add e2e test case for flatpak #17207

Merged
merged 3 commits into from
Jan 15, 2025
Merged

Conversation

vsedmik
Copy link
Contributor

@vsedmik vsedmik commented Dec 19, 2024

Problem Statement

In Satellite 6.17 we are going to support full path for host setup and flatpak app installation on a content host, including REX templates to make it more user-friendly. We should have an E2E test case to cover all of that too.

Solution

This PR adds such a test case (and fixes two typos).

Related Issues

https://issues.redhat.com/browse/SAT-28557
https://issues.redhat.com/browse/SAT-4420

Requires

Katello/katello#11223 (in snap)
Katello/hammer-cli-katello#971 (in snap)
Katello/katello#11264

PRT test Cases example

trigger: test-robottelo
pytest: tests/foreman/cli/test_flatpak.py -k test_sync_consume_flatpak_repo_via_library
Katello:
    katello: 11264

@vsedmik vsedmik added No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master labels Dec 19, 2024
@vsedmik vsedmik self-assigned this Dec 19, 2024
remote_name = f'SAT-remote-{gen_string("alpha")}'
res = host.execute(
'flatpak --user remote-add --authenticator-name=org.flatpak.Authenticator.Oci '
f'{remote_name} oci+https://{sat.hostname}/pulpcore_registry/'
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the intended user flow or is this something that host registration should set up if it detects flatpak?

Copy link
Contributor Author

@vsedmik vsedmik Dec 20, 2024

Choose a reason for hiding this comment

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

@ekohl It is the current workflow as per this doc.

Anyway @sjha4 is working on a REX template to configure the host with a flatpak remote. I think the template might be leveraged by the GR, but the GR update is rather part of the M2 epic if I'm not quite mistaken.

Copy link

Choose a reason for hiding this comment

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

Global registration will need to install podman and flatpak on the client and then run the remote-add. For now, we will leave it to the admins to set it up..

@vsedmik vsedmik force-pushed the add-flatpak-client branch from e136e07 to a96198f Compare January 15, 2025 09:48
@vsedmik
Copy link
Contributor Author

vsedmik commented Jan 15, 2025

trigger: test-robottelo
pytest: tests/foreman/cli/test_flatpak.py -k test_sync_consume_flatpak_repo_via_library
Katello:
    katello: 11264

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9875
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_flatpak.py -k test_sync_consume_flatpak_repo_via_library --external-logging
Test Result : ========== 1 passed, 4 deselected, 17 warnings in 1721.87s (0:28:41) ===========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jan 15, 2025
@vsedmik vsedmik marked this pull request as ready for review January 15, 2025 10:46
@vsedmik vsedmik requested review from a team as code owners January 15, 2025 10:46
Comment on lines 244 to 246
for pkg in ['podman', 'flatpak', 'dbus-x11']:
res = host.execute(f'dnf -y install {pkg}')
assert res.status == 0, f'{pkg} installation failed: {res.stderr}'
Copy link
Member

Choose a reason for hiding this comment

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

Can this be a single DNF transaction?

Suggested change
for pkg in ['podman', 'flatpak', 'dbus-x11']:
res = host.execute(f'dnf -y install {pkg}')
assert res.status == 0, f'{pkg} installation failed: {res.stderr}'
pkgs = ['podman', 'flatpak', 'dbus-x11']
res = host.execute(f'dnf -y install {' '.join(pkgs)}')
assert res.status == 0, f'Package installation failed: {res.stderr}'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ogajduse It could be. I just wanted to keep it separate to provide more info which installation failed and why through res.stderr. But it doesn't matter so much probably, dnf should return some meaningful info anyway.

@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Jan 15, 2025
@vsedmik
Copy link
Contributor Author

vsedmik commented Jan 15, 2025

trigger: test-robottelo
pytest: tests/foreman/cli/test_flatpak.py -k test_sync_consume_flatpak_repo_via_library
Katello:
    katello: 11264

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9885
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/cli/test_flatpak.py -k test_sync_consume_flatpak_repo_via_library --external-logging
Test Result : ========== 1 passed, 4 deselected, 17 warnings in 1608.26s (0:26:48) ===========

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Jan 15, 2025
@damoore044 damoore044 merged commit 8efeaca into SatelliteQE:master Jan 15, 2025
11 checks passed
@vsedmik vsedmik deleted the add-flatpak-client branch January 16, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR Stream Introduced in or relating directly to Satellite Stream/Master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants