Commit graph

176 commits

Author SHA1 Message Date
Antonio Cardace d450c07a31 git: ignore clangd and ctags generated files 2020-01-29 17:25:21 +01:00
Thomas Haller 44c5331e29 shared: move "shared/nm-utils/tests/test-shared-general" to "shared/nm-glib-aux/tests"
"shared/nm-utils" got long renamed and split into separate parts. The remaining
tests are really to test nm-std-aux and nm-glib-aux (no libnm dependencies). Move
the tests to the appropriate place.
2019-12-10 09:17:17 +01:00
Thomas Haller 69f048bf0c cloud-setup: add tool for automatic IP configuration in cloud
This is a tool for automatically configuring networking in a cloud
environment.

Currently it only supports IPv4 on EC2, but it's intended for extending
to other cloud providers (Azure). See [1] and [2] for how to configure
secondary IP addresses on EC2. This is what the tool currently aims to
do (but in the future it might do more).

[1] https://aws.amazon.com/premiumsupport/knowledge-center/ec2-ubuntu-secondary-network-interface/

It is inspired by SuSE's cloud-netconfig ([1], [2]) and ec2-net-utils
package on Amazon Linux ([3], [4]).

[1] https://www.suse.com/c/multi-nic-cloud-netconfig-ec2-azure/
[2] https://github.com/SUSE-Enceladus/cloud-netconfig
[3] https://github.com/aws/ec2-net-utils
[4] https://github.com/lorengordon/ec2-net-utils.git

It is also intended to work without configuration. The main point is
that you boot an image with NetworkManager and nm-cloud-setup enabled,
and it just works.
2019-11-28 19:52:18 +01:00
Thomas Haller 878d4963ed bluetooth/tests: add "nm-bt-test helper" program for manual testing of bluetooth code
Just add a stub implementation and let it build. More will be added
later.
2019-09-22 16:05:50 +02:00
Lubomir Rintel 6e5385a4eb wwan/tests: test service-providers.xml parser
Just a handful of unit tests.
2019-09-11 14:32:05 +02:00
Lubomir Rintel e9f2ea6c22 COPYING: make sure we ship the relevant license texts
This adds LGPL and GFDL texts from the GNU web site and updates the GPL
one:

  COPYING: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
  COPYING.LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
  COPYING.GFDL: https://www.gnu.org/licenses/old-licenses/fdl-1.1.txt

The update to the GPL text is purely cosmetic. However, shipping the
exact same file as GNU publishes may help distros that deduplicate the
license texts or hardlink duplicates.
2019-09-10 11:10:52 +02:00
Lubomir Rintel 7a72c705ac initrd: add devicetree support
This adds capability to hand over the network configuration from
OpenFirmware (and potentially other boot loaders with openfirmware
support such as U-Boot) to NetworkManager.

It's done analogously to ACPI/iBFT. In fact, the same ip=ibft command
line option is used, adding a more general ip=fw alias. This probably
deserves some documentation, but I'm not adding any at this time.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/257
2019-09-10 11:04:51 +02:00
Thomas Haller 74641be816 settings: drop ibft settings plugin
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
2019-06-20 16:06:44 +02:00
Thomas Haller 1da7dfc408 gitignore: merge gitignore files
For the most part, we only have one main .gitignore file.

There were a few nested files, merge them into the main file.

I find it better to have only one gitignore file, otherwise the
list of ignored files is spread out through the working directory.
2019-05-19 14:41:21 +02:00
Thomas Haller 5c0dd32622 src/tests: rename core's "test-general*" to "test-core*" 2019-05-19 14:41:00 +02:00
Thomas Haller fbe2fdd167 libnm/tests: rename libnm's "test-general" to "test-libnm" 2019-05-19 14:41:00 +02:00
Thomas Haller 0c7bc1a5d9 clients/tests: rename clients/common's "test-general" to "test-clients-common" 2019-05-19 14:00:16 +02:00
Thomas Haller c99bbc99b0 wifi/tests: rename Wi-Fi's "test-general" to "test-devices-wifi"
We already have 4 other tests that are named "test-general". Rename.
2019-05-19 11:28:53 +02:00
Thomas Haller d27f6b9d0a keyfile/tests: rename core's "test-keyfile" to "test-keyfile-settings"
We already have "libnm-core/tests/test-keyfile.c" from which we build
"test-keyfile".

Our test binaries should be named the following:

- "*/tests/test-*"

- the test binary "*/tests/test-*" should be build from a source file
  "*/tests/test-*.c". Meaning: the source's and executable's name should
  correspond.

- test binaries should be named uniquely. Also, because older meson
  versions don't like having the same binary name more than once.

Rename to avoid the duplicate name.
2019-05-19 11:25:59 +02:00
Thomas Haller a80c199e9e gitignore: move ignored libnm-glib/libnm-util files to the bottom of the .gitignore
The bottom contains the tombstones for files that we ignored in
the past, but no longer actually have. Move the lines.
2019-05-19 11:23:23 +02:00
Thomas Haller 7a25f67af7 shared/tests: add tests for libnm-core-aux
These tests cannot (easily) be under "shared/nm-libnm-core-aux/tests"
because libnm/libnm-core requires code under shared while
"nm-libnm-core-aux" requires libnm/libnm-core. With autotools that is
not problem, but with meson we include sub directories in a particular
order and there is no way to foward declare stuff (AFAIK). To avoid
the circular dependency, add the tests to "clients/common/tests", which
is always built last.
2019-04-25 07:47:37 +02:00
Thomas Haller dfdbd1b385 shared/tests: add test for "shared/nm-utils"
"shared/nm-utils" is a loose collection of utility functions.
There is a certain aim that they can be used independently.
However, they also rely on each other.

Add a test that we can build a minimal shared library with
these tools, independent of libnm-core.
2018-10-18 12:16:55 +02:00
Lubomir Rintel 9f9609555d initrd: add configuration generator
nm-initrd-generator scans the command line for options relevant to network
configuration and creates configuration files for an early instance of
NetworkManager run from the initial ramdisk during early boot.
2018-09-18 17:40:47 +02:00
Lubomir Rintel ecc074b2f8 initrd: add command line parser 2018-09-18 17:40:47 +02:00
Lubomir Rintel b544f7243d initrd: add iBFT reader
This is loosely based on nms-ibft-reader, but with some significant
changes. Notably, it parses /sys/firmware/ibft directly instead of
iscsiadm output.

iscsiadm is not available on early boot (perhaps it's too large) and
turns out that parsing sysfs directly is easier and more
straightforwared anyways. A win-win situation.

It is not useful alone, it's in a separate commit just for the sake of
easier review.
2018-09-18 17:40:47 +02:00
Jan Alexander Steffens (heftig) 9de4cc53a5 gitignore: Fix *.stamp ignore
ripgrep complains about the invalid `**`.

(cherry picked from commit 1fad494c34)
2018-09-13 14:33:11 +02:00
Thomas Haller a75ab799e4 build: create "config-extra.h" header instead of passing directory variables via CFLAGS
1) the command line gets shorter. I frequently run `make V=1` to see
   the command line arguments for the compiler, and there is a lot
   of noise.

2) define each of these variables at one place. This makes it easy
   to verify that for all compilation units, a particular
   define has the same value. Previously that was not obvious or
   even not the case (see commit e5d1a71396
   and commit d63cf1ef2f).
   The point is to avoid redundancy.

3) not all compilation units need all defines. In fact, most modules
   would only need a few of these defines. We aimed to pass the necessary
   minium of defines to each compilation unit, but that was non-obvious
   to get right and often we set a define that wasn't used. See for example
   "src_settings_plugins_ibft_cppflags" which needlessly had "-DSYSCONFDIR".
   This question is now entirely avoided by just defining all variables in
   a header. We don't care to find the minimum, because every component
   gets anyway all defines from the header.

4) this also avoids the situation, where a module that previously did
   not use a particular define gets modified to require it. Previously,
   that would have required to identify the missing define, and add
   it to the CFLAGS of the complation unit. Since every compilation
   now includes "config-extra.h", all defines are available everywhere.

5) the fact that each define is now available in all compilation units
   could be perceived as a downside. But it isn't, because these defines
   should have a unique name and one specific value. Defining the same
   name with different values, or refer to the same value by different
   names is a bug, not a desirable feature. Since these defines should
   be unique accross the entire tree, there is no problem in providing
   them to every compilation unit.

