Add support for detecting flatpaks and snaps
This commit is contained in:
parent
11351cce87
commit
eb1d096c90
10 changed files with 2033 additions and 16 deletions
|
|
@ -224,6 +224,19 @@ def test_harvest_dedup_manual_packages_and_builds_etc_custom(
|
|||
|
||||
monkeypatch.setattr(harvest, "collect_non_system_users", lambda: [])
|
||||
|
||||
import enroll.accounts as accounts
|
||||
|
||||
monkeypatch.setattr(accounts, "find_system_flatpaks", lambda: [])
|
||||
monkeypatch.setattr(accounts, "find_system_flatpak_remotes", lambda: [])
|
||||
monkeypatch.setattr(
|
||||
accounts, "find_user_flatpak_remotes", lambda home, user=None: []
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
accounts,
|
||||
"find_system_snaps",
|
||||
lambda: [accounts.SnapInstall(name="code", channel="latest/stable")],
|
||||
)
|
||||
|
||||
def fake_stat_triplet(p: str):
|
||||
if p == "/usr/local/bin/myscript":
|
||||
return ("root", "root", "0755")
|
||||
|
|
@ -259,6 +272,9 @@ def test_harvest_dedup_manual_packages_and_builds_etc_custom(
|
|||
for o in openvpn_obs
|
||||
)
|
||||
|
||||
assert st["roles"]["snap"]["role_name"] == "snap"
|
||||
assert st["roles"]["snap"]["system_snaps"][0]["name"] == "code"
|
||||
|
||||
# Service role captured modified conffile
|
||||
svc = st["roles"]["services"][0]
|
||||
assert svc["unit"] == "openvpn.service"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue