about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/check-config-options.sh72
-rwxr-xr-xtools/run-nm-test.sh9
-rwxr-xr-xtools/test-networkmanager-service.py24
3 files changed, 98 insertions, 7 deletions
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/.*\<NM_CON_DEFAULT\s*("\([^"]*\)").*/\1/p' $(find "$srcdir/src/" -name \*.c ! -name test\*.c)
+    sed -ne 's/.*\<NM_CON_DEFAULT_NOP\s*("\([^"]*\)").*/\1/p' $(find "$srcdir/src/" -name \*.c ! -name test\*.c)
+}
+
+get_man_con_defaults()
+{
+    awk '/start connection defaults/{flag=1;next}/end connection defaults/{flag=0}flag' "$srcdir/man/NetworkManager.conf.xml" |
+	sed -ne 's#.*<varname>\([^<]*\)</varname>.*#\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):