diff options
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/check-docs.sh | 79 | ||||
| -rwxr-xr-x | tools/check-settings-docs.sh | 19 | ||||
| -rwxr-xr-x | tools/create-exports-NetworkManager.sh | 2 | ||||
| -rwxr-xr-x | tools/meson-post-install.sh | 2 | ||||
| -rwxr-xr-x | tools/test-networkmanager-service.py | 12 |
5 files changed, 88 insertions, 26 deletions
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/.*<xi:include href="dbus-\(.*\.xml\)".*/\1\n\1/p' $SOURCEDIR''docs/api/network-manager-docs.xml; - cd $SOURCEDIR''introspection; ls *.xml) |sort |uniq -u| grep . >&2; then - echo "*** Error: D-Bus interfaces not included in docs/api/network-manager-docs.xml ***" >&2 - exit 1 +F1="$(sed -n 's,^ <xi:include href="dbus-\([^"]*\.xml\)"/>$,\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/.*<xi:include href="\(xml\/.*\.xml\)".*/\1\n\1/p' $SOURCEDIR''docs/libnm/libnm-docs.xml; - grep -lE "$(sed -n 's/^[\t ]*\(.*_get_type\);/\1/p' $SOURCEDIR''libnm/libnm.ver |xargs echo |sed 's/ /|/g')" $SOURCEDIR''libnm{,-core}/*.h | - sed 's,.*/,xml/,;s/\.h$/.xml/') |sort |uniq -u| grep . >&2; then - echo "*** Error: libnm classes not included in docs/libnm/libnm-docs.xml ***" >&2 - exit 1 +F1="$(sed -n 's/.*<xi:include href="xml\/\([^"]*\)\.xml".*/\1/p' "$SOURCEDIR"docs/libnm/libnm-docs.xml)" +F1_EXTRA=" +nm-core-enum-types +nm-enum-types +" +F2="$(grep -l "$(sed -n 's/^[\t ]*\(.*_get_type\);/\1/p' "$SOURCEDIR"libnm/libnm.ver | word_regex)" \ + $(libnm_headers "$SOURCEDIR" "$BUILDDIR") \ + | sed 's,.*/\([^/]\+\)\.h$,\1,')" +F2_EXTRA=" +annotation-glossary +api-index-full +nm-dbus-interface +nm-errors +nm-utils +nm-version +" +if ! same_lines "$F1"$'\n'"$F1_EXTRA" "$F2"$'\n'"$F2_EXTRA"; then + die "*** Error: libnm classes not included in docs/libnm/libnm-docs.xml ***" fi - -exit 0 diff --git a/tools/check-settings-docs.sh b/tools/check-settings-docs.sh new file mode 100755 index 00000000..8695ccc0 --- /dev/null +++ b/tools/check-settings-docs.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +srcdir=$1 +builddir=$2 +doc_h=$3 + +if [ -z "$NMTST_NO_CHECK_SETTINGS_DOCS" ] ; then + if ! cmp -s "${srcdir}/${doc_h}.in" "${builddir}/${doc_h}"; then + if [ "$NM_TEST_REGENERATE" = 1 ] ; then + cp -f "${builddir}/${doc_h}" "${srcdir}/${doc_h}.in" + else + echo "*** Error: the generated file '${builddir}/${doc_h}' differs from the source file '${srcdir}/${doc_h}.in'. You probably should copy the generated file over to the source file. You can skip this test by setting NMTST_NO_CHECK_SETTINGS_DOCS=yes. You can also automatically copy the file by rerunning the test with NM_TEST_REGENERATE=1" + exit 1 + fi + fi +fi + +exit 0 + diff --git a/tools/create-exports-NetworkManager.sh b/tools/create-exports-NetworkManager.sh index 3c5789d8..375141aa 100755 --- a/tools/create-exports-NetworkManager.sh +++ b/tools/create-exports-NetworkManager.sh @@ -19,7 +19,7 @@ die() { _build() { git clean -fdx ./autogen.sh --enable-ld-gc --enable-ifcfg-rh --enable-ifupdown \ - --enable-ibft --enable-teamdctl --enable-wifi \ + --enable-config-plugin-ibft --enable-teamdctl --enable-wifi \ --with-modem-manager-1 --with-ofono --with-more-asserts \ --with-more-logging make -j20 diff --git a/tools/meson-post-install.sh b/tools/meson-post-install.sh index 8a60ce33..2037c0ce 100755 --- a/tools/meson-post-install.sh +++ b/tools/meson-post-install.sh @@ -42,6 +42,6 @@ if [ "$6" = install_docs ]; then ln -f "${DESTDIR}${mandir}/man1/nmtui.1" "${DESTDIR}${mandir}/man1/${alias}.1" done - ln -f "${DESTDIR}${mandir}/man5/NetworkManager.conf.5" "${DESTDIR}${mandir}/man5/nm-system-settings.conf" + ln -f "${DESTDIR}${mandir}/man5/NetworkManager.conf.5" "${DESTDIR}${mandir}/man5/nm-system-settings.conf.5" fi diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py index 8a37fb17..9aa44a90 100755 --- a/tools/test-networkmanager-service.py +++ b/tools/test-networkmanager-service.py @@ -916,16 +916,8 @@ class WifiDevice(Device): self.aps = [] self.scan_cb_id = None - # Note: we would like to simulate how nmcli calls RequestScan() and we could - # do so by using an older timestamp. However, that makes the client tests - # racy, because if a bunch of nmcli instances run in parallel against this - # service, earlier instances will issue a RequestScan(), while later instances - # won't do that (because the LastScan timestamp is already updated). That means, - # the later instances will print the scan result immediately, and in another sort - # order. That should be fixed, by nmcli not starting to print anything, before - # all RequestScan() requests complete, and thus, always print a consistent list - # of results. - ts = NM.utils_get_timestamp_msec() + # Use a randomly older timestamp to trigger RequestScan() from the client + ts = max(0, NM.utils_get_timestamp_msec() - Util.random_int(self.path, 20000, 40000)) props = { PRP_WIFI_HW_ADDRESS: mac, |