From 964ae8cc391520440cf5aa13e2b9cc34850ea6c2 Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Tue, 26 Feb 2019 19:01:41 +0100 Subject: New upstream version 1.14.6 --- tools/check-docs.sh | 79 ++++++++++++++++++++++++++++------ tools/check-settings-docs.sh | 19 ++++++++ tools/create-exports-NetworkManager.sh | 2 +- tools/meson-post-install.sh | 2 +- tools/test-networkmanager-service.py | 12 +----- 5 files changed, 88 insertions(+), 26 deletions(-) create mode 100755 tools/check-settings-docs.sh (limited to 'tools') diff --git a/tools/check-docs.sh b/tools/check-docs.sh index 9dcdb1ef..b6fca6e0 100755 --- a/tools/check-docs.sh +++ b/tools/check-docs.sh @@ -1,22 +1,73 @@ -#!/bin/sh +#!/bin/bash -SOURCEDIR=$1 +set -e + +export LANG=C + +die() { + printf '%s\n' "$@" >&2 + exit 1 +} + +word_regex() { + tr '\n|<>\\' ' ' \ + | sed -e 's, *$,\\>,' \ + -e 's,^ *,\\<,' \ + -e 's, \+,\\>\\|\\<,g' +} + +same_lines() { + diff <(printf "%s\n" "$1" | sed '/^$/d' | sort) \ + <(printf "%s\n" "$2" | sed '/^$/d' | sort) >&2 +} + +libnm_headers() { + ( + ls -1 "$1"libnm/*.h "$1"libnm-core/*.h + if [ -n "$2" ]; then + ls -1 "$2"/libnm/*.h "$2"/libnm-core/*.h + fi + ) | sort | uniq +} + + +SOURCEDIR="$1" +BUILDDIR="$2" +if test "$SOURCEDIR" == "$BUILDDIR"; then + BUILDDIR= +fi [ -n "$SOURCEDIR" ] && SOURCEDIR="$SOURCEDIR/" + # Check that the D-Bus API docs contain all known interfaces -if (sed -n 's/.*&2; then - echo "*** Error: D-Bus interfaces not included in docs/api/network-manager-docs.xml ***" >&2 - exit 1 +F1="$(sed -n 's,^ $,\1,p' "$SOURCEDIR"docs/api/network-manager-docs.xml)" +F1_EXTRA=" +org.freedesktop.NetworkManager.Device.WiMax.xml +org.freedesktop.NetworkManager.WiMax.Nsp.xml +" +F2="$(cd "$SOURCEDIR"introspection; ls -1 *.xml)" +if ! same_lines "$F1"$'\n'"$F1_EXTRA" "$F2" ; then + die "*** Error: D-Bus interfaces not included in docs/api/network-manager-docs.xml ***" fi + # Check that files that define types that are in public libnm API are included in libnm documentation. -# Don't complain about readability or I'll rewrite this in Perl. -if (sed -n 's/.*&2; then - echo "*** Error: libnm classes not included in docs/libnm/libnm-docs.xml ***" >&2 - exit 1 +F1="$(sed -n 's/.* Date: Tue, 26 Mar 2019 23:25:23 +0100 Subject: New upstream version 1.16.0 --- tools/check-config-options.sh | 72 ++++++++++++++++++++++++++++++++++++ tools/run-nm-test.sh | 9 +++-- tools/test-networkmanager-service.py | 24 ++++++++++-- 3 files changed, 98 insertions(+), 7 deletions(-) create mode 100755 tools/check-config-options.sh (limited to 'tools') diff --git a/tools/check-config-options.sh b/tools/check-config-options.sh new file mode 100755 index 00000000..659f5490 --- /dev/null +++ b/tools/check-config-options.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +srcdir=${1:-.} +ret=0 + +get_supported_options() +{ + awk '/START OPTION LIST/{flag=1;next}/END OPTION LIST/{flag=0}flag' "$srcdir/src/nm-config.c" | + grep -o 'NM_CONFIG_KEYFILE_KEY_\w*' +} + +get_missing_options() +{ + grep -v '/\* check-config-options skip \*/' "$srcdir/src/nm-config.h" | + grep -o 'NM_CONFIG_KEYFILE_KEY_\w*' | + grep -v -Fx -f <(get_supported_options) +} + +get_src_con_defaults() +{ + sed -ne 's/.*\\([^<]*\).*#\1#p' +} + +get_missing_con_defaults() +{ + get_src_con_defaults | grep -v -Fx -f <(get_man_con_defaults) +} + +get_missing_con_defaults2() +{ + get_man_con_defaults | grep -v -Fx -f <(get_src_con_defaults) +} + +missing=$(get_missing_options) + +if [ -n "$missing" ]; then + echo "***" + echo "*** Error: the following configuration options are defined but not present in the list of supported options" + echo "***" + echo "$missing" + echo + ret=1 +fi + +missing_con_defaults=$(get_missing_con_defaults) +if [ -n "$missing_con_defaults" ]; then + echo "***" + echo "*** Error: the following connection defaults are present in source files but not in the NetworkManager.conf man page:" + echo "***" + echo "$missing_con_defaults" + echo + ret=1 +fi + +missing_con_defaults2=$(get_missing_con_defaults2) +if [ -n "$missing_con_defaults2" ]; then + echo "***" + echo "*** Error: the following connection defaults are present in the NetworkManager.conf man page but not in source files:" + echo "***" + echo "$missing_con_defaults2" + echo + ret=1 +fi + +exit $ret diff --git a/tools/run-nm-test.sh b/tools/run-nm-test.sh index 29ac7cd3..6e7d02c8 100755 --- a/tools/run-nm-test.sh +++ b/tools/run-nm-test.sh @@ -278,7 +278,7 @@ if [ $RESULT -ne 0 -a $RESULT -ne 77 ]; then UNRESOLVED=$(awk -F: '/obj:\// {print $NF}' "$LOGFILE" | sort | uniq) if [ -n "$UNRESOLVED" ]; then echo Some addresses could not be resolved into symbols. >&2 - echo The errors might get suppressed when you install the debuging symbols. >&2 + echo The errors might get suppressed when you install the debugging symbols. >&2 if [ -x /usr/bin/dnf ]; then echo Hint: dnf debuginfo-install $UNRESOLVED >&2 elif [ -x /usr/bin/debuginfo-install ]; then @@ -294,8 +294,11 @@ fi if [ $HAS_ERRORS -eq 0 ]; then # valgrind doesn't support setns syscall and spams the logfile. # hack around it... - if [ "$TEST_NAME" = 'test-link-linux' -a -z "$(sed -e '/^--[0-9]\+-- WARNING: unhandled .* syscall: /,/^--[0-9]\+-- it at http.*\.$/d' "$LOGFILE")" ]; then - HAS_ERRORS=1 + if [ "$TEST_NAME" = 'test-link-linux' -o \ + "$TEST_NAME" = 'test-acd' ]; then + if [ -z "$(sed -e '/^--[0-9]\+-- WARNING: unhandled .* syscall: /,/^--[0-9]\+-- it at http.*\.$/d' "$LOGFILE")" ]; then + HAS_ERRORS=1 + fi fi fi diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py index 9aa44a90..2fec2e26 100755 --- a/tools/test-networkmanager-service.py +++ b/tools/test-networkmanager-service.py @@ -296,7 +296,7 @@ class Util: if val.signature == 'y': return GLib.Variant('ay', [int(x) for x in val]) if val.signature == 'u': - return GLib.Variant('au', [Util.variant_from_dbus(x) for x in val]) + return GLib.Variant('au', [int(x) for x in val]) if val.signature == 'ay': return GLib.Variant('aay', [Util.variant_from_dbus(x) for x in val]) if val.signature == 'au': @@ -861,12 +861,23 @@ class WifiAp(ExportedObj): ExportedObj.__init__(self, ExportedObj.create_path(WifiAp), ident) + NM_AP_FLAGS = getattr(NM, '80211ApSecurityFlags') if flags is None: flags = 0x1 if wpaf is None: - wpaf = 0x1cc + wpaf = 0x0 + wpaf = wpaf | NM_AP_FLAGS.PAIR_TKIP + wpaf = wpaf | NM_AP_FLAGS.PAIR_CCMP + wpaf = wpaf | NM_AP_FLAGS.GROUP_TKIP + wpaf = wpaf | NM_AP_FLAGS.GROUP_CCMP + wpaf = wpaf | NM_AP_FLAGS.KEY_MGMT_PSK if rsnf is None: - rsnf = 0x1cc + rsnf = 0x0 + rsnf = rsnf | NM_AP_FLAGS.PAIR_TKIP + rsnf = rsnf | NM_AP_FLAGS.PAIR_CCMP + rsnf = rsnf | NM_AP_FLAGS.GROUP_TKIP + rsnf = rsnf | NM_AP_FLAGS.GROUP_CCMP + rsnf = rsnf | NM_AP_FLAGS.KEY_MGMT_PSK if freq is None: freq = 2412 if bssid is None: @@ -1341,9 +1352,14 @@ class NetworkManager(ExportedObj): @dbus.service.method(dbus_interface=IFACE_NM, in_signature='a{sa{sv}}oo', out_signature='oo') def AddAndActivateConnection(self, con_hash, devpath, specific_object): + conpath, acpath, result = self.AddAndActivateConnection2(con_hash, devpath, specific_object, dict()) + return (conpath, acpath) + + @dbus.service.method(dbus_interface=IFACE_NM, in_signature='a{sa{sv}}ooa{sv}', out_signature='ooa{sv}') + def AddAndActivateConnection2(self, con_hash, devpath, specific_object, options): device = self.find_device_first(path = devpath, require = BusErr.UnknownDeviceException) conpath = gl.settings.AddConnection(con_hash) - return (conpath, self.ActivateConnection(conpath, devpath, specific_object)) + return (conpath, self.ActivateConnection(conpath, devpath, specific_object), []) @dbus.service.method(dbus_interface=IFACE_NM, in_signature='o', out_signature='') def DeactivateConnection(self, active_connection): -- cgit 1.3.0-6-gf8a5 From 85563b7fc7ec2cd21e38debb9b28db342e2e8e7c Mon Sep 17 00:00:00 2001 From: Michael Biebl Date: Sun, 21 Apr 2019 21:09:51 +0200 Subject: New upstream version 1.18.0 --- tools/test-networkmanager-service.py | 82 ++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) (limited to 'tools') diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py index 2fec2e26..c2d874f3 100755 --- a/tools/test-networkmanager-service.py +++ b/tools/test-networkmanager-service.py @@ -687,6 +687,7 @@ PRP_DEVICE_MANAGED = "Managed" PRP_DEVICE_AUTOCONNECT = "Autoconnect" PRP_DEVICE_DEVICE_TYPE = "DeviceType" PRP_DEVICE_AVAILABLE_CONNECTIONS = "AvailableConnections" +PRP_DEVICE_LLDP_NEIGHBORS = "LldpNeighbors" class Device(ExportedObj): @@ -719,6 +720,87 @@ class Device(ExportedObj): PRP_DEVICE_AUTOCONNECT: True, PRP_DEVICE_DEVICE_TYPE: dbus.UInt32(devtype), PRP_DEVICE_AVAILABLE_CONNECTIONS: ExportedObj.to_path_array([]), + PRP_DEVICE_LLDP_NEIGHBORS: dbus.Array([ + dbus.Dictionary({ + 'chassis-id-type': dbus.UInt32(6), + 'chassis-id': dbus.String('00:11:22:33:44:00'), + 'port-id-type': dbus.UInt32(7), + 'port-id': dbus.String('Uplink port'), + 'port-description': dbus.String('GigabitEthernet #1'), + 'system-name': dbus.String('test1.example.com'), + 'system-description': dbus.String('Test system #1'), + 'system-capabilities': dbus.UInt32(20), + 'destination': dbus.String('nearest-bridge'), + }), + dbus.Dictionary({ + 'chassis-id-type': dbus.UInt32(2), + 'chassis-id': dbus.String('chassis1'), + 'port-id-type': dbus.UInt32(3), + 'port-id': dbus.String('44:44:44:44:44:44'), + 'port-description': dbus.String('GigabitEthernet #2'), + 'system-name': dbus.String('test2.example.com'), + 'system-description': dbus.String('Test system #2'), + 'system-capabilities': dbus.UInt32(2047), + 'destination': dbus.String('nearest-non-tpmr-bridge'), + 'ieee-802-1-vlans': dbus.Array([ + dbus.Dictionary({ + 'vid': dbus.UInt32(80), + 'name': dbus.String('vlan80'), + }, signature = 'sv'), + dbus.Dictionary({ + 'vid': dbus.UInt32(4000), + 'name': dbus.String('My VLAN'), + }, signature = 'sv'), + ]), + 'ieee-802-1-ppvids': dbus.Array([ + dbus.Dictionary({ + 'ppvid': dbus.UInt32(4), + 'flags': dbus.UInt32(0x12), + }, signature = 'sv'), + dbus.Dictionary({ + 'ppvid': dbus.UInt32(10), + 'flags': dbus.UInt32(0x31), + }, signature = 'sv'), + ]), + + }), + dbus.Dictionary({ + 'chassis-id-type': dbus.UInt32(6), + 'chassis-id': dbus.String('00:11:22:33:44:22'), + 'port-id-type': dbus.UInt32(1), + 'port-id': dbus.String('port1'), + 'port-description': dbus.String('GigabitEthernet #3'), + 'system-name': dbus.String('test3.example.com'), + 'system-description': dbus.String('Test system #3'), + 'system-capabilities': dbus.UInt32(40), + 'destination': dbus.String('nearest-customer-bridge'), + 'management-addresses': dbus.Array([ + dbus.Dictionary({ + 'address-subtype': dbus.UInt32(1), + 'address': dbus.ByteArray(b'\xc0\xa8\x01\x01'), + 'interface-number': dbus.UInt32(4), + 'interface-number-subtype': dbus.UInt32(3), + 'object-id': dbus.ByteArray(b'\x01\x02\x03\x04') + }, signature = 'sv'), + dbus.Dictionary({ + 'address-subtype': dbus.UInt32(2), + 'address': dbus.ByteArray(b'\xfd\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x12\x34\x56\x78'), + 'interface-number': dbus.UInt32(1), + 'interface-number-subtype': dbus.UInt32(2), + }, signature = 'sv'), + ]), + 'ieee-802-3-mac-phy-conf': dbus.Dictionary({ + 'autoneg': dbus.UInt32(3), + 'pmd-autoneg-cap': dbus.UInt32(0xfe), + 'operational-mau-type': dbus.UInt32(5), + }, signature = 'sv'), + 'ieee-802-3-power-via-mdi': dbus.Dictionary({ + 'mdi-power-support': dbus.UInt32(7), + 'pse-power-pair': dbus.UInt32(6), + 'power-class': dbus.UInt32(1), + }, signature = 'sv'), + }) + ], 'a{sv}') } self.dbus_interface_add(IFACE_DEVICE, props, Device.PropertiesChanged) -- cgit 1.3.0-6-gf8a5