From 14b94e6adfde579bbb96e8c9d4932324374abb9b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sat, 20 Apr 2019 21:04:18 +0200 Subject: [PATCH 01/18] shared: add "nm-libnm-core-aux/nm-libnm-core-aux.h" --- Makefile.am | 2 ++ libnm-core/meson.build | 3 ++- shared/nm-libnm-core-aux/nm-libnm-core-aux.c | 23 +++++++++++++++++++ shared/nm-libnm-core-aux/nm-libnm-core-aux.h | 24 ++++++++++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 shared/nm-libnm-core-aux/nm-libnm-core-aux.c create mode 100644 shared/nm-libnm-core-aux/nm-libnm-core-aux.h diff --git a/Makefile.am b/Makefile.am index 21359e5d6e..b950f8fafa 100644 --- a/Makefile.am +++ b/Makefile.am @@ -449,6 +449,8 @@ shared_nm_libnm_core_aux_libnm_libnm_core_aux_la_CPPFLAGS = \ shared_nm_libnm_core_aux_libnm_libnm_core_aux_la_SOURCES = \ shared/nm-libnm-core-aux/nm-dispatcher-api.h \ + shared/nm-libnm-core-aux/nm-libnm-core-aux.c \ + shared/nm-libnm-core-aux/nm-libnm-core-aux.h \ $(NULL) shared_nm_libnm_core_aux_libnm_libnm_core_aux_la_LDFLAGS = \ diff --git a/libnm-core/meson.build b/libnm-core/meson.build index bc2d087a15..25ed019831 100644 --- a/libnm-core/meson.build +++ b/libnm-core/meson.build @@ -256,7 +256,7 @@ libnm_core_dep = declare_dependency( shared_nm_libnm_core_aux = static_library( 'nm-libnm-core-aux', - sources: files('../shared/nm-libnm-core-aux/nm-dispatcher-api.h'), + sources: files('../shared/nm-libnm-core-aux/nm-libnm-core-aux.c'), c_args: [ '-DG_LOG_DOMAIN="@0@"'.format(libnm_name), '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_WITH_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_LIB)', @@ -270,6 +270,7 @@ shared_nm_libnm_core_aux = static_library( glib_dep, shared_c_siphash_dep, shared_nm_glib_aux_dep, + libnm_core_dep, ], ) diff --git a/shared/nm-libnm-core-aux/nm-libnm-core-aux.c b/shared/nm-libnm-core-aux/nm-libnm-core-aux.c new file mode 100644 index 0000000000..b312ef42b9 --- /dev/null +++ b/shared/nm-libnm-core-aux/nm-libnm-core-aux.c @@ -0,0 +1,23 @@ +/* NetworkManager -- Network link manager + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2019 Red Hat, Inc. + */ + +#include "nm-default.h" + +#include "nm-libnm-core-aux.h" diff --git a/shared/nm-libnm-core-aux/nm-libnm-core-aux.h b/shared/nm-libnm-core-aux/nm-libnm-core-aux.h new file mode 100644 index 0000000000..5fc8f69b4c --- /dev/null +++ b/shared/nm-libnm-core-aux/nm-libnm-core-aux.h @@ -0,0 +1,24 @@ +/* NetworkManager -- Network link manager + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * (C) Copyright 2019 Red Hat, Inc. + */ + +#ifndef __NM_LIBNM_CORE_AUX_H__ +#define __NM_LIBNM_CORE_AUX_H__ + +#endif /* __NM_LIBNM_CORE_AUX_H__ */ From db9fbcee6c7c1f88c31dcf95242f0200f4d425ed Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 19 Apr 2019 09:38:45 +0200 Subject: [PATCH 02/18] cli,shared: move NMTeamLinkWatcher to/from string function to "nm-libnm-core-aux.h" to/from string functions are useful. We should be able to reuse them. Move them to their own location. Also, it moves independent code out of "clients/common/nm-meta-setting-desc.c" which is already one of the largest source files we have. Also, it makes the code unit-testable, which is obviously required as the code has bugs. --- clients/common/nm-meta-setting-desc.c | 158 +------------------ shared/nm-libnm-core-aux/nm-libnm-core-aux.c | 155 ++++++++++++++++++ shared/nm-libnm-core-aux/nm-libnm-core-aux.h | 7 + 3 files changed, 166 insertions(+), 154 deletions(-) diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 698ded869e..68226eca12 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -28,6 +28,7 @@ #include "nm-glib-aux/nm-enum-utils.h" #include "nm-glib-aux/nm-secret-utils.h" #include "nm-libnm-core-intern/nm-libnm-core-utils.h" +#include "nm-libnm-core-aux/nm-libnm-core-aux.h" #include "nm-vpn-helpers.h" #include "nm-client-utils.h" @@ -432,158 +433,7 @@ _parse_ip_route (int family, return route; } -static char * -_dump_team_link_watcher (NMTeamLinkWatcher *watcher) -{ - const char *name; - NMTeamLinkWatcherArpPingFlags flags; - GString *w_dump; - - if (!watcher) - return NULL; - - w_dump = g_string_new (NULL); - name = nm_team_link_watcher_get_name (watcher); - g_string_append_printf (w_dump, "name=%s", name); - -#define DUMP_WATCHER_INT(str, watcher, name, key) \ - G_STMT_START { \ - int _val = nm_team_link_watcher_get_##key (watcher); \ - \ - if (_val) \ - g_string_append_printf (str, " %s=%d", name, _val); \ - } G_STMT_END; - - if (nm_streq (name, NM_TEAM_LINK_WATCHER_ETHTOOL)) { - DUMP_WATCHER_INT (w_dump, watcher, "delay-up", delay_up); - DUMP_WATCHER_INT (w_dump, watcher, "delay-down", delay_down); - return g_string_free (w_dump, FALSE); - } - /* NM_TEAM_LINK_WATCHER_NSNA_PING and NM_TEAM_LINK_WATCHER_ARP_PING */ - DUMP_WATCHER_INT (w_dump, watcher, "init-wait", init_wait); - DUMP_WATCHER_INT (w_dump, watcher, "interval", interval); - DUMP_WATCHER_INT (w_dump, watcher, "missed-max", missed_max); - g_string_append_printf (w_dump, " target-host=%s", - nm_team_link_watcher_get_target_host (watcher)); - - if (nm_streq (name, NM_TEAM_LINK_WATCHER_NSNA_PING)) - return g_string_free (w_dump, FALSE); - - DUMP_WATCHER_INT (w_dump, watcher, "vlanid", vlanid); -#undef DUMP_WATCHER_INT - g_string_append_printf (w_dump, " source-host=%s", - nm_team_link_watcher_get_source_host (watcher)); - flags = nm_team_link_watcher_get_flags (watcher); - if (flags & NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_ACTIVE) - g_string_append_printf (w_dump, " validate-active=true"); - if (flags & NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_INACTIVE) - g_string_append_printf (w_dump, " validate-inactive=true"); - if (flags & NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_SEND_ALWAYS) - g_string_append_printf (w_dump, "send-always=true"); - - return g_string_free (w_dump, FALSE); -} - -static NMTeamLinkWatcher * -_parse_team_link_watcher (const char *str, - GError **error) -{ - gs_free const char **watcherv = NULL; - gs_free char *str_clean_free = NULL; - const char *str_clean; - guint i; - gs_free const char *name = NULL; - int val1 = 0, val2 = 0, val3 = 3, val4 = -1; - gs_free const char *target_host = NULL; - gs_free const char *source_host = NULL; - NMTeamLinkWatcherArpPingFlags flags = 0; - - nm_assert (str); - nm_assert (!error || !*error); - - str_clean = nm_strstrip_avoid_copy_a (300, str, &str_clean_free); - watcherv = nm_utils_strsplit_set (str_clean, " \t"); - if (!watcherv) { - g_set_error (error, 1, 0, "'%s' is not valid", str); - return NULL; - } - - for (i = 0; watcherv[i]; i++) { - gs_free const char **pair = NULL; - - pair = nm_utils_strsplit_set (watcherv[i], "="); - if (!pair) { - g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], - "properties should be specified as 'key=value'"); - return NULL; - } - if (!pair[1]) { - g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], - "missing key value"); - return NULL; - } - if (pair[2]) { - g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], - "properties should be specified as 'key=value'"); - return NULL; - } - - if (nm_streq (pair[0], "name")) - name = g_strdup (pair[1]); - else if ( nm_streq (pair[0], "delay-up") - || nm_streq (pair[0], "init-wait")) - val1 = _nm_utils_ascii_str_to_int64 (pair[1], 10, 0, G_MAXINT32, -1); - else if ( nm_streq (pair[0], "delay-down") - || nm_streq (pair[0], "interval")) - val2 = _nm_utils_ascii_str_to_int64 (pair[1], 10, 0, G_MAXINT32, -1); - else if (nm_streq (pair[0], "missed-max")) - val3 = _nm_utils_ascii_str_to_int64 (pair[1], 10, 0, G_MAXINT32, -1); - else if (nm_streq (pair[0], "vlanid")) - val4 = _nm_utils_ascii_str_to_int64 (pair[1], 10, -1, 4094, -2); - else if (nm_streq (pair[0], "target-host")) - target_host = g_strdup (pair[1]); - else if (nm_streq (pair[0], "source-host")) - source_host = g_strdup (pair[1]); - else if (nm_streq (pair[0], "validate-active")) { - if (nm_streq (pair[1], "true")) - flags |= NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_ACTIVE; - } else if (nm_streq (pair[0], "validate-inactive")) { - if (nm_streq (pair[1], "true")) - flags |= NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_INACTIVE; - } else if (nm_streq (pair[0], "send-always")) { - if (nm_streq (pair[1], "true")) - flags |= NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_SEND_ALWAYS; - } else { - g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], - "unknown key"); - return NULL; - } - - if ((val1 < 0) || (val2 < 0) || (val3 < 0)) { - g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], - "value is not a valid number [0, MAXINT]"); - return NULL; - } - if (val4 < -1) { - g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], - "value is not a valid number [-1, 4094]"); - return NULL; - } - } - - if (nm_streq0 (name, NM_TEAM_LINK_WATCHER_ETHTOOL)) - return nm_team_link_watcher_new_ethtool (val1, val2, error); - else if (nm_streq0 (name, NM_TEAM_LINK_WATCHER_NSNA_PING)) - return nm_team_link_watcher_new_nsna_ping (val1, val2, val3, target_host, error); - else if (nm_streq0 (name, NM_TEAM_LINK_WATCHER_ARP_PING)) - return nm_team_link_watcher_new_arp_ping2 (val1, val2, val3, val4, target_host, source_host, flags, error); - - if (!name) - g_set_error (error, 1, 0, "link watcher name missing"); - else - g_set_error (error, 1, 0, "unknown link watcher name: '%s'", name); - return NULL; -} +/*****************************************************************************/ /* Max priority values from libnm-core/nm-setting-vlan.c */ #define MAX_SKB_PRIO G_MAXUINT32 @@ -3779,7 +3629,7 @@ _objlist_obj_to_str_fcn_team_link_watchers (NMMetaAccessorGetType get_type, else watcher = nm_setting_team_port_get_link_watcher (NM_SETTING_TEAM_PORT (setting), idx); - s = _dump_team_link_watcher (watcher); + s = nm_utils_team_link_watcher_to_string (watcher); if (s) g_string_append (str, s); } @@ -3792,7 +3642,7 @@ _objlist_set_fcn_team_link_watchers (NMSetting *setting, { nm_auto_unref_team_link_watcher NMTeamLinkWatcher *watcher = NULL; - watcher = _parse_team_link_watcher (value, error); + watcher = nm_utils_team_link_watcher_from_string (value, error); if (!watcher) return FALSE; if (NM_IS_SETTING_TEAM (setting)) { diff --git a/shared/nm-libnm-core-aux/nm-libnm-core-aux.c b/shared/nm-libnm-core-aux/nm-libnm-core-aux.c index b312ef42b9..bc9775b36b 100644 --- a/shared/nm-libnm-core-aux/nm-libnm-core-aux.c +++ b/shared/nm-libnm-core-aux/nm-libnm-core-aux.c @@ -21,3 +21,158 @@ #include "nm-default.h" #include "nm-libnm-core-aux.h" + +/*****************************************************************************/ + +char * +nm_utils_team_link_watcher_to_string (NMTeamLinkWatcher *watcher) +{ + const char *name; + NMTeamLinkWatcherArpPingFlags flags; + GString *w_dump; + + if (!watcher) + return NULL; + + w_dump = g_string_new (NULL); + name = nm_team_link_watcher_get_name (watcher); + g_string_append_printf (w_dump, "name=%s", name); + +#define DUMP_WATCHER_INT(str, watcher, name, key) \ + G_STMT_START { \ + int _val = nm_team_link_watcher_get_##key (watcher); \ + \ + if (_val) \ + g_string_append_printf (str, " %s=%d", name, _val); \ + } G_STMT_END; + + if (nm_streq (name, NM_TEAM_LINK_WATCHER_ETHTOOL)) { + DUMP_WATCHER_INT (w_dump, watcher, "delay-up", delay_up); + DUMP_WATCHER_INT (w_dump, watcher, "delay-down", delay_down); + return g_string_free (w_dump, FALSE); + } + /* NM_TEAM_LINK_WATCHER_NSNA_PING and NM_TEAM_LINK_WATCHER_ARP_PING */ + DUMP_WATCHER_INT (w_dump, watcher, "init-wait", init_wait); + DUMP_WATCHER_INT (w_dump, watcher, "interval", interval); + DUMP_WATCHER_INT (w_dump, watcher, "missed-max", missed_max); + g_string_append_printf (w_dump, " target-host=%s", + nm_team_link_watcher_get_target_host (watcher)); + + if (nm_streq (name, NM_TEAM_LINK_WATCHER_NSNA_PING)) + return g_string_free (w_dump, FALSE); + + DUMP_WATCHER_INT (w_dump, watcher, "vlanid", vlanid); +#undef DUMP_WATCHER_INT + g_string_append_printf (w_dump, " source-host=%s", + nm_team_link_watcher_get_source_host (watcher)); + flags = nm_team_link_watcher_get_flags (watcher); + if (flags & NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_ACTIVE) + g_string_append_printf (w_dump, " validate-active=true"); + if (flags & NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_INACTIVE) + g_string_append_printf (w_dump, " validate-inactive=true"); + if (flags & NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_SEND_ALWAYS) + g_string_append_printf (w_dump, "send-always=true"); + + return g_string_free (w_dump, FALSE); +} + +NMTeamLinkWatcher * +nm_utils_team_link_watcher_from_string (const char *str, + GError **error) +{ + gs_free const char **watcherv = NULL; + gs_free char *str_clean_free = NULL; + const char *str_clean; + guint i; + gs_free const char *name = NULL; + int val1 = 0, val2 = 0, val3 = 3, val4 = -1; + gs_free const char *target_host = NULL; + gs_free const char *source_host = NULL; + NMTeamLinkWatcherArpPingFlags flags = 0; + + nm_assert (str); + nm_assert (!error || !*error); + + str_clean = nm_strstrip_avoid_copy_a (300, str, &str_clean_free); + watcherv = nm_utils_strsplit_set (str_clean, " \t"); + if (!watcherv) { + g_set_error (error, 1, 0, "'%s' is not valid", str); + return NULL; + } + + for (i = 0; watcherv[i]; i++) { + gs_free const char **pair = NULL; + + pair = nm_utils_strsplit_set (watcherv[i], "="); + if (!pair) { + g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], + "properties should be specified as 'key=value'"); + return NULL; + } + if (!pair[1]) { + g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], + "missing key value"); + return NULL; + } + if (pair[2]) { + g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], + "properties should be specified as 'key=value'"); + return NULL; + } + + if (nm_streq (pair[0], "name")) + name = g_strdup (pair[1]); + else if ( nm_streq (pair[0], "delay-up") + || nm_streq (pair[0], "init-wait")) + val1 = _nm_utils_ascii_str_to_int64 (pair[1], 10, 0, G_MAXINT32, -1); + else if ( nm_streq (pair[0], "delay-down") + || nm_streq (pair[0], "interval")) + val2 = _nm_utils_ascii_str_to_int64 (pair[1], 10, 0, G_MAXINT32, -1); + else if (nm_streq (pair[0], "missed-max")) + val3 = _nm_utils_ascii_str_to_int64 (pair[1], 10, 0, G_MAXINT32, -1); + else if (nm_streq (pair[0], "vlanid")) + val4 = _nm_utils_ascii_str_to_int64 (pair[1], 10, -1, 4094, -2); + else if (nm_streq (pair[0], "target-host")) + target_host = g_strdup (pair[1]); + else if (nm_streq (pair[0], "source-host")) + source_host = g_strdup (pair[1]); + else if (nm_streq (pair[0], "validate-active")) { + if (nm_streq (pair[1], "true")) + flags |= NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_ACTIVE; + } else if (nm_streq (pair[0], "validate-inactive")) { + if (nm_streq (pair[1], "true")) + flags |= NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_INACTIVE; + } else if (nm_streq (pair[0], "send-always")) { + if (nm_streq (pair[1], "true")) + flags |= NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_SEND_ALWAYS; + } else { + g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], + "unknown key"); + return NULL; + } + + if ((val1 < 0) || (val2 < 0) || (val3 < 0)) { + g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], + "value is not a valid number [0, MAXINT]"); + return NULL; + } + if (val4 < -1) { + g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], + "value is not a valid number [-1, 4094]"); + return NULL; + } + } + + if (nm_streq0 (name, NM_TEAM_LINK_WATCHER_ETHTOOL)) + return nm_team_link_watcher_new_ethtool (val1, val2, error); + else if (nm_streq0 (name, NM_TEAM_LINK_WATCHER_NSNA_PING)) + return nm_team_link_watcher_new_nsna_ping (val1, val2, val3, target_host, error); + else if (nm_streq0 (name, NM_TEAM_LINK_WATCHER_ARP_PING)) + return nm_team_link_watcher_new_arp_ping2 (val1, val2, val3, val4, target_host, source_host, flags, error); + + if (!name) + g_set_error (error, 1, 0, "link watcher name missing"); + else + g_set_error (error, 1, 0, "unknown link watcher name: '%s'", name); + return NULL; +} diff --git a/shared/nm-libnm-core-aux/nm-libnm-core-aux.h b/shared/nm-libnm-core-aux/nm-libnm-core-aux.h index 5fc8f69b4c..a2b4cf85c9 100644 --- a/shared/nm-libnm-core-aux/nm-libnm-core-aux.h +++ b/shared/nm-libnm-core-aux/nm-libnm-core-aux.h @@ -21,4 +21,11 @@ #ifndef __NM_LIBNM_CORE_AUX_H__ #define __NM_LIBNM_CORE_AUX_H__ +#include "nm-setting-team.h" + +char *nm_utils_team_link_watcher_to_string (NMTeamLinkWatcher *watcher); + +NMTeamLinkWatcher *nm_utils_team_link_watcher_from_string (const char *str, + GError **error); + #endif /* __NM_LIBNM_CORE_AUX_H__ */ From 911f2dfe5658b09b6b55b2ffba060272c694922a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 21 Apr 2019 11:17:27 +0200 Subject: [PATCH 03/18] shared: fix missing space printing "send-always" flag of NMTeamLinkWatcher --- shared/nm-libnm-core-aux/nm-libnm-core-aux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/nm-libnm-core-aux/nm-libnm-core-aux.c b/shared/nm-libnm-core-aux/nm-libnm-core-aux.c index bc9775b36b..8b443ec204 100644 --- a/shared/nm-libnm-core-aux/nm-libnm-core-aux.c +++ b/shared/nm-libnm-core-aux/nm-libnm-core-aux.c @@ -71,7 +71,7 @@ nm_utils_team_link_watcher_to_string (NMTeamLinkWatcher *watcher) if (flags & NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_INACTIVE) g_string_append_printf (w_dump, " validate-inactive=true"); if (flags & NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_SEND_ALWAYS) - g_string_append_printf (w_dump, "send-always=true"); + g_string_append_printf (w_dump, " send-always=true"); return g_string_free (w_dump, FALSE); } From 7a25f67af79c1732e3b450e4e274630327832e09 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 21 Apr 2019 10:11:16 +0200 Subject: [PATCH 04/18] shared/tests: add tests for libnm-core-aux These tests cannot (easily) be under "shared/nm-libnm-core-aux/tests" because libnm/libnm-core requires code under shared while "nm-libnm-core-aux" requires libnm/libnm-core. With autotools that is not problem, but with meson we include sub directories in a particular order and there is no way to foward declare stuff (AFAIK). To avoid the circular dependency, add the tests to "clients/common/tests", which is always built last. --- .gitignore | 8 ++-- Makefile.am | 36 +++++++++++++++++ clients/common/tests/meson.build | 43 +++++++++++++++------ clients/common/tests/test-libnm-core-aux.c | 35 +++++++++++++++++ shared/meson.build | 25 ++++++------ shared/nm-utils/tests/test-shared-general.c | 1 - 6 files changed, 120 insertions(+), 28 deletions(-) create mode 100644 clients/common/tests/test-libnm-core-aux.c diff --git a/.gitignore b/.gitignore index bb3f82b514..5b752e7b1a 100644 --- a/.gitignore +++ b/.gitignore @@ -63,9 +63,11 @@ test-*.trs /clients/cli/nmcli /clients/common/settings-docs.h +/clients/common/tests/test-general +/clients/common/tests/test-libnm-core-aux +/clients/nm-online /clients/tui/newt/libnmt-newt.a /clients/tui/nmtui -/clients/nm-online /data/NetworkManager.service /data/NetworkManager-wait-online.service @@ -146,8 +148,8 @@ test-*.trs /examples/C/qt/list-connections /examples/C/qt/change-ipv4-addresses -/shared/nm-version-macros.h /shared/nm-utils/tests/test-shared-general +/shared/nm-version-macros.h /introspection/org.freedesktop.NetworkManager*.[ch] @@ -278,8 +280,6 @@ test-*.trs /src/tests/test-utils /src/tests/test-wired-defname -/clients/common/tests/test-general - /vapi/*.vapi # The following names are no longer present on this branch, diff --git a/Makefile.am b/Makefile.am index b950f8fafa..1bba093e25 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4103,6 +4103,8 @@ clients_common_tests_test_general_LDADD = \ $(clients_common_tests_test_general_OBJECTS): $(libnm_core_lib_h_pub_mkenums) +############################################################################### + EXTRA_DIST += \ clients/common/tests/wg-test0.conf \ clients/common/tests/wg-test1.conf \ @@ -4110,6 +4112,40 @@ EXTRA_DIST += \ clients/common/tests/wg-test3.conf \ $(NULL) +############################################################################### + +check_programs += clients/common/tests/test-libnm-core-aux + +clients_common_tests_test_libnm_core_aux_CPPFLAGS = \ + $(dflt_cppflags) \ + -I$(builddir)/shared \ + -I$(srcdir)/shared \ + -I$(builddir)/libnm-core \ + -I$(srcdir)/libnm-core \ + -I$(builddir)/libnm \ + -I$(srcdir)/libnm \ + -DNETWORKMANAGER_COMPILATION_TEST \ + -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \ + $(CODE_COVERAGE_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(SANITIZER_LIB_CFLAGS) \ + $(NULL) + +clients_common_tests_test_libnm_core_aux_LDFLAGS = \ + $(CODE_COVERAGE_LDFLAGS) \ + $(SANITIZER_EXEC_LDFLAGS) \ + $(NULL) + +clients_common_tests_test_libnm_core_aux_LDADD = \ + shared/nm-libnm-core-aux/libnm-libnm-core-aux.la \ + libnm/libnm.la \ + shared/nm-glib-aux/libnm-glib-aux.la \ + $(GLIB_LIBS) \ + $(NULL) + +$(clients_common_tests_test_libnm_core_aux_OBJECTS): $(libnm_core_lib_h_pub_mkenums) +$(clients_common_tests_test_libnm_core_aux_OBJECTS): $(libnm_lib_h_pub_mkenums) + ############################################################################### # clients/cli ############################################################################### diff --git a/clients/common/tests/meson.build b/clients/common/tests/meson.build index 3eb32a4726..88996f3a3c 100644 --- a/clients/common/tests/meson.build +++ b/clients/common/tests/meson.build @@ -1,23 +1,42 @@ -test_unit = 'test-general' - -deps = [ - libnm_dep, - libnmc_dep, - libnmc_base_dep, - libnm_core_dep, -] exe = executable( - 'clients-' + test_unit, - test_unit + '.c', - dependencies: deps, + 'clients-test-general', + 'test-general.c', + dependencies: [ + libnm_dep, + libnmc_dep, + libnmc_base_dep, + libnm_core_dep, + ], c_args: clients_cflags + [ '-DNETWORKMANAGER_COMPILATION_TEST', ], ) test( - 'clients/' + test_unit, + 'clients/common/tests/test-general', test_script, args: test_args + [exe.full_path()], ) + +############################################################################### + +exe = executable( + 'test-libnm-core-aux', + [ 'test-libnm-core-aux.c', ], + c_args: [ + '-DNETWORKMANAGER_COMPILATION_TEST', + '-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT', + ], + dependencies: [ + libnm_dep, + shared_nm_libnm_core_aux_dep, + shared_nm_libnm_core_intern_dep, + ], +) + +test( + 'clients/common/tests/test-libnm-core-aux', + test_script, + args: test_args + [exe.full_path()] +) diff --git a/clients/common/tests/test-libnm-core-aux.c b/clients/common/tests/test-libnm-core-aux.c new file mode 100644 index 0000000000..cc016a5a8a --- /dev/null +++ b/clients/common/tests/test-libnm-core-aux.c @@ -0,0 +1,35 @@ +/* + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + * Copyright 2019 Red Hat, Inc. + */ + +#include "nm-default.h" + +#include "nm-libnm-core-aux/nm-libnm-core-aux.h" + +#include "nm-utils/nm-test-utils.h" + +/*****************************************************************************/ + +NMTST_DEFINE (); + +int main (int argc, char **argv) +{ + nmtst_init (&argc, &argv, TRUE); + + return g_test_run (); +} diff --git a/shared/meson.build b/shared/meson.build index 380758f00f..ba4c28c3fd 100644 --- a/shared/meson.build +++ b/shared/meson.build @@ -287,18 +287,21 @@ libnm_systemd_shared_no_logging_dep = declare_dependency( ############################################################################### -test_shared_general = executable( - 'nm-utils/tests/test-shared-general', - [ 'nm-utils/tests/test-shared-general.c', ], - c_args: [ - '-DNETWORKMANAGER_COMPILATION_TEST', - '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)', +exe = executable( + 'nm-utils/tests/test-shared-general', + [ 'nm-utils/tests/test-shared-general.c' ], + c_args: [ + '-DNETWORKMANAGER_COMPILATION_TEST', + '-DNETWORKMANAGER_COMPILATION=(NM_NETWORKMANAGER_COMPILATION_GLIB|NM_NETWORKMANAGER_COMPILATION_WITH_GLIB_I18N_PROG)', + ], + dependencies: [ + shared_nm_glib_aux_dep, + shared_c_siphash_dep, ], - dependencies: shared_nm_glib_aux_dep, - link_with: shared_c_siphash, ) + test( - 'shared/nm-utils/test-shared-general', - test_script, - args: test_args + [test_shared_general.full_path()] + 'shared/nm-utils/tests/test-shared-general', + test_script, + args: test_args + [exe.full_path()] ) diff --git a/shared/nm-utils/tests/test-shared-general.c b/shared/nm-utils/tests/test-shared-general.c index 83cffd7f3d..ddf1ef7823 100644 --- a/shared/nm-utils/tests/test-shared-general.c +++ b/shared/nm-utils/tests/test-shared-general.c @@ -461,4 +461,3 @@ int main (int argc, char **argv) return g_test_run (); } - From 2aa81edeaf6a5cfb6925604de7a68315f5815962 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 21 Apr 2019 10:28:53 +0200 Subject: [PATCH 05/18] shared/tests: add test for NMTeamLinkWatcher to/from string --- clients/common/tests/test-libnm-core-aux.c | 220 +++++++++++++++++++++ 1 file changed, 220 insertions(+) diff --git a/clients/common/tests/test-libnm-core-aux.c b/clients/common/tests/test-libnm-core-aux.c index cc016a5a8a..e773300bf9 100644 --- a/clients/common/tests/test-libnm-core-aux.c +++ b/clients/common/tests/test-libnm-core-aux.c @@ -20,16 +20,236 @@ #include "nm-default.h" #include "nm-libnm-core-aux/nm-libnm-core-aux.h" +#include "nm-libnm-core-intern/nm-libnm-core-utils.h" #include "nm-utils/nm-test-utils.h" /*****************************************************************************/ +static NMTeamLinkWatcher * +_team_link_watcher_from_string_impl (const char *str, gsize nextra, const char *const*vextra) +{ + NMTeamLinkWatcher *watcher; + gs_free char *str1_free = NULL; + gs_free_error GError *error = NULL; + gsize i; + + g_assert (str); + + watcher = nm_utils_team_link_watcher_from_string (str, &error); + nmtst_assert_success (watcher, error); + + for (i = 0; i < 1 + nextra; i++) { + nm_auto_unref_team_link_watcher NMTeamLinkWatcher *watcher1 = NULL; + const char *str1; + + if (i == 0) { + str1_free = nm_utils_team_link_watcher_to_string (watcher); + g_assert (str1_free); + str1 = str1_free; + g_assert_cmpstr (str, ==, str1); + } else + str1 = vextra[i - 1]; + + watcher1 = nm_utils_team_link_watcher_from_string (str1, &error); + nmtst_assert_success (watcher1, error); + if (!nm_team_link_watcher_equal (watcher, watcher1)) { + gs_free char *ss1 = NULL; + gs_free char *ss2 = NULL; + + g_print (">>> watcher differs: \"%s\" vs. \"%s\"", + (ss1 = nm_utils_team_link_watcher_to_string (watcher)), + (ss2 = nm_utils_team_link_watcher_to_string (watcher1))); + g_print (">>> ORIG: \"%s\" vs. \"%s\"", str, str1); + g_assert_not_reached (); + } + g_assert (nm_team_link_watcher_equal (watcher1, watcher)); + } + + return watcher; +} +#define _team_link_watcher_from_string(str, ...) \ + _team_link_watcher_from_string_impl ((str), NM_NARG (__VA_ARGS__), NM_MAKE_STRV (__VA_ARGS__)) + +/*****************************************************************************/ + +static void +test_team_link_watcher_tofro_string (void) +{ + nm_auto_unref_team_link_watcher NMTeamLinkWatcher *w = NULL; + +#define _team_link_watcher_cmp(watcher, \ + name, \ + delay_down, \ + delay_up, \ + init_wait, \ + interval, \ + missed_max, \ + target_host, \ + source_host, \ + vlanid, \ + arping_flags) \ + G_STMT_START { \ + nm_auto_unref_team_link_watcher NMTeamLinkWatcher *_w = g_steal_pointer (watcher); \ + \ + g_assert_cmpstr ((name), ==, nm_team_link_watcher_get_name (_w)); \ + g_assert_cmpint ((delay_down), ==, nm_team_link_watcher_get_delay_down (_w)); \ + g_assert_cmpint ((delay_up), ==, nm_team_link_watcher_get_delay_up (_w)); \ + g_assert_cmpint ((init_wait), ==, nm_team_link_watcher_get_init_wait (_w)); \ + g_assert_cmpint ((interval), ==, nm_team_link_watcher_get_interval (_w)); \ + g_assert_cmpint ((missed_max), ==, nm_team_link_watcher_get_missed_max (_w)); \ + g_assert_cmpstr ((target_host), ==, nm_team_link_watcher_get_target_host (_w)); \ + g_assert_cmpstr ((source_host), ==, nm_team_link_watcher_get_source_host (_w)); \ + g_assert_cmpint ((vlanid), ==, nm_team_link_watcher_get_vlanid (_w)); \ + g_assert_cmpint ((arping_flags), ==, nm_team_link_watcher_get_flags (_w)); \ + } G_STMT_END + + w = _team_link_watcher_from_string ("name=ethtool", + "delay-up=0 name=ethtool", + "delay-down=0 name=ethtool source-host=x", + " delay-down=0 name=ethtool "); + _team_link_watcher_cmp (&w, + "ethtool", + 0, + 0, + -1, + -1, + -1, + NULL, + NULL, + -1, + NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE); + + w = _team_link_watcher_from_string ("name=ethtool delay-up=10", + " delay-down=0 delay-up=10 name=ethtool"); + _team_link_watcher_cmp (&w, + "ethtool", + 0, + 10, + -1, + -1, + -1, + NULL, + NULL, + -1, + NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE); + + w = _team_link_watcher_from_string ("name=ethtool delay-up=10 delay-down=11", + " delay-down=11 delay-up=10 name=ethtool"); + _team_link_watcher_cmp (&w, + "ethtool", + 11, + 10, + -1, + -1, + -1, + NULL, + NULL, + -1, + NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE); + + w = _team_link_watcher_from_string ("name=nsna_ping missed-max=3 target-host=xxx", + "name=nsna_ping target-host=xxx", + "target-host=x1 target-host=xxx name=nsna_ping", + " missed-max=3 target-host=xxx name=nsna_ping "); + _team_link_watcher_cmp (&w, + "nsna_ping", + -1, + -1, + 0, + 0, + 3, + "xxx", + NULL, + -1, + NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE); + + w = _team_link_watcher_from_string ("name=arp_ping missed-max=3 target-host=xxx vlanid=-1 source-host=yzd", + "source-host=yzd name=arp_ping target-host=xxx", + "source-host=yz source-host=yzd target-host=x1 target-host=xxx name=arp_ping", + " source-host=yzd target-host=xxx name=arp_ping "); + _team_link_watcher_cmp (&w, + "arp_ping", + -1, + -1, + 0, + 0, + 3, + "xxx", + "yzd", + -1, + NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE); + + w = _team_link_watcher_from_string ("name=arp_ping missed-max=1 target-host=xxx vlanid=-1 source-host=yzd"); + _team_link_watcher_cmp (&w, + "arp_ping", + -1, + -1, + 0, + 0, + 1, + "xxx", + "yzd", + -1, + NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE); + + w = _team_link_watcher_from_string ("name=arp_ping missed-max=3 target-host=xxx vlanid=-1 source-host=yzd validate-active=true", + "source-host=yzd send-always=false name=arp_ping validate-active=true validate-inactive=false target-host=xxx", + "source-host=yz validate-active=true source-host=yzd target-host=x1 target-host=xxx name=arp_ping", + " source-host=yzd target-host=xxx validate-active=true name=arp_ping "); + _team_link_watcher_cmp (&w, + "arp_ping", + -1, + -1, + 0, + 0, + 3, + "xxx", + "yzd", + -1, + NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_ACTIVE); + + w = _team_link_watcher_from_string ("name=arp_ping missed-max=3 target-host=xxx vlanid=-1 source-host=yzd validate-active=true validate-inactive=true send-always=true", + "source-host=yzd send-always=true name=arp_ping validate-active=true validate-inactive=true target-host=xxx", + "source-host=yz validate-active=true source-host=yzd target-host=x1 target-host=xxx name=arp_ping send-always=true validate-inactive=true", + " source-host=yzd target-host=xxx validate-inactive=true send-always=true validate-active=true name=arp_ping "); + _team_link_watcher_cmp (&w, + "arp_ping", + -1, + -1, + 0, + 0, + 3, + "xxx", + "yzd", + -1, + NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_ACTIVE + | NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_INACTIVE + | NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_SEND_ALWAYS); + + w = _team_link_watcher_from_string ("name=arp_ping missed-max=1 target-host=xxx vlanid=1 source-host=yzd"); + _team_link_watcher_cmp (&w, + "arp_ping", + -1, + -1, + 0, + 0, + 1, + "xxx", + "yzd", + 1, + NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE); +} + +/*****************************************************************************/ + NMTST_DEFINE (); int main (int argc, char **argv) { nmtst_init (&argc, &argv, TRUE); + g_test_add_func ("/libnm-core-aux/test_team_link_watcher_tofro_string", test_team_link_watcher_tofro_string); + return g_test_run (); } From 2800574221711c702d22fcfbba55230e82c96c34 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 21 Apr 2019 11:50:18 +0200 Subject: [PATCH 06/18] shared: fix to/from string of vlanid and missed-max values for NMTeamLinkWatcher The vlanid and missed-max values have non-zero default values. That is what nm_utils_team_link_watcher_from_string() honors. Note that nm_utils_team_link_watcher_to_string() must omit printing the value only if it's the default value too. Otherwise, these values are not preserved during a to string conversion and back. Maybe a better fix would be to always print the values, regardless of the default value. But arguably, that is quite ugly because in most cases we don't want to cluter the string output with values that are left at the default. --- clients/common/tests/test-libnm-core-aux.c | 24 ++++++++++---------- shared/nm-libnm-core-aux/nm-libnm-core-aux.c | 9 ++++++-- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/clients/common/tests/test-libnm-core-aux.c b/clients/common/tests/test-libnm-core-aux.c index e773300bf9..e5679bc43c 100644 --- a/clients/common/tests/test-libnm-core-aux.c +++ b/clients/common/tests/test-libnm-core-aux.c @@ -148,7 +148,7 @@ test_team_link_watcher_tofro_string (void) -1, NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE); - w = _team_link_watcher_from_string ("name=nsna_ping missed-max=3 target-host=xxx", + w = _team_link_watcher_from_string ("name=nsna_ping target-host=xxx", "name=nsna_ping target-host=xxx", "target-host=x1 target-host=xxx name=nsna_ping", " missed-max=3 target-host=xxx name=nsna_ping "); @@ -164,8 +164,8 @@ test_team_link_watcher_tofro_string (void) -1, NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE); - w = _team_link_watcher_from_string ("name=arp_ping missed-max=3 target-host=xxx vlanid=-1 source-host=yzd", - "source-host=yzd name=arp_ping target-host=xxx", + w = _team_link_watcher_from_string ("name=arp_ping target-host=xxx source-host=yzd", + "source-host=yzd name=arp_ping vlanid=-1 target-host=xxx", "source-host=yz source-host=yzd target-host=x1 target-host=xxx name=arp_ping", " source-host=yzd target-host=xxx name=arp_ping "); _team_link_watcher_cmp (&w, @@ -180,23 +180,23 @@ test_team_link_watcher_tofro_string (void) -1, NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE); - w = _team_link_watcher_from_string ("name=arp_ping missed-max=1 target-host=xxx vlanid=-1 source-host=yzd"); + w = _team_link_watcher_from_string ("name=arp_ping missed-max=0 target-host=xxx vlanid=0 source-host=yzd"); _team_link_watcher_cmp (&w, "arp_ping", -1, -1, 0, 0, - 1, + 0, "xxx", "yzd", - -1, + 0, NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE); - w = _team_link_watcher_from_string ("name=arp_ping missed-max=3 target-host=xxx vlanid=-1 source-host=yzd validate-active=true", + w = _team_link_watcher_from_string ("name=arp_ping target-host=xxx source-host=yzd validate-active=true", "source-host=yzd send-always=false name=arp_ping validate-active=true validate-inactive=false target-host=xxx", "source-host=yz validate-active=true source-host=yzd target-host=x1 target-host=xxx name=arp_ping", - " source-host=yzd target-host=xxx validate-active=true name=arp_ping "); + " source-host=yzd target-host=xxx vlanid=-1 validate-active=true name=arp_ping "); _team_link_watcher_cmp (&w, "arp_ping", -1, @@ -209,7 +209,7 @@ test_team_link_watcher_tofro_string (void) -1, NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_ACTIVE); - w = _team_link_watcher_from_string ("name=arp_ping missed-max=3 target-host=xxx vlanid=-1 source-host=yzd validate-active=true validate-inactive=true send-always=true", + w = _team_link_watcher_from_string ("name=arp_ping target-host=xxx source-host=yzd validate-active=true validate-inactive=true send-always=true", "source-host=yzd send-always=true name=arp_ping validate-active=true validate-inactive=true target-host=xxx", "source-host=yz validate-active=true source-host=yzd target-host=x1 target-host=xxx name=arp_ping send-always=true validate-inactive=true", " source-host=yzd target-host=xxx validate-inactive=true send-always=true validate-active=true name=arp_ping "); @@ -227,17 +227,17 @@ test_team_link_watcher_tofro_string (void) | NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_INACTIVE | NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_SEND_ALWAYS); - w = _team_link_watcher_from_string ("name=arp_ping missed-max=1 target-host=xxx vlanid=1 source-host=yzd"); + w = _team_link_watcher_from_string ("name=arp_ping missed-max=0 target-host=xxx vlanid=0 source-host=yzd"); _team_link_watcher_cmp (&w, "arp_ping", -1, -1, 0, 0, - 1, + 0, "xxx", "yzd", - 1, + 0, NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE); } diff --git a/shared/nm-libnm-core-aux/nm-libnm-core-aux.c b/shared/nm-libnm-core-aux/nm-libnm-core-aux.c index 8b443ec204..72f12ddccc 100644 --- a/shared/nm-libnm-core-aux/nm-libnm-core-aux.c +++ b/shared/nm-libnm-core-aux/nm-libnm-core-aux.c @@ -54,14 +54,19 @@ nm_utils_team_link_watcher_to_string (NMTeamLinkWatcher *watcher) /* NM_TEAM_LINK_WATCHER_NSNA_PING and NM_TEAM_LINK_WATCHER_ARP_PING */ DUMP_WATCHER_INT (w_dump, watcher, "init-wait", init_wait); DUMP_WATCHER_INT (w_dump, watcher, "interval", interval); - DUMP_WATCHER_INT (w_dump, watcher, "missed-max", missed_max); + + if (nm_team_link_watcher_get_missed_max (watcher) != 3) + g_string_append_printf (w_dump, " %s=%d", "missed-max", nm_team_link_watcher_get_missed_max (watcher)); + g_string_append_printf (w_dump, " target-host=%s", nm_team_link_watcher_get_target_host (watcher)); if (nm_streq (name, NM_TEAM_LINK_WATCHER_NSNA_PING)) return g_string_free (w_dump, FALSE); - DUMP_WATCHER_INT (w_dump, watcher, "vlanid", vlanid); + if (nm_team_link_watcher_get_vlanid (watcher) != -1) + g_string_append_printf (w_dump, " %s=%d", "vlanid", nm_team_link_watcher_get_vlanid (watcher)); + #undef DUMP_WATCHER_INT g_string_append_printf (w_dump, " source-host=%s", nm_team_link_watcher_get_source_host (watcher)); From a473ab431af463dcd75e0f029272253280f477ae Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 21 Apr 2019 11:15:59 +0200 Subject: [PATCH 07/18] cli: refactor team-link-watcher to/from strings Stricter parsing of the string: - reject attributes that don't make sense depending on the type. - reject duplicate attributes. --- clients/common/tests/test-libnm-core-aux.c | 9 +- po/POTFILES.in | 1 + shared/nm-libnm-core-aux/nm-libnm-core-aux.c | 419 ++++++++++++++----- shared/nm-libnm-core-aux/nm-libnm-core-aux.h | 23 + 4 files changed, 330 insertions(+), 122 deletions(-) diff --git a/clients/common/tests/test-libnm-core-aux.c b/clients/common/tests/test-libnm-core-aux.c index e5679bc43c..609a688c6e 100644 --- a/clients/common/tests/test-libnm-core-aux.c +++ b/clients/common/tests/test-libnm-core-aux.c @@ -106,7 +106,6 @@ test_team_link_watcher_tofro_string (void) w = _team_link_watcher_from_string ("name=ethtool", "delay-up=0 name=ethtool", - "delay-down=0 name=ethtool source-host=x", " delay-down=0 name=ethtool "); _team_link_watcher_cmp (&w, "ethtool", @@ -150,7 +149,6 @@ test_team_link_watcher_tofro_string (void) w = _team_link_watcher_from_string ("name=nsna_ping target-host=xxx", "name=nsna_ping target-host=xxx", - "target-host=x1 target-host=xxx name=nsna_ping", " missed-max=3 target-host=xxx name=nsna_ping "); _team_link_watcher_cmp (&w, "nsna_ping", @@ -165,8 +163,6 @@ test_team_link_watcher_tofro_string (void) NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE); w = _team_link_watcher_from_string ("name=arp_ping target-host=xxx source-host=yzd", - "source-host=yzd name=arp_ping vlanid=-1 target-host=xxx", - "source-host=yz source-host=yzd target-host=x1 target-host=xxx name=arp_ping", " source-host=yzd target-host=xxx name=arp_ping "); _team_link_watcher_cmp (&w, "arp_ping", @@ -195,8 +191,7 @@ test_team_link_watcher_tofro_string (void) w = _team_link_watcher_from_string ("name=arp_ping target-host=xxx source-host=yzd validate-active=true", "source-host=yzd send-always=false name=arp_ping validate-active=true validate-inactive=false target-host=xxx", - "source-host=yz validate-active=true source-host=yzd target-host=x1 target-host=xxx name=arp_ping", - " source-host=yzd target-host=xxx vlanid=-1 validate-active=true name=arp_ping "); + " source-host=yzd target-host=xxx validate-active=true name=arp_ping "); _team_link_watcher_cmp (&w, "arp_ping", -1, @@ -211,7 +206,7 @@ test_team_link_watcher_tofro_string (void) w = _team_link_watcher_from_string ("name=arp_ping target-host=xxx source-host=yzd validate-active=true validate-inactive=true send-always=true", "source-host=yzd send-always=true name=arp_ping validate-active=true validate-inactive=true target-host=xxx", - "source-host=yz validate-active=true source-host=yzd target-host=x1 target-host=xxx name=arp_ping send-always=true validate-inactive=true", + "source-host=yzd send-always=true name=arp_ping validate-active=1 validate-inactive=yes target-host=xxx", " source-host=yzd target-host=xxx validate-inactive=true send-always=true validate-active=true name=arp_ping "); _team_link_watcher_cmp (&w, "arp_ping", diff --git a/po/POTFILES.in b/po/POTFILES.in index dcce693109..fdae23ee3f 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -138,6 +138,7 @@ libnm/nm-vpn-plugin-old.c libnm/nm-vpn-service-plugin.c data/org.freedesktop.NetworkManager.policy.in.in shared/nm-glib-aux/nm-shared-utils.c +shared/nm-libnm-core-aux/nm-libnm-core-aux.c src/NetworkManagerUtils.c src/main.c src/main-utils.c diff --git a/shared/nm-libnm-core-aux/nm-libnm-core-aux.c b/shared/nm-libnm-core-aux/nm-libnm-core-aux.c index 72f12ddccc..7ddf326ac1 100644 --- a/shared/nm-libnm-core-aux/nm-libnm-core-aux.c +++ b/shared/nm-libnm-core-aux/nm-libnm-core-aux.c @@ -22,162 +22,351 @@ #include "nm-libnm-core-aux.h" +#include "nm-libnm-core-intern/nm-libnm-core-utils.h" + /*****************************************************************************/ +typedef enum { + KEY_TYPE_STRING, + KEY_TYPE_INT, + KEY_TYPE_BOOL, +} KeyType; + +typedef struct { + const char *str_val; + union { + int vint; + bool vbool; + } typ_val; +} ParseData; + +typedef struct { + const char *name; + NMTeamLinkWatcherType watcher_type; + KeyType key_type; + union { + int (*fint) (NMTeamLinkWatcher *watcher); + gboolean (*fbool) (NMTeamLinkWatcher *watcher); + const char *(*fstring) (NMTeamLinkWatcher *watcher); + } get_fcn; + union { + int vint; + bool vbool; + } def_val; +} TeamLinkWatcherKeyInfo; + +static gboolean +_team_link_watcher_validate_active (NMTeamLinkWatcher *watcher) +{ + return NM_FLAGS_HAS (nm_team_link_watcher_get_flags (watcher), NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_ACTIVE); +} + +static gboolean +_team_link_watcher_validate_inactive (NMTeamLinkWatcher *watcher) +{ + return NM_FLAGS_HAS (nm_team_link_watcher_get_flags (watcher), NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_INACTIVE); +} + +static gboolean +_team_link_watcher_send_always (NMTeamLinkWatcher *watcher) +{ + return NM_FLAGS_HAS (nm_team_link_watcher_get_flags (watcher), NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_SEND_ALWAYS); +} + +static const TeamLinkWatcherKeyInfo _team_link_watcher_key_infos[_NM_TEAM_LINK_WATCHER_KEY_NUM] = { + +#define _KEY_INFO(key_id, _name, _watcher_type, _key_type, ...) \ + [key_id] = { .name = ""_name"", .watcher_type = (_watcher_type), .key_type = _key_type, ##__VA_ARGS__ } + + _KEY_INFO (NM_TEAM_LINK_WATCHER_KEY_NAME, "name", NM_TEAM_LINK_WATCHER_TYPE_ETHTOOL | NM_TEAM_LINK_WATCHER_TYPE_NSNAPING | NM_TEAM_LINK_WATCHER_TYPE_ARPING, KEY_TYPE_STRING, .get_fcn.fstring = nm_team_link_watcher_get_name, ), + _KEY_INFO (NM_TEAM_LINK_WATCHER_KEY_DELAY_UP, "delay-up", NM_TEAM_LINK_WATCHER_TYPE_ETHTOOL, KEY_TYPE_INT, .get_fcn.fint = nm_team_link_watcher_get_delay_up, ), + _KEY_INFO (NM_TEAM_LINK_WATCHER_KEY_DELAY_DOWN, "delay-down", NM_TEAM_LINK_WATCHER_TYPE_ETHTOOL, KEY_TYPE_INT, .get_fcn.fint = nm_team_link_watcher_get_delay_down, ), + _KEY_INFO (NM_TEAM_LINK_WATCHER_KEY_INIT_WAIT, "init-wait", NM_TEAM_LINK_WATCHER_TYPE_NSNAPING | NM_TEAM_LINK_WATCHER_TYPE_ARPING, KEY_TYPE_INT, .get_fcn.fint = nm_team_link_watcher_get_init_wait, ), + _KEY_INFO (NM_TEAM_LINK_WATCHER_KEY_INTERVAL, "interval", NM_TEAM_LINK_WATCHER_TYPE_NSNAPING | NM_TEAM_LINK_WATCHER_TYPE_ARPING, KEY_TYPE_INT, .get_fcn.fint = nm_team_link_watcher_get_interval, ), + _KEY_INFO (NM_TEAM_LINK_WATCHER_KEY_MISSED_MAX, "missed-max", NM_TEAM_LINK_WATCHER_TYPE_NSNAPING | NM_TEAM_LINK_WATCHER_TYPE_ARPING, KEY_TYPE_INT, .get_fcn.fint = nm_team_link_watcher_get_missed_max, .def_val.vint = 3, ), + _KEY_INFO (NM_TEAM_LINK_WATCHER_KEY_TARGET_HOST, "target-host", NM_TEAM_LINK_WATCHER_TYPE_NSNAPING | NM_TEAM_LINK_WATCHER_TYPE_ARPING, KEY_TYPE_STRING, .get_fcn.fstring = nm_team_link_watcher_get_target_host, ), + _KEY_INFO (NM_TEAM_LINK_WATCHER_KEY_VLANID, "vlanid", NM_TEAM_LINK_WATCHER_TYPE_ARPING, KEY_TYPE_INT, .get_fcn.fint = nm_team_link_watcher_get_vlanid, .def_val.vint = -1, ), + _KEY_INFO (NM_TEAM_LINK_WATCHER_KEY_SOURCE_HOST, "source-host", NM_TEAM_LINK_WATCHER_TYPE_ARPING, KEY_TYPE_STRING, .get_fcn.fstring = nm_team_link_watcher_get_source_host, ), + _KEY_INFO (NM_TEAM_LINK_WATCHER_KEY_VALIDATE_ACTIVE, "validate-active", NM_TEAM_LINK_WATCHER_TYPE_ARPING, KEY_TYPE_BOOL, .get_fcn.fbool = _team_link_watcher_validate_active, ), + _KEY_INFO (NM_TEAM_LINK_WATCHER_KEY_VALIDATE_INACTIVE, "validate-inactive", NM_TEAM_LINK_WATCHER_TYPE_ARPING, KEY_TYPE_BOOL, .get_fcn.fbool = _team_link_watcher_validate_inactive, ), + _KEY_INFO (NM_TEAM_LINK_WATCHER_KEY_SEND_ALWAYS, "send-always", NM_TEAM_LINK_WATCHER_TYPE_ARPING, KEY_TYPE_BOOL, .get_fcn.fbool = _team_link_watcher_send_always, ), + +}; + +static NMTeamLinkWatcherType +_team_link_watcher_get_watcher_type_from_name (const char *name) +{ + if (name) { + if (nm_streq (name, NM_TEAM_LINK_WATCHER_ETHTOOL)) + return NM_TEAM_LINK_WATCHER_TYPE_ETHTOOL; + if (nm_streq (name, NM_TEAM_LINK_WATCHER_NSNA_PING)) + return NM_TEAM_LINK_WATCHER_TYPE_NSNAPING; + if (nm_streq (name, NM_TEAM_LINK_WATCHER_ARP_PING)) + return NM_TEAM_LINK_WATCHER_TYPE_ARPING; + } + return NM_TEAM_LINK_WATCHER_TYPE_NONE; +} + +static const char * +_parse_data_get_str (const ParseData parse_data[static _NM_TEAM_LINK_WATCHER_KEY_NUM], + NMTeamLinkWatcherKeyId key_id) +{ + nm_assert (_NM_INT_NOT_NEGATIVE (key_id) && key_id < _NM_TEAM_LINK_WATCHER_KEY_NUM); + nm_assert (_team_link_watcher_key_infos[key_id].key_type == KEY_TYPE_STRING); + + return parse_data[key_id].str_val; +} + +static int +_parse_data_get_int (const ParseData parse_data[static _NM_TEAM_LINK_WATCHER_KEY_NUM], + NMTeamLinkWatcherKeyId key_id) +{ + nm_assert (_NM_INT_NOT_NEGATIVE (key_id) && key_id < _NM_TEAM_LINK_WATCHER_KEY_NUM); + nm_assert (_team_link_watcher_key_infos[key_id].key_type == KEY_TYPE_INT); + + if (parse_data[key_id].str_val) + return parse_data[key_id].typ_val.vint; + return _team_link_watcher_key_infos[key_id].def_val.vint; +} + +static int +_parse_data_get_bool (const ParseData parse_data[static _NM_TEAM_LINK_WATCHER_KEY_NUM], + NMTeamLinkWatcherKeyId key_id) +{ + nm_assert (_NM_INT_NOT_NEGATIVE (key_id) && key_id < _NM_TEAM_LINK_WATCHER_KEY_NUM); + nm_assert (_team_link_watcher_key_infos[key_id].key_type == KEY_TYPE_BOOL); + + if (parse_data[key_id].str_val) + return parse_data[key_id].typ_val.vbool; + return _team_link_watcher_key_infos[key_id].def_val.vbool; +} + char * nm_utils_team_link_watcher_to_string (NMTeamLinkWatcher *watcher) { + nm_auto_free_gstring GString *str = NULL; const char *name; - NMTeamLinkWatcherArpPingFlags flags; - GString *w_dump; + NMTeamLinkWatcherType watcher_type; + NMTeamLinkWatcherKeyId key_id; if (!watcher) return NULL; - w_dump = g_string_new (NULL); + str = g_string_new (NULL); + name = nm_team_link_watcher_get_name (watcher); - g_string_append_printf (w_dump, "name=%s", name); + g_string_append_printf (str, "name=%s", name ?: ""); -#define DUMP_WATCHER_INT(str, watcher, name, key) \ - G_STMT_START { \ - int _val = nm_team_link_watcher_get_##key (watcher); \ - \ - if (_val) \ - g_string_append_printf (str, " %s=%d", name, _val); \ - } G_STMT_END; + watcher_type = _team_link_watcher_get_watcher_type_from_name (name); - if (nm_streq (name, NM_TEAM_LINK_WATCHER_ETHTOOL)) { - DUMP_WATCHER_INT (w_dump, watcher, "delay-up", delay_up); - DUMP_WATCHER_INT (w_dump, watcher, "delay-down", delay_down); - return g_string_free (w_dump, FALSE); + for (key_id = 0; key_id < _NM_TEAM_LINK_WATCHER_KEY_NUM; key_id++) { + const TeamLinkWatcherKeyInfo *info = &_team_link_watcher_key_infos[key_id]; + const char *vstr; + int vint; + bool vbool; + + nm_assert (info->name && info->name && NM_STRCHAR_ALL (info->name, ch,((ch >= 'a' && ch <= 'z') || NM_IN_SET (ch, '-')))); + nm_assert (NM_IN_SET (info->key_type, KEY_TYPE_STRING, + KEY_TYPE_INT, + KEY_TYPE_BOOL)); + + if (key_id == NM_TEAM_LINK_WATCHER_KEY_NAME) + continue; + + if (!NM_FLAGS_ALL (info->watcher_type, watcher_type)) + continue; + + switch (info->key_type) { + case KEY_TYPE_STRING: + vstr = info->get_fcn.fstring (watcher); + if (vstr) { + g_string_append_printf (nm_gstring_add_space_delimiter (str), + "%s=%s", info->name, vstr); + } + break; + case KEY_TYPE_INT: + vint = info->get_fcn.fint (watcher); + if (vint != info->def_val.vint) { + g_string_append_printf (nm_gstring_add_space_delimiter (str), + "%s=%d", info->name, vint); + } + break; + case KEY_TYPE_BOOL: + vbool = info->get_fcn.fbool (watcher); + if (vbool != info->def_val.vbool) { + g_string_append_printf (nm_gstring_add_space_delimiter (str), + "%s=%s", info->name, vbool ? "true" : "false"); + } + break; + } } - /* NM_TEAM_LINK_WATCHER_NSNA_PING and NM_TEAM_LINK_WATCHER_ARP_PING */ - DUMP_WATCHER_INT (w_dump, watcher, "init-wait", init_wait); - DUMP_WATCHER_INT (w_dump, watcher, "interval", interval); - if (nm_team_link_watcher_get_missed_max (watcher) != 3) - g_string_append_printf (w_dump, " %s=%d", "missed-max", nm_team_link_watcher_get_missed_max (watcher)); - - g_string_append_printf (w_dump, " target-host=%s", - nm_team_link_watcher_get_target_host (watcher)); - - if (nm_streq (name, NM_TEAM_LINK_WATCHER_NSNA_PING)) - return g_string_free (w_dump, FALSE); - - if (nm_team_link_watcher_get_vlanid (watcher) != -1) - g_string_append_printf (w_dump, " %s=%d", "vlanid", nm_team_link_watcher_get_vlanid (watcher)); - -#undef DUMP_WATCHER_INT - g_string_append_printf (w_dump, " source-host=%s", - nm_team_link_watcher_get_source_host (watcher)); - flags = nm_team_link_watcher_get_flags (watcher); - if (flags & NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_ACTIVE) - g_string_append_printf (w_dump, " validate-active=true"); - if (flags & NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_INACTIVE) - g_string_append_printf (w_dump, " validate-inactive=true"); - if (flags & NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_SEND_ALWAYS) - g_string_append_printf (w_dump, " send-always=true"); - - return g_string_free (w_dump, FALSE); + return g_string_free (g_steal_pointer (&str), FALSE); } NMTeamLinkWatcher * nm_utils_team_link_watcher_from_string (const char *str, GError **error) { - gs_free const char **watcherv = NULL; - gs_free char *str_clean_free = NULL; - const char *str_clean; - guint i; - gs_free const char *name = NULL; - int val1 = 0, val2 = 0, val3 = 3, val4 = -1; - gs_free const char *target_host = NULL; - gs_free const char *source_host = NULL; - NMTeamLinkWatcherArpPingFlags flags = 0; + gs_free const char **tokens = NULL; + ParseData parse_data[_NM_TEAM_LINK_WATCHER_KEY_NUM] = { }; + NMTeamLinkWatcherType watcher_type; + NMTeamLinkWatcherKeyId key_id; + gsize i_token; + NMTeamLinkWatcher *watcher; + int errsv; - nm_assert (str); - nm_assert (!error || !*error); + g_return_val_if_fail (str, NULL); + g_return_val_if_fail (!error || !*error, NULL); - str_clean = nm_strstrip_avoid_copy_a (300, str, &str_clean_free); - watcherv = nm_utils_strsplit_set (str_clean, " \t"); - if (!watcherv) { + tokens = nm_utils_escaped_tokens_split (str, NM_ASCII_SPACES); + if (!tokens) { g_set_error (error, 1, 0, "'%s' is not valid", str); return NULL; } - for (i = 0; watcherv[i]; i++) { - gs_free const char **pair = NULL; + for (i_token = 0; tokens[i_token]; i_token++) { + const TeamLinkWatcherKeyInfo *info; + const char *key = tokens[i_token]; + const char *val; - pair = nm_utils_strsplit_set (watcherv[i], "="); - if (!pair) { - g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], - "properties should be specified as 'key=value'"); + val = strchr (key, '='); + if (!val) { + nm_utils_error_set (error, NM_UTILS_ERROR_UNKNOWN, + _("'%s' is not valid: properties should be specified as 'key=value'"), + key); return NULL; } - if (!pair[1]) { - g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], - "missing key value"); - return NULL; + ((char *) val)[0] = '\0'; + val++; + + for (key_id = 0; key_id < _NM_TEAM_LINK_WATCHER_KEY_NUM; key_id++) { + info = &_team_link_watcher_key_infos[key_id]; + if (nm_streq (key, info->name)) + break; } - if (pair[2]) { - g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], - "properties should be specified as 'key=value'"); + + if (key_id == _NM_TEAM_LINK_WATCHER_KEY_NUM) { + nm_utils_error_set (error, NM_UTILS_ERROR_UNKNOWN, + _("'%s' is not a valid key"), key); return NULL; } - if (nm_streq (pair[0], "name")) - name = g_strdup (pair[1]); - else if ( nm_streq (pair[0], "delay-up") - || nm_streq (pair[0], "init-wait")) - val1 = _nm_utils_ascii_str_to_int64 (pair[1], 10, 0, G_MAXINT32, -1); - else if ( nm_streq (pair[0], "delay-down") - || nm_streq (pair[0], "interval")) - val2 = _nm_utils_ascii_str_to_int64 (pair[1], 10, 0, G_MAXINT32, -1); - else if (nm_streq (pair[0], "missed-max")) - val3 = _nm_utils_ascii_str_to_int64 (pair[1], 10, 0, G_MAXINT32, -1); - else if (nm_streq (pair[0], "vlanid")) - val4 = _nm_utils_ascii_str_to_int64 (pair[1], 10, -1, 4094, -2); - else if (nm_streq (pair[0], "target-host")) - target_host = g_strdup (pair[1]); - else if (nm_streq (pair[0], "source-host")) - source_host = g_strdup (pair[1]); - else if (nm_streq (pair[0], "validate-active")) { - if (nm_streq (pair[1], "true")) - flags |= NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_ACTIVE; - } else if (nm_streq (pair[0], "validate-inactive")) { - if (nm_streq (pair[1], "true")) - flags |= NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_INACTIVE; - } else if (nm_streq (pair[0], "send-always")) { - if (nm_streq (pair[1], "true")) - flags |= NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_SEND_ALWAYS; - } else { - g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], - "unknown key"); + if (parse_data[key_id].str_val) { + nm_utils_error_set (error, NM_UTILS_ERROR_UNKNOWN, + _("duplicate key '%s'"), key); return NULL; } - if ((val1 < 0) || (val2 < 0) || (val3 < 0)) { - g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], - "value is not a valid number [0, MAXINT]"); - return NULL; + parse_data[key_id].str_val = val; + + if (info->key_type == KEY_TYPE_INT) { + gint64 v64; + + v64 = _nm_utils_ascii_str_to_int64 (val, 10, G_MININT, G_MAXINT, G_MAXINT64); + if ( v64 == G_MAXINT64 + && ((errsv = errno) != 0)) { + if (errsv == ERANGE) { + nm_utils_error_set (error, NM_UTILS_ERROR_UNKNOWN, + _("number for '%s' is out of range"), key); + } else { + nm_utils_error_set (error, NM_UTILS_ERROR_UNKNOWN, + _("value for '%s' must be a number"), key); + } + return NULL; + } + parse_data[key_id].typ_val.vint = v64; + } else if (info->key_type == KEY_TYPE_BOOL) { + int vbool; + + vbool = _nm_utils_ascii_str_to_bool (val, -1); + if (vbool == -1) { + nm_utils_error_set (error, NM_UTILS_ERROR_UNKNOWN, + _("value for '%s' must be a boolean"), key); + return NULL; + } + parse_data[key_id].typ_val.vbool = vbool; } - if (val4 < -1) { - g_set_error (error, 1, 0, "'%s' is not valid: %s", watcherv[i], - "value is not a valid number [-1, 4094]"); + } + + if (!parse_data[NM_TEAM_LINK_WATCHER_KEY_NAME].str_val) { + nm_utils_error_set (error, NM_UTILS_ERROR_UNKNOWN, + _("missing 'name' attribute")); + return NULL; + } + + watcher_type = _team_link_watcher_get_watcher_type_from_name (parse_data[NM_TEAM_LINK_WATCHER_KEY_NAME].str_val); + if (watcher_type == NM_TEAM_LINK_WATCHER_TYPE_NONE) { + nm_utils_error_set (error, NM_UTILS_ERROR_UNKNOWN, + _("invalid 'name' \"%s\""), + parse_data[NM_TEAM_LINK_WATCHER_KEY_NAME].str_val); + return NULL; + } + + for (key_id = 0; key_id < _NM_TEAM_LINK_WATCHER_KEY_NUM; key_id++) { + const TeamLinkWatcherKeyInfo *info = &_team_link_watcher_key_infos[key_id]; + + if (!parse_data[key_id].str_val) + continue; + if (!NM_FLAGS_ALL (info->watcher_type, watcher_type)) { + nm_utils_error_set (error, NM_UTILS_ERROR_UNKNOWN, + _("attribute '%s' is invalid for \"%s\""), + info->name, + parse_data[NM_TEAM_LINK_WATCHER_KEY_NAME].str_val); return NULL; } } - if (nm_streq0 (name, NM_TEAM_LINK_WATCHER_ETHTOOL)) - return nm_team_link_watcher_new_ethtool (val1, val2, error); - else if (nm_streq0 (name, NM_TEAM_LINK_WATCHER_NSNA_PING)) - return nm_team_link_watcher_new_nsna_ping (val1, val2, val3, target_host, error); - else if (nm_streq0 (name, NM_TEAM_LINK_WATCHER_ARP_PING)) - return nm_team_link_watcher_new_arp_ping2 (val1, val2, val3, val4, target_host, source_host, flags, error); + switch (watcher_type) { + case NM_TEAM_LINK_WATCHER_TYPE_ETHTOOL: + watcher = nm_team_link_watcher_new_ethtool (_parse_data_get_int (parse_data, NM_TEAM_LINK_WATCHER_KEY_DELAY_UP), + _parse_data_get_int (parse_data, NM_TEAM_LINK_WATCHER_KEY_DELAY_DOWN), + error); + break; + case NM_TEAM_LINK_WATCHER_TYPE_NSNAPING: + watcher = nm_team_link_watcher_new_nsna_ping (_parse_data_get_int (parse_data, NM_TEAM_LINK_WATCHER_KEY_INIT_WAIT), + _parse_data_get_int (parse_data, NM_TEAM_LINK_WATCHER_KEY_INTERVAL), + _parse_data_get_int (parse_data, NM_TEAM_LINK_WATCHER_KEY_MISSED_MAX), + _parse_data_get_str (parse_data, NM_TEAM_LINK_WATCHER_KEY_TARGET_HOST), + error); + break; + default: + nm_assert (watcher_type == NM_TEAM_LINK_WATCHER_TYPE_ARPING); + watcher = nm_team_link_watcher_new_arp_ping2 (_parse_data_get_int (parse_data, NM_TEAM_LINK_WATCHER_KEY_INIT_WAIT), + _parse_data_get_int (parse_data, NM_TEAM_LINK_WATCHER_KEY_INTERVAL), + _parse_data_get_int (parse_data, NM_TEAM_LINK_WATCHER_KEY_MISSED_MAX), + _parse_data_get_int (parse_data, NM_TEAM_LINK_WATCHER_KEY_VLANID), + _parse_data_get_str (parse_data, NM_TEAM_LINK_WATCHER_KEY_TARGET_HOST), + _parse_data_get_str (parse_data, NM_TEAM_LINK_WATCHER_KEY_SOURCE_HOST), + ( NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE + | (_parse_data_get_bool (parse_data, NM_TEAM_LINK_WATCHER_KEY_VALIDATE_ACTIVE) ? NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_ACTIVE : NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE) + | (_parse_data_get_bool (parse_data, NM_TEAM_LINK_WATCHER_KEY_VALIDATE_INACTIVE) ? NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_VALIDATE_INACTIVE : NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE) + | (_parse_data_get_bool (parse_data, NM_TEAM_LINK_WATCHER_KEY_SEND_ALWAYS) ? NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_SEND_ALWAYS : NM_TEAM_LINK_WATCHER_ARP_PING_FLAG_NONE) + ), + error); + break; + } - if (!name) - g_set_error (error, 1, 0, "link watcher name missing"); - else - g_set_error (error, 1, 0, "unknown link watcher name: '%s'", name); - return NULL; +#if NM_MORE_ASSERTS > 5 + { + gs_free char *str2 = NULL; + nm_auto_unref_team_link_watcher NMTeamLinkWatcher *watcher2 = NULL; + static _nm_thread_local int recursive; + + nm_assert (watcher); + if (recursive == 0) { + recursive = 1; + str2 = nm_utils_team_link_watcher_to_string (watcher); + nm_assert (str2); + watcher2 = nm_utils_team_link_watcher_from_string (str2, NULL); + nm_assert (watcher2); + nm_assert (nm_team_link_watcher_equal (watcher, watcher2)); + nm_assert (nm_team_link_watcher_equal (watcher2, watcher)); + nm_assert (recursive == 1); + recursive = 0; + } + } +#endif + + return watcher; } diff --git a/shared/nm-libnm-core-aux/nm-libnm-core-aux.h b/shared/nm-libnm-core-aux/nm-libnm-core-aux.h index a2b4cf85c9..3b7d86d1c8 100644 --- a/shared/nm-libnm-core-aux/nm-libnm-core-aux.h +++ b/shared/nm-libnm-core-aux/nm-libnm-core-aux.h @@ -23,6 +23,29 @@ #include "nm-setting-team.h" +typedef enum { + NM_TEAM_LINK_WATCHER_TYPE_NONE = 0, + NM_TEAM_LINK_WATCHER_TYPE_ETHTOOL = (1u << 0), + NM_TEAM_LINK_WATCHER_TYPE_NSNAPING = (1u << 1), + NM_TEAM_LINK_WATCHER_TYPE_ARPING = (1u << 2), +} NMTeamLinkWatcherType; + +typedef enum { + NM_TEAM_LINK_WATCHER_KEY_NAME, + NM_TEAM_LINK_WATCHER_KEY_DELAY_UP, + NM_TEAM_LINK_WATCHER_KEY_DELAY_DOWN, + NM_TEAM_LINK_WATCHER_KEY_INIT_WAIT, + NM_TEAM_LINK_WATCHER_KEY_INTERVAL, + NM_TEAM_LINK_WATCHER_KEY_MISSED_MAX, + NM_TEAM_LINK_WATCHER_KEY_TARGET_HOST, + NM_TEAM_LINK_WATCHER_KEY_VLANID, + NM_TEAM_LINK_WATCHER_KEY_SOURCE_HOST, + NM_TEAM_LINK_WATCHER_KEY_VALIDATE_ACTIVE, + NM_TEAM_LINK_WATCHER_KEY_VALIDATE_INACTIVE, + NM_TEAM_LINK_WATCHER_KEY_SEND_ALWAYS, + _NM_TEAM_LINK_WATCHER_KEY_NUM, +} NMTeamLinkWatcherKeyId; + char *nm_utils_team_link_watcher_to_string (NMTeamLinkWatcher *watcher); NMTeamLinkWatcher *nm_utils_team_link_watcher_from_string (const char *str, From d76f3748de954510bb4fcd6b5e0f507f72fd28cf Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sun, 21 Apr 2019 13:07:30 +0200 Subject: [PATCH 08/18] cli: use escaped-tokens style for team-link-watcher list properties The link-watcher properties are not expected to contain any special values that require escaping. Hence, change the tokenizing from plain splitting at ',' to escaped-tokens style is likely to not affect any existing setups. Still, all our properties should be handled the same way (including a tokenizing which allows escaping to represent every possible value). --- clients/common/nm-meta-setting-desc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 68226eca12..e5759e5358 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -3631,7 +3631,7 @@ _objlist_obj_to_str_fcn_team_link_watchers (NMMetaAccessorGetType get_type, s = nm_utils_team_link_watcher_to_string (watcher); if (s) - g_string_append (str, s); + nm_utils_escaped_tokens_escape_gstr (s, ESCAPED_TOKENS_DELIMITERS, str); } static gboolean @@ -6512,7 +6512,6 @@ static const NMMetaPropertyInfo *const property_infos_TEAM[] = { .obj_to_str_fcn = _objlist_obj_to_str_fcn_team_link_watchers, .set_fcn = _objlist_set_fcn_team_link_watchers, .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingTeam, nm_setting_team_remove_link_watcher), - .strsplit_plain = TRUE, ), ), ), @@ -6589,7 +6588,6 @@ static const NMMetaPropertyInfo *const property_infos_TEAM_PORT[] = { .obj_to_str_fcn = _objlist_obj_to_str_fcn_team_link_watchers, .set_fcn = _objlist_set_fcn_team_link_watchers, .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingTeamPort, nm_setting_team_port_remove_link_watcher), - .strsplit_plain = TRUE, ), ), ), From bee4d30becc223c645a205b1636ebbf0f24fd70a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 25 Apr 2019 07:53:48 +0200 Subject: [PATCH 09/18] cli: add RETURN_STR_TEMPORARY() macro to "clients/common/nm-meta-setting-desc.c" Will be used next. --- clients/common/nm-meta-setting-desc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index e5759e5358..658e250bed 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -699,9 +699,21 @@ _SET_FCN_DO_REMOVE (char modifier, const char *value) #define RETURN_STR_TO_FREE(val) \ G_STMT_START { \ char *_val = (val); \ + \ return ((*(out_to_free)) = _val); \ } G_STMT_END +#define RETURN_STR_TEMPORARY(val) \ + G_STMT_START { \ + const char *_val = (val); \ + \ + if (_val == NULL) \ + return NULL; \ + if (_val[0] == '\0') \ + return ""; \ + return ((*(out_to_free)) = g_strdup (_val)); \ + } G_STMT_END + static gboolean _gobject_property_is_default (NMSetting *setting, const char *prop_name) { From 655a920577a923c43428ac5389bd21c65e9455b2 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 23 Apr 2019 12:46:25 +0200 Subject: [PATCH 10/18] cli: cleanup and fix handling of unset/empty "ipv4.dns-options" "ipv4.dns-options" and "ipv6.dns-options" are special, in that they can be either unset/default or an empty list of options. That means, nmcli must treat these two options differently. For the (terse) getter, it returns "" for default and " " for empty. The setter must likewise support and distingish between these two cases. Cleanup the handling of such options. This only applies to properties of type "multilist". Hence, add multilist.clear_emptyunset_fcn() handler that indicates that the property is of that kind. Try: nmcli connection modify "$PROFILE" ipv4.dns-options '' nmcli connection modify "$PROFILE" ipv4.dns-options ' ' and compare the output: nmcli connection show "$PROFILE" | sed -n '/ipv4.dns-options/ s/.*/<\0>/p' nmcli -t connection show "$PROFILE" | sed -n '/ipv4.dns-options/ s/.*/<\0>/p' nmcli -o connection show "$PROFILE" | sed -n '/ipv4.dns-options/ s/.*/<\0>/p' --- clients/common/nm-meta-setting-desc.c | 186 ++++-- clients/common/nm-meta-setting-desc.h | 7 + .../test_003.expected | 424 ++++++------- .../test_004.expected | 600 +++++++++--------- clients/tests/test-client.py | 2 +- 5 files changed, 654 insertions(+), 565 deletions(-) diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 658e250bed..d02d62b9ad 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -767,73 +767,124 @@ _gobject_property_reset_default (NMSetting *setting, const char *prop_name) return _gobject_property_reset (setting, prop_name, TRUE); } +static const char * +_coerce_str_emptyunset (NMMetaAccessorGetType get_type, + gboolean is_default, + const char *cstr, + char **out_str) +{ + nm_assert (out_str && !*out_str); + nm_assert ( (!is_default && cstr && cstr[0] != '\0') + || NM_IN_STRSET (cstr, NULL, "")); + + if (get_type == NM_META_ACCESSOR_GET_TYPE_PRETTY) { + if ( !cstr + || cstr[0] == '\0') { + if (is_default) + return ""; + else + return "\"\""; + } + nm_assert (!is_default); + return (*out_str = g_strdup_printf ("\"%s\"", cstr)); + } + + /* we coerce NULL/"" to either "" or " ". */ + if ( !cstr + || cstr[0] == '\0') { + if (is_default) + return ""; + else + return " "; + } + nm_assert (!is_default); + return cstr; +} + +static gboolean +_is_default (const NMMetaPropertyInfo *property_info, + NMSetting *setting) +{ + if ( property_info->property_typ_data + && property_info->property_typ_data->is_default_fcn) + return !!(property_info->property_typ_data->is_default_fcn (setting)); + + return _gobject_property_is_default (setting, property_info->property_name); + +} + static gconstpointer _get_fcn_gobject_impl (const NMMetaPropertyInfo *property_info, NMSetting *setting, NMMetaAccessorGetType get_type, + gboolean handle_emptyunset, gboolean *out_is_default, gpointer *out_to_free) { + char *str = NULL; const char *cstr; GType gtype_prop; nm_auto_unset_gvalue GValue val = G_VALUE_INIT; + gboolean is_default; + gboolean glib_handles_str_transform; RETURN_UNSUPPORTED_GET_TYPE (); - NM_SET_OUT (out_is_default, _gobject_property_is_default (setting, property_info->property_name)); - if ( property_info->property_typ_data - && property_info->property_typ_data->is_default_fcn - && property_info->property_typ_data->is_default_fcn (setting)) { - if (get_type == NM_META_ACCESSOR_GET_TYPE_PRETTY) - return _("(default)"); - return ""; - } + is_default = _is_default (property_info, setting); + + NM_SET_OUT (out_is_default, is_default); gtype_prop = _gobject_property_get_gtype (G_OBJECT (setting), property_info->property_name); + glib_handles_str_transform = !NM_IN_SET (gtype_prop, G_TYPE_BOOLEAN); + + if (glib_handles_str_transform) { + /* We rely on the type convertion of the gobject property to string. + * + * Note that we register some transformations via nmc_value_transforms_register() + * to make that working for G_TYPE_STRV, G_TYPE_HASH_TABLE, and G_TYPE_BYTES. + * + * FIXME: that is particularly ugly because it's non-obvious which code relies + * on nmc_value_transforms_register(). Also, nmc_value_transforms_register() is + * in clients/cli, while we are here in clients/common. */ + g_value_init (&val, G_TYPE_STRING); + } else + g_value_init (&val, gtype_prop); + + g_object_get_property (G_OBJECT (setting), property_info->property_name, &val); + + if (glib_handles_str_transform) { + cstr = g_value_get_string (&val); + + /* special hack for handling properties that can be empty and unset + * (see multilist.clear_emptyunset_fcn). */ + if (handle_emptyunset) + cstr = _coerce_str_emptyunset (get_type, is_default, cstr, &str); + + if (str) + RETURN_STR_TO_FREE (str); + RETURN_STR_TEMPORARY (cstr); + } + if (gtype_prop == G_TYPE_BOOLEAN) { gboolean b; - g_value_init (&val, gtype_prop); - g_object_get_property (G_OBJECT (setting), property_info->property_name, &val); b = g_value_get_boolean (&val); if (get_type == NM_META_ACCESSOR_GET_TYPE_PRETTY) cstr = b ? _("yes") : _("no"); else cstr = b ? "yes" : "no"; return cstr; - } else { - char *str; - - /* Note that we register certain transform functions in nmc_value_transforms_register(). - * This makes G_TYPE_STRV working. - * - * FIXME: that is particularly ugly because it's non-obvious which code relies - * on nmc_value_transforms_register(). Also, nmc_value_transforms_register() is - * in clients/cli, while we are here in clients/common. */ - g_value_init (&val, G_TYPE_STRING); - g_object_get_property (G_OBJECT (setting), property_info->property_name, &val); - cstr = g_value_get_string (&val); - - if ( property_info->property_typ_data - && property_info->property_typ_data->is_default_fcn) { - if (get_type == NM_META_ACCESSOR_GET_TYPE_PRETTY) { - str = cstr - ? g_strdup_printf ("\"%s\"", cstr) - : g_strdup (""); - } else - str = g_strdup (cstr && cstr[0] ? cstr : " "); - } else - str = cstr ? g_strdup (cstr) : NULL; - - RETURN_STR_TO_FREE (str); } + + nm_assert_not_reached (); + return NULL; } static gconstpointer _get_fcn_gobject (ARGS_GET_FCN) { - return _get_fcn_gobject_impl (property_info, setting, get_type, out_is_default, out_to_free); + return _get_fcn_gobject_impl (property_info, setting, get_type, FALSE, out_is_default, out_to_free); } static gconstpointer @@ -925,7 +976,7 @@ _get_fcn_gobject_mtu (ARGS_GET_FCN) if ( !property_info->property_typ_data || !property_info->property_typ_data->subtype.mtu.get_fcn) - return _get_fcn_gobject_impl (property_info, setting, get_type, out_is_default, out_to_free); + return _get_fcn_gobject_impl (property_info, setting, get_type, FALSE, out_is_default, out_to_free); mtu = property_info->property_typ_data->subtype.mtu.get_fcn (setting); if (mtu == 0) { @@ -1701,19 +1752,41 @@ _multilist_do_validate (const NMMetaPropertyInfo *property_info, return item; } +static gconstpointer +_get_fcn_multilist (ARGS_GET_FCN) +{ + return _get_fcn_gobject_impl (property_info, + setting, + get_type, + property_info->property_typ_data->subtype.multilist.clear_emptyunset_fcn != NULL, + out_is_default, + out_to_free); +} + +static gboolean +_multilist_clear_property (const NMMetaPropertyInfo *property_info, + NMSetting *setting, + gboolean is_set /* or else set default */) +{ + if (property_info->property_typ_data->subtype.multilist.clear_emptyunset_fcn) { + property_info->property_typ_data->subtype.multilist.clear_emptyunset_fcn (setting, is_set); + return TRUE; + } + if (property_info->property_typ_data->subtype.multilist.clear_all_fcn) { + property_info->property_typ_data->subtype.multilist.clear_all_fcn (setting); + return TRUE; + } + return _gobject_property_reset (setting, property_info->property_name, FALSE); +} + static gboolean _set_fcn_multilist (ARGS_SET_FCN) { gs_free const char **strv = NULL; gsize i, j, nstrv; - if (_SET_FCN_DO_RESET_DEFAULT_WITH_SUPPORTS_REMOVE (property_info, modifier, value)) { - if (property_info->property_typ_data->subtype.multilist.clear_all_fcn) { - property_info->property_typ_data->subtype.multilist.clear_all_fcn (setting); - return TRUE; - } - return _gobject_property_reset (setting, property_info->property_name, FALSE); - } + if (_SET_FCN_DO_RESET_DEFAULT_WITH_SUPPORTS_REMOVE (property_info, modifier, value)) + return _multilist_clear_property (property_info, setting, FALSE); if ( _SET_FCN_DO_REMOVE (modifier, value) && ( property_info->property_typ_data->subtype.multilist.remove_by_idx_fcn_u32 @@ -1746,6 +1819,11 @@ _set_fcn_multilist (ARGS_SET_FCN) } } + if ( _SET_FCN_DO_SET_ALL (modifier, value) + && property_info->property_typ_data->subtype.multilist.clear_emptyunset_fcn + && value[0] == '\0') + return _multilist_clear_property (property_info, setting, FALSE); + strv = _value_strsplit (value, property_info->property_typ_data->subtype.multilist.strsplit_plain ? VALUE_STRSPLIT_MODE_MULTILIST @@ -1768,11 +1846,13 @@ _set_fcn_multilist (ARGS_SET_FCN) } nstrv = j; - if (_SET_FCN_DO_SET_ALL (modifier, value)) { - if (property_info->property_typ_data->subtype.multilist.clear_all_fcn) - property_info->property_typ_data->subtype.multilist.clear_all_fcn (setting); - else - _gobject_property_reset (setting, property_info->property_name, FALSE); + if (_SET_FCN_DO_SET_ALL (modifier, value)) + _multilist_clear_property (property_info, setting, TRUE); + else if ( property_info->property_typ_data->subtype.multilist.clear_emptyunset_fcn + && _is_default (property_info, setting)) { + /* the property is already the default. But we hav here a '+' / '-' modifier, so + * that always makes it non-default (empty) first. */ + _multilist_clear_property (property_info, setting, TRUE); } for (i = 0; i < nstrv; i++) { @@ -3224,8 +3304,7 @@ _objlist_set_fcn_ip_config_routes (NMSetting *setting, static gboolean _is_default_func_ip_config_dns_options (NMSetting *setting) { - return nm_setting_ip_config_has_dns_options (NM_SETTING_IP_CONFIG (setting)) - && !nm_setting_ip_config_get_num_dns_options (NM_SETTING_IP_CONFIG (setting)); + return !nm_setting_ip_config_has_dns_options (NM_SETTING_IP_CONFIG (setting)); } static void @@ -4328,7 +4407,7 @@ static const NMMetaPropertyType _pt_ethtool = { }; static const NMMetaPropertyType _pt_multilist = { - .get_fcn = _get_fcn_gobject, + .get_fcn = _get_fcn_multilist, .set_fcn = _set_fcn_multilist, .set_supports_remove = TRUE, }; @@ -4347,6 +4426,7 @@ static const NMMetaPropertyType _pt_objlist = { #define MULTILIST_REMOVE_BY_IDX_FCN_S(type, func) (((func) == ((void (*) (type *, int )) (func))) ? ((void (*) (NMSetting *, int )) (func)) : NULL) #define MULTILIST_REMOVE_BY_IDX_FCN_U(type, func) (((func) == ((void (*) (type *, guint )) (func))) ? ((void (*) (NMSetting *, guint )) (func)) : NULL) #define MULTILIST_REMOVE_BY_VALUE_FCN(type, func) (((func) == ((gboolean (*) (type *, const char *)) (func))) ? ((gboolean (*) (NMSetting *, const char *)) (func)) : NULL) +#define MULTILIST_CLEAR_EMPTYUNSET_FCN(type, func) (((func) == ((void (*) (type *, gboolean )) (func))) ? ((void (*) (NMSetting *, gboolean )) (func)) : NULL) #define OBJLIST_GET_NUM_FCN(type, func) (((func) == ((guint (*) (type * )) (func))) ? ((guint (*) (NMSetting * )) (func)) : NULL) #define OBJLIST_CLEAR_ALL_FCN(type, func) (((func) == ((void (*) (type * )) (func))) ? ((void (*) (NMSetting * )) (func)) : NULL) @@ -5457,6 +5537,7 @@ static const NMMetaPropertyInfo *const property_infos_IP4_CONFIG[] = { .add_fcn = _multilist_add_fcn_ip_config_dns_options, .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns_option), .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_option_by_value), + .clear_emptyunset_fcn = MULTILIST_CLEAR_EMPTYUNSET_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_dns_options), .strsplit_plain = TRUE, ), .is_default_fcn = _is_default_func_ip_config_dns_options, @@ -5669,6 +5750,7 @@ static const NMMetaPropertyInfo *const property_infos_IP6_CONFIG[] = { .add_fcn = _multilist_add_fcn_ip_config_dns_options, .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns_option), .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_option_by_value), + .clear_emptyunset_fcn = MULTILIST_CLEAR_EMPTYUNSET_FCN (NMSettingIPConfig, nm_setting_ip_config_clear_dns_options), .strsplit_plain = TRUE, ), .is_default_fcn = _is_default_func_ip_config_dns_options, diff --git a/clients/common/nm-meta-setting-desc.h b/clients/common/nm-meta-setting-desc.h index b69a07b503..2178f747bb 100644 --- a/clients/common/nm-meta-setting-desc.h +++ b/clients/common/nm-meta-setting-desc.h @@ -270,6 +270,13 @@ struct _NMMetaPropertyTypData { guint32 (*get_num_fcn_u32) (NMSetting *setting); guint (*get_num_fcn_u) (NMSetting *setting); void (*clear_all_fcn) (NMSetting *setting); + + /* some multilist properties distinguish between an empty list and + * and unset. If this function pointer is set, certain behaviors come + * into action to handle that. */ + void (*clear_emptyunset_fcn) (NMSetting *setting, + gboolean is_set /* or else set default */); + gboolean (*add_fcn) (NMSetting *setting, const char *item); void (*add2_fcn) (NMSetting *setting, diff --git a/clients/tests/test-client.check-on-disk/test_003.expected b/clients/tests/test-client.check-on-disk/test_003.expected index ded1e9d703..694854c207 100644 --- a/clients/tests/test-client.check-on-disk/test_003.expected +++ b/clients/tests/test-client.check-on-disk/test_003.expected @@ -32,9 +32,9 @@ con-1 5fcfd6d7-1e63-3332-8826-a7eda103792d ethernet -- con-xx1 UUID-con-xx1-REPLACED-REPLACED-REPLA ethernet -- <<< -size: 332 +size: 353 location: clients/tests/test-client.py:893:test_003()/4 -cmd: $NMCLI connection add type gsm autoconnect no con-name con-gsm1 ifname '*' apn xyz.con-gsm1 serial.baud 5 serial.send-delay 100 serial.pari 1 +cmd: $NMCLI connection add type gsm autoconnect no con-name con-gsm1 ifname '*' apn xyz.con-gsm1 serial.baud 5 serial.send-delay 100 serial.pari 1 ipv4.dns-options ' ' lang: C returncode: 0 stdout: 81 bytes @@ -204,7 +204,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -300,7 +300,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -521,7 +521,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -542,7 +542,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -613,7 +613,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -634,7 +634,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -725,7 +725,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -746,7 +746,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -829,7 +829,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -850,7 +850,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -1377,7 +1377,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -1398,7 +1398,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -1469,7 +1469,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -1490,7 +1490,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -1585,7 +1585,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -1606,7 +1606,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -1702,7 +1702,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -1723,7 +1723,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -2181,7 +2181,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -2202,7 +2202,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -2298,7 +2298,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -2319,7 +2319,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -2415,7 +2415,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -2436,7 +2436,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -2519,7 +2519,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -2540,7 +2540,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -2813,7 +2813,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -2834,7 +2834,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -2930,7 +2930,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -2951,7 +2951,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -3047,7 +3047,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -3068,7 +3068,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -3151,7 +3151,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -3172,7 +3172,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -3466,7 +3466,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -3488,7 +3488,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -3599,7 +3599,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -3621,7 +3621,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -3732,7 +3732,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -3754,7 +3754,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -3848,7 +3848,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -3870,7 +3870,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -4192,7 +4192,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -4214,7 +4214,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -4325,7 +4325,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -4347,7 +4347,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -4458,7 +4458,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -4480,7 +4480,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -4574,7 +4574,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -4596,7 +4596,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -4846,12 +4846,12 @@ UUID-con-gsm1-REPLACED-REPLACED-REPL:gsm UUID-con-xx1-REPLACED-REPLACED-REPLA:802-3-ethernet <<< -size: 2809 +size: 2807 location: clients/tests/test-client.py:978:test_003()/104 cmd: $NMCLI --terse con s ethernet lang: C returncode: 0 -stdout: 2666 bytes +stdout: 2664 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -4893,7 +4893,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -4914,7 +4914,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -4963,12 +4963,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 2819 +size: 2817 location: clients/tests/test-client.py:978:test_003()/105 cmd: $NMCLI --terse con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 2666 bytes +stdout: 2664 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -5010,7 +5010,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -5031,7 +5031,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -5080,12 +5080,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 2481 +size: 2479 location: clients/tests/test-client.py:981:test_003()/106 cmd: $NMCLI --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 2298 bytes +stdout: 2296 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -5127,7 +5127,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -5148,7 +5148,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -5184,12 +5184,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 2491 +size: 2489 location: clients/tests/test-client.py:981:test_003()/107 cmd: $NMCLI --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2298 bytes +stdout: 2296 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -5231,7 +5231,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -5252,7 +5252,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -5474,12 +5474,12 @@ UUID-con-gsm1-REPLACED-REPLACED-REPL:gsm UUID-con-xx1-REPLACED-REPLACED-REPLA:802-3-ethernet <<< -size: 2821 +size: 2819 location: clients/tests/test-client.py:978:test_003()/114 cmd: $NMCLI --terse --color yes con s ethernet lang: C returncode: 0 -stdout: 2666 bytes +stdout: 2664 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -5521,7 +5521,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -5542,7 +5542,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -5591,12 +5591,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 2831 +size: 2829 location: clients/tests/test-client.py:978:test_003()/115 cmd: $NMCLI --terse --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 2666 bytes +stdout: 2664 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -5638,7 +5638,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -5659,7 +5659,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -5708,12 +5708,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 2493 +size: 2491 location: clients/tests/test-client.py:981:test_003()/116 cmd: $NMCLI --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 2298 bytes +stdout: 2296 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -5755,7 +5755,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -5776,7 +5776,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -5812,12 +5812,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 2503 +size: 2501 location: clients/tests/test-client.py:981:test_003()/117 cmd: $NMCLI --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2298 bytes +stdout: 2296 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -5859,7 +5859,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -5880,7 +5880,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -6120,10 +6120,10 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add 802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name method browser-only pac-url pac-script proxy none no -- -- @@ -6151,10 +6151,10 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add 802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name method browser-only pac-url pac-script proxy none nie -- -- @@ -6182,10 +6182,10 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add 802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name method browser-only pac-url pac-script proxy none no -- -- @@ -6209,10 +6209,10 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add 802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name method browser-only pac-url pac-script proxy none nie -- -- @@ -6358,10 +6358,10 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add 802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name method browser-only pac-url pac-script proxy none no -- -- @@ -6389,10 +6389,10 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add 802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name method browser-only pac-url pac-script proxy none nie -- -- @@ -6420,10 +6420,10 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add 802-3-ethernet -- 0 -- no -- -- -- -- auto -- -- -- default -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name method browser-only pac-url pac-script proxy none no -- -- @@ -6447,10 +6447,10 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add 802-3-ethernet -- 0 -- nie -- -- -- -- automatyczne -- -- -- default -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name method browser-only pac-url pac-script proxy none nie -- -- @@ -6618,11 +6618,11 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name method browser-only pac-url pac-script -------------------------------------------------- @@ -6665,11 +6665,11 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name method browser-only pac-url pac-script -------------------------------------------------- @@ -6712,11 +6712,11 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name method browser-only pac-url pac-script -------------------------------------------------- @@ -6751,11 +6751,11 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name method browser-only pac-url pac-script -------------------------------------------------- @@ -6950,11 +6950,11 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name method browser-only pac-url pac-script -------------------------------------------------- @@ -6997,11 +6997,11 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name method browser-only pac-url pac-script -------------------------------------------------- @@ -7044,11 +7044,11 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name method browser-only pac-url pac-script -------------------------------------------------- @@ -7083,11 +7083,11 @@ name port speed duplex auto-negotiate mac-address cloned-mac-add name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name method browser-only pac-url pac-script -------------------------------------------------- @@ -7242,66 +7242,66 @@ UUID-con-gsm1-REPLACED-REPLACED-REPL:gsm UUID-con-xx1-REPLACED-REPLACED-REPLA:802-3-ethernet <<< -size: 830 +size: 828 location: clients/tests/test-client.py:978:test_003()/164 cmd: $NMCLI --mode tabular --terse con s ethernet lang: C returncode: 0 -stdout: 673 bytes +stdout: 671 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 802-3-ethernet::0::no:::::auto::::default: -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth1:activated:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/4:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/4:: <<< -size: 840 +size: 838 location: clients/tests/test-client.py:978:test_003()/165 cmd: $NMCLI --mode tabular --terse con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 673 bytes +stdout: 671 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 802-3-ethernet::0::no:::::auto::::default: -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth1:activated:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/4:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/4:: <<< -size: 683 +size: 681 location: clients/tests/test-client.py:981:test_003()/166 cmd: $NMCLI --mode tabular --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 486 bytes +stdout: 484 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 802-3-ethernet::0::no:::::auto::::default: -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/4:: <<< -size: 693 +size: 691 location: clients/tests/test-client.py:981:test_003()/167 cmd: $NMCLI --mode tabular --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 486 bytes +stdout: 484 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 802-3-ethernet::0::no:::::auto::::default: -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/4:: @@ -7394,66 +7394,66 @@ UUID-con-gsm1-REPLACED-REPLACED-REPL:gsm UUID-con-xx1-REPLACED-REPLACED-REPLA:802-3-ethernet <<< -size: 842 +size: 840 location: clients/tests/test-client.py:978:test_003()/174 cmd: $NMCLI --mode tabular --terse --color yes con s ethernet lang: C returncode: 0 -stdout: 673 bytes +stdout: 671 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 802-3-ethernet::0::no:::::auto::::default: -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth1:activated:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/4:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/4:: <<< -size: 852 +size: 850 location: clients/tests/test-client.py:978:test_003()/175 cmd: $NMCLI --mode tabular --terse --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 673 bytes +stdout: 671 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 802-3-ethernet::0::no:::::auto::::default: -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth1:activated:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/4:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/4:: <<< -size: 695 +size: 693 location: clients/tests/test-client.py:981:test_003()/176 cmd: $NMCLI --mode tabular --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 486 bytes +stdout: 484 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 802-3-ethernet::0::no:::::auto::::default: -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/4:: <<< -size: 705 +size: 703 location: clients/tests/test-client.py:981:test_003()/177 cmd: $NMCLI --mode tabular --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 486 bytes +stdout: 484 bytes >>> connection:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL::802-3-ethernet::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 802-3-ethernet::0::no:::::auto::::default: -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: proxy:none:no:: GENERAL:ethernet:UUID-ethernet-REPLACED-REPLACED-REPL:eth0:deactivating:no:no::no:/org/freedesktop/NetworkManager/ActiveConnection/1:/org/freedesktop/NetworkManager/Settings/Connection/4:: @@ -7741,7 +7741,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -7762,7 +7762,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -7858,7 +7858,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -7879,7 +7879,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -7975,7 +7975,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -7996,7 +7996,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -8079,7 +8079,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -8100,7 +8100,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -8517,7 +8517,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -8538,7 +8538,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -8634,7 +8634,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -8655,7 +8655,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -8751,7 +8751,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -8772,7 +8772,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -8855,7 +8855,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -8876,7 +8876,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -9328,7 +9328,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -9350,7 +9350,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -9461,7 +9461,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -9483,7 +9483,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -9594,7 +9594,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -9616,7 +9616,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -9710,7 +9710,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -9732,7 +9732,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -10212,7 +10212,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -10234,7 +10234,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -10345,7 +10345,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -10367,7 +10367,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -10478,7 +10478,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -10500,7 +10500,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -10594,7 +10594,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -10616,7 +10616,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -11014,12 +11014,12 @@ UUID:UUID-con-xx1-REPLACED-REPLACED-REPLA TYPE:802-3-ethernet <<< -size: 2826 +size: 2824 location: clients/tests/test-client.py:978:test_003()/224 cmd: $NMCLI --mode multiline --terse con s ethernet lang: C returncode: 0 -stdout: 2666 bytes +stdout: 2664 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -11061,7 +11061,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -11082,7 +11082,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -11131,12 +11131,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 2836 +size: 2834 location: clients/tests/test-client.py:978:test_003()/225 cmd: $NMCLI --mode multiline --terse con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 2666 bytes +stdout: 2664 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -11178,7 +11178,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -11199,7 +11199,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -11248,12 +11248,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 2498 +size: 2496 location: clients/tests/test-client.py:981:test_003()/226 cmd: $NMCLI --mode multiline --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 2298 bytes +stdout: 2296 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -11295,7 +11295,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -11316,7 +11316,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -11352,12 +11352,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 2508 +size: 2506 location: clients/tests/test-client.py:981:test_003()/227 cmd: $NMCLI --mode multiline --terse c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2298 bytes +stdout: 2296 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -11399,7 +11399,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -11420,7 +11420,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -11790,12 +11790,12 @@ UUID:UUID-con-xx1-REPLACED-REPLACED-REPLA TYPE:802-3-ethernet <<< -size: 2838 +size: 2836 location: clients/tests/test-client.py:978:test_003()/234 cmd: $NMCLI --mode multiline --terse --color yes con s ethernet lang: C returncode: 0 -stdout: 2666 bytes +stdout: 2664 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -11837,7 +11837,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -11858,7 +11858,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -11907,12 +11907,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 2848 +size: 2846 location: clients/tests/test-client.py:978:test_003()/235 cmd: $NMCLI --mode multiline --terse --color yes con s ethernet lang: pl_PL.UTF-8 returncode: 0 -stdout: 2666 bytes +stdout: 2664 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -11954,7 +11954,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -11975,7 +11975,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -12024,12 +12024,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 2510 +size: 2508 location: clients/tests/test-client.py:981:test_003()/236 cmd: $NMCLI --mode multiline --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: C returncode: 0 -stdout: 2298 bytes +stdout: 2296 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -12071,7 +12071,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -12092,7 +12092,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -12128,12 +12128,12 @@ GENERAL.ZONE: GENERAL.MASTER-PATH: <<< -size: 2520 +size: 2518 location: clients/tests/test-client.py:981:test_003()/237 cmd: $NMCLI --mode multiline --terse --color yes c s /org/freedesktop/NetworkManager/ActiveConnection/1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2298 bytes +stdout: 2296 bytes >>> connection.id:ethernet connection.uuid:UUID-ethernet-REPLACED-REPLACED-REPL @@ -12175,7 +12175,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -12196,7 +12196,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: diff --git a/clients/tests/test-client.check-on-disk/test_004.expected b/clients/tests/test-client.check-on-disk/test_004.expected index 48f68a5bcc..8fdc7497cc 100644 --- a/clients/tests/test-client.check-on-disk/test_004.expected +++ b/clients/tests/test-client.check-on-disk/test_004.expected @@ -108,7 +108,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: 192.168.77.5/24 ipv4.gateway: -- @@ -129,7 +129,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: 1:2:3:4::6/64 ipv6.gateway: -- @@ -203,7 +203,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: 192.168.77.5/24 ipv4.gateway: -- @@ -224,7 +224,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: 1:2:3:4::6/64 ipv6.gateway: -- @@ -317,7 +317,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -338,7 +338,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -401,7 +401,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -422,7 +422,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -557,7 +557,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -578,7 +578,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -661,7 +661,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -682,7 +682,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -765,7 +765,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -786,7 +786,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -869,7 +869,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -890,7 +890,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -973,7 +973,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -994,7 +994,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -1077,7 +1077,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -1098,7 +1098,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -1181,7 +1181,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -1202,7 +1202,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -1265,7 +1265,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -1286,7 +1286,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -3739,7 +3739,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -3760,7 +3760,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -3843,7 +3843,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -3864,7 +3864,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -3947,7 +3947,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -3968,7 +3968,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -4051,7 +4051,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -4072,7 +4072,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -4155,7 +4155,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -4176,7 +4176,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -4239,7 +4239,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -4260,7 +4260,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -6717,7 +6717,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -6739,7 +6739,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -6834,7 +6834,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -6856,7 +6856,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -6951,7 +6951,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -6973,7 +6973,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -7068,7 +7068,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -7090,7 +7090,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -7185,7 +7185,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -7207,7 +7207,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -7277,7 +7277,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -7299,7 +7299,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -10305,7 +10305,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -10327,7 +10327,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -10422,7 +10422,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -10444,7 +10444,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -10539,7 +10539,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -10561,7 +10561,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -10656,7 +10656,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -10678,7 +10678,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -10773,7 +10773,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -10795,7 +10795,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -10865,7 +10865,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -10887,7 +10887,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -13856,12 +13856,12 @@ NEIGHBOR[2].SYSTEM-CAPABILITIES: 40 (wlan-access-point,telephone) ------------------------------------------------------------------------------- <<< -size: 2363 +size: 2361 location: clients/tests/test-client.py:1037:test_004()/215 cmd: $NMCLI --terse con s con-vpn-1 lang: C returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -13889,7 +13889,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -13910,7 +13910,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -13960,12 +13960,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2373 +size: 2371 location: clients/tests/test-client.py:1037:test_004()/216 cmd: $NMCLI --terse con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -13993,7 +13993,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -14014,7 +14014,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -14064,12 +14064,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2363 +size: 2361 location: clients/tests/test-client.py:1039:test_004()/217 cmd: $NMCLI --terse con s con-vpn-1 lang: C returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -14097,7 +14097,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -14118,7 +14118,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -14168,12 +14168,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2373 +size: 2371 location: clients/tests/test-client.py:1039:test_004()/218 cmd: $NMCLI --terse con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -14201,7 +14201,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -14222,7 +14222,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -14272,12 +14272,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 1811 +size: 1809 location: clients/tests/test-client.py:1042:test_004()/219 cmd: $NMCLI --terse -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 1659 bytes +stdout: 1657 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -14305,7 +14305,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -14326,7 +14326,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -14356,12 +14356,12 @@ proxy.pac-url: proxy.pac-script: <<< -size: 1821 +size: 1819 location: clients/tests/test-client.py:1042:test_004()/220 cmd: $NMCLI --terse -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 1659 bytes +stdout: 1657 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -14389,7 +14389,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -14410,7 +14410,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -16800,12 +16800,12 @@ NEIGHBOR[2].SYSTEM-DESCRIPTION:Test system #3 NEIGHBOR[2].SYSTEM-CAPABILITIES:40 (wlan-access-point,telephone) <<< -size: 2375 +size: 2373 location: clients/tests/test-client.py:1037:test_004()/263 cmd: $NMCLI --terse --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -16833,7 +16833,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -16854,7 +16854,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -16904,12 +16904,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2385 +size: 2383 location: clients/tests/test-client.py:1037:test_004()/264 cmd: $NMCLI --terse --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -16937,7 +16937,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -16958,7 +16958,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -17008,12 +17008,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2375 +size: 2373 location: clients/tests/test-client.py:1039:test_004()/265 cmd: $NMCLI --terse --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -17041,7 +17041,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -17062,7 +17062,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -17112,12 +17112,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2385 +size: 2383 location: clients/tests/test-client.py:1039:test_004()/266 cmd: $NMCLI --terse --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -17145,7 +17145,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -17166,7 +17166,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -17216,12 +17216,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 1823 +size: 1821 location: clients/tests/test-client.py:1042:test_004()/267 cmd: $NMCLI --terse --color yes -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 1659 bytes +stdout: 1657 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -17249,7 +17249,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -17270,7 +17270,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -17300,12 +17300,12 @@ proxy.pac-url: proxy.pac-script: <<< -size: 1833 +size: 1831 location: clients/tests/test-client.py:1042:test_004()/268 cmd: $NMCLI --terse --color yes -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 1659 bytes +stdout: 1657 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -17333,7 +17333,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -17354,7 +17354,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -19755,10 +19755,10 @@ name id uuid stable-id type in connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 no -- -- -- -- -1 (default) -- 0 unknown default -1 (default) -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name service-type user-name data secrets persistent timeout vpn org.freedesktop.NetworkManager.openvpn -- key1 = val1, key2 = val2, key3 = val3 no 0 @@ -19784,10 +19784,10 @@ name id uuid stable-id type in connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 nie -- -- -- -- -1 (default) -- 0 nieznane default -1 (default) -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name service-type user-name data secrets persistent timeout vpn org.freedesktop.NetworkManager.openvpn -- key1 = val1, key2 = val2, key3 = val3 nie 0 @@ -19813,10 +19813,10 @@ name id uuid stable-id type in connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 no -- -- -- -- -1 (default) -- 0 unknown default -1 (default) -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name service-type user-name data secrets persistent timeout vpn org.freedesktop.NetworkManager.openvpn -- key1 = val1, key2 = val2, key3 = val3 no 0 @@ -19842,10 +19842,10 @@ name id uuid stable-id type in connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 nie -- -- -- -- -1 (default) -- 0 nieznane default -1 (default) -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name service-type user-name data secrets persistent timeout vpn org.freedesktop.NetworkManager.openvpn -- key1 = val1, key2 = val2, key3 = val3 nie 0 @@ -19871,10 +19871,10 @@ name id uuid stable-id type in connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 no -- -- -- -- -1 (default) -- 0 unknown default -1 (default) -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name service-type user-name data secrets persistent timeout vpn org.freedesktop.NetworkManager.openvpn -- key1 = val1, key2 = val2, key3 = val3 no 0 @@ -19895,10 +19895,10 @@ name id uuid stable-id type in connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 nie -- -- -- -- -1 (default) -- 0 nieznane default -1 (default) -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name service-type user-name data secrets persistent timeout vpn org.freedesktop.NetworkManager.openvpn -- key1 = val1, key2 = val2, key3 = val3 nie 0 @@ -21269,10 +21269,10 @@ name id uuid stable-id type in connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 no -- -- -- -- -1 (default) -- 0 unknown default -1 (default) -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name service-type user-name data secrets persistent timeout vpn org.freedesktop.NetworkManager.openvpn -- key1 = val1, key2 = val2, key3 = val3 no 0 @@ -21298,10 +21298,10 @@ name id uuid stable-id type in connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 nie -- -- -- -- -1 (default) -- 0 nieznane default -1 (default) -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name service-type user-name data secrets persistent timeout vpn org.freedesktop.NetworkManager.openvpn -- key1 = val1, key2 = val2, key3 = val3 nie 0 @@ -21327,10 +21327,10 @@ name id uuid stable-id type in connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 no -- -- -- -- -1 (default) -- 0 unknown default -1 (default) -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name service-type user-name data secrets persistent timeout vpn org.freedesktop.NetworkManager.openvpn -- key1 = val1, key2 = val2, key3 = val3 no 0 @@ -21356,10 +21356,10 @@ name id uuid stable-id type in connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 nie -- -- -- -- -1 (default) -- 0 nieznane default -1 (default) -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name service-type user-name data secrets persistent timeout vpn org.freedesktop.NetworkManager.openvpn -- key1 = val1, key2 = val2, key3 = val3 nie 0 @@ -21385,10 +21385,10 @@ name id uuid stable-id type in connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- yes 0 -1 (default) 0 (default) -1 0 no -- -- -- -- -1 (default) -- 0 unknown default -1 (default) -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name service-type user-name data secrets persistent timeout vpn org.freedesktop.NetworkManager.openvpn -- key1 = val1, key2 = val2, key3 = val3 no 0 @@ -21409,10 +21409,10 @@ name id uuid stable-id type in connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- tak 0 -1 (default) 0 (default) -1 0 nie -- -- -- -- -1 (default) -- 0 nieznane default -1 (default) -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name service-type user-name data secrets persistent timeout vpn org.freedesktop.NetworkManager.openvpn -- key1 = val1, key2 = val2, key3 = val3 nie 0 @@ -22788,11 +22788,11 @@ connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name service-type user-name data secrets persistent timeout ------------------------------------------------------------------------------------------------------------------------------- @@ -22830,11 +22830,11 @@ connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name service-type user-name data secrets persistent timeout ------------------------------------------------------------------------------------------------------------------------------- @@ -22872,11 +22872,11 @@ connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name service-type user-name data secrets persistent timeout ------------------------------------------------------------------------------------------------------------------------------- @@ -22914,11 +22914,11 @@ connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name service-type user-name data secrets persistent timeout ------------------------------------------------------------------------------------------------------------------------------- @@ -22956,11 +22956,11 @@ connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name service-type user-name data secrets persistent timeout ------------------------------------------------------------------------------------------------------------------------------- @@ -22988,11 +22988,11 @@ connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name service-type user-name data secrets persistent timeout ------------------------------------------------------------------------------------------------------------------------------- @@ -24898,11 +24898,11 @@ connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name service-type user-name data secrets persistent timeout ------------------------------------------------------------------------------------------------------------------------------- @@ -24940,11 +24940,11 @@ connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name service-type user-name data secrets persistent timeout ------------------------------------------------------------------------------------------------------------------------------- @@ -24982,11 +24982,11 @@ connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name service-type user-name data secrets persistent timeout ------------------------------------------------------------------------------------------------------------------------------- @@ -25024,11 +25024,11 @@ connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name service-type user-name data secrets persistent timeout ------------------------------------------------------------------------------------------------------------------------------- @@ -25066,11 +25066,11 @@ connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no -- 0 (default) yes -- -- no yes -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- no no no yes -1 (unknown) stable-privacy -- yes -- -- name service-type user-name data secrets persistent timeout ------------------------------------------------------------------------------------------------------------------------------- @@ -25098,11 +25098,11 @@ connection con-vpn-1 UUID-con-vpn-1-REPLACED-REPLACED-REP -- vpn -- name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns dhcp-client-id dhcp-timeout dhcp-send-hostname dhcp-hostname dhcp-fqdn never-default may-fail dad-timeout ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv4 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) +ipv4 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie -- 0 (default) tak -- -- nie tak -1 (default) name method dns dns-search dns-options dns-priority addresses gateway routes route-metric route-table routing-rules ignore-auto-routes ignore-auto-dns never-default may-fail ip6-privacy addr-gen-mode dhcp-duid dhcp-send-hostname dhcp-hostname token --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -ipv6 auto -- -- "" 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- +ipv6 auto -- -- -- 0 -- -- -- -1 0 (unspec) -- nie nie nie tak -1 (unknown) stable-privacy -- tak -- -- name service-type user-name data secrets persistent timeout ------------------------------------------------------------------------------------------------------------------------------- @@ -26992,94 +26992,94 @@ eth0 chassis1 44:44:44:44:44:44 GigabitEthernet #2 test2.example. eth0 00:11:22:33:44:22 port1 GigabitEthernet #3 test3.example.com Test system #3 40 (wlan-access-point,telephone) <<< -size: 793 +size: 791 location: clients/tests/test-client.py:1037:test_004()/503 cmd: $NMCLI --mode tabular --terse con s con-vpn-1 lang: C returncode: 0 -stdout: 634 bytes +stdout: 632 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3::no:0 proxy:none:no:: GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:activated:no:no::yes:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/3:: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 803 +size: 801 location: clients/tests/test-client.py:1037:test_004()/504 cmd: $NMCLI --mode tabular --terse con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 634 bytes +stdout: 632 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3::no:0 proxy:none:no:: GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:activated:no:no::yes:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/3:: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 793 +size: 791 location: clients/tests/test-client.py:1039:test_004()/505 cmd: $NMCLI --mode tabular --terse con s con-vpn-1 lang: C returncode: 0 -stdout: 634 bytes +stdout: 632 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3::no:0 proxy:none:no:: GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:activated:no:no::yes:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/3:: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 803 +size: 801 location: clients/tests/test-client.py:1039:test_004()/506 cmd: $NMCLI --mode tabular --terse con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 634 bytes +stdout: 632 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3::no:0 proxy:none:no:: GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:activated:no:no::yes:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/3:: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 506 +size: 504 location: clients/tests/test-client.py:1042:test_004()/507 cmd: $NMCLI --mode tabular --terse -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 340 bytes +stdout: 338 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3::no:0 proxy:none:no:: <<< -size: 516 +size: 514 location: clients/tests/test-client.py:1042:test_004()/508 cmd: $NMCLI --mode tabular --terse -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 340 bytes +stdout: 338 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3::no:0 proxy:none:no:: @@ -27868,94 +27868,94 @@ eth0:chassis1:44\:44\:44\:44\:44\:44:GigabitEthernet #2:test2.example.com:Test s eth0:00\:11\:22\:33\:44\:22:port1:GigabitEthernet #3:test3.example.com:Test system #3:40 (wlan-access-point,telephone) <<< -size: 805 +size: 803 location: clients/tests/test-client.py:1037:test_004()/551 cmd: $NMCLI --mode tabular --terse --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 634 bytes +stdout: 632 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3::no:0 proxy:none:no:: GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:activated:no:no::yes:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/3:: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 815 +size: 813 location: clients/tests/test-client.py:1037:test_004()/552 cmd: $NMCLI --mode tabular --terse --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 634 bytes +stdout: 632 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3::no:0 proxy:none:no:: GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:activated:no:no::yes:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/3:: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 805 +size: 803 location: clients/tests/test-client.py:1039:test_004()/553 cmd: $NMCLI --mode tabular --terse --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 634 bytes +stdout: 632 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3::no:0 proxy:none:no:: GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:activated:no:no::yes:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/3:: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 815 +size: 813 location: clients/tests/test-client.py:1039:test_004()/554 cmd: $NMCLI --mode tabular --terse --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 634 bytes +stdout: 632 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3::no:0 proxy:none:no:: GENERAL:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP:wlan0:activated:no:no::yes:/org/freedesktop/NetworkManager/ActiveConnection/2:/org/freedesktop/NetworkManager/Settings/Connection/3:: VPN:openvpn:::*** VPN connection con-vpn-1 ***:5 - VPN connected:key1 = val1 | key2 = val2 | key3 = val3 <<< -size: 518 +size: 516 location: clients/tests/test-client.py:1042:test_004()/555 cmd: $NMCLI --mode tabular --terse --color yes -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 340 bytes +stdout: 338 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3::no:0 proxy:none:no:: <<< -size: 528 +size: 526 location: clients/tests/test-client.py:1042:test_004()/556 cmd: $NMCLI --mode tabular --terse --color yes -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 340 bytes +stdout: 338 bytes >>> connection:con-vpn-1:UUID-con-vpn-1-REPLACED-REPLACED-REP::vpn::yes:0:-1:0:-1:0:no:::::-1::0:unknown:default:-1:-1 -ipv4:auto::: :0::::-1:0::no:no::0:yes:::no:yes:-1 -ipv6:auto::: :0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: +ipv4:auto::::0::::-1:0::no:no::0:yes:::no:yes:-1 +ipv6:auto::::0::::-1:0::no:no:no:yes:-1:stable-privacy::yes:: vpn:org.freedesktop.NetworkManager.openvpn::key1 = val1, key2 = val2, key3 = val3::no:0 proxy:none:no:: @@ -28777,7 +28777,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -28798,7 +28798,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -28881,7 +28881,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -28902,7 +28902,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -28985,7 +28985,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -29006,7 +29006,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -29089,7 +29089,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -29110,7 +29110,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -29193,7 +29193,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -29214,7 +29214,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -29277,7 +29277,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -29298,7 +29298,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -32241,7 +32241,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -32262,7 +32262,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -32345,7 +32345,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -32366,7 +32366,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -32449,7 +32449,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -32470,7 +32470,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -32553,7 +32553,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -32574,7 +32574,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -32657,7 +32657,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -32678,7 +32678,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -32741,7 +32741,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -32762,7 +32762,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -35709,7 +35709,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -35731,7 +35731,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -35826,7 +35826,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -35848,7 +35848,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -35943,7 +35943,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -35965,7 +35965,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -36060,7 +36060,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -36082,7 +36082,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -36177,7 +36177,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -36199,7 +36199,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -36269,7 +36269,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -36291,7 +36291,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -39817,7 +39817,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -39839,7 +39839,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -39934,7 +39934,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -39956,7 +39956,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -40051,7 +40051,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -40073,7 +40073,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -40168,7 +40168,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -40190,7 +40190,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -40285,7 +40285,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -40307,7 +40307,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -40377,7 +40377,7 @@ connection.llmnr: -1 (default) ipv4.method: auto ipv4.dns: -- ipv4.dns-search: -- -ipv4.dns-options: "" +ipv4.dns-options: -- ipv4.dns-priority: 0 ipv4.addresses: -- ipv4.gateway: -- @@ -40399,7 +40399,7 @@ ipv4.dad-timeout: -1 (default) ipv6.method: auto ipv6.dns: -- ipv6.dns-search: -- -ipv6.dns-options: "" +ipv6.dns-options: -- ipv6.dns-priority: 0 ipv6.addresses: -- ipv6.gateway: -- @@ -43888,12 +43888,12 @@ NEIGHBOR[2].SYSTEM-CAPABILITIES: 40 (wlan-access-point,telephone) ------------------------------------------------------------------------------- <<< -size: 2380 +size: 2378 location: clients/tests/test-client.py:1037:test_004()/791 cmd: $NMCLI --mode multiline --terse con s con-vpn-1 lang: C returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -43921,7 +43921,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -43942,7 +43942,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -43992,12 +43992,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2390 +size: 2388 location: clients/tests/test-client.py:1037:test_004()/792 cmd: $NMCLI --mode multiline --terse con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -44025,7 +44025,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -44046,7 +44046,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -44096,12 +44096,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2380 +size: 2378 location: clients/tests/test-client.py:1039:test_004()/793 cmd: $NMCLI --mode multiline --terse con s con-vpn-1 lang: C returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -44129,7 +44129,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -44150,7 +44150,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -44200,12 +44200,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2390 +size: 2388 location: clients/tests/test-client.py:1039:test_004()/794 cmd: $NMCLI --mode multiline --terse con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -44233,7 +44233,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -44254,7 +44254,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -44304,12 +44304,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 1828 +size: 1826 location: clients/tests/test-client.py:1042:test_004()/795 cmd: $NMCLI --mode multiline --terse -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 1659 bytes +stdout: 1657 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -44337,7 +44337,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -44358,7 +44358,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -44388,12 +44388,12 @@ proxy.pac-url: proxy.pac-script: <<< -size: 1838 +size: 1836 location: clients/tests/test-client.py:1042:test_004()/796 cmd: $NMCLI --mode multiline --terse -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 1659 bytes +stdout: 1657 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -44421,7 +44421,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -44442,7 +44442,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -47352,12 +47352,12 @@ NEIGHBOR[2].SYSTEM-DESCRIPTION:Test system #3 NEIGHBOR[2].SYSTEM-CAPABILITIES:40 (wlan-access-point,telephone) <<< -size: 2392 +size: 2390 location: clients/tests/test-client.py:1037:test_004()/839 cmd: $NMCLI --mode multiline --terse --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -47385,7 +47385,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -47406,7 +47406,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -47456,12 +47456,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2402 +size: 2400 location: clients/tests/test-client.py:1037:test_004()/840 cmd: $NMCLI --mode multiline --terse --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -47489,7 +47489,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -47510,7 +47510,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -47560,12 +47560,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2392 +size: 2390 location: clients/tests/test-client.py:1039:test_004()/841 cmd: $NMCLI --mode multiline --terse --color yes con s con-vpn-1 lang: C returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -47593,7 +47593,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -47614,7 +47614,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -47664,12 +47664,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 2402 +size: 2400 location: clients/tests/test-client.py:1039:test_004()/842 cmd: $NMCLI --mode multiline --terse --color yes con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 2218 bytes +stdout: 2216 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -47697,7 +47697,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -47718,7 +47718,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -47768,12 +47768,12 @@ VPN.CFG[2]:key2 = val2 VPN.CFG[3]:key3 = val3 <<< -size: 1840 +size: 1838 location: clients/tests/test-client.py:1042:test_004()/843 cmd: $NMCLI --mode multiline --terse --color yes -f ALL con s con-vpn-1 lang: C returncode: 0 -stdout: 1659 bytes +stdout: 1657 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -47801,7 +47801,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -47822,7 +47822,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: @@ -47852,12 +47852,12 @@ proxy.pac-url: proxy.pac-script: <<< -size: 1850 +size: 1848 location: clients/tests/test-client.py:1042:test_004()/844 cmd: $NMCLI --mode multiline --terse --color yes -f ALL con s con-vpn-1 lang: pl_PL.UTF-8 returncode: 0 -stdout: 1659 bytes +stdout: 1657 bytes >>> connection.id:con-vpn-1 connection.uuid:UUID-con-vpn-1-REPLACED-REPLACED-REP @@ -47885,7 +47885,7 @@ connection.llmnr:-1 ipv4.method:auto ipv4.dns: ipv4.dns-search: -ipv4.dns-options: +ipv4.dns-options: ipv4.dns-priority:0 ipv4.addresses: ipv4.gateway: @@ -47906,7 +47906,7 @@ ipv4.dad-timeout:-1 ipv6.method:auto ipv6.dns: ipv6.dns-search: -ipv6.dns-options: +ipv6.dns-options: ipv6.dns-priority:0 ipv6.addresses: ipv6.gateway: diff --git a/clients/tests/test-client.py b/clients/tests/test-client.py index 08b0b951d1..b2411d6e52 100755 --- a/clients/tests/test-client.py +++ b/clients/tests/test-client.py @@ -889,7 +889,7 @@ class TestNmcli(NmTestBase): replace_stdout.append((Util.memoize_nullary(lambda: self.srv.findConnectionUuid('con-gsm1')), 'UUID-con-gsm1-REPLACED-REPLACED-REPL')) - self.call_nmcli(['connection', 'add', 'type', 'gsm', 'autoconnect', 'no', 'con-name', 'con-gsm1', 'ifname', '*', 'apn', 'xyz.con-gsm1', 'serial.baud', '5', 'serial.send-delay', '100', 'serial.pari', '1'], + self.call_nmcli(['connection', 'add', 'type', 'gsm', 'autoconnect', 'no', 'con-name', 'con-gsm1', 'ifname', '*', 'apn', 'xyz.con-gsm1', 'serial.baud', '5', 'serial.send-delay', '100', 'serial.pari', '1', 'ipv4.dns-options', ' '], replace_stdout = replace_stdout) replace_stdout.append((Util.memoize_nullary(lambda: self.srv.findConnectionUuid('ethernet')), 'UUID-ethernet-REPLACED-REPLACED-REPL')) From d4d1e5f00d0bdf03f55e06d157c793ecdb472b2c Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 23 Apr 2019 15:23:16 +0200 Subject: [PATCH 11/18] cli: drop GValue transform function for G_TYPE_STRV to G_TYPE_STRING It's ugly to modify the global behavior of glib to convert between types. Instead, _get_fcn_gobject_impl() is perfectly capable to implement converting a strv array to string. --- clients/cli/nmcli.c | 16 ---------- clients/common/nm-meta-setting-desc.c | 45 ++++++++++++++++++--------- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c index d8300e780c..2f401e134f 100644 --- a/clients/cli/nmcli.c +++ b/clients/cli/nmcli.c @@ -915,18 +915,6 @@ signal_handler (gpointer user_data) return G_SOURCE_CONTINUE; } -static void -nmc_convert_strv_to_string (const GValue *src_value, GValue *dest_value) -{ - char **strings; - - strings = g_value_get_boxed (src_value); - if (strings) - g_value_take_string (dest_value, g_strjoinv (",", strings)); - else - g_value_set_string (dest_value, ""); -} - static void nmc_convert_string_hash_to_string (const GValue *src_value, GValue *dest_value) { @@ -981,10 +969,6 @@ nmc_convert_bytes_to_string (const GValue *src_value, GValue *dest_value) static void nmc_value_transforms_register (void) { - g_value_register_transform_func (G_TYPE_STRV, - G_TYPE_STRING, - nmc_convert_strv_to_string); - /* This depends on the fact that all of the hash-table-valued properties * in libnm-core are string->string. */ diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index d02d62b9ad..5bb9a3e8e7 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -821,7 +821,6 @@ _get_fcn_gobject_impl (const NMMetaPropertyInfo *property_info, gboolean *out_is_default, gpointer *out_to_free) { - char *str = NULL; const char *cstr; GType gtype_prop; nm_auto_unset_gvalue GValue val = G_VALUE_INIT; @@ -836,13 +835,14 @@ _get_fcn_gobject_impl (const NMMetaPropertyInfo *property_info, gtype_prop = _gobject_property_get_gtype (G_OBJECT (setting), property_info->property_name); - glib_handles_str_transform = !NM_IN_SET (gtype_prop, G_TYPE_BOOLEAN); + glib_handles_str_transform = !NM_IN_SET (gtype_prop, G_TYPE_BOOLEAN, + G_TYPE_STRV); if (glib_handles_str_transform) { /* We rely on the type convertion of the gobject property to string. * * Note that we register some transformations via nmc_value_transforms_register() - * to make that working for G_TYPE_STRV, G_TYPE_HASH_TABLE, and G_TYPE_BYTES. + * to make that working for G_TYPE_HASH_TABLE, and G_TYPE_BYTES. * * FIXME: that is particularly ugly because it's non-obvious which code relies * on nmc_value_transforms_register(). Also, nmc_value_transforms_register() is @@ -853,18 +853,14 @@ _get_fcn_gobject_impl (const NMMetaPropertyInfo *property_info, g_object_get_property (G_OBJECT (setting), property_info->property_name, &val); - if (glib_handles_str_transform) { - cstr = g_value_get_string (&val); + /* Currently only one particular property asks us to "handle_emptyunset". + * So, don't implement it (yet) for the other types, where it's unneeded. */ + nm_assert ( !handle_emptyunset + || ( gtype_prop == G_TYPE_STRV + && !glib_handles_str_transform)); - /* special hack for handling properties that can be empty and unset - * (see multilist.clear_emptyunset_fcn). */ - if (handle_emptyunset) - cstr = _coerce_str_emptyunset (get_type, is_default, cstr, &str); - - if (str) - RETURN_STR_TO_FREE (str); - RETURN_STR_TEMPORARY (cstr); - } + if (glib_handles_str_transform) + RETURN_STR_TEMPORARY (g_value_get_string (&val)); if (gtype_prop == G_TYPE_BOOLEAN) { gboolean b; @@ -877,6 +873,27 @@ _get_fcn_gobject_impl (const NMMetaPropertyInfo *property_info, return cstr; } + if (gtype_prop == G_TYPE_STRV) { + const char *const*strv; + + strv = g_value_get_boxed (&val); + if (strv && strv[0]) + RETURN_STR_TO_FREE (g_strjoinv (",", (char **) strv)); + + /* special hack for handling properties that can be empty and unset + * (see multilist.clear_emptyunset_fcn). */ + if (handle_emptyunset) { + char *str = NULL; + + cstr = _coerce_str_emptyunset (get_type, is_default, NULL, &str); + if (str) + RETURN_STR_TO_FREE (str); + RETURN_STR_TEMPORARY (cstr); + } + + return ""; + } + nm_assert_not_reached (); return NULL; } From e55a45faa25eaa282d8dc96e9d1ffa5d049977d3 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 23 Apr 2019 16:19:11 +0200 Subject: [PATCH 12/18] cli: drop GValue transformation of GBytes to string and implement bytes getter via _get_fcn_gobject_impl() The g_value_register_transform_func() for handling GBytes was not actually used. All properties of type G_TYPE_BYTES have their explit handler how to convert bytes to string. That is good, because the implementation there was very bad (it did not honor pretty/parsable get-type). Also, merge _get_fcn_gobject_bytes() into _get_fcn_gobject_impl(). We already have a generic handler that handles properties solely based on the GObject type: _get_fcn_gobject_impl(). Just let it also handle bytes. It's better to have fewer handlers, if they don't need special context. --- clients/cli/nmcli.c | 32 ------------- clients/common/nm-meta-setting-desc.c | 66 +++++++++++++-------------- 2 files changed, 31 insertions(+), 67 deletions(-) diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c index 2f401e134f..9076e13d7c 100644 --- a/clients/cli/nmcli.c +++ b/clients/cli/nmcli.c @@ -938,34 +938,6 @@ nmc_convert_string_hash_to_string (const GValue *src_value, GValue *dest_value) g_value_take_string (dest_value, g_string_free (string, FALSE)); } -static void -nmc_convert_bytes_to_string (const GValue *src_value, GValue *dest_value) -{ - GBytes *bytes; - const guint8 *array; - gsize length; - GString *printable; - guint i = 0; - - bytes = g_value_get_boxed (src_value); - - printable = g_string_new ("["); - - if (bytes) { - array = g_bytes_get_data (bytes, &length); - while (i < MIN (length, 35)) { - if (i > 0) - g_string_append_c (printable, ' '); - g_string_append_printf (printable, "0x%02X", array[i++]); - } - if (i < length) - g_string_append (printable, " ... "); - } - g_string_append_c (printable, ']'); - - g_value_take_string (dest_value, g_string_free (printable, FALSE)); -} - static void nmc_value_transforms_register (void) { @@ -975,10 +947,6 @@ nmc_value_transforms_register (void) g_value_register_transform_func (G_TYPE_HASH_TABLE, G_TYPE_STRING, nmc_convert_string_hash_to_string); - - g_value_register_transform_func (G_TYPE_BYTES, - G_TYPE_STRING, - nmc_convert_bytes_to_string); } void diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 5bb9a3e8e7..5136d98a2b 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -77,6 +77,25 @@ _gtype_property_get_gtype (GType gtype, const char *property_name) /*****************************************************************************/ +static char * +bytes_to_string (GBytes *bytes) +{ + const guint8 *data; + gsize len; + + if (!bytes) + return NULL; + + data = g_bytes_get_data (bytes, &len); + return nm_utils_bin2hexstr_full (data, + len, + '\0', + TRUE, + NULL); +} + +/*****************************************************************************/ + static int _int64_cmp_desc (gconstpointer a, gconstpointer b, @@ -836,13 +855,14 @@ _get_fcn_gobject_impl (const NMMetaPropertyInfo *property_info, gtype_prop = _gobject_property_get_gtype (G_OBJECT (setting), property_info->property_name); glib_handles_str_transform = !NM_IN_SET (gtype_prop, G_TYPE_BOOLEAN, - G_TYPE_STRV); + G_TYPE_STRV, + G_TYPE_BYTES); if (glib_handles_str_transform) { /* We rely on the type convertion of the gobject property to string. * * Note that we register some transformations via nmc_value_transforms_register() - * to make that working for G_TYPE_HASH_TABLE, and G_TYPE_BYTES. + * to make that working for G_TYPE_HASH_TABLE. * * FIXME: that is particularly ugly because it's non-obvious which code relies * on nmc_value_transforms_register(). Also, nmc_value_transforms_register() is @@ -894,6 +914,14 @@ _get_fcn_gobject_impl (const NMMetaPropertyInfo *property_info, return ""; } + if (gtype_prop == G_TYPE_BYTES) { + char *str; + + str = bytes_to_string (g_value_get_boxed (&val)); + NM_SET_OUT (out_is_default, !str || !str[0]); + RETURN_STR_TO_FREE (str); + } + nm_assert_not_reached (); return NULL; } @@ -1652,23 +1680,6 @@ wep_key_type_to_string (NMWepKeyType type) } } -static char * -bytes_to_string (GBytes *bytes) -{ - const guint8 *data; - gsize len; - - if (!bytes) - return NULL; - - data = g_bytes_get_data (bytes, &len); - return nm_utils_bin2hexstr_full (data, - len, - '\0', - TRUE, - NULL); -} - static char * vlan_flags_to_string (guint32 flags, NMMetaAccessorGetType get_type) { @@ -2257,21 +2268,6 @@ _set_fcn_cert_8021x (ARGS_SET_FCN) } } -static gconstpointer -_get_fcn_gobject_bytes (ARGS_GET_FCN) -{ - gs_unref_bytes GBytes *bytes = NULL; - char *str; - - RETURN_UNSUPPORTED_GET_TYPE (); - - g_object_get (setting, property_info->property_name, &bytes, NULL); - - str = bytes_to_string (bytes); - NM_SET_OUT (out_is_default, !str || !str[0]); - RETURN_STR_TO_FREE (str); -} - static gconstpointer _get_fcn_bond_options (ARGS_GET_FCN) { @@ -4370,7 +4366,7 @@ static const NMMetaPropertyType _pt_gobject_mtu = { }; static const NMMetaPropertyType _pt_gobject_bytes = { - .get_fcn = _get_fcn_gobject_bytes, + .get_fcn = _get_fcn_gobject, .set_fcn = _set_fcn_gobject_bytes, }; From 020c4c81d82ad314f1998b271a4fdfbf96e1b7c3 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 23 Apr 2019 16:34:59 +0200 Subject: [PATCH 13/18] cli: drop GValue transform functions for strdict and implement it in _get_fcn_gobject_impl() The only remaining GValue transform function was from GHashTable (of (str,str) type) to string. Drop that too, and implement the conversion in _get_fcn_gobject_impl(). Note that there are few GObject properties of type GHashTable and most of them implement their own logic. This only applies to "802-3-ethernet.s390-options". Also, always sort the keys. Otherwise, the output is not stable. --- clients/cli/nmcli.c | 36 --------------------------- clients/common/nm-meta-setting-desc.c | 35 +++++++++++++++++++------- 2 files changed, 26 insertions(+), 45 deletions(-) diff --git a/clients/cli/nmcli.c b/clients/cli/nmcli.c index 9076e13d7c..ad45f179a5 100644 --- a/clients/cli/nmcli.c +++ b/clients/cli/nmcli.c @@ -915,40 +915,6 @@ signal_handler (gpointer user_data) return G_SOURCE_CONTINUE; } -static void -nmc_convert_string_hash_to_string (const GValue *src_value, GValue *dest_value) -{ - GHashTable *hash; - GHashTableIter iter; - const char *key, *value; - GString *string; - - hash = (GHashTable *) g_value_get_boxed (src_value); - - string = g_string_new (NULL); - if (hash) { - g_hash_table_iter_init (&iter, hash); - while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &value)) { - if (string->len) - g_string_append_c (string, ','); - g_string_append_printf (string, "%s=%s", key, value); - } - } - - g_value_take_string (dest_value, g_string_free (string, FALSE)); -} - -static void -nmc_value_transforms_register (void) -{ - /* This depends on the fact that all of the hash-table-valued properties - * in libnm-core are string->string. - */ - g_value_register_transform_func (G_TYPE_HASH_TABLE, - G_TYPE_STRING, - nmc_convert_string_hash_to_string); -} - void nm_cli_spawn_pager (NmCli *nmc) { @@ -1006,8 +972,6 @@ main (int argc, char *argv[]) /* Save terminal settings */ tcgetattr (STDIN_FILENO, &termios_orig); - nmc_value_transforms_register (); - nm_cli.return_text = g_string_new (_("Success")); loop = g_main_loop_new (NULL, FALSE); diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index 5136d98a2b..98cb50405c 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -856,17 +856,11 @@ _get_fcn_gobject_impl (const NMMetaPropertyInfo *property_info, glib_handles_str_transform = !NM_IN_SET (gtype_prop, G_TYPE_BOOLEAN, G_TYPE_STRV, - G_TYPE_BYTES); + G_TYPE_BYTES, + G_TYPE_HASH_TABLE); if (glib_handles_str_transform) { - /* We rely on the type convertion of the gobject property to string. - * - * Note that we register some transformations via nmc_value_transforms_register() - * to make that working for G_TYPE_HASH_TABLE. - * - * FIXME: that is particularly ugly because it's non-obvious which code relies - * on nmc_value_transforms_register(). Also, nmc_value_transforms_register() is - * in clients/cli, while we are here in clients/common. */ + /* We rely on the type convertion of the gobject property to string. */ g_value_init (&val, G_TYPE_STRING); } else g_value_init (&val, gtype_prop); @@ -922,6 +916,29 @@ _get_fcn_gobject_impl (const NMMetaPropertyInfo *property_info, RETURN_STR_TO_FREE (str); } + if (gtype_prop == G_TYPE_HASH_TABLE) { + GHashTable *strdict; + gs_free const char **keys = NULL; + GString *str; + gsize i; + + strdict = g_value_get_boxed (&val); + keys = nm_utils_strdict_get_keys (strdict, TRUE, NULL); + if (!keys) + return NULL; + + str = g_string_new (NULL); + for (i = 0; keys[i]; i++) { + if (str->len > 0) + g_string_append_c (str, ','); + g_string_append_printf (str, + "%s=%s", + keys[i], + (const char *) g_hash_table_lookup (strdict, keys[i])); + } + RETURN_STR_TO_FREE (g_string_free (str, FALSE)); + } + nm_assert_not_reached (); return NULL; } From 6d472dacb432611beb825a27163fa63562511f99 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 25 Apr 2019 08:25:34 +0200 Subject: [PATCH 14/18] shared: add nm_utils_named_value_list_*() utils nm_utils_named_value_list_find(), nm_utils_named_value_list_sort(), and nm_utils_named_value_list_is_sorted(). --- shared/nm-glib-aux/nm-shared-utils.c | 96 ++++++++++++++++++++++++++++ shared/nm-glib-aux/nm-shared-utils.h | 18 ++++++ 2 files changed, 114 insertions(+) diff --git a/shared/nm-glib-aux/nm-shared-utils.c b/shared/nm-glib-aux/nm-shared-utils.c index cf08a77fde..07441323ce 100644 --- a/shared/nm-glib-aux/nm-shared-utils.c +++ b/shared/nm-glib-aux/nm-shared-utils.c @@ -2130,6 +2130,8 @@ nm_utils_fd_read_loop_exact (int fd, void *buf, size_t nbytes, bool do_poll) return 0; } +/*****************************************************************************/ + NMUtilsNamedValue * nm_utils_named_values_from_str_dict (GHashTable *hash, guint *out_len) { @@ -2163,6 +2165,100 @@ nm_utils_named_values_from_str_dict (GHashTable *hash, guint *out_len) return values; } +gssize +nm_utils_named_value_list_find (const NMUtilsNamedValue *arr, + gsize len, + const char *name, + gboolean sorted) +{ + gsize i; + + nm_assert (name); + +#if NM_MORE_ASSERTS > 5 + { + for (i = 0; i < len; i++) { + const NMUtilsNamedValue *v = &arr[i]; + + nm_assert (v->name); + if ( sorted + && i > 0) + nm_assert (strcmp (arr[i - 1].name, v->name) < 0); + } + } + + nm_assert ( !sorted + || nm_utils_named_value_list_is_sorted (arr, len, FALSE, NULL, NULL)); +#endif + + if (sorted) { + return nm_utils_array_find_binary_search (arr, + sizeof (NMUtilsNamedValue), + len, + &name, + nm_strcmp_p_with_data, + NULL); + } + for (i = 0; i < len; i++) { + if (nm_streq (arr[i].name, name)) + return i; + } + return ~((gssize) len); +} + +gboolean +nm_utils_named_value_list_is_sorted (const NMUtilsNamedValue *arr, + gsize len, + gboolean accept_duplicates, + GCompareDataFunc compare_func, + gpointer user_data) +{ + gsize i; + int c_limit; + + if (len == 0) + return TRUE; + + g_return_val_if_fail (arr, FALSE); + + if (!compare_func) + compare_func = nm_strcmp_p_with_data; + + c_limit = accept_duplicates ? 0 : -1; + + for (i = 1; i < len; i++) { + int c; + + c = compare_func (&arr[i - 1], &arr[i], user_data); + if (c > c_limit) + return FALSE; + } + return TRUE; +} + +void +nm_utils_named_value_list_sort (NMUtilsNamedValue *arr, + gsize len, + GCompareDataFunc compare_func, + gpointer user_data) +{ + if (len == 0) + return; + + g_return_if_fail (arr); + + if (len == 1) + return; + + g_qsort_with_data (arr, + len, + sizeof (NMUtilsNamedValue), + compare_func ?: nm_strcmp_p_with_data, + user_data); +} + +/*****************************************************************************/ + gpointer * nm_utils_hash_keys_to_array (GHashTable *hash, GCompareDataFunc compare_func, diff --git a/shared/nm-glib-aux/nm-shared-utils.h b/shared/nm-glib-aux/nm-shared-utils.h index af3c2f830b..aec61fe073 100644 --- a/shared/nm-glib-aux/nm-shared-utils.h +++ b/shared/nm-glib-aux/nm-shared-utils.h @@ -911,6 +911,24 @@ typedef struct { NMUtilsNamedValue *nm_utils_named_values_from_str_dict (GHashTable *hash, guint *out_len); +gssize nm_utils_named_value_list_find (const NMUtilsNamedValue *arr, + gsize len, + const char *name, + gboolean sorted); + +gboolean nm_utils_named_value_list_is_sorted (const NMUtilsNamedValue *arr, + gsize len, + gboolean accept_duplicates, + GCompareDataFunc compare_func, + gpointer user_data); + +void nm_utils_named_value_list_sort (NMUtilsNamedValue *arr, + gsize len, + GCompareDataFunc compare_func, + gpointer user_data); + +/*****************************************************************************/ + gpointer *nm_utils_hash_keys_to_array (GHashTable *hash, GCompareDataFunc compare_func, gpointer user_data, From 2f9e55ee52ee4f3faeb2e0a203095142cc0b14c9 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 25 Apr 2019 08:38:35 +0200 Subject: [PATCH 15/18] shared,libnm-core: use nm_utils_named_value_list_sort() --- libnm-core/nm-utils.c | 3 +-- shared/nm-glib-aux/nm-shared-utils.c | 5 +---- shared/nm-glib-aux/nm-shared-utils.h | 3 --- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c index 04d5b1b558..9a1430f6c7 100644 --- a/libnm-core/nm-utils.c +++ b/libnm-core/nm-utils.c @@ -851,8 +851,7 @@ _nm_utils_strdict_to_dbus (const GValue *prop_value) } while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &value)); nm_assert (i == len); - g_qsort_with_data (idx, len, sizeof (idx[0]), - nm_utils_named_entry_cmp_with_data, NULL); + nm_utils_named_value_list_sort (idx, len, NULL, NULL); for (i = 0; i < len; i++) g_variant_builder_add (&builder, "{ss}", idx[i].name, idx[i].value_str); diff --git a/shared/nm-glib-aux/nm-shared-utils.c b/shared/nm-glib-aux/nm-shared-utils.c index 07441323ce..94650705be 100644 --- a/shared/nm-glib-aux/nm-shared-utils.c +++ b/shared/nm-glib-aux/nm-shared-utils.c @@ -2156,10 +2156,7 @@ nm_utils_named_values_from_str_dict (GHashTable *hash, guint *out_len) values[i].name = NULL; values[i].value_ptr = NULL; - if (len > 1) { - g_qsort_with_data (values, len, sizeof (values[0]), - nm_utils_named_entry_cmp_with_data, NULL); - } + nm_utils_named_value_list_sort (values, len, NULL, NULL); NM_SET_OUT (out_len, len); return values; diff --git a/shared/nm-glib-aux/nm-shared-utils.h b/shared/nm-glib-aux/nm-shared-utils.h index aec61fe073..eea54e7143 100644 --- a/shared/nm-glib-aux/nm-shared-utils.h +++ b/shared/nm-glib-aux/nm-shared-utils.h @@ -906,9 +906,6 @@ typedef struct { }; } NMUtilsNamedValue; -#define nm_utils_named_entry_cmp nm_strcmp_p -#define nm_utils_named_entry_cmp_with_data nm_strcmp_p_with_data - NMUtilsNamedValue *nm_utils_named_values_from_str_dict (GHashTable *hash, guint *out_len); gssize nm_utils_named_value_list_find (const NMUtilsNamedValue *arr, From cf9b8d3badfdd2b1617e21e195eef510a5840e79 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 24 Apr 2019 12:03:10 +0200 Subject: [PATCH 16/18] libnm/keyfile: implement ethernet.s390-options in keyfile Currently, nm_setting_wired_get_s390_option() returns the key in an undefined order. Hence, the keyfile writer and the test need to awkwardly sort the keys first. That will be solved better in the next commit, when nm_setting_wired_get_s390_option() returns the items sorted by key. --- libnm-core/nm-keyfile.c | 82 +++++++++++++++++++++ libnm-core/tests/test-setting.c | 124 +++++++++++++++++++++++++++++++- 2 files changed, 204 insertions(+), 2 deletions(-) diff --git a/libnm-core/nm-keyfile.c b/libnm-core/nm-keyfile.c index bf8d219310..f2edd0661d 100644 --- a/libnm-core/nm-keyfile.c +++ b/libnm-core/nm-keyfile.c @@ -994,6 +994,11 @@ read_hash_of_string (GKeyFile *file, NMSetting *setting, const char *key) gboolean is_vpn; gsize n_keys; + nm_assert ( (NM_IS_SETTING_VPN (setting) && nm_streq (key, NM_SETTING_VPN_DATA)) + || (NM_IS_SETTING_VPN (setting) && nm_streq (key, NM_SETTING_VPN_SECRETS)) + || (NM_IS_SETTING_BOND (setting) && nm_streq (key, NM_SETTING_BOND_OPTIONS)) + || (NM_IS_SETTING_USER (setting) && nm_streq (key, NM_SETTING_USER_DATA))); + keys = nm_keyfile_plugin_kf_get_keys (file, setting_name, &n_keys, NULL); if (n_keys == 0) return; @@ -1041,7 +1046,10 @@ read_hash_of_string (GKeyFile *file, NMSetting *setting, const char *key) value); } g_object_set (setting, NM_SETTING_USER_DATA, data, NULL); + return; } + + nm_assert_not_reached (); } static gsize @@ -2019,6 +2027,68 @@ bridge_vlan_writer (KeyfileWriterInfo *info, g_string_free (string, TRUE); } + +#define ETHERNET_S390_OPTIONS_GROUP_NAME "ethernet-s390-options" + +static void +wired_s390_options_parser_full (KeyfileReaderInfo *info, + const NMMetaSettingInfo *setting_info, + const NMSettInfoProperty *property_info, + const ParseInfoProperty *pip, + NMSetting *setting) +{ + NMSettingWired *s_wired = NM_SETTING_WIRED (setting); + gs_strfreev char **keys = NULL; + gsize n_keys; + gsize i; + + keys = nm_keyfile_plugin_kf_get_keys (info->keyfile, ETHERNET_S390_OPTIONS_GROUP_NAME, &n_keys, NULL); + for (i = 0; i < n_keys; i++) { + gs_free char *value = NULL; + gs_free char *key_to_free = NULL; + + value = nm_keyfile_plugin_kf_get_string (info->keyfile, + ETHERNET_S390_OPTIONS_GROUP_NAME, + keys[i], + NULL); + if (!value) + continue; + + nm_setting_wired_add_s390_option (s_wired, + nm_keyfile_key_decode (keys[i], + &key_to_free), + value); + } +} + +static void +wired_s390_options_writer_full (KeyfileWriterInfo *info, + const NMMetaSettingInfo *setting_info, + const NMSettInfoProperty *property_info, + const ParseInfoProperty *pip, + NMSetting *setting) +{ + NMSettingWired *s_wired = NM_SETTING_WIRED (setting); + gs_free NMUtilsNamedValue *arr = NULL; + guint i, n; + + n = nm_setting_wired_get_num_s390_options (s_wired); + if (n == 0) + return; + arr = g_new (NMUtilsNamedValue, n); + for (i = 0; i < n; i++) + nm_setting_wired_get_s390_option (s_wired, i, &arr[i].name, &arr[i].value_str); + nm_utils_named_value_list_sort (arr, n, NULL, NULL); + for (i = 0; i < n; i++) { + gs_free char *key_to_free = NULL; + + nm_keyfile_plugin_kf_set_string (info->keyfile, + ETHERNET_S390_OPTIONS_GROUP_NAME, + nm_keyfile_key_encode (arr[i].name, &key_to_free), + arr[i].value_str); + } +} + static void ip_routing_rule_writer_full (KeyfileWriterInfo *info, const NMMetaSettingInfo *setting_info, @@ -2131,6 +2201,11 @@ write_hash_of_string (GKeyFile *file, gs_free const char **keys = NULL; guint i, l; + nm_assert ( (NM_IS_SETTING_VPN (setting) && nm_streq (key, NM_SETTING_VPN_DATA)) + || (NM_IS_SETTING_VPN (setting) && nm_streq (key, NM_SETTING_VPN_SECRETS)) + || (NM_IS_SETTING_BOND (setting) && nm_streq (key, NM_SETTING_BOND_OPTIONS)) + || (NM_IS_SETTING_USER (setting) && nm_streq (key, NM_SETTING_USER_DATA))); + /* Write VPN secrets out to a different group to keep them separate */ if ( NM_IS_SETTING_VPN (setting) && nm_streq (key, NM_SETTING_VPN_SECRETS)) { @@ -2478,6 +2553,13 @@ static const ParseInfoSetting *const parse_infos[_NM_META_SETTING_TYPE_NUM] = { PARSE_INFO_PROPERTY (NM_SETTING_WIRED_MAC_ADDRESS, .parser = mac_address_parser_ETHER, ), + PARSE_INFO_PROPERTY (NM_SETTING_WIRED_S390_OPTIONS, + .parser_no_check_key = TRUE, + .parser_full = wired_s390_options_parser_full, + .writer_full = wired_s390_options_writer_full, + .has_parser_full = TRUE, + .has_writer_full = TRUE, + ), ), ), PARSE_INFO_SETTING (NM_META_SETTING_TYPE_BLUETOOTH, diff --git a/libnm-core/tests/test-setting.c b/libnm-core/tests/test-setting.c index 03100a039b..e1c26328a4 100644 --- a/libnm-core/tests/test-setting.c +++ b/libnm-core/tests/test-setting.c @@ -2108,6 +2108,116 @@ test_tc_config_dbus (void) /*****************************************************************************/ +static void +_rndt_wired_add_s390_options (NMSettingWired *s_wired, + char **out_keyfile_entries) +{ + gsize n_opts; + gsize i, j; + const char *const*option_names; + gs_free const char **opt_keys = NULL; + gs_strfreev char **opt_vals = NULL; + gs_free bool *opt_found = NULL; + GString *keyfile_entries; + nm_auto_free_gstring GString *str_tmp = NULL; + gs_free NMUtilsNamedValue *valx = NULL; + + option_names = nm_setting_wired_get_valid_s390_options (nmtst_get_rand_bool () ? NULL : s_wired); + + n_opts = NM_PTRARRAY_LEN (option_names); + opt_keys = g_new (const char *, (n_opts + 1)); + nmtst_rand_perm (NULL, opt_keys, option_names, sizeof (const char *), n_opts); + n_opts = nmtst_get_rand_int () % (n_opts + 1); + opt_keys[n_opts] = NULL; + + opt_vals = g_new0 (char *, n_opts + 1); + opt_found = g_new0 (bool, n_opts + 1); + for (i = 0; i < n_opts; i++) { + guint p = nmtst_get_rand_int () % 1000; + + if (p < 200) + opt_vals[i] = nm_strdup_int (i); + else { + opt_vals[i] = g_strdup_printf ("%s%s%s%s-%zu", + ((p % 5) % 2) ? "\n" : "", + ((p % 7) % 2) ? "\t" : "", + ((p % 11) % 2) ? "x" : "", + ((p % 13) % 2) ? "=" : "", + i); + } + } + + if (nmtst_get_rand_bool ()) { + gs_unref_hashtable GHashTable *hash = NULL; + + hash = g_hash_table_new (nm_str_hash, g_str_equal); + for (i = 0; i < n_opts; i++) + g_hash_table_insert (hash, (char *) opt_keys[i], opt_vals[i]); + g_object_set (s_wired, + NM_SETTING_WIRED_S390_OPTIONS, + hash, + NULL); + } else { + for (i = 0; i < n_opts; i++) { + if (!nm_setting_wired_add_s390_option (s_wired, opt_keys[i], opt_vals[i])) + g_assert_not_reached (); + } + } + + g_assert_cmpint (nm_setting_wired_get_num_s390_options (s_wired), ==, n_opts); + + keyfile_entries = g_string_new (NULL); + str_tmp = g_string_new (NULL); + if (n_opts > 0) + g_string_append_printf (keyfile_entries, "[ethernet-s390-options]\n"); + valx = g_new (NMUtilsNamedValue, n_opts); + for (i = 0; i < n_opts; i++) { + gssize idx; + const char *k, *v; + + nm_setting_wired_get_s390_option (s_wired, i, &k, &v); + g_assert (k); + g_assert (v); + + idx = nm_utils_strv_find_first ((char **) opt_keys, n_opts, k); + g_assert (idx >= 0); + g_assert (!opt_found[idx]); + opt_found[idx] = TRUE; + g_assert_cmpstr (opt_keys[idx], ==, k); + g_assert_cmpstr (opt_vals[idx], ==, v); + + valx[i] = (NMUtilsNamedValue) { + .name = k, + .value_str = v, + }; + } + nm_utils_named_value_list_sort (valx, n_opts, NULL, NULL); + for (i = 0; i < n_opts; i++) { + const char *k = valx[i].name; + const char *v = valx[i].value_str; + + g_string_truncate (str_tmp, 0); + for (j = 0; v[j] != '\0'; j++) { + if (v[j] == '\n') + g_string_append (str_tmp, "\\n"); + else if (v[j] == '\t') + g_string_append (str_tmp, "\\t"); + else + g_string_append_c (str_tmp, v[j]); + } + + g_string_append_printf (keyfile_entries, + "%s=%s\n", + k, + str_tmp->str); + } + for (i = 0; i < n_opts; i++) + g_assert (opt_found[i]); + if (n_opts > 0) + g_string_append_printf (keyfile_entries, "\n"); + *out_keyfile_entries = g_string_free (keyfile_entries, FALSE); +} + static GPtrArray * _rndt_wg_peers_create (void) { @@ -2385,6 +2495,7 @@ test_roundtrip_conversion (gconstpointer test_data) int is_ipv4; guint i; gboolean success; + gs_free char *s390_keyfile_entries = NULL; switch (MODE) { case 0: @@ -2403,6 +2514,8 @@ test_roundtrip_conversion (gconstpointer test_data) ETH_MTU, NULL); + _rndt_wired_add_s390_options (s_eth, &s390_keyfile_entries); + g_ptr_array_add (kf_data_arr, g_strdup_printf ("[connection]\n" "id=%s\n" @@ -2415,6 +2528,7 @@ test_roundtrip_conversion (gconstpointer test_data) "mac-address-blacklist=\n" "%s" /* mtu */ "\n" + "%s" /* [ethernet-s390-options] */ "[ipv4]\n" "dns-search=\n" "method=auto\n" @@ -2429,7 +2543,8 @@ test_roundtrip_conversion (gconstpointer test_data) INTERFACE_NAME, (ETH_MTU != 0) ? nm_sprintf_bufa (100, "mtu=%u\n", ETH_MTU) - : "")); + : "", + s390_keyfile_entries)); g_ptr_array_add (kf_data_arr, g_strdup_printf ("[connection]\n" @@ -2443,6 +2558,7 @@ test_roundtrip_conversion (gconstpointer test_data) "mac-address-blacklist=\n" "%s" /* mtu */ "\n" + "%s" /* [ethernet-s390-options] */ "[ipv4]\n" "dns-search=\n" "method=auto\n" @@ -2457,7 +2573,8 @@ test_roundtrip_conversion (gconstpointer test_data) INTERFACE_NAME, (ETH_MTU != 0) ? nm_sprintf_bufa (100, "mtu=%d\n", (int) ETH_MTU) - : "")); + : "", + s390_keyfile_entries)); break; @@ -2703,6 +2820,9 @@ test_roundtrip_conversion (gconstpointer test_data) g_assert_cmpint (nm_setting_wired_get_mtu (s_eth), ==, ETH_MTU); g_assert_cmpint (nm_setting_wired_get_mtu (s_eth2), ==, ETH_MTU); + + g_assert_cmpint (nm_setting_wired_get_num_s390_options (s_eth2), ==, nm_setting_wired_get_num_s390_options (s_eth)); + break; case 1: From 0a8f11639a7ffe439489fe206e8dd9751c2a2381 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 24 Apr 2019 09:24:15 +0200 Subject: [PATCH 17/18] libnm: refactor implementation of "ethernet.s390-options" property - the previous implementation of nm_setting_wired_get_s390_option() returned the elements in an arbitrary order (because it just iterated idx times over the unsorted hash table). - the API for "s390-options" suggests both accessing by index and by name. Storing the options in a hash-table is not optimal for lookup by index. It also requires us to sort the elements over and over again. Use instead a sorted array. Note that add/remove of course requires to move the elements (and has thus O(n)). - "s390-options" are very seldomly set. We shouldn't pay the price in every NMSettingWired to allocate a GHashTable and deal with it. - don't assert in nm_setting_wired_add_s390_option() and nm_setting_wired_remove_s390_option() that the key is valid. ifcfg-rh reader understandably does not want to implement additional logic to pre-validate the key, so any invalid keys would trigger an assertion failure. We have verify() for this purpose. --- libnm-core/nm-core-internal.h | 2 + libnm-core/nm-keyfile.c | 14 +- libnm-core/nm-setting-wired.c | 318 +++++++++++++++--- libnm-core/tests/test-setting.c | 13 +- src/devices/nm-device-ethernet.c | 8 +- .../plugins/ifcfg-rh/nms-ifcfg-rh-writer.c | 2 +- 6 files changed, 276 insertions(+), 81 deletions(-) diff --git a/libnm-core/nm-core-internal.h b/libnm-core/nm-core-internal.h index 3e33dd930d..c05b9dd86e 100644 --- a/libnm-core/nm-core-internal.h +++ b/libnm-core/nm-core-internal.h @@ -260,6 +260,8 @@ typedef gpointer (*NMUtilsCopyFunc) (gpointer); const char **_nm_ip_address_get_attribute_names (const NMIPAddress *addr, gboolean sorted, guint *out_length); +void _nm_setting_wired_clear_s390_options (NMSettingWired *setting); + gboolean _nm_ip_route_attribute_validate_all (const NMIPRoute *route); const char **_nm_ip_route_get_attribute_names (const NMIPRoute *route, gboolean sorted, guint *out_length); GHashTable *_nm_ip_route_get_attributes (NMIPRoute *route); diff --git a/libnm-core/nm-keyfile.c b/libnm-core/nm-keyfile.c index f2edd0661d..6a4681a3ae 100644 --- a/libnm-core/nm-keyfile.c +++ b/libnm-core/nm-keyfile.c @@ -2069,23 +2069,19 @@ wired_s390_options_writer_full (KeyfileWriterInfo *info, NMSetting *setting) { NMSettingWired *s_wired = NM_SETTING_WIRED (setting); - gs_free NMUtilsNamedValue *arr = NULL; guint i, n; n = nm_setting_wired_get_num_s390_options (s_wired); - if (n == 0) - return; - arr = g_new (NMUtilsNamedValue, n); - for (i = 0; i < n; i++) - nm_setting_wired_get_s390_option (s_wired, i, &arr[i].name, &arr[i].value_str); - nm_utils_named_value_list_sort (arr, n, NULL, NULL); for (i = 0; i < n; i++) { + const char *opt_key; + const char *opt_val; gs_free char *key_to_free = NULL; + nm_setting_wired_get_s390_option (s_wired, i, &opt_key, &opt_val); nm_keyfile_plugin_kf_set_string (info->keyfile, ETHERNET_S390_OPTIONS_GROUP_NAME, - nm_keyfile_key_encode (arr[i].name, &key_to_free), - arr[i].value_str); + nm_keyfile_key_encode (opt_key, &key_to_free), + opt_val); } } diff --git a/libnm-core/nm-setting-wired.c b/libnm-core/nm-setting-wired.c index 182e719302..b37acda4ca 100644 --- a/libnm-core/nm-setting-wired.c +++ b/libnm-core/nm-setting-wired.c @@ -75,7 +75,11 @@ typedef struct { guint32 mtu; char **s390_subchannels; char *s390_nettype; - GHashTable *s390_options; + struct { + NMUtilsNamedValue *arr; + guint len; + guint n_alloc; + } s390_options; NMSettingWiredWakeOnLan wol; char *wol_password; } NMSettingWiredPrivate; @@ -87,15 +91,68 @@ G_DEFINE_TYPE (NMSettingWired, nm_setting_wired, NM_TYPE_SETTING) /*****************************************************************************/ static const char *valid_s390_opts[] = { - "portno", "layer2", "portname", "protocol", "priority_queueing", - "buffer_count", "isolation", "total", "inter", "inter_jumbo", "route4", - "route6", "fake_broadcast", "broadcast_mode", "canonical_macaddr", - "checksumming", "sniffer", "large_send", "ipato_enable", "ipato_invert4", - "ipato_add4", "ipato_invert6", "ipato_add6", "vipa_add4", "vipa_add6", - "rxip_add4", "rxip_add6", "lancmd_timeout", "ctcprot", - NULL + "broadcast_mode", + "buffer_count", + "canonical_macaddr", + "checksumming", + "ctcprot", + "fake_broadcast", + "inter", + "inter_jumbo", + "ipato_add4", + "ipato_add6", + "ipato_enable", + "ipato_invert4", + "ipato_invert6", + "isolation", + "lancmd_timeout", + "large_send", + "layer2", + "portname", + "portno", + "priority_queueing", + "protocol", + "route4", + "route6", + "rxip_add4", + "rxip_add6", + "sniffer", + "total", + "vipa_add4", + "vipa_add6", + NULL, }; +static gboolean +valid_s390_opts_check (const char *option) +{ +#if NM_MORE_ASSERTS > 5 + nm_assert (NM_PTRARRAY_LEN (valid_s390_opts) + 1 == G_N_ELEMENTS (valid_s390_opts)); + { + gsize i; + + for (i = 0; i < G_N_ELEMENTS (valid_s390_opts); i++) { + if (i == G_N_ELEMENTS (valid_s390_opts) - 1) + nm_assert (!valid_s390_opts[i]); + else { + nm_assert (valid_s390_opts[i]); + nm_assert (valid_s390_opts[i][0] != '\0'); + if (i > 0) + g_assert (strcmp (valid_s390_opts[i - 1], valid_s390_opts[i]) < 0); + } + } + } +#endif + + return option + && (nm_utils_array_find_binary_search (valid_s390_opts, + sizeof (const char *), + G_N_ELEMENTS (valid_s390_opts) - 1, + &option, + nm_strcmp_p_with_data, + NULL) >= 0); +} + /** * nm_setting_wired_get_port: * @setting: the #NMSettingWired @@ -417,7 +474,7 @@ nm_setting_wired_get_num_s390_options (NMSettingWired *setting) { g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), 0); - return g_hash_table_size (NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_options); + return NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_options.len; } /** @@ -447,24 +504,17 @@ nm_setting_wired_get_s390_option (NMSettingWired *setting, const char **out_key, const char **out_value) { - const char *_key, *_value; - GHashTableIter iter; - guint i = 0; + NMSettingWiredPrivate *priv; g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), FALSE); - g_hash_table_iter_init (&iter, NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_options); - while (g_hash_table_iter_next (&iter, (gpointer) &_key, (gpointer) &_value)) { - if (i == idx) { - if (out_key) - *out_key = _key; - if (out_value) - *out_value = _value; - return TRUE; - } - i++; - } - g_return_val_if_reached (FALSE); + priv = NM_SETTING_WIRED_GET_PRIVATE (setting); + + g_return_val_if_fail (idx < priv->s390_options.len, FALSE); + + NM_SET_OUT (out_key, priv->s390_options.arr[idx].name); + NM_SET_OUT (out_value, priv->s390_options.arr[idx].value_str); + return TRUE; } /** @@ -482,10 +532,21 @@ const char * nm_setting_wired_get_s390_option_by_key (NMSettingWired *setting, const char *key) { + NMSettingWiredPrivate *priv; + gssize idx; + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), NULL); g_return_val_if_fail (key && key[0], NULL); - return g_hash_table_lookup (NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_options, key); + priv = NM_SETTING_WIRED_GET_PRIVATE (setting); + + idx = nm_utils_named_value_list_find (priv->s390_options.arr, + priv->s390_options.len, + key, + TRUE); + if (idx < 0) + return NULL; + return priv->s390_options.arr[idx].value_str; } /** @@ -507,14 +568,51 @@ nm_setting_wired_add_s390_option (NMSettingWired *setting, const char *key, const char *value) { - g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), FALSE); - g_return_val_if_fail (key && key[0], FALSE); - g_return_val_if_fail (g_strv_contains (valid_s390_opts, key), FALSE); - g_return_val_if_fail (value != NULL, FALSE); + NMSettingWiredPrivate *priv; + gssize idx; + NMUtilsNamedValue *v; + + g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), FALSE); + g_return_val_if_fail (value, FALSE); + + if (!valid_s390_opts_check (key)) { + g_return_val_if_fail (key, FALSE); + return FALSE; + } + + priv = NM_SETTING_WIRED_GET_PRIVATE (setting); + + idx = nm_utils_named_value_list_find (priv->s390_options.arr, + priv->s390_options.len, + key, + TRUE); + if (idx < 0) { + gsize dst_idx = ~idx; + + if (priv->s390_options.n_alloc < priv->s390_options.len + 1) { + priv->s390_options.n_alloc = NM_MAX (4, + (priv->s390_options.len + 1) * 2); + priv->s390_options.arr = g_realloc (priv->s390_options.arr, + priv->s390_options.n_alloc * sizeof (NMUtilsNamedValue)); + } + if (dst_idx < priv->s390_options.len) { + memmove (&priv->s390_options.arr[dst_idx + 1], + &priv->s390_options.arr[dst_idx], + (priv->s390_options.len - dst_idx) * sizeof (NMUtilsNamedValue)); + } + priv->s390_options.arr[dst_idx] = (NMUtilsNamedValue) { + .name = g_strdup (key), + .value_str = g_strdup (value), + }; + priv->s390_options.len++; + } else { + v = &priv->s390_options.arr[idx]; + if (nm_streq (value, v->value_str)) + return TRUE; + g_free ((char *) v->value_str); + v->value_str = g_strdup (value); + } - g_hash_table_insert (NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_options, - g_strdup (key), - g_strdup (value)); _notify (setting, PROP_S390_OPTIONS); return TRUE; } @@ -534,20 +632,64 @@ gboolean nm_setting_wired_remove_s390_option (NMSettingWired *setting, const char *key) { - gboolean found; + NMSettingWiredPrivate *priv; + gsize dst_idx; + gssize idx; g_return_val_if_fail (NM_IS_SETTING_WIRED (setting), FALSE); - g_return_val_if_fail (key && key[0], FALSE); + g_return_val_if_fail (key, FALSE); - found = g_hash_table_remove (NM_SETTING_WIRED_GET_PRIVATE (setting)->s390_options, key); - if (found) - _notify (setting, PROP_S390_OPTIONS); - return found; + priv = NM_SETTING_WIRED_GET_PRIVATE (setting); + + idx = nm_utils_named_value_list_find (priv->s390_options.arr, + priv->s390_options.len, + key, + TRUE); + if (idx < 0) + return FALSE; + + dst_idx = idx; + + g_free ((char *) priv->s390_options.arr[dst_idx].name); + g_free ((char *) priv->s390_options.arr[dst_idx].value_str); + if (dst_idx + 1 != priv->s390_options.len) { + memmove (&priv->s390_options.arr[dst_idx], + &priv->s390_options.arr[dst_idx + 1], + (priv->s390_options.len - dst_idx - 1) * sizeof (NMUtilsNamedValue)); + } + + priv->s390_options.len--; + + _notify (setting, PROP_S390_OPTIONS); + return TRUE; +} + +static void +_s390_options_clear (NMSettingWiredPrivate *priv) +{ + guint i; + + for (i = 0; i < priv->s390_options.len; i++) { + g_free ((char *) priv->s390_options.arr[i].name); + g_free ((char *) priv->s390_options.arr[i].value_str); + } + nm_clear_g_free (&priv->s390_options.arr); + priv->s390_options.len = 0; + priv->s390_options.n_alloc = 0; +} + +void +_nm_setting_wired_clear_s390_options (NMSettingWired *setting) +{ + g_return_if_fail (NM_IS_SETTING_WIRED (setting)); + + _s390_options_clear (NM_SETTING_WIRED_GET_PRIVATE (setting)); } /** * nm_setting_wired_get_valid_s390_options: - * @setting: (allow-none): the #NMSettingWired + * @setting: (allow-none): the #NMSettingWired. This argument is unused + * and you may pass %NULL. * * Returns a list of valid s390 options. * @@ -602,10 +744,8 @@ static gboolean verify (NMSetting *setting, NMConnection *connection, GError **error) { NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (setting); - GHashTableIter iter; - const char *key, *value; - int i; GError *local = NULL; + guint i; if (!NM_IN_STRSET (priv->port, NULL, "tp", "aui", "bnc", "mii")) { g_set_error (error, @@ -672,16 +812,19 @@ verify (NMSetting *setting, NMConnection *connection, GError **error) return FALSE; } - g_hash_table_iter_init (&iter, priv->s390_options); - while (g_hash_table_iter_next (&iter, (gpointer) &key, (gpointer) &value)) { - if ( !g_strv_contains (valid_s390_opts, key) - || value[0] == '\0' - || (strlen (value) > 200)) { + for (i = 0; i < priv->s390_options.len; i++) { + const NMUtilsNamedValue *v = &priv->s390_options.arr[i]; + + nm_assert (v->name); + + if ( !valid_s390_opts_check (v->name) + || v->value_str[0] == '\0' + || strlen (v->value_str) > 200) { g_set_error (error, NM_CONNECTION_ERROR, NM_CONNECTION_ERROR_INVALID_PROPERTY, _("invalid '%s' or its value '%s'"), - key, value); + v->name, v->value_str); g_prefix_error (error, "%s.%s: ", NM_SETTING_WIRED_SETTING_NAME, NM_SETTING_WIRED_S390_OPTIONS); return FALSE; } @@ -802,6 +945,8 @@ get_property (GObject *object, guint prop_id, { NMSettingWired *setting = NM_SETTING_WIRED (object); NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (setting); + GHashTable *hash; + guint i; switch (prop_id) { case PROP_PORT: @@ -838,7 +983,16 @@ get_property (GObject *object, guint prop_id, g_value_set_string (value, nm_setting_wired_get_s390_nettype (setting)); break; case PROP_S390_OPTIONS: - g_value_take_boxed (value, _nm_utils_copy_strdict (priv->s390_options)); + hash = g_hash_table_new_full (nm_str_hash, + g_str_equal, + g_free, + g_free); + for (i = 0; i < priv->s390_options.len; i++) { + g_hash_table_insert (hash, + g_strdup (priv->s390_options.arr[i].name), + g_strdup (priv->s390_options.arr[i].value_str)); + } + g_value_take_boxed (value, hash); break; case PROP_WAKE_ON_LAN: g_value_set_uint (value, priv->wol); @@ -859,7 +1013,6 @@ set_property (GObject *object, guint prop_id, NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (object); const char * const *blacklist; const char *mac; - int i; switch (prop_id) { case PROP_PORT: @@ -894,6 +1047,8 @@ set_property (GObject *object, guint prop_id, blacklist = g_value_get_boxed (value); g_array_set_size (priv->mac_address_blacklist, 0); if (blacklist && *blacklist) { + guint i; + for (i = 0; blacklist[i]; i++) { mac = _nm_utils_hwaddr_canonical_or_invalid (blacklist[i], ETH_ALEN); g_array_append_val (priv->mac_address_blacklist, mac); @@ -913,8 +1068,63 @@ set_property (GObject *object, guint prop_id, priv->s390_nettype = g_value_dup_string (value); break; case PROP_S390_OPTIONS: - g_hash_table_unref (priv->s390_options); - priv->s390_options = _nm_utils_copy_strdict (g_value_get_boxed (value)); + { + GHashTable *hash; + + _s390_options_clear (priv); + + hash = g_value_get_boxed (value); + + priv->s390_options.n_alloc = hash ? g_hash_table_size (hash) : 0u; + + if (priv->s390_options.n_alloc > 0) { + gboolean invalid_content = FALSE; + GHashTableIter iter; + const char *key; + const char *val; + guint i, j; + + priv->s390_options.arr = g_new (NMUtilsNamedValue, priv->s390_options.n_alloc); + g_hash_table_iter_init (&iter, hash); + while (g_hash_table_iter_next (&iter, (gpointer *) &key, (gpointer *) &val)) { + if (!key || !val) { + invalid_content = TRUE; + continue; + } + nm_assert (priv->s390_options.len < priv->s390_options.n_alloc); + priv->s390_options.arr[priv->s390_options.len] = (NMUtilsNamedValue) { + .name = g_strdup (key), + .value_str = g_strdup (val), + }; + priv->s390_options.len++; + } + if (priv->s390_options.len > 1) { + nm_utils_named_value_list_sort (priv->s390_options.arr, + priv->s390_options.len, + NULL, + NULL); + /* prune duplicate keys. This is only possible if @hash does not use + * g_str_equal() as compare function (which would be a bug). + * Still, handle this, because we use later binary sort and rely + * on unique names. One bug here, should not bork the remainder + * of the program. */ + j = 1; + for (i = 1; i < priv->s390_options.len; i++) { + if (nm_streq (priv->s390_options.arr[j - 1].name, + priv->s390_options.arr[i].name)) { + g_free ((char *) priv->s390_options.arr[i].name); + g_free ((char *) priv->s390_options.arr[i].value_str); + invalid_content = TRUE; + continue; + } + priv->s390_options.arr[j++] = priv->s390_options.arr[i]; + } + priv->s390_options.len = j; + } + + g_return_if_fail (!invalid_content); + } + } break; case PROP_WAKE_ON_LAN: priv->wol = g_value_get_uint (value); @@ -936,8 +1146,6 @@ nm_setting_wired_init (NMSettingWired *setting) { NMSettingWiredPrivate *priv = NM_SETTING_WIRED_GET_PRIVATE (setting); - priv->s390_options = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, g_free); - /* We use GArray rather than GPtrArray so it will automatically be NULL-terminated */ priv->mac_address_blacklist = g_array_new (TRUE, FALSE, sizeof (char *)); g_array_set_clear_func (priv->mac_address_blacklist, (GDestroyNotify) clear_blacklist_item); @@ -965,7 +1173,7 @@ finalize (GObject *object) g_free (priv->duplex); g_free (priv->s390_nettype); - g_hash_table_destroy (priv->s390_options); + _s390_options_clear (priv); g_free (priv->device_mac_address); g_free (priv->cloned_mac_address); diff --git a/libnm-core/tests/test-setting.c b/libnm-core/tests/test-setting.c index e1c26328a4..8784a27470 100644 --- a/libnm-core/tests/test-setting.c +++ b/libnm-core/tests/test-setting.c @@ -2120,7 +2120,6 @@ _rndt_wired_add_s390_options (NMSettingWired *s_wired, gs_free bool *opt_found = NULL; GString *keyfile_entries; nm_auto_free_gstring GString *str_tmp = NULL; - gs_free NMUtilsNamedValue *valx = NULL; option_names = nm_setting_wired_get_valid_s390_options (nmtst_get_rand_bool () ? NULL : s_wired); @@ -2158,6 +2157,7 @@ _rndt_wired_add_s390_options (NMSettingWired *s_wired, hash, NULL); } else { + _nm_setting_wired_clear_s390_options (s_wired); for (i = 0; i < n_opts; i++) { if (!nm_setting_wired_add_s390_option (s_wired, opt_keys[i], opt_vals[i])) g_assert_not_reached (); @@ -2170,7 +2170,6 @@ _rndt_wired_add_s390_options (NMSettingWired *s_wired, str_tmp = g_string_new (NULL); if (n_opts > 0) g_string_append_printf (keyfile_entries, "[ethernet-s390-options]\n"); - valx = g_new (NMUtilsNamedValue, n_opts); for (i = 0; i < n_opts; i++) { gssize idx; const char *k, *v; @@ -2186,16 +2185,6 @@ _rndt_wired_add_s390_options (NMSettingWired *s_wired, g_assert_cmpstr (opt_keys[idx], ==, k); g_assert_cmpstr (opt_vals[idx], ==, v); - valx[i] = (NMUtilsNamedValue) { - .name = k, - .value_str = v, - }; - } - nm_utils_named_value_list_sort (valx, n_opts, NULL, NULL); - for (i = 0; i < n_opts; i++) { - const char *k = valx[i].name; - const char *v = valx[i].value_str; - g_string_truncate (str_tmp, 0); for (j = 0; v[j] != '\0'; j++) { if (v[j] == '\n') diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c index 170c7e2852..ff1c482f47 100644 --- a/src/devices/nm-device-ethernet.c +++ b/src/devices/nm-device-ethernet.c @@ -1575,11 +1575,11 @@ update_connection (NMDevice *device, NMConnection *connection) g_object_set (s_wired, NM_SETTING_WIRED_S390_SUBCHANNELS, priv->subchannels_dbus, NULL); if (priv->s390_nettype) g_object_set (s_wired, NM_SETTING_WIRED_S390_NETTYPE, priv->s390_nettype, NULL); - g_hash_table_iter_init (&iter, priv->s390_options); - while (g_hash_table_iter_next (&iter, &key, &value)) { - nm_setting_wired_add_s390_option (s_wired, (const char *) key, (const char *) value); - } + _nm_setting_wired_clear_s390_options (s_wired); + g_hash_table_iter_init (&iter, priv->s390_options); + while (g_hash_table_iter_next (&iter, &key, &value)) + nm_setting_wired_add_s390_option (s_wired, (const char *) key, (const char *) value); } static void diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c index 80b1bffe1f..b752642dfe 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c @@ -1118,7 +1118,7 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) nm_setting_wired_get_s390_option (s_wired, i, &s390_key, &s390_val); /* portname is handled separately */ - if (!strcmp (s390_key, "portname") || !strcmp (s390_key, "ctcprot")) + if (NM_IN_STRSET (s390_key, "portname", "ctcprot")) continue; if (!tmp) From df769c8dfd015c9a6ade4aa1cfc40f38d4e5398c Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 24 Apr 2019 13:06:58 +0200 Subject: [PATCH 18/18] ifcfg-rh: support serializaing all possible values for ethernet.s390-options (OPTIONS) While the keys of s390-options are from a well-behaving set of names (that is enforced by nm_connection_verify()), the values are arbitrary strings. Our settings plugin must be able to express all values of a connection, hence we need to support escapes. --- src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c | 2 +- src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index e5423b181e..286ee58abc 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -4512,7 +4512,7 @@ make_wired_setting (shvarFile *ifcfg, gs_free const char **options = NULL; gsize i; - options = nm_utils_strsplit_set_with_empty (value, " "); + options = nm_utils_escaped_tokens_split (value, NM_ASCII_SPACES); for (i = 0; options && options[i]; i++) { const char *line = options[i]; const char *equals; diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c index b752642dfe..e9a023c5b9 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c @@ -1121,11 +1121,19 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) if (NM_IN_STRSET (s390_key, "portname", "ctcprot")) continue; + if (strchr (s390_key, '=')) { + /* this key cannot be expressed. But after all, it's not valid anyway + * and the connection shouldn't even verify. */ + continue; + } + if (!tmp) tmp = g_string_sized_new (30); else g_string_append_c (tmp, ' '); - g_string_append_printf (tmp, "%s=%s", s390_key, s390_val); + nm_utils_escaped_tokens_escape_gstr (s390_key, NM_ASCII_SPACES, tmp); + g_string_append_c (tmp, '='); + nm_utils_escaped_tokens_escape_gstr (s390_val, NM_ASCII_SPACES, tmp); } if (tmp) svSetValueStr (ifcfg, "OPTIONS", tmp->str);