Merge ~morphis/snappy-hwe-snaps/+git/network-manager:feature/aliases into ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:master

Proposed by Simon Fels
Status: Merged
Approved by: Alfonso Sanchez-Beato
Approved revision: 0fcdac8f2922885735b8cb25801e27dba87bdb36
Merged at revision: 772213f40f2e53863f1d87d32ff252c03d0a8e50
Proposed branch: ~morphis/snappy-hwe-snaps/+git/network-manager:feature/aliases
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:master
Diff against target: 46 lines (+24/-0)
2 files modified
snapcraft.yaml (+11/-0)
tests/main/aliases/task.yaml (+13/-0)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Approve
Jim Hodapp (community) code Approve
Review via email: mp+314409@code.launchpad.net

Description of the change

Add alias for nmcli

This enables us to get the nmcli application coming from the snap as a first class program into the system. It will be available as /snap/bin/nmcli and as /snap/bin is high up in your $PATH it will be used over an existing nmcli coming from /usr/bin.

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jim Hodapp (jhodapp) wrote :

Just a question inline below. Very nice work experimenting with this!

review: Needs Information
Revision history for this message
Simon Fels (morphis) :
Revision history for this message
Simon Fels (morphis) wrote :

CI failed with some checksum failures of the core snap. Triggered a new run.

Revision history for this message
Jim Hodapp (jhodapp) wrote :

LGTM

review: Approve (code)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/snapcraft.yaml b/snapcraft.yaml
2index f1c9e00..06f3218 100644
3--- a/snapcraft.yaml
4+++ b/snapcraft.yaml
5@@ -21,11 +21,22 @@ apps:
6 nmcli:
7 command: usr/bin/nmcli
8 plugs: [nmcli]
9+ aliases:
10+ - nmcli
11 networkmanager:
12 command: bin/networkmanager
13 daemon: simple
14 slots: [service]
15 plugs: [modem-manager, ppp, network-setup-observe]
16+ # FIXME: This will create currently a symlink inside /snap/bin
17+ # which points nowhere as the service isn't exposed as application
18+ # for the user. Instead snapd needs to gain support to handle
19+ # aliases for services differently by adding the Alias= option
20+ # within the systemd unit file instead for example. Until this
21+ # is implemented we keep the alias disabled.
22+ #
23+ # aliases:
24+ # - NetworkManager
25
26 parts:
27 networkmanager-common:
28diff --git a/tests/main/aliases/task.yaml b/tests/main/aliases/task.yaml
29new file mode 100644
30index 0000000..e2eff9d
31--- /dev/null
32+++ b/tests/main/aliases/task.yaml
33@@ -0,0 +1,13 @@
34+summary: Verify aliases provided by the snap are correctly enabled
35+
36+execute: |
37+ # FIXME: Aliases should be not in place automatically unless we
38+ # have them approved from the store in our snap-declaration assertion.
39+ test ! -e /snap/bin/nmcli
40+
41+ snap alias network-manager nmcli
42+
43+ test -e /snap/bin/nmcli
44+
45+ # Verify the alias works without any problems
46+ /snap/bin/nmcli g

Subscribers

People subscribed via source and target branches