6) the reason why we generate "config-extra.h" this way, instead of using
   AC_DEFINE() in configure.ac, is due to the particular handling of
   autoconf for directory variables. See [1].
   With meson, it would be trivial to put them into "config.h.meson".
   While that is not easy with autoconf, the "config-extra.h" workaround
   seems still preferable to me.

[1] https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Installation-Directory-Variables.html
2018-07-17 17:46:39 +02:00
Beniamino Galvani 3886cc8e0c core: rename 'arping' to 'acd'
Now that the ACD functionality is no longer using arping, rename
nm-arping-manager to nm-acd-manager and other occurences of arping as
well.
2018-04-18 15:22:34 +02:00
Thomas Haller 33d2d8850b gitignore: ignore *.pyc files 2018-04-04 14:57:07 +02:00
Thomas Haller 868c3cedfd dhcp: remove unused nm_utils_resolve_conf_parse() function 2018-03-20 21:03:20 +01:00
Thomas Haller 2f85fe0adf gitignore: ignore generated clients/common/settings-docs.h file 2018-01-12 09:51:12 +01:00
Thomas Haller 0474441e22 settings: drop unmaintained ifnet settings plugin of Gentoo
Even Gentoo disables this plugin since before 0.9.8 release
of NetworkManager. Time to say goodbye.

If somebody happens to show up to maintain it, we may resurrect it
later.

If "$distro_plugins=ifnet" was set, configure.ac would use that
to autodetect --with-hostname-persist=gentoo. Replace that autodetect
part by checking for /etc/gentoo-release file.
2017-12-21 10:50:33 +01:00
Thomas Haller 58c07d33a4 gitignore: ignore default meson build directory "build" 2017-12-15 09:36:45 +01:00
Thomas Haller d5d4911b58 gitignore: readd removed libnm-core/tests/test-setting* programs
Although removed, they show up whenever switching to an
old branch. Keep ignoring them.
2017-12-08 08:45:51 +01:00
Francesco Giudici 540b7b3dfd gitignore: ignore libnm-core/tests/test-setting
We now have merged in libnm-core/tests/test-setting test file the test
files for 8021x, bond and dcb... add the new test file to .gitignore and
remove the old ones.
2017-12-08 00:46:27 +01:00
Lubomir Rintel 4d1f090aed libnm: register empty NMClient and NetworkManager when loading libnm with GIR
Register empty "NMClient" and "NetworkManager" GIR modules as soon as libnm is
loaded witch gnome-introspection. This prevents the real modules from being
loaded because they would in turn load libnm-glib and abort() and crash.

In particular this prevents the GNOME shell from crashing with
libnm-glib abort and allows gracefully disabling the extensions which
use the obsolete library.

Test:

  $ cat test.js
  const NM = imports.gi.NM;
  print (NM.SecretAgentGetSecretsFlags.ALLOW_INTERACTION);

  const NMClient = imports.gi.NMClient;
  print (NMClient.SecretAgentGetSecretsFlags.ALLOW_INTERACTION);

Before:

  $ gjs test.js
  1

  (gjs:16253): libnm-util-ERROR **: libnm symbols detected; Mixing libnm with libnm-util/libnm-glib is not supported
  Trace/breakpoint trap (core dumped)
  $

After:

  $ gjs test.js
  1
  Gjs-Message: JS WARNING: [test.js 5]: reference to undefined property "SecretAgentGetSecretsFlags"

  (gjs:16228): Gjs-WARNING **: JS ERROR: TypeError: NMClient.SecretAgentGetSecretsFlags is undefined
  @test.js:5:1

  JS_EvaluateScript() failed
