Commit Graph

24 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek a132bef023 Drop kdbus bits
Some kdbus_flag and memfd related parts are left behind, because they
are entangled with the "legacy" dbus support.

test-bus-benchmark is switched to "manual". It was already broken before
(in the non-kdbus mode) but apparently nobody noticed. Hopefully it can
be fixed later.
2017-07-23 12:01:54 -04:00
Zbigniew Jędrzejewski-Szmek 2416f73be1 tests: add test-random-util
In case you're wondering: 16 aligns in a nice pyramid.
2017-06-28 10:34:45 -04:00
Djalal Harouni 7a093ea246 Merge pull request #5990 from keszybz/logind
A bunch of sd-login improvements
2017-05-21 07:14:21 +02:00
Lennart Poettering b2d0c14214 Merge pull request #5598 from pfl/ndisc_prefix_delegation
Initial Router Advertisment implementation
2017-05-19 11:17:07 +02:00
Zbigniew Jędrzejewski-Szmek ce737f46cd test-login: make the test non-manual
test-login.c is largely rewritten to use _cleanup_ and give more meaningful
messages (function names are used instead of creative terms like "active
session", so that when something unexpected is returned, it's much easier to
see what function is responsible).

The monitoring part is only activated if '-m' is passed on the command line.

It runs against the information from /run/systemd/ in the live system, but that
should be OK: logind/sd-login interface is supposed to be stable and both
backwards and forwards compatible.

If not running in a login session, some tests are skipped.

Those two changes together mean that it's possible to run test-login in the
test suite.

Tests for sd_pid_get_{unit,user_unit,slice} are added.
2017-05-18 22:11:58 -04:00
Lennart Poettering f731ad4456 Merge pull request #5957 from keszybz/test-c++
Test compilation under C++
2017-05-17 17:02:55 +02:00
Zbigniew Jędrzejewski-Szmek 4a24ba71a3 meson: add rules for RA sources 2017-05-15 14:49:50 +03:00
Zbigniew Jędrzejewski-Szmek 94e2523b70 tests,meson: add test-bus-vtable, compiled as C and C++
This test is mostly a compilation test that checks that various defines in
sd-bus-vtable.h are valid C++. The code is executed, but the results are not
checked (apart from sd-bus functions not returning an error). test-bus-objects
contains pretty extensive tests for this functionality.

The C++ version is only added to meson, since it's simpler there.
Because of the .cc extension, meson will compile the executable with c++.

This test is necessary to properly check the macros in sd-bus-vtable.h. Just
running the headers through g++ is not enough, because the macros are not
exercised.

