summaryrefslogtreecommitdiff
path: root/contrib/scripts
Commit message (Collapse)AuthorAgeFilesLines
* contrib/checkpatch: fix the systemd code pathlr/licensingLubomir Rintel2019-09-101-1/+1
|
* contrib/checkpatch: check for SPDX tagsLubomir Rintel2019-09-101-1/+8
|
* all: SPDX header conversionLubomir Rintel2019-09-105-161/+4
| | | | | $ find * -type f |xargs perl contrib/scripts/spdx.pl $ git rm contrib/scripts/spdx.pl
* contrib/spdx: add a tool that determines SPDX licensing headersLubomir Rintel2019-09-101-0/+105
| | | | | | | This is a one-off hacky tool that we'll use to convert the long license boilerplates to SPDX headers that are more friendly to automated tools. Then we can drop it and forget it existed.
* dhcp: add nettools dhcp4 clientTom Gundersen2019-07-051-1/+1
| | | | | | | | | | | | | | | | | | | This is inspired by the existing systemd integration, with a few differences: * This parses the WPAD option, which systemd requested, but did not use. * We hook into the DAD handling, only making use of the configured address once DAD has completed successfully, and declining the lease if it fails. There are still many areas of possible improvement. In particular, we need to ensure the parsing of all options are compliant, as n-dhcp4 treats all options as opaque, unlike sd-dhcp4. We probably also need to look at how to handle failures and retries (in particular if we decline a lease). We need to query the current MTU at client startu, as well as the hardware broadcast address. Both these are provided by the kernel over netlink, so it should simply be a matter of hooking that up with NM's netlink layer. Contribution under LGPL2.0+, in addition to stated licenses.
* contrib/checkpatch: allow empty lines within continuationsLubomir Rintel2019-06-251-1/+1
| | | | | | | | | | | | | This chunk from nm-device.c is, in fact, okay: |<-tab->nm_assert ( !new_config |<-tab-> || ( new_config |<-tab-> && ({ |<-tab-> int ip_ifindex = ... empty line -> | |<-tab-> ( ip_ifindex > 0 |<-tab-> && ip_ifindex == ... |<-tab-> })));
* contrib/checkpatch: be a bit stricter about whitespaceLubomir Rintel2019-06-251-1/+1
| | | | | | | | | | | | | In continations (that use spaces for alignment), don't allow the number of leading tabs to change. Previously only removal of tabs was disallowed, but addition doesn't make sense either, as only spaces should be used for further alignemnt. This catches situations like this: |<-tab->all_work_and_no_play (makes, |<-tab-> jack, |<-tab-><-tab-> a dull boy);
* contrib/checkpatch: discourage g_assert*()Lubomir Rintel2019-06-251-0/+1
|
* settings: drop ibft settings pluginth/drop-ibft-settings-pluginThomas Haller2019-06-201-2/+0
| | | | | | | | | | | | | | | The functionality of the ibft settings plugin is now handled by nm-initrd-generator. There is no need for it anymore, drop it. Note that ibft called iscsiadm, which requires CAP_SYS_ADMIN to work ([1]). We really want to drop this capability, so the current solution of a settings plugin (as it is implemented) is wrong. The solution instead is nm-initrd-generator. Also, on Fedora the ibft was disabled and probably on most other distributions as well. This was only used on RHEL. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1371201#c7
* all: drop vim file variables from source filesThomas Haller2019-06-113-3/+0
| | | | sed '1,3 { /^\(#\|--\) *vim:/d }; 1 { /^\/\* *vim:.*\*\/$/ d}' -i $(git grep -l 'vim:')
* all: drop emacs file variables from source filesThomas Haller2019-06-113-3/+0
| | | | | | | | | | | | | | | | | | | | | | We no longer add these. If you use Emacs, configure it yourself. Also, due to our "smart-tab" usage the editor anyway does a subpar job handling our tabs. However, on the upside every user can choose whatever tab-width he/she prefers. If "smart-tabs" are used properly (like we do), every tab-width will work. No manual changes, just ran commands: F=($(git grep -l -e '-\*-')) sed '1 { /\/\* *-\*- *[mM]ode.*\*\/$/d }' -i "${F[@]}" sed '1,4 { /^\(#\|--\|dnl\) *-\*- [mM]ode/d }' -i "${F[@]}" Check remaining lines with: git grep -e '-\*-' The ultimate purpose of this is to cleanup our files and eventually use SPDX license identifiers. For that, first get rid of the boilerplate lines.
* gitlab-ci: also build on CentOS 7.5 and 7.6th/gitlab-ci-centosThomas Haller2019-05-291-1/+1
|
* contrib/checkpatch: properly determine the commit id boundaryLubomir Rintel2019-05-201-1/+1
| | | | | | | It doesn't have to be at the end of line, there may be more words following. Fixes: d66a1ace23c5 ('contrib/checkpatch: avoid command injection in checkpatch.pl script')
* gitlab-ci: disable valgrind on Fedora 30 and Fedora 31 depending on glib2 ↵Thomas Haller2019-05-181-3/+29
| | | | | | | | | | | package Valgrind is known to report many false positives with certain glib2 versions. Workaround that by disabling it based on the installed package version. See-also: https://bugzilla.redhat.com/show_bug.cgi?id=1710417 See-also: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/155
* gitlab-ci: run unit tests under valgrind in gitlab-ciThomas Haller2019-05-182-4/+68
| | | | | | | | On Ubuntu 16.04 (trusty) valgrind fails due to rdrand being advertised but not implemented. Work around that by installing valgrind from Ubuntu 18.04 (bionic) via the "contrib/scripts/nm-ci-install-valgrind-in-ubuntu1604.sh" script.
* tests: use "/run" instead of "/var/run"Thomas Haller2019-05-171-1/+1
|
* ci: randomize tests during our CIThomas Haller2019-05-171-0/+4
| | | | This affects gitlab-ci and travis-ci, which both run this script.
* gitlab-ci: build on Ubuntu 16.04, 18.04 and Debian stretch (9), testing, sidThomas Haller2019-04-191-10/+22
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/119
* all: goodbye libnm-glibLubomir Rintel2019-04-161-2/+0
| | | | | | | | | | | | | | | | | | | | | | | This removes libnm-glib, libnm-glib-vpn, and libnm-util for good. The it has been replaced with libnm since NetworkManager 1.0, disabled by default since 1.12 and no up-to-date distributions ship it for years now. Removing the libraries allows us to: * Remove the horrible hacks that were in place to deal with accidental use of both the new and old library in a single process. * Relief the translators of maintenance burden of similar yet different strings. * Get rid of known bad code without chances of ever getting fixed (libnm-glib/nm-object.c and libnm-glib/nm-object-cache.c) * Generally lower the footprint of the releases and our workspace If there are some really really legacy users; they can just build libnm-glib and friends from the NetworkManager-1.16 distribution. The D-Bus API is stable and old libnm-glib will keep working forever. https://github.com/NetworkManager/NetworkManager/pull/308
* gitlab-ci: run unit tests for n-acd with eBPF disabledThomas Haller2019-04-071-0/+4
| | | | | | | | | | | | | Enabling eBPF causes src/devices/tests/test-acd to fail: strace: bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=4, value_size=1, max_entries=8, map_flags=0, inner_map_fd=0, map_name="", map_ifindex=0, btf_fd=0, btf_key_type_id=0, btf_value_type_id=0}, 112) = -1 EPERM (Operation not permitted) NetworkManager-Message: 10:07:04.404: <warn> [1554631624.4046] acd[0xa2b400,10]: couldn't init ACD for announcing addresses on interface 'nm-test-veth0': Operation not permitted Interestingly it does not always fail. Seems to depend on the kernel which is used in the containerized test environments of gitlab-ci. For now, just disable eBPF and use the fallback implementation.
* Revert "all: goodbye libnm-glib"Lubomir Rintel2019-04-031-0/+2
| | | | | | We need this for a little little longer :( This reverts commit 1de8383ad9fdfc8f552117e5d109bdfa7005634b.
* all: goodbye libnm-glibLubomir Rintel2019-03-191-2/+0
| | | | | | | | | | | | | | | | | | | | | | | This removes libnm-glib, libnm-glib-vpn, and libnm-util for good. The it has been replaced with libnm since NetworkManager 1.0, disabled by default since 1.12 and no up-to-date distributions ship it for years now. Removing the libraries allows us to: * Remove the horrible hacks that were in place to deal with accidental use of both the new and old library in a single process. * Relief the translators of maintenance burden of similar yet different strings. * Get rid of known bad code without chances of ever getting fixed (libnm-glib/nm-object.c and libnm-glib/nm-object-cache.c) * Generally lower the footprint of the releases and our workspace If there are some really really legacy users; they can just build libnm-glib and friends from the NetworkManager-1.16 distribution. The D-Bus API is stable and old libnm-glib will keep working forever. https://github.com/NetworkManager/NetworkManager/pull/308
* contrib/checkpatch: avoid command injection in checkpatch.pl scriptThomas Haller2019-03-181-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | The capture variables, $1, etc, are not valid unless the match succeeded, and they're not cleared, either. $ git checkout -B C origin/master && \ echo XXXXX > f.txt && \ git add f.txt && \ git commit -m 'this commit does something()' Branch 'C' set up to track remote branch 'master' from 'origin'. Reset branch 'C' Your branch is up to date with 'origin/master'. sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `git log --abbrev=12 --pretty=format:"%h ('%s')" -1 does something() 2>/dev/null' >>> VALIDATE "a169a98e14 this commit does something()" (commit message):4: Commit 'does something()' does not seem to exist: > Subject: [PATCH] this commit does something() (commit message):4: Refer to the commit id properly: : > Subject: [PATCH] this commit does something() The patch does not validate.
* platform: add routing-rule add/delete netlink functionsThomas Haller2019-03-131-1/+1
|
* contrib: set shift for less in NM-logThomas Haller2019-03-131-1/+1
|
* contrib/checkpatch: check that we refer to commits properlyLubomir Rintel2019-03-071-3/+33
|
* build/ci: enable --werror for meson buildsThomas Haller2019-02-081-3/+16
| | | | | | | | | This enables -Werror for meson builds on gitlab-ci and semaphore. Not on Travis, the compiler there is too old, giving too many bogus warnings. This reverts commit 928d68d04af20808f801f05f92ad83179d7b826e ("m4: disable -Wmissing-braces for newer clang").
* gitlab-ci: build with clang and do multiple builds in one test-stepThomas Haller2019-02-071-0/+4
| | | | | | | | | | | | | Also, let one docker image do multiple builds. We fetch a fedora docker image, and then install 250 MB of packages. That alone takes a lot of time and resources. Instead of running a large number of docker images that only do one build, let one image do several builds. Also, install ccache. Hopefully this way we can benefit from building the same sources multiple times. Also note that building docs does not work currently with clang, due to g-ir-scanner. See commit 05568860cce5332977d92b85f7c25b8ed646cd58.
* gitlab-ci: allow enabling/disabling building documentation in "nm-ci-run.sh"Thomas Haller2019-02-071-0/+23
| | | | | | | | | | | | | | | | | | | | | | | g-ir-scanner does not support building with clang, due to [1], [2], [3]. It triggers checking if /usr/bin/g-ir-scanner works... no (compiler failure -- check config.log) configure: error: introspection enabled but can't be used with clang-7: error: unknown argument: '-fstack-clash-protection' See also commit 99b92fd9920372e57bfe3a624b29915ca3335d99, which adds this configure check. Honor the environment variable WITH_DOCS to allow the caller to overwrite the automatic detection that the script does. [1] https://bugzilla.gnome.org/show_bug.cgi?id=757934 [2] https://gitlab.gnome.org/GNOME/gobject-introspection/issues/150 [3] https://gitlab.gnome.org/GNOME/gobject-introspection/commit/c14d0372283abc1b857e38517e791447233e4d62
* gitlab-ci: minor cleanup of "contrib/scripts/nm-ci-run.sh" scriptThomas Haller2019-02-051-3/+11
|
* contrib: adjust NM-log for changes to platform loggingThomas Haller2018-12-301-1/+1
| | | | Fixes: 8f107f5c00258c7a4fb780a25f299af6f116f575
* checkpatch: warn if there is a file "TODO.txt"Thomas Haller2018-12-301-3/+17
| | | | | | | | This allows us to add a file "TODO.txt" in the top level directory. This file is not intended to be merged to master, but keep track of stuff that is still to do before merging a branch. Let checkpatch.pl warn about the presence of such a file.
* checkpatch: warn about suspicious gtk-doc annotationsThomas Haller2018-12-301-0/+1
| | | | | | | | | | | | It's (allow-none): and (transfer none): That's confusing enough. Add a check.
* gitlab-ci: patch gtk-doc to generate valid documentationThomas Haller2018-12-011-0/+40
| | | | | | | | | We generate documentation for pages ([1], [2]), hence, we need to patch gtk-doc [3]. [1] https://networkmanager.pages.freedesktop.org/NetworkManager/NetworkManager/ [2] https://networkmanager.pages.freedesktop.org/NetworkManager/libnm/ [3] https://gitlab.gnome.org/GNOME/gtk-doc/merge_requests/2
* ci: use common script for tests on travis and gitlabThomas Haller2018-11-121-0/+150
| | | | | | | | | | | | | | For one, it's not unreasonable that we want to run the same tests both for gitlab and travis. Move the actual tests into a script, which is called by both CI environments. We still can do something different, based on the environment. The advantage here is, that the common part will be shared, and the places where we differ can easily be spot. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/44
* checkpatch: complain about XXX markers in codeThomas Haller2018-10-251-0/+1
| | | | | | We have a few source code tags like "TODO" and "FIXME". "XXX" is not intended to be merged, it is for marking places in code while still working on it.
* contrib: adjust NM-log for changes to platform loggingThomas Haller2018-10-231-2/+2
| | | | Fixes: 8f107f5c00258c7a4fb780a25f299af6f116f575
* checkpatch: quote variable in "checkpatch-feature-branch.sh"Thomas Haller2018-10-221-3/+3
|
* checkpatch: support ranges for "checkpatch-feature-branch.sh"Thomas Haller2018-10-221-10/+19
| | | | | Improve "checkpatch-feature-branch.sh" to support accepting range as argument.
* checkpatch: fix "checkpatch-feature-branch.sh" for master branchThomas Haller2018-10-221-1/+5
| | | | | | | | | | | | | The main purpose of "checkpatch-feature-branch.sh" is to test all patches of a feature branch. When we run the script against master (or nm-1-*), then there is no feature branch. Previously, the script would just error out. That is not very useful, in particular as we call this from gitlab-ci, which also runs on master. Instead, in that case, test the HEAD.
* checkpatch: add "contrib/scripts/checkpatch-feature-branch.sh" scriptThomas Haller2018-10-222-0/+39
| | | | | | | | | This takes current HEAD branch, and finds all the commits what are not on master or one of the nm-1-* branches, and runs checkpatch.pl on each. The use is to run checkpatch.pl on all patches of a feature branch.
* checkpatch: complain about Emacs file variables in source codeThomas Haller2018-10-181-0/+1
|
* contrib/checkpatch: remove the first character off a diffLubomir Rintel2018-10-071-1/+1
| | | | Otherwise the leading whitespace checks won't work on patches.
* contrib/checkpatch: check some more whitespace troubleLubomir Rintel2018-10-071-1/+9
|
* contrib/checkpatch: correctly separate indentation across hunksLubomir Rintel2018-10-071-6/+6
|
* checkpatch: detect some whitespace errorsLubomir Rintel2018-09-241-0/+6
| | | | Vim's trademark.
* checkpatch.pl: complain about space in elvis operator ?:Thomas Haller2018-08-091-0/+1
|
* checkpatch: fix perldoc headingJavier Arteaga2018-07-121-1/+1
| | | | | | The script does not actually emulate a serial modem (yet). https://github.com/NetworkManager/NetworkManager/pull/165
* checkpatch: skip foreign codeLubomir Rintel2018-07-111-0/+4
|
* checkpatch: add a licensing hintLubomir Rintel2018-07-111-0/+1
|