Commit Graph

2223 Commits

Author SHA1 Message Date
Michal Sekletar e01ff70a77 nspawn: always setup machine id
We check /etc/machine-id of the container and if it is already populated
we use value from there, possibly ignoring value of --uuid option from
the command line. When dealing with R/O image we setup transient machine
id.

Once we determined machine id of the container, we use this value for
registration with systemd-machined and we also export it via
container_uuid environment variable.

As registration with systemd-machined is done by the main nspawn process
we communicate container machine id established by setup_machine_id from
outer child to the main process by unix domain socket. Similarly to PID
of inner child.
2016-04-11 16:43:16 +02:00
Zbigniew Jędrzejewski-Szmek 56815242ac build-sys: force generation of triggers.systemd file
We don't want to actually install it anywhere, because it
is only usable copied or %included directly into a spec file,
and must be available before %prep is run. But still, it's
useful to generate it automatically so it's easier to copy
and it doesn't go stale.
2016-04-07 14:29:34 -04:00
Martin Pitt f7152c19b9 Merge pull request #2981 from keszybz/test-nss
build-sys: move test-nss to manual_tests
2016-04-07 17:01:12 +02:00
Zbigniew Jędrzejewski-Szmek b7b61747b0 build-sys: move test-nss to manual_tests 2016-04-07 09:02:12 -04:00
Lennart Poettering 056f0498fe Merge pull request #2947 from keszybz/test-nss
Add a test for nss modules and some related fixes
2016-04-06 10:48:55 +02:00
Zbigniew Jędrzejewski-Szmek 2abb5b3b10 test-nss: test the resolution of various names
nss-dns is also "tested". It should be almost always available,
and provides a reference for comparison.
2016-04-05 23:19:56 -04:00
Zbigniew Jędrzejewski-Szmek 1db30aeab1 Merge pull request #2915 from vinaykul/master 2016-03-31 00:52:23 -04:00
Vinay Kulkarni 413708d106 DHCP DUID, IAID configuration options 2016-03-30 16:33:55 -07:00
Zbigniew Jędrzejewski-Szmek ab19c9e457 Merge pull request #2898 from bengal/lldp-api
lldp: move public macros to sd-lldp.h and namespace them
2016-03-29 21:00:58 -04:00
Zbigniew Jędrzejewski-Szmek b68f10bf1f build-sys: fix build with libgrcypt disabled
- Move gcrypt.h include inside grcrypt-util.h.
- Allow gcrypt-util.[ch] to be compiled even without gcrypt.
This allows the logic in files using gcrypt to be simplified.

- Fix compilation of systemd-resolve without gcrypt.
systemd-resolved already supported that.

Fixes #2711.
2016-03-27 21:51:44 -04:00
Beniamino Galvani 6afa676780 lldp: move public macros to sd-lldp.h and namespace them
lldp.h contains definitions of LLDP types, subtypes and capabilities which
should be exposed in public headers. Get rid of the file and move those
definitions to sd-lldp.h with the SD_ prefix.
2016-03-24 16:41:48 +01:00
Daniel Mack 99d91109a6 Merge pull request #2880 from keszybz/more-tests
Add some simple tests for env_value_is_valid and env_assignment_is_valid
2016-03-22 10:23:12 +01:00
Zbigniew Jędrzejewski-Szmek afec45395f Revert "DHCP DUID and IAID configurability" 2016-03-21 18:24:24 -04:00
Zbigniew Jędrzejewski-Szmek 93515caebf tests: rename test-env-replace to test-env-util 2016-03-21 16:17:18 -04:00
Daniel Mack 68de79d6a4 Merge pull request #2760 from ronnychevalier/rc/core_no_new_privileges_seccompv3
core: set NoNewPrivileges for seccomp if we don't have CAP_SYS_ADMIN
2016-03-21 12:57:43 +01:00
Umut Tezduyar Lindskog 2adeb166da journal-upload: remove microhttpd dependency
journal-upload doesn't really need microhttpd to run.
Without the dependency, we can cross compile systemd
without microhttpd and get the uploader part of the
remote logging.

Change-Id: I28dfa5ad2aae94e50de1d32713e1827623c3fd1d
2016-03-18 11:35:37 +01:00
Daniel Mack 5fec580c84 Merge pull request #2839 from keszybz/use-sendfile-smarter
Use sendfile smarter
2016-03-17 20:33:41 +01:00
Zbigniew Jędrzejewski-Szmek 2f368e4a11 basic/missing: move syscall definitions to basic/missing_syscall.h
We have a bunch of syscall wrapper definitions and it's easier to
see that they follow the same pattern if they are not interspersed
with other defines.

Change the wrappers to be uniform:
- if __NR_XXX is not defined, do not bother to call the syscall,
  and return -1/ENOSYS immediately.
- do not check __NR_XXX defines if we detect the symbol as defined,
  since we don't need them anyway
- reindent stuff for readability