2017-11-06 11:47:05 +01:00
Thomas Haller 6dbc390302 gitignore: ignore temporary ifcfg-rh tests directory 2017-06-29 14:52:09 +02:00
Thomas Haller 8df944c7e4 libnm: add testable libnm/nm-libnm-utils.c file
Previously, internal parts of libnm were not testable.
Instead, add "libnm/nm-libnm-utils.c" and "libnm/libnm-utils.la"
to contain code that can be statically linked with a new
test "libnm/tests/test-general".
2017-05-19 12:45:45 +02:00
Thomas Haller b4b8e81153 gitignore: ignore .zanata-cache directory 2017-04-19 11:52:26 +02:00
Thomas Haller 022117ff36 cli/tests: add "clients/common/tests/test-general.c" 2017-04-05 16:53:06 +02:00
Thomas Haller b044b306d2 gitignore: fix ignoring "clients/common/settings-docs.c" (2)
Fixes: d720f0955f
2017-03-30 18:07:35 +02:00
Thomas Haller 1b2da4b5f3 gitignore: fix ignoring "clients/common/settings-docs.c"
Fixes: d720f0955f
2017-03-30 17:29:21 +02:00
Thomas Haller 2ac6c5a981 build: rename intermediate doc xmls
Allows to use pattern rules by making the
related files having a common naming scheme.

This commit only renames files.
2016-11-24 16:54:17 +01:00
Lubomir Rintel 972e0d2803 all: rename the introspection data to use the interface paths in names
This makes it easier to install the files with proper names.
Also, it makes the makefile rules slightly simpler.

Lastly, the documentation is now generated into docs/api, which makes it
possible to get rid of the awkward relative file names in docbook.
2016-11-23 15:43:42 +01:00
Thomas Haller 8c7f5e2653 build: rename "src/dnsmasq-manager" to "src/dnsmasq"
The dnsmasq directory does not only contain the manager
instance, but various files related to dnsmasq.

Rename.
2016-11-21 14:07:47 +01:00
Thomas Haller e053996881 build: rename "src/dhcp-manager" to "src/dhcp"
The dhcp directory does not only contain the manager
instance, but various files related to DHCP.

Rename.
2016-11-21 14:07:47 +01:00
Thomas Haller 1706366351 build: rename "src/supplicant-manager" to "src/supplicant"
The supplicant directory does not only contain the manager
instance, but various files related to wpa-supplicant.

Rename.
2016-11-21 14:07:47 +01:00
Thomas Haller 7b78a931df build: generate src/NetworkManager.ver during build
This adds 0.4 seconds to the build time.

You can disable it by setting $NM_BUILD_NO_CREATE_EXPORTS environment
variable. This is useful in the unexpected case that the script
is broken.
Or, if you just want to use a different, non-generated version-script.
Or, if you want to save 0.4 seconds build-time.
2016-11-10 18:30:38 +01:00
Lubomir Rintel 44fca246a7 rdisc: rename to ndisc
We'll soon not only do the router discovery, but announce ourselves as a
reouter. "Neighbor discovery" sounds to be a more appropriate name for
the class than "Router discovery".
2016-11-09 17:16:47 +01:00
Thomas Haller 4be9b4a2cb build: move policy file from "policy/" to "data/" 2016-11-03 14:18:23 +01:00
Thomas Haller 3c2a49df2f build: merge "introspection/Makefile.am" into toplevel Makefile.am 2016-10-19 15:26:30 +02:00
Thomas Haller f42466215a callouts/dispatcher: rename directory callouts
Originally, the "callouts" directory contained various programs
that NetworkManager would call, for example the dhcp helper.

For a while, it only contains nm-dispatcher. Thus rename the directory
to indicate that it's for dispatcher.
2016-10-13 21:33:33 +02:00
Thomas Haller eab8b06d8b ifcfg-rh/tests: merge test-ifcfg-rh-utils into test-ifcfg-rh
We don't need need separate unit tests for basic tests that can
just run in the same test-run. If you really need to run only
a particular set of tests, try
  ./src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh -p /settings/plugins/ifcfg-rh/utils

Results in less compilation (time), and less binaries to test during
`make check`.
2016-10-11 11:37:46 +02:00
Thomas Haller 8b1d569e91 gitignore: ignore test-wifi-ap-utils
Although the test "test-wifi-ap-utils" got already renamed to "test-general",
keep ignoring the old binary when switching between branches.
2016-10-08 10:19:10 +02:00
Thomas Haller 44b2044faa wifi: rename NMAccessPoint to NMWifiAP
NMAccessPoint was in file "nm-wifi-ap.h" with
method nm_ap_*(). Make the naming consistent.

Also rename "nm-wifi-ap-utils.*" as it contains general
purpose wifi utilities. No need to have special "ap" utilities.

Same for "test-wifi-ap-utils.c". It just contains general wifi
tests.
2016-10-06 20:35:05 +02:00