Merge ~alfonsosanchezbeato/snappy-hwe-snaps/+git/network-manager:fix-netplan-write-generated into ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:snap-22

Proposed by Alfonso Sanchez-Beato
Status: Merged
Approved by: Alfonso Sanchez-Beato
Approved revision: c6b44b327bcf1fb6886ac3841133a8f9d3ca7bdc
Merged at revision: 1cddcf799cec8583ebaba6482cebec342cd3147e
Proposed branch: ~alfonsosanchezbeato/snappy-hwe-snaps/+git/network-manager:fix-netplan-write-generated
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:snap-22
Diff against target: 45 lines (+16/-6)
2 files modified
snap-patch/networkmanager/0002-netplan-make-use-of-libnetplan-for-YAML-backend.patch (+2/-2)
tests/vpn/openvpn/task.yaml (+14/-4)
Reviewer Review Type Date Requested Status
Alfonso Sanchez-Beato Approve
System Enablement Bot continuous-integration Approve
Review via email: mp+436824@code.launchpad.net

Commit message

snap-patch/netplan: do not write external or generated connections

See
https://developer-old.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMSettingsConnectionFlags

Description of the change

snap-patch/netplan: do not write external or generated connections

See
https://developer-old.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMSettingsConnectionFlags

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/snap-patch/networkmanager/0002-netplan-make-use-of-libnetplan-for-YAML-backend.patch b/snap-patch/networkmanager/0002-netplan-make-use-of-libnetplan-for-YAML-backend.patch
2index 0b94441..47d45f1 100644
3--- a/snap-patch/networkmanager/0002-netplan-make-use-of-libnetplan-for-YAML-backend.patch
4+++ b/snap-patch/networkmanager/0002-netplan-make-use-of-libnetplan-for-YAML-backend.patch
5@@ -278,8 +278,8 @@ index ad6f277ce..0af209f64 100644
6 if (existing_path && !existing_path_read_only && !nm_streq(path, existing_path))
7 unlink(existing_path);
8
9-+ /* NETPLAN: write only non-volatile files to /etc/netplan/... */
10-+ if (!is_volatile) {
11++ /* NETPLAN: write only non-temporary files to /etc/netplan/... */
12++ if (!is_volatile && !is_nm_generated && !is_external) {
13 + g_autofree gchar* ssid = g_key_file_get_string(kf_file, "wifi", "ssid", NULL);
14 + g_autofree gchar* escaped_ssid = ssid ?
15 + g_uri_escape_string(ssid, NULL, TRUE) : NULL;
16diff --git a/tests/vpn/openvpn/task.yaml b/tests/vpn/openvpn/task.yaml
17index 651b0df..5d233e4 100644
18--- a/tests/vpn/openvpn/task.yaml
19+++ b/tests/vpn/openvpn/task.yaml
20@@ -25,11 +25,21 @@ execute: |
21 # tun2 device active (0 and 1 belong to easy-openvpn-server)
22 network-manager.nmcli c show --active | grep tun2
23
24- # Ping other end of the tunnel
25- peer_ip=$(ip -4 a show dev tun1 primary | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
26- sudo sysctl net.ipv4.conf.tun1.accept_local=1
27+ # Ping other end of the tunnel. Note that
28+ # we could have connected to either tun0 or tun1.
29 sudo sysctl net.ipv4.conf.tun2.accept_local=1
30- ping -I tun2 -c 1 "$peer_ip"
31+ pingOk=no
32+ for i in {0..1}; do
33+ sudo sysctl net.ipv4.conf.tun"$i".accept_local=1
34+ peer_ip=$(ip -4 a show dev tun"$i" primary | grep -oP '(?<=inet\s)\d+(\.\d+){3}')
35+ if ping -I tun2 -c 1 "$peer_ip"; then
36+ pingOk=yes
37+ fi
38+ done
39+ if [ "$pingOk" != yes ]; then
40+ printf "Cannot ping other end of the tunnel\n"
41+ exit 1
42+ fi
43
44 network-manager.nmcli c down default
45 network-manager.nmcli c del default

Subscribers

People subscribed via source and target branches