Follow-up for #5941.
2017-05-13 15:50:44 -04:00
Daniel Wang b85bc551c3 network: Implement DHCP Option 119 (Domain Search List) (#5932)
This adds a modified version of dhcp6_option_parse_domainname() that is
able to parse compressed domain names, borrowing the idea from
dns_packet_read_name(). It also adds pieces in networkd-link and
networkd-manager to properly save/load the added option field.

Resolves #2710.
2017-05-13 10:19:32 -04:00
Zbigniew Jędrzejewski-Szmek 0bc9115251 Merge branch 'master' into meson-no-libudev 2017-04-27 13:39:54 -04:00
Michael Biebl c3045943c4 meson: get rid of libfirewall 2017-04-26 22:14:23 +02:00
Michael Biebl 34ce0a52c7 meson: drop implicit libudev link dependencies
Executables which link against libshared do not need an explicit
dependency on libudev, as libshared will make sure that those symbols
are available.
2017-04-26 17:28:48 +02:00
Zbigniew Jędrzejewski-Szmek ad68714d5c meson: test-ns is manual, not just unsafe 2017-04-24 19:28:05 -04:00
Zbigniew Jędrzejewski-Szmek 37efbbd821 meson: reindent all files with 8 spaces
The indentation for emacs'es meson-mode is added .dir-locals.

All files are reindented automatically, using the lasest meson-mode from git.
Indentation should now be fairly consistent.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 3a30f21ff8 meson: allow optional static linking of shared code in udev helpers
This makes the helper binaries significantly bigger (in some cases, the final
size depends on link options and optimization level), and is only useful for
distributions which want to provide the option to install udev without systemd.
As the linking is improved, the difference between the columns might shrink,
but it's unlikely that linking libshared statically could ever be more
efficient.

E.g. with -O0, no -flto:
                   (static) (shared)
src/udev/ata_id     999176    85696
src/udev/cdrom_id  1024344   111656
src/udev/collect    990344    81280
src/udev/scsi_id   1023592   115656
src/udev/v4l_id     811736    17744

When linked dynamically, install_rpath must be specified, so add that.
2017-04-23 21:47:29 -04:00
Zbigniew Jędrzejewski-Szmek 83b6af36d1 meson: add test-dlopen
test-dlopen is a very simple binary that is only linked with libc and
libdl. From it we do dlopen() on the nss and pam modules to check that they are
linked to all necessary libs.

(meson-compiled nss modules are linked to less libraries, for whatever reason.
I suspected that some deps are missing, but it turns out that my suspicions
weren't justified, and the modules load just fine. Let's keep the test though,
it is very quick, and might detect missing linkage in the future.)
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek aac2605820 meson: eliminate libsystemd_journal_internal and use libsystemd_internal less
This simplifies things and leads to a smaller installation footprint.
libsystemd_internal and libsystemd_journal_internal are linked into
libystemd-shared and available to all programs linked to libsystemd-shared.
libsystemd_journal_internal is not needed anymore, and libsystemd-shared
is used everwhere. The few exceptions are: libsystemd.so, test-engine,
test-bus-error, and various loadable modules.
2017-04-23 21:47:28 -04:00
Zbigniew Jędrzejewski-Szmek 81efcc1c89 meson: specify a timeout of 90 s for tests which take a bit longer
Both test-hashmap and test-benchmark need 10-11 s here, but might time out
under load with the default meson timeout of 30 s.
2017-04-23 21:47:27 -04:00
Zbigniew Jędrzejewski-Szmek f0bd7cc701 meson: fix compilation with -Dnetworkd=false, -Dkmod=no, -Dlibgcrypt=no
The tests are included under the conditional too, instead of specifying
'ENABLE_NETWORKD' in the test definition array, because libnetworkd_core
dependency is undefined if networkd is disabled.
2017-04-23 21:47:27 -04:00
Zbigniew Jędrzejewski-Szmek 826472ce36 meson: update linking for fixed meson linking
With mesonbuid/meson#1545, meson does not propagate deps of a library
when linking with that library. That's of course the right thing to do,
but it exposes a bunch of missing deps.

This compiles with both meson-0.39.1 and meson-git + pr/1545.
2017-04-23 21:47:27 -04:00
Zbigniew Jędrzejewski-Szmek e0bec52f27 meson: add test-libudev-sym
This is slightly complicated by the fact that files('libudev.h') cannot be used
as an argument in custom_target command (string is required). This restriction
should be lifted in future versions of mesons, so this could be simplified.
2017-04-23 21:47:27 -04:00
Zbigniew Jędrzejewski-Szmek 37ab1a25ec meson: add test-libsystemd-sym, fix linking of libsystemd
This is quite messy. I think libtool might have been using something
like -Wl,--whole-archive, but I don't think meson has support for that.
For now, just recompile all the sources for linking into libsystemd
directly. This should not matter much for efficiency, since it's a
few small files.
2017-04-23 21:47:27 -04:00
Zbigniew Jędrzejewski-Szmek f4ee10a282 meson: create a static version of libshared and link libcore and some tests to it
This is what autoconf-based build does, and it makes test-bus-error and
test-engine able to access the bus error mapping table. OTOH, this is a heavy
price to pay: it would be excellent to link libcore.a to libsystemd-shared-NNN.so.
Otherwise we duplicate the same code in 'systemd' and 'libsystemd-shared-NNN.so'.

-rwxrwxr-x. 1 4075544 Apr  6 20:30 systemd* <-- libcore linked against libsystemd-shared.so
-rwxrwxr-x. 1 5596504 Apr  9 14:07 systemd* <-- libcore linked against libsystemd-shared.a

v2:
- update for 6b5cf3ea62
2017-04-23 21:47:27 -04:00
Zbigniew Jędrzejewski-Szmek 69e96427a2 meson: define tests
Tests can be run with 'ninja-build test' or using 'mesontest'.
'-Dtests=unsafe' can be used to include the "unsafe" tests in the
test suite, same as with autotools.

v2:
- use more conf.get guards are optional components
- declare deps on generated headers for test-{af,arphrd,cap}-list

v3:
- define environment for tests

  Most test don't need this, but to be consistent with autotools-based build, and
  to avoid questions which tests need it and which don't, set the same environment
  for all tests.

v4:
- rework test generation

  Use a list of lists to define each test. This way we can reduce the
  boilerplate somewhat, although the test listings are still pretty verbose. We
  can also move the definitions of the tests to the subdirs. Unfortunately some
  subdirs are included earlier than some of the libraries that test binaries
  are linked to.  So just dump all definitions of all tests that cannot be
  defined earlier into src/test. The `executable` definitions are still at the
  top level, so the binaries are compiled into the build root.

v5:
- tag test-dnssec-complex as manual

v6:
- fix HAVE_LIBZ typo
- add missing libgobject/libgio defs
- mark test-qcow2 as manual
2017-04-23 21:47:26 -04:00