New file basic/missing_syscall.h is included at the end of missing.h
because it might make use of some of the definitions in missing.h.
2016-03-17 13:34:34 -04:00
Zbigniew Jędrzejewski-Szmek 7f495b9848 build-sys: add check that our headers are ANSI compatible 2016-03-11 13:33:43 -05:00
Tom Gundersen ead02a14ed Merge pull request #2818 from vinaykul/master
DHCP DUID and IAID configurability
2016-03-10 14:38:42 +01:00
Vinay Kulkarni c83321e6d4 DHCP DUID and IAID configurability 2016-03-09 21:58:44 -08:00
Zbigniew Jędrzejewski-Szmek c41d3b3a0c Merge pull request #2792 from ronnychevalier/rc/tests_movev2
tests: move out unrelated tests from test-util to their own file
2016-03-09 23:53:54 -05:00
Zbigniew Jędrzejewski-Szmek ce1e49c3d6 test-journal-enum: enable by default
It will get at most ten values, I don't know why we wouldn't
always run this test.
2016-03-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek 301a9c67aa test-libudev: disable monitor mode by default and add to automatic tests 2016-03-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek c1ab819162 Enable test-ipcrm, test-hostname in unsafe tests 2016-03-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek 134953c99c Enable test-daemon, test-log, test-watchdog by default
Those should be safe to run, resulting in some messages in logs.
2016-03-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek a4bfedec70 Rename test-boot-timestamp to test-boot-timestamps and enable by default
The source file name and the binary name were mismatched.
Rename binary to match.

Make the test exit with TEST_SKIP if the data is missing or we
have no permissions. Otherwise, the data will be printed, which
should be safe to enable by default.
2016-03-04 21:45:45 -05:00
Zbigniew Jędrzejewski-Szmek f26b57d12a Move test-loopback to normal tests
In the normal case lo should be already configured and this should be
a noop, even when run under root.
2016-03-04 21:45:44 -05:00
Ronny Chevalier ac229ed890 tests: move xattr-util related tests to test-xattr-util.c 2016-03-03 19:04:07 +01:00
Ronny Chevalier 6a4f4a0fa0 tests: move glob-util related tests to test-glob-util.c 2016-03-03 19:04:07 +01:00
Ronny Chevalier ac933e8ec4 tests: move io-util related tests to test-io-util 2016-03-03 19:04:06 +01:00
Ronny Chevalier d376cbb7b0 tests: move proc-cmdline related tests to test-proc-cmdline.c 2016-03-03 19:04:06 +01:00
Ronny Chevalier c270684afd tests: move fs-util related tests to test-fs-util.c 2016-03-03 19:04:06 +01:00
Ronny Chevalier 0999c8ade8 tests: move fd-util related tests to test-fd-util.c 2016-03-03 19:04:06 +01:00
Ronny Chevalier f4c13ad76f tests: move stat-util related tests to test-stat-util.c 2016-03-03 19:04:06 +01:00
Ronny Chevalier 7ba365a9b2 tests: move cpu-set-util related tests to test-cpu-set-util.c 2016-03-03 18:46:58 +01:00
Ronny Chevalier cd3510707a tests: move web-util related tests to test-web-util.c 2016-03-03 18:46:58 +01:00
Ronny Chevalier b66de1f9d4 tests: move alloc related tests to test-alloc-util.c 2016-03-03 18:46:58 +01:00
Ronny Chevalier 45e0b1f68c tests: move escape related tests to test-escape.c 2016-03-03 18:46:58 +01:00
Ronny Chevalier 134714368e tests: move hexdecoct tests to test-hexdecoct.c 2016-03-03 18:46:58 +01:00
Zbigniew Jędrzejewski-Szmek fed527aa5b test-sizeof: add a helper which prints variable sizes and signedness
This helps to understand misleading gcc warnings about type mismatches.
2016-03-02 10:42:27 -05:00
Zbigniew Jędrzejewski-Szmek ada94e69cd test-selinux: add some simple tests which call functions and print the results and timings 2016-03-02 10:42:27 -05:00
Ronny Chevalier 50f130c286 test-execute: add nfsnobody alternative as a nobody user 2016-02-28 15:00:18 +01:00
Ronny Chevalier 19c0b0b9a5 core: set NoNewPrivileges for seccomp if we don't have CAP_SYS_ADMIN
The manpage of seccomp specify that using seccomp with
SECCOMP_SET_MODE_FILTER will return EACCES if the caller do not have
CAP_SYS_ADMIN set, or if the no_new_privileges bit is not set. Hence,
without NoNewPrivilege set, it is impossible to use a SystemCall*
directive with a User directive set in system mode.

Now, NoNewPrivileges is set if we are in user mode, or if we are in
system mode and we don't have CAP_SYS_ADMIN, and SystemCall*
directives are used.
2016-02-28 14:44:26 +01:00
Martin Pitt 6369641d6f clock-util: make clock_is_localtime() testable and add initial tests
Add path argument to clock_is_localtime() and default to "/etc/adjtime" if it's
NULL. This makes the function testable.

Add test-clock: initial test cases for some scenarios, using a temporary file.
This also checks the behaviour with a NULL (i. e. the system's /etc/adjtime)
file.
2016-02-26 11:28:49 +01:00
Martin Pitt 77d9510adc Merge pull request #2719 from evverx/add-test-to-makefile
tests: various fixes
2016-02-24 08:06:53 +01:00
Evgeny Vereshchagin bd3bc54620 tests: add exec-capabilityambientset* to Makefile.am
This is a follow-up to 70d7aea5c
2016-02-23 17:01:12 +00:00
Evgeny Vereshchagin 5a7c1eaedd tests: add exec-runtimedirectory* to Makefile.am
This is a follow-up to cc3ddc851
2016-02-23 17:01:12 +00:00
Evgeny Vereshchagin dcf7860e11 tests: add exec-spec-interpolation.service to Makefile.am
This is a follow-up to 2525499
2016-02-23 17:01:12 +00:00
Daniel Mack 232c84b2d2 Remove systemd-bootchart
This commit rips out systemd-bootchart. It will be given a new home, outside
of the systemd repository. The code itself isn't actually specific to
systemd and can be used without systemd even, so let's put it somewhere
else.
2016-02-23 13:30:09 +01:00