Skip to content

Commit

Permalink
Merge pull request #23 from charmed-osm/use-confined-snap
Browse files Browse the repository at this point in the history
Use strictly confined snap
  • Loading branch information
ghislainbourgeois authored May 10, 2023
2 parents 8b65855 + b661b86 commit 27666c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ def _on_remove_default_gw_action(self, event: ActionEvent) -> None:
@staticmethod
def _install_srsran() -> None:
"""Installs srsRAN snap."""
shell("snap install srsran --edge --devmode")
shell("snap install srsran --edge")
shell("snap connect srsran:network-control")
shell("snap connect srsran:process-control")
shell("snap connect srsran:system-observe")
logger.info("Installed srsRAN snap")

@staticmethod
Expand Down
9 changes: 8 additions & 1 deletion tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ def test_given_unit_is_leader_when_on_install_then_srsran_snap_is_installed(self

self.harness.charm.on.install.emit()

patch_shell.assert_called_with("snap install srsran --edge --devmode")
patch_shell.assert_has_calls(
[
call("snap install srsran --edge"),
call("snap connect srsran:network-control"),
call("snap connect srsran:process-control"),
call("snap connect srsran:system-observe"),
]
)

@patch("charm.shell", new=Mock())
def test_given_unit_is_leader_when_install_then_status_is_maintenance(self):
Expand Down

0 comments on commit 27666c9

Please sign in to comment.