summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* generate-docs-nm-settings-docs-gir: remove space from the beginning of a paralr/docs-deprec-propsLubomir Rintel2022-09-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | From nm-settings-dbus(5): Before (ugly, offensive, possibly in violation of geneva protocol): ... | set, the authentication retries for 3 | times before failing the connection. | | Currently, this only applies to 802-1x | authentication. After (beautiful, smells good, in harmony with nature): ... | set, the authentication retries for 3 | times before failing the connection. | | Currently, this only applies to 802-1x | authentication.
* generate-docs-nm-settings-docs-gir: move deprecation info to a separate tagLubomir Rintel2022-09-071-7/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the deprecation data was included in <description*>, in form of an integer. E.g.: /** * NMSettingLala:hello: * * Does this and that. * * Deprecated: 1.12: Be sad instead. **/ Results in: <property name="hello"> <description>Does this and that. Deprecated: 1</description> </property> Let's make it do this instead: <property name="hello"> <description>Does this and that.</description> <deprecated since="1.12">Be sad instead.</description> </property>
* generate-docs-nm-settings-docs-merge: merge <deprecated*> elementsLubomir Rintel2022-09-071-0/+7
| | | | They will be used to include property deprecation data.
* generate-docs-nm-settings-docs-merge: streamline a bitLubomir Rintel2022-09-071-18/+8
| | | | | Replace a pair of overly sophisticated expressions with something that's easier to follow, avoiding code duplication at the same time.
* build/meson: force overwriting files in "meson-post-install.sh"Thomas Haller2022-08-081-5/+5
| | | | | | | | | | Repeated `ninja -C build install` should succeed. But they did not: Running custom install script '/data/src/NetworkManager/tools/meson-post-install.sh /usr/share /usr/bin /etc/NetworkManager /usr/lib/NetworkManager /var/lib/NetworkManager /usr/share/man /etc 1 1 1 1' --- stdout --- --- stderr --- ln: failed to create symbolic link '/usr/lib/NetworkManager/dispatcher.d/90-nm-cloud-setup.sh': File exists
* doc: preserve paraghraphs in nmcli man pagesVojtech Bubela2022-07-153-5/+134
| | | | | | | | | | | | | | | | | | | | | | | | | Improve documentation by preserving paragraphs in the nm-settings-nmcli man pages. To do that structure of src/libnm-client-impl/nm-settings-docs-gir.xml was changed to have "description" as subnode to property node instead of attribute of property node. Another subnode "description-docbook" was added - this node is then used when generating man pages. tools/generate-docs-nm-settings-docs-gir.py and man/nm-settings-dbus.xsl were also changed to accomodate for changes mentioned above. Replace xsltproc tool with python script when generating ./src/libnmc-setting/settings-docs.h. Deleted settings-docs.xsl since it was replaced by python script. Change src/libnmc-setting/settings-docs.h.in accodring to newly generated src/libnmc-setting/settings-docs.h https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/661 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1260
* tools: Fix generate-docs-nm-settings-docs-gir.py on Python 2Igor Ponomarev2022-06-031-6/+5
| | | | | | | | | | | | | | | | | | | | On python2 the following error is raised: `LookupError: unknown encoding: unicode` Seems like `unicode` is a correct encoding in Python 3 but not 2. Fix: 1. Change encoding to `utf-8` 2. Pass output path string instead of opening file and passing opened file object. Python2 and 3 might need different file modes, passing just path lets ElementTree select appropriate file mode. Fixes: f00e90923c8c ('tools: Use ElementTree to write XML in generate-docs-nm-settings-docs-gir.py') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1249
* tools: Use ElementTree to write XML in generate-docs-nm-settings-docs-gir.pyIgor Ponomarev2022-05-311-39/+30
| | | | | | | | Instead of manually writting XML line by line. Quoting is automatic. Makes it much easier to modify. (just add new elements) Generated XML not indented at the moment.
* tools: Modernize generate-docs-nm-settings-docs-gir.py to 2022 standardsIgor Ponomarev2022-05-311-101/+113
| | | | | | | | | * Create main() function and put its execution under __name__ == '__main__' guard. * Only one module import per line * Use required=True to check if necessary arguments have been passed. * Remove usage() as ArgumentParser handles that already
* build/meson: use "rename" directive for installing nmcli bash completionThomas Haller2022-05-131-5/+0
| | | | | | | Otherwise, `ninja -C build uninstall` tries to delete "nmcli-completion", when the file got renamed to "nmcli". We depend on meson 0.47.2 already.
* libnm/docs: fix documentation for "proxy.pac-script"Thomas Haller2022-03-211-1/+7
|
* tests: propagate 77 exit code from "tools/run-nm-test.sh"Thomas Haller2022-02-191-2/+2
| | | | | | | | This is important. We must not swallow 77, which has the meaning that the test was skipped. Fixes: f65747f6e9ed ('tests: let "run-nm-test.sh" fail with exit code 1 on failure') (cherry picked from commit aff40f736c63cda19b87533578e0ca3435943f38)
* tools: fix constructing XML by dropping broken pretty_xml()Thomas Haller2022-02-101-14/+0
| | | | | | | | | | | | | | | | | | | | I don't understand the code, but it mangles the XML. There is no difference in the markup we have so far. But if you have nested XML (like for description-docbook tag) there are cases where this is wrong. There is also no need to prettify anything. If you want pretty-formatted XML, do it yourself, for example with $ tidy --indent yes --indent-spaces 4 --indent-attributes yes --wrap-attributes yes --input-xml yes --output-xml yes src/libnm-client-impl/nm-property-infos-nmcli.xml I think this was initially done, because we had the tool in perl, and when migrating, we wanted to generate the exactly same output. And it was the same output, and it was fine for the input we have. But with different input, it's wrong. Drop it now. (cherry picked from commit 35599b4349c18b771d86ea6a7f577909cfcb7a2f)
* tools: re-use regular expression in process_data()Thomas Haller2022-02-101-21/+24
| | | | | | | Yes, they get cached by the library already. Still, no need for doing this repeatedly. (cherry picked from commit 41a177486b4c84fd6d7ce5b488c22c991b9c4a84)
* tests: let "run-nm-test.sh" fail with exit code 1 on failureThomas Haller2022-02-101-3/+4
| | | | | | | | | | | | | | | `git bisect run` is peculiar about the exit code: error: bisect run failed: exit code 134 from '...' is < 0 or >= 128 If we just "exec" the test, it usually will fail on an assert. That results in SIGABRT or exit code 134. So out of the box that is annoying with git-bisect. Work around that and let the test wrapper always coerce any test failure to exit code 1. (cherry picked from commit f65747f6e9edc4a6d01d8825e6c6bc3da284c6b9)
* tools/tests: set available-connections for vlan device in NM test stubThomas Haller2022-01-211-0/+6
|
* tools: support --no-make-first option in "run-nm-test.sh"Thomas Haller2022-01-211-0/+5
| | | | | | | | | | | | | | | | Why? Because I often use a command line like $ ./tools/run-nm-test.sh -m src/libnm-client-impl/tests/test-nm-client -p /libnm/device-connection-compatibility or even alias it to a one character command `x`. Usually I want to do the rebuild, and as `make` is so slow, it adds noticeable time running the command. Thus, sometimes I want to modify the command, for which I have to edit the command from the history, or toggle two separate commands. Add a `-M` flag that can reverse the effect of an earlier `-m`. An "enable" flag in general should just also have a "disable" flag.
* core: rework IP configuration in NetworkManager using layer 3 configurationThomas Haller2021-11-181-1/+0
| | | | | | | | | | | | | | | | | Completely rework IP configuration in the daemon. Use NML3Cfg as layer 3 manager for the IP configuration of an interface. Use NML3ConfigData as pieces of configuration that the various components collect and configure. NMDevice is managing most of the IP configuration at a higher level, that is, it starts DHCP and other IP methods. Rework the state handling there. This is a huge rework of how NetworkManager daemon handles IP configuration. Some fallout is to be expected. It appears the patch deletes many lines of code. That is not accurate, because you also have to count the files `src/core/nm-l3*`, which were unused previously. Co-authored-by: Beniamino Galvani <bgalvani@redhat.com>
* build/tests: ignore all valgrind warnings about unhandled syscallsThomas Haller2021-10-081-27/+10
| | | | | | | | | | | | | | | | | | valgrind might log warnings about syscalls that it doesn't implement. When we run valgrind tests, we check that the command exits with success, but we also check that there is no unexpected content in the valgrind log. Those warnings are not relevant for us. We don't unit-tests valgrind, we unit tests NetworkManager. Let's always remove such warnings with `sed`. We already did that previously, but only for a explicit list of tests. Now do it for all tests. This is currently relevant on Fedora 35 and Ubuntu devel, where the "close_range" syscall is used by libc, but not supported by valgrind. While at it, rework the confusing logic of "HAS_ERRORS" variable.
* tools: use "is" to compare _DEFAULT_ARG in "test-networkmanager-service.py"Thomas Haller2021-07-291-4/+4
|
* tools: fix bogus code in "tools/generate-docs-nm-property-infos.py"Thomas Haller2021-07-061-4/+1
| | | | | | | | | | | Coverity warns about this: 2. NetworkManager-1.32.2/tools/generate-docs-nm-property-infos.py:117: identical_branches: The same code is executed regardless of whether "temp.index(subelement) < len(temp) - 1" is true, because the then and else branches are identical. Should one of the branches be modified, or the entire 'if' statement replaced? Fixes: c3504f7e624e ('Rewrite `./tools/generate-docs-nm-property-infos.py` with XML library')
* Support new attribute tag `description-docbook`Wen Liang2021-06-232-2/+31
| | | | | | | | `description-docbook` is the alternative tag to `description`, the difference is that `description-docbook` expects docbook XML but not plaintext. Signed-off-by: Wen Liang <liangwen12year@gmail.com>
* tools: correct NetworkManager top object set_state functionFrederic Martinsons2021-06-231-2/+2
| | | | Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
* tools: suppress duplicate state change in deactivation step of active connectionFrederic Martinsons2021-06-231-4/+0
| | | | Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
* tools: add debug printf statements to ↵al/1963854-bond-optionThomas Haller2021-06-091-0/+22
| | | | | | | | | "tools/generate-docs-nm-settings-docs-merge.py" It's hard to understand what "tools/generate-docs-nm-settings-docs-merge.py" does. Add dbg() statements that are all NOP by default. But the user can easily patch the code to print what is happening. This is only for debugging the script.
* python: remove unused importsThomas Haller2021-05-272-3/+3
| | | | | They are flagged by lgtm.com. Avoid the warning by dropping unused includes.
* tools: drop spurious whitespace in ↵Thomas Haller2021-05-261-1/+0
| | | | | | | | | "src/libnm-client-impl/nm-property-infos-*.xml" <nm-setting-docs> - <setting name="6lowpan"> +<setting name="6lowpan"> </setting>
* Rewrite `./tools/generate-docs-nm-property-infos.py` with XML libraryWen Liang2021-05-201-38/+36
| | | | | | | Instead of writing XML text word by word, it is less error prone to write with XML library. Signed-off-by: Wen Liang <liangwen12year@gmail.com>
* Adjust `property` tag format in `nm-property-infos-*.xml`Wen Liang2021-05-201-1/+1
| | | | | | | In order to make the generated XML file format consistent before and after using XML library, adjust `property` tag format. Signed-off-by: Wen Liang <liangwen12year@gmail.com>
* Revert "Rewrite `./tools/generate-docs-nm-property-infos.py` with XML library"Thomas Haller2021-05-181-36/+38
| | | | | | | This breaks build on RHEL7, probably due to an older python version. Revert for now. This reverts commit a83fb33840baba6da0e75eb5489a63bf3ea39d0d.
* Rewrite `./tools/generate-docs-nm-property-infos.py` with XML libraryWen Liang2021-05-171-38/+36
| | | | | | | Instead of writing XML text word by word, it is less error prone to write with XML library. Signed-off-by: Wen Liang <liangwen12year@gmail.com>
* Remove unnecessary escaping for single quoteWen Liang2021-05-171-1/+0
| | | | | | | When writing XML text with XML library, single quote will not be escaped. So remove the escaping for single quote in current tool. Signed-off-by: Wen Liang <liangwen12year@gmail.com>
* Add paired `property` tag to `nm-property-infos-*.xml`Wen Liang2021-05-171-1/+1
| | | | | | | | In order to make the generated XML file format consistent before and after using XML library, replace self-closing `property` tag with paired `property` tag. Signed-off-by: Wen Liang <liangwen12year@gmail.com>
* Remove line breaks in attribute value of `nm-property-infos-*.xml`Wen Liang2021-05-171-2/+2
| | | | | | | Since line breaks are not needed for XML's attribute tag, remove the unnecessary line breaks. Signed-off-by: Wen Liang <liangwen12year@gmail.com>
* tools: remove deprecated PropertiesChanged signal in ↵Thomas Haller2021-05-141-96/+17
| | | | "test-networkmanager-service.py"
* build: replace `./tools/generate-docs-nm-property-infos.pl` with python scriptWen Liang2021-05-052-160/+146
| | | | | | | | | | | | In order to have more structured settings in man page and make it more manageable to generate the docbook, it is recommended to use python script to replace `./tools/generate-docs-nm-property-infos.pl` (this tool is used to parse the comment section starting with `---nmcli---`, `---dbus---`, `---keyfile---`, `---ifcfg-rh---`). Signed-off-by: Wen Liang <liangwen12year@gmail.com> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/824
* tools: use libtool --mode=executeorbea2021-04-041-14/+17
| | | | | | | | | | | | | | | | Better fix for https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/732 The original issue was that when compiling NetworkManager with slibtool the create-exports-NetworkManager.sh script gave the NetworkManager-all-sym slibtool wrapper script to nm(1) instead of the actual binary. This is because slibtool and GNU libtool do not place the compiled programs in the same location. The original fix was to test both locations, but this is bit of a hack especially since the build system should not be using the .libs directory directly. However with $(LIBTOOL) --mode=execute this is not a problem since both implementations can figure out where the correct binary is. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/805
* tui: move from "clients/tui/" to "src/nmtui/"Thomas Haller2021-03-151-1/+1
|
* cli: move from "clients/cli/" to "src/nmcli/"Thomas Haller2021-03-151-1/+1
|
* build: move "clients/nm-online.c" to "src/nm-online/"th/move-client-libsThomas Haller2021-03-021-6/+6
|
* build: move "clients/common/" to "src/libnmc-{base,setting}/"Thomas Haller2021-03-021-2/+2
|
* build: move "libnm/" to "src/" and split itThomas Haller2021-02-243-14/+14
| | | | | | Like with "libnm-core/", split "libnm/" into different directories for the public headers, for the implementation and for the helper "aux" library.
* build: move "shared/nm-{base,udev-aux}" to "src/libnm-{base,udev-aux}"Thomas Haller2021-02-241-1/+1
|
* build: move "libnm-core/" to "src/" and split itThomas Haller2021-02-183-5/+6
| | | | | | | | | | | | | | | | | | | | "libnm-core/" is rather complicated. It provides a static library that is linked into libnm.so and NetworkManager. It also contains public headers (like "nm-setting.h") which are part of public libnm API. Then we have helper libraries ("libnm-core/nm-libnm-core-*/") which only rely on public API of libnm-core, but are themself static libraries that can be used by anybody who uses libnm-core. And "libnm-core/nm-libnm-core-intern" is used by libnm-core itself. Move "libnm-core/" to "src/". But also split it in different directories so that they have a clearer purpose. The goal is to have a flat directory hierarchy. The "src/libnm-core*/" directories correspond to the different modules (static libraries and set of headers that we have). We have different kinds of such modules because of how we combine various code together. The directory layout now reflects this.
* all: move shared/nm-meta-setting.[hc] to libnm-core and clientsThomas Haller2021-02-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "shared/nm-meta-setting.[hc]" contains meta data about settings. As such it is similarly used by libnm-core (as internal API) and by clients (as extension of public API of libnm). However, it must be compiled twice, because while it defines in both cases a NMMetaSettingInfo type, these types are different between internal and public API. Hence, the files must also be compiled twice (and differently), once against libnm-core and once against the client helper library. Previously, the file was under "shared/", but there it's a bit odd it doesn't clearly belong anywhere. There are two goals here: - copy the file to the two places where it is used. We also have a "check-tree" unit test that ensures those files don't diverge in the future. - we no longer require CFLAGS set during built. Instead, the sources should control the build. For that we have new (simple) headers "nm-meta-setting-base.h" that define the right behavior for the impl files. There is still an ugliness (among several): the files must be named the same for libnm-core and clients/common. Preferably, all our sources have unique names, but that is not possible with this scheme (without introducing other ugliness). To mitigate that, include the files only at one exact place.
* tests: add "tools/check-tree.sh" script for checking consistency of sourcesThomas Haller2021-02-091-0/+22
| | | | | | Our source tree also has certain consistency requirements. Since the source is in git, this is a rather static check. However, we want to ensure that future changes don't break it by adding a test.
* all: move "src/" directory to "src/core/"Thomas Haller2021-02-044-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently "src/" mostly contains the source code of the daemon. I say mostly, because that is not true, there are also the device, settings, wwan, ppp plugins, the initrd generator, the pppd and dhcp helper, and probably more. Also we have source code under libnm-core/, libnm/, clients/, and shared/ directories. That is all confusing. We should have one "src" directory, that contains subdirectories. Those subdirectories should contain individual parts (libraries or applications), that possibly have dependencies on other subdirectories. There should be a flat hierarchy of directories under src/, which contains individual modules. As the name "src/" is already taken, that prevents any sensible restructuring of the code. As a first step, move "src/" to "src/core/". This gives space to reorganize the code better by moving individual components into "src/". For inspiration, look at systemd's "src/" directory. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/743
* libnm/docs: hook up new nm-keyfile API in libnm documentation (fix)Thomas Haller2021-02-021-0/+1
| | | | Fixes: 25d64c861c21 ('libnm/docs: hook up new nm-keyfile API in libnm documentation')
* tests: add a dbus test function to change delay of active connection state ↵Frederic Martinsons2021-02-021-2/+17
| | | | | | | | change Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/740
* tools/tests: add usage to "tools/run-nm-test.sh"Thomas Haller2021-01-291-0/+45
| | | | Also support specifying the test name after "--".