Commit Graph

274 Commits

Author SHA1 Message Date
Eli Schwartz
fe62ce6a4b ci: avoid building manpages on Fedora
It appears that xsltproc is not installed there. It is generally needed
for the docs build too, so as a crude CI heuristic, don't build anywhere
that docs are disabled.
2025-05-30 09:42:55 +00:00
Tomas Bzatek
ec917dc670 ci: add libnvme dependency
Required for the nm-initrd-generator NBFT support.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2025-04-28 16:09:54 +00:00
Lubomir Rintel
57f9d99b8a contrib: drop old gtkdoc patch
This has been integrated 6 years ago.

(cherry picked from commit 054962aeea)
2025-02-28 14:21:19 +01:00
Beniamino Galvani
98b124a661 dhcp: drop dhcpcanon support
Drop support for the "dhcpcanon" DHCP client. It's unmantained, as the
last code change was in 2018:

  https://github.com/juga0/dhcpcanon/commits

There is no need to first deprecate it because it was still marked as
"experimental" in NM. Also, it's not packaged by any recent distro, so
we can assume that nobody will miss it.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2112
2025-01-20 18:56:41 +01:00
Íñigo Huguet
5c62286a77 release, find-backports: formatting and log small fixes 2024-12-23 12:41:34 +01:00
Íñigo Huguet
248addcc22 find-backports: fix Ignore-Fixes detection
The regex for "Fixes" also matches with "Ignore-Fixes", so the commit is
added twice and then removed only once by the "Ignore-Fixes". It still
remains once in the list of commits to backport, making that
"Ignore-Fixes" does not work. Fix it.
2024-12-23 12:32:13 +01:00
Beniamino Galvani
0209a55d24 contrib/copr: update the URL for nm-git-bundle
The old bundle is no longer available, use the latest one.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2086
2024-12-09 17:38:36 +01:00
Beniamino Galvani
3e93134c04 checkpatch: silence warning about direct properties for the IP setting
Since NMSettingIPConfig is an abstract type that cannot be
instantiated, the overrides for the direct properties are defined on
the subclasses (NMSettingIP4Config and NMSettingIP6Config).

Silence the warning about using direct properties.
2024-10-23 15:06:58 +02:00
Jan Vaclav
12b5b8317b build: remove autotools configuration from scripts 2024-09-11 12:18:15 +00:00
Jan Vaclav
fa747f6478 gitlab-ci: ignore autotools deprecation
We still need the tests to run on autotools builds too, so we must pass the argument.

(cherry picked from commit 5f72b251b1)
2024-05-09 12:00:47 +02:00
Jan Vaclav
61f0531509 gitlab-ci: test re-buildability of distribution tarballs
Adds tests for making a distribution tarball, and then attempting to build NM from its contents.
Files have been left out from the distribution in the past by accident (e.g. 75027879, b2931c96)
and hopefully this test will catch this type of errors.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1862
2024-03-01 07:51:21 +00:00
Íñigo Huguet
69ceee1a0b contrib: new script to anonymize logs
Script to do some anonymization to NetworkManager logs. It does
very basic stuff so it shouldn't be trusted without manually
reviewing the logs, but it can still be useful to replace lot
of potentially sensitive data.

What it masks by default:
- MAC addresses
- Public IP addresses
- Hostnames detected from `hostname` command and some known
  log messages from NM.
- Hostnames ending in some common domains such as .com or .org
- Hostnames specified via --hostname argument

What it can mask but it doesn't by default:
- Private IPs

Options like --show-macs and --hide-private-ips can override the default
behaviour.

Note that masking IP addresses can make difficult to analyze routing
problems, and trying to be smart analyzing the defined routes from the
logs or from `ip route` can lead to even worse results. Because of this,
if routing problems need to be analyzed, --show-public-ips need to be
passed.
2023-11-24 07:40:08 +00:00
Thomas Haller
a6e085b3e8 clang-format: rework "nm-code-format-container.sh" script
Instead of doing the broken `podman run` and `podman start` approach,
build an image ("nm-code-format:f38"), cache it, and use it to run
"nm-code-format.sh" via `podman run`. We should build and keep a
container image, not a container.

The benefit is that this allows to hand over the command line arguments
to "nm-code-format.sh". In particular the "-u" and "-F" options, which
are life savers.

This means,

  $ contrib/scripts/nm-code-format-container.sh -u

works.

Try also

  $ contrib/scripts/nm-code-format-container.sh -h

which tells you that you are running inside the container, and how to
delete/renew the container image.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1798
2023-11-22 13:25:04 +01:00
Thomas Haller
1d241f5295 contrib: fix invalid escape sequence in "find-backports"
Fixes: 57cfa5daf9 ('contrib: add "find-backports" script')
2023-11-20 17:14:47 +01:00
Thomas Haller
f08102bf41 contrib: autodetect the Fedora version for "nm-code-format-container.sh" script
From time to time we bump the used clang-format (and Fedora) version.
Previously, we had to change more than one places.

Instead, let the "nm-code-format-container.sh" parse it from ".gitlab-ci/config.yml".
2023-06-27 15:19:01 +02:00
Thomas Haller
9ede7e04b1 contrib: extend usage for "contrib/scripts/nm-setup-git.sh" script 2023-06-06 15:00:23 +02:00
Thomas Haller
e75deb8c94 contrib/copr: update URL in "nm-copr-build.sh" to new nm-git-bundle 2023-06-06 14:53:37 +02:00
Thomas Haller
a8b2997fa5 contrib/copr: improve readme in copr scripts (2) 2023-06-06 12:21:30 +02:00
Thomas Haller
fd6fcf335c contrib/copr: improve readme in copr scripts 2023-06-06 12:20:29 +02:00
Thomas Haller
c275d24637 clang-format: reformat code with clang-format 16.0.2-1.fc38
This is the version shipped in Fedora 38. As Fedora 38 is now out, the
core developers switch to it. Our gitlab-ci will also use that as base
image for the check-{patch.tree} tests and to generate the pages. There
is a need that everybody agrees on which clang-format version to use,
and that version should be the one of the currently used Fedora release.

Also update the used Fedora image in "contrib/scripts/nm-code-format-container.sh"
script.

The gitlab-ci still needs update in the following commit. This change
in isolation will break the "check-tree" test.
2023-05-19 10:53:13 +02:00
Thomas Haller
e37a15acad all: avoid "==" bashism in scripts 2023-05-18 09:16:41 +02:00
Thomas Haller
cae2011b08 contrib: show clang-format version in failure message
The actual formatting depends on the version of clang-format. Print the
used version, which is in particular interesting when we get an error in
our gitlab-ci check (which uses the correct version).
2023-04-18 19:05:02 +02:00
Thomas Haller
fe4e5c24e4 find-backports: improve git_ref_exists() to cache also the hashes themselves
git_ref_exists() memoizes the result. But while it looks up the SHA sum
for "ref", it also can cache the result for the SHA sum itself.
2023-04-07 17:23:13 +02:00
Thomas Haller
65ef6bc9bc find-backports: warn if any commits are not from the first reference
Every branch (for example "nm-1-40") has exactly one next branch, from
which patches should be backported (in that example that branch is
"nm-1-42").

While "find-backports" searches all newer branches for patches, it does
not make it clear form where the patch should come from.

That means, if you run the script `contrib/scripts/find-backports origin/nm-1-40`
it will check nm-1-42 and main branch, and might suggest to backport
patches that are only on main, but not "nm-1-42". That would be wrong,
because patches need to first go into nm-1-42, and then backported (from
there) further to nm-1-40.

Print a warning to highlight that.
2023-04-06 21:37:10 +02:00
Thomas Haller
9f89910852 find-backports: various cleanups in script
- avoid list([...]).
- use some f-strings.
2023-04-06 18:34:15 +02:00
Thomas Haller
efd23da26b find-backports: enable debug logging in script 2023-04-06 18:34:15 +02:00
Thomas Haller
1ed3854402 checkpatch: discourage deprecated "(allow-none)" annotation 2023-03-29 11:46:48 +02:00
Thomas Haller
2c9faea63c contrib,tools: move "nm-in-container.sh" script to "tools"
This script seems very useful to me. Give it a more prominent place and
move it out from "contrib/scripts". Also do some further renaming.
2023-03-20 08:59:59 +01:00
Thomas Haller
a6802cfa74 nm-in-container: disable handling of "/etc/resolv.conf" in container and use 8.8.8.8.
By default, podman bind mounts a "/etc/resolv.conf" file. That prevents
NetworkManager (inside the container) to update the file, which leads to
warnings in the log and certain NM-ci tests won't pass due to that.

Disable handling of "/etc/resolv.conf" in podman. But also pre-deploy a
default resolv.conf, with the google name server 8.8.8.8.  I don't
understand why, but even with "--dns=none", writing "/etc/resolv.conf"
while building the container doesn't take effect.  Instead, write a
usable "/etc/resolv.conf" from "/etc/rc.d/rc.local".
2023-03-16 08:33:00 +01:00
Thomas Haller
d453188ed2 nm-in-container: add nm-deploy.sh script for reinstalling NetworkManager 2023-03-15 16:50:57 +01:00
Thomas Haller
0c233fb216 nm-in-container: symlink NM/NM-ci directories in nm-in-container 2023-03-15 16:50:57 +01:00
Thomas Haller
9bf193f1a8 contrib: escape shell arguments in "nm-setup-git.sh" output 2023-03-09 16:56:18 +01:00
Thomas Haller
acd895e1f7 contrib: update history and hints in "nm-in-container.sh" script
Calling `nm-env-prepare.sh --prefix eth -i 1 && nmcli device connect eth1` has
a race, where NetworkManager didn't see the interface yet. Add a sleep.
2023-03-08 11:22:52 +01:00
Thomas Haller
d0732962d2 contrib: install more packages in "nm-in-container.sh" 2023-03-03 15:42:05 +01:00
Thomas Haller
713de313dc contrib: add usage comment to "git-subtree-reimport.sh" 2023-03-03 13:45:31 +01:00
Thomas Haller
5973e83160 systemd: merge branch systemd into main
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1529
2023-02-13 15:33:02 +01:00
Thomas Haller
46f39829d9 contrib: accept ssh:// git url for origin in "nm-setup-git.sh" 2023-02-09 19:22:37 +01:00
Thomas Haller
0ee784f1f0 contrib: add "git-backport-merge" script for backporting merge commits in NetworkManager
On the main branch, we commonly rebase our WIP branches to latest HEAD,
before merging them with "--no-ff". The effect is to have a merge commit
that acts as a parentheses around the set of patches.

When backporting such a branch, we should preserve that structure and
take the merge commit too. We should must use `git cherry-pick -x` to
record the commit IDs of the original patch.

This script helps with that.

Also hook it up in "contrib/scripts/nm-setup-git.sh" to create an alias
for it. This alias has the advantage, of fetching the latest version of
the script from "main" or "origin/main", so it also works on older
branches.
2023-02-03 10:37:35 +01:00
Thomas Haller
dba2fb5fff gitlab-ci: use "meson test" for running unit tests
It seems that `meson test` is preferred over `ninja test`.  Also, pass
"--print-errorlogs" to meson, and pass "-v" to the build steps.

Note that `ninja test` already ends up calling `meson test
--print-errorlogs`, but it doesn't use "-v", so the logs are truncated.
2023-01-30 08:19:49 +01:00
Thomas Haller
13d9cf75ed gitlab-ci: rerun meson test on failure with debugging
Like done for autotools. First we run the test without debugging option.
If it fails, we run it again to possibly trigger the failure again and
get better logs.
2023-01-30 08:19:49 +01:00
Thomas Haller
3f2ad76363 gitlab-ci: explicitly set "NMTST_DEBUG=debug,..." for second debug run
"debug" is implied when setting NMTST_DEBUG, but not specifying
"no-debug". This change has thus no effect, but it seems clearer to be
explicit.

The "debug" flag affects nmtst_is_debug(). Note that tests *must* not
result in different code paths based on debug, they may only

 1) print more debug logging
 2) do more assertion checks.

Having more assertion checks can result in different outcome of the
test, that is, that the additional assertion fails first. That is
acceptable, because failing earlier is possibly closer to the issue and
helps debugging. Also, when the additional failure is fixed and passes,
we still will fail at the assertion we are trying to debug.

In particular, an access to nmtst_get_rand*()/nmtst_rand*() must not
depend on nmtst_is_debug(), because then different randomized paths
are taken based on whether debugging is enabled.
2023-01-30 08:18:45 +01:00
Thomas Haller
3bad3f8b24 gitlab-ci: fix randomizing tests in "nm-ci-run.sh"
The code was just wrong. Usually in gitlab-ci, NMTST_SEED_RANDOM is
unset, so the previous code  would not have set it. Which means that our
tests run with NMTST_SEED_RANDOM="0".

Fuzzing (or randomizing tests) is very useful, we should do that for the
unit tests that run in gitlab-ci. Fix this.

But don't let the test choose a random number. Instead, let the calling
script choose it. That is, because we might run the tests more than once
(without debugging and no valgrind; in case of failure return with
debugging; with valgrind). Those runs should use the same seed.

This fixes commit 70487d9ff8 ('ci: randomize tests during our CI'),
but as fixing randomization can break previously running tests, we may
only want to backport this commit after careful evaluation.
2023-01-30 08:18:45 +01:00
Thomas Haller
fce8e572d0 contrib/copr: better detect git-ref in "nm-copr-build.sh" 2023-01-24 14:58:52 +01:00
Thomas Haller
096b9955d6 contrib/fedora: make "lto" in the spec file configurable
When we build a copr image, we run the "nm-copr-build.sh" script.
That script, should honor "LTO=0|1|" to explicitly enable/disable
LTO. Since the copr script only builds a SRPM, which then gets build
we need that the default LTO flag in the SRPM is templated.

Fixes: 0566e9dc63 ('contrib: support disabling "LTO" in "nm-copr-build.sh"')
2023-01-24 10:36:34 +01:00
Thomas Haller
0566e9dc63 contrib: support disabling "LTO" in "nm-copr-build.sh"
The "nm-copr-build.sh" script is run by our copr to generate the SRPM of
NetworkManager (via `curl ... | bash`).

Building with LTO takes a long time, for testing it can be nice to disable
that. Add an environment variable for that. It can be used when manually
building an RPM in copr.
2023-01-24 08:46:14 +01:00
Thomas Haller
ae7e7bf3d3 contrib: add "reexec" step to "nm-in-container.sh"
Just a shortcut for reset and exec.
2023-01-05 08:59:10 +01:00
Thomas Haller
897a96da7b contrib: default to run same fedora version in nm-in-container.sh as host
If the out host runs Fedora, it's most useful that the container is the
same Fedora version. Detect it.
2023-01-05 08:17:24 +01:00
Thomas Haller
81527052d7 contrib: install more package in "nm-in-container.sh"
NM-ci wants to install a lot of packages when running the first test.
In particular, NM-ci has no nice script that lists all the dependencies,
so it's not immediately clear which packages are required.

Still, install some of those packages so that they are already present
when running the first NM-ci test.
2023-01-04 21:40:00 +01:00
Thomas Haller
ea80a4a813 contrib/scripts: update "nm-copr-build.sh" script to use new nm-git-bundle 2022-12-20 11:38:32 +01:00
Thomas Haller
8febb15bfe contrib: fix duplicate package in "contrib/scripts/nm-in-container.sh" script 2022-12-14 10:07:23 +01:00