1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-27 18:55:40 +03:00
Commit Graph

84 Commits

Author SHA1 Message Date
Harald Hoyer
99877b7e37 test-functions:install_libnss() call dracut_install with all $NSS_LIBS
dracut_install() can cope with more than one file
2015-02-03 10:46:57 +01:00
Martin Pitt
7d023341c7 tests: install ldconfig.real for Debian based distros
In Debian based distributions ldconfig is just a shell wrapper around
ldconfig.real, for deferring it during package installation.
2015-02-03 09:50:45 +01:00
Martin Pitt
c50a4525aa tests: install hostname debug tool
This is mostly a vehicle to pull in libnsl.so which gets dlopen()ed by NSS
under certain NSS configurations.
2015-02-03 09:50:45 +01:00
Martin Pitt
cffae62bcb tests: install all required libnss modules
Don't assume "files" for everything in nsswitch. Instead, ask "getent passwd"
about which libnss modules it dlopen()s, and install these.
2015-02-03 09:50:45 +01:00
Martin Pitt
53d90f9582 tests: don't hardcode systemctl path
Get it from type -P instead, to support --enable-split-usr.
2015-02-03 09:50:45 +01:00
Martin Pitt
3486cb6cfa tests: determine rootlibdir from pkg-config
Prefer asking pkg-config for the rootlibdir, to also support systems with
--enable-split-usr. Fall back to the hardcoded /usr/lib/systemd if that fails.
2015-02-03 09:50:45 +01:00
Martin Pitt
4be4833ece tests: Make sushell optional in image creation
sushell does not exist in all distributions, and it can be changed with
configure --with-debug-shell, so make installation of it optional.
2015-02-03 09:50:45 +01:00
Marko Myllynen
25b47f96d9 Use eurlatgr as the example console font
See https://fedoraproject.org/wiki/Changes/NewDefaultConsoleFont

https://bugzilla.redhat.com/show_bug.cgi?id=1182529
2015-01-22 01:14:53 -05:00
Martin Pitt
77354c7e6f sysv-generator: Replace Provides: symlinks with real units
Since commit b7e7184 the SysV generator creates symlinks for all "Provides:" in
the LSB header. However, this is too greedy; there are cases where the
creation of a unit .service file fails because of an already existing
symlink with the same name:

 - Backup files such as /etc/init.d/foo.bak still have "Provides: foo", and
   thus get a foo.service -> foo.bak.service link. foo.bak would not be enabled
   in rcN.d/, but we (deliberately) create units for all executables in init.d/
   so that a manual "systemctl start" works. If foo.bak is processed before,
   the symlink already exists.

 - init.d/bar has "Provides: foo", while there also is a real init.d/foo. The
   former would create a link foo.service -> bar.service, while the latter
   would fail to create the real foo.service.

If we encounter an existing symlink, just remove it before writing a real unit.

Note that two init.d scripts "foo" and "bar" which both provide the same name
"common" already work. The first processed init script wins and creates the
"common.service" symlink, and the second just fails to create the symlink
again. Thus create an additional test case for this to ensure that it keeps
working sensibly.

https://bugs.debian.org/775404
2015-01-21 17:01:00 +01:00
Martin Pitt
d816e2b790 systemd-sysv-generator test: test scripts with hidden suffixes
We don't expect any unit generated from temporary package manager, swap, and
similar files.
2015-01-21 15:30:01 +01:00
Martin Pitt
29e0e6d8c1 sysv-generator: Handle .sh suffixes when translating Provides:
When deciding whether the provided name equals the file name in
sysv_translate_facility(), also consider them equal if the file name has a
".sh" suffix.

This was uncovered by commit b7e7184 which then created a symlink
"<name>.service" to itself for ".sh" suffixed init.d scripts.

For additional robustness, refuse to create symlinks to itself in add_alias().

Add test case which reproduces the bug.

https://bugs.debian.org/775889
2015-01-21 14:53:38 +01:00
Martin Pitt
eb89bc1d25 systemd-sysv-generator test: fix enabled check
Fix hardcoded "foo.service", test for the actual unit parameter.
2015-01-21 10:22:10 +01:00
Martin Pitt
56401ac57a systemd-sysv-generator test: don't parse symlinks
Generated services which are symlinks should be tested/handled differently from
files, so ignore them in run_generator()'s result parsing.
2015-01-21 09:45:15 +01:00
Martin Pitt
e28aa588f0 test: add integration test for systemd-sysv-generator
This covers the general functionality as well as regression tests for recent
fixes like commits b7e718 and 1ed0c19.
2015-01-21 08:07:07 +01:00
Martin Pitt
72521ab9fd test: eliminate shell wrapper for Python test
Use the parallel test runner's TEST_EXTENSIONS/*_LOG_COMPILER feature
(https://www.gnu.org/software/automake/manual/html_node/Parallel-Test-Harness.html)
to run *.py tests through $(PYTHON), and only if we have python
available/enabled.

This eliminates the need of having shell wrappers, thus drop
test/rules-test.sh.
2015-01-20 21:26:35 +01:00
Martin Pitt
e8015e6e28 test: simplify rules-test.sh wrapper
Drop globbing of rules/*.rules in the rules-test.sh wrapper and move that logic
into the actual test rule-syntax-check.py. This can still be called with
individual rules files, but when being called without arguments it will now
process all top_builddir/rules/*.rules.

Preparation for dropping the shell wrappers altogether.
2015-01-20 20:52:25 +01:00
Martin Pitt
6c8f2e7d78 test: Use configured Python
Don't hardcode "python" or /usr/bin/python, but use the configured $(PYTHON).
2015-01-20 12:49:08 +01:00
Martin Pitt
c6be83c16d test/rule-syntax-check.py: Fix for Python 3
Make this work with both Python 2 and 3.
2015-01-20 12:18:40 +01:00
Ronny Chevalier
27c5347c8c test-execute: add tests for UMask directive 2014-12-11 18:32:57 +01:00
Tom Gundersen
02cd084db7 tests: udev - assume /etc/machine-id rather than /etc/hosts
On todays machines /etc/hosts is not mandatory. /etc/machine-id is though, so let's rely on that instead.

This makes the udev tests pass again for me.
2014-12-11 14:17:35 +01:00
Jan Synacek
0eb3cc8850 test: fix some tests when running inside a container 2014-12-10 13:36:10 +01:00
Lennart Poettering
55e189007c bus-policy: also add in other bus policy tests from dbus1
dbus1 only checks if these files parse correctly so let's do the same for now.
2014-11-26 20:58:34 +01:00
Lennart Poettering
3a9cca1104 bus-policy: steal a test case for prefix ownership from dbus1, and make sure it passes with the bus proxy enforcement 2014-11-26 20:22:22 +01:00
Michal Schmidt
06c1c4f98c test: add test for crash when adding a JOB_NOP 2014-11-26 16:33:40 +01:00
Ronny Chevalier
281e05b6cb tests: add test-execute
add tests for the following directives:
- WorkingDirectory
- Personality
- IgnoreSIGPIPE
- PrivateTmp
- SystemCallFilter: It makes test/TEST-04-SECCOMP obsolete, so it has
  been removed.
- SystemCallErrorNumber
- User
- Group
- Environment
2014-11-13 10:39:51 +01:00
Ronny Chevalier
bc9992978c tests: add test-path
It tests all available directives of Path units:
- PathChanged
- PathModified
- PathExists
- PathExisysGlob
- DirectoryNotEmpty
- MakeDirectory
- DirectoryMode
- Unit
2014-11-08 22:45:56 +01:00
Daniel Mack
e91c8c2019 bus-proxyd: assorted cleanups and fixes
Just some cleanups around policy checks that came up during review.
The code is still not productive.
2014-10-07 18:02:38 +02:00
Daniel Mack
078ef7b85a bus-policy: split API for bus-proxyd
Instead of operating on an sd_bus_message object, expose an API that has 4
functions:

  policy_check_own()
  policy_check_hello()
  policy_check_recv()
  policy_check_send()

This also allows dropping extra code to parse message contents - the bus
proxy already has dedicated code paths for that, and we can hook into
those later.

Tests amended accordingly.
2014-09-24 17:07:14 +02:00
Daniel Mack
20725d929f bus-policy: add test utility
Add some test files and routines for dbus policy checking.
2014-09-20 18:47:45 +02:00
Tom Gundersen
9158d03e40 test: udev - restrict nemuric uid's to existing ones
We now verify the existence of uid's before applying them to devicenodes, so change the
test accordingly. We assume that both uid/gid 1 and 2 exist on the test system.
2014-09-20 18:12:53 +02:00
Zbigniew Jędrzejewski-Szmek
d1fab3fe88 core: warn when merged units have conflicting dependencies
A unit should not Conflict with itself. It also does not make
much sense for a unit to be After or Before itself, or to
trigger itself in some way.

If one of those dependency types is encountered, warn, instead
of dropping it silently like other dependency types.

% build/systemd-analyze verify test/loopy3.service
...
Dependency Conflicts dropped when merging unit loopy4.service into loopy3.service
Dependency ConflictedBy dropped when merging unit loopy4.service into loopy3.service
2014-08-07 20:46:49 -04:00
Zbigniew Jędrzejewski-Szmek
e66047ff62 core: do not add dependencies to self
Adds a pair of files which cause a segfault (also with
systemd-analyze verify).

https://bugzilla.redhat.com/show_bug.cgi?id=1124843
2014-08-07 20:42:58 -04:00
Zbigniew Jędrzejewski-Szmek
0d8c31ff72 test-engine: fix access to unit load path
Also add a bit of debugging output to help diagnose problems,
add missing units, and simplify cppflags.

Move test-engine to normal tests from manual tests, it should now
work without destroying the system.
2014-07-20 19:48:16 -04:00
Ronny Chevalier
d31e109677 tests: do not use systemctl status --failed
since v212 calling systemctl status without arguments
will show a overall system state
2014-06-10 19:04:18 +02:00
Lennart Poettering
0e4061c4d5 test: add missing test units 2014-02-18 23:55:41 +01:00
Ronny Chevalier
f928d3263d test: add basic seccomp tests 2014-02-14 19:00:32 -05:00
Zbigniew Jędrzejewski-Szmek
8a8332f77e test: print the important commands to make debugging easier 2014-02-14 19:00:32 -05:00
Zbigniew Jędrzejewski-Szmek
b8667ee416 test: make the image bigger
I got some errors about lack of disk space... 100MB either way
shouldn't matter.
2014-02-14 19:00:26 -05:00
Zbigniew Jędrzejewski-Szmek
739d81ddd0 test: wrap $LOOPDEV in quotes
Otherwise things go awry if it is not set ('[ -b ]' is not the same as '[ -b "" ]'!).
2013-12-10 07:46:21 -05:00
Ronny Chevalier
c6a77179a4 test: rework run_qemu
It tries to find a suitable QEMU binary and will use KVM if present.
We can now configure QEMU from outside with 4 variables :
  - $QEMU_BIN : path to QEMU's binary
  - $KERNEL_APPEND : arguments appended to kernel cmdline
  - $KERNEL_BIN : path to a kernel
    Default /boot/vmlinuz-$KERNEL_VER
  - $INITRD : path to an initramfs
    Default /boot/initramfs-${KERNEL_VER}.img
  - $QEMU_SMP : number of CPU simulated by QEMU.
    Default 1

(from Alexander Graf's script: http://www.spinics.net/lists/kvm/msg72389.html)
2013-12-10 07:46:21 -05:00
Ronny Chevalier
1a6dc6534e test: fix TEST-02-CRYPTSETUP
missing generate_module_dependencies call which prevents dm_mod and
dm_crypt modules to be loaded
2013-12-10 07:46:21 -05:00
David Strauss
6414b7c981 cgroups: Cache controller masks and optimize queues. 2013-11-22 11:22:47 +10:00
Ronny Chevalier
889a90422d test: remove duplicated code 2013-11-07 01:23:54 -05:00
Harald Hoyer
41a5ef639b TEST-03-JOBS/test.sh: do not output the "failed" if it does not exist 2013-09-17 15:19:17 -05:00
Harald Hoyer
07ba977575 TEST-01-BASIC, TEST-02-CRYPTSETUP: fixed strip
also output more status about failed jobs
2013-09-17 15:19:17 -05:00
Kay Sievers
0228a7e56a test: add licence header and switch to LGPL
Checked with and got OK from Martin.
2013-08-14 22:55:40 +02:00
Zbigniew Jędrzejewski-Szmek
fff87a35d9 test: make it easier to override kernel version 2013-04-24 00:25:04 -04:00
Anatol Pomozov
ab06eef810 Fix spelling errors using 'codespell' tool 2013-04-15 08:40:05 -04:00
Michal Schmidt
d710d36375 test: test irreversible jobs 2013-02-23 14:18:17 +01:00
Zbigniew Jędrzejewski-Szmek
7bcd865d38 test: some trivial fixes to test scripts
- fix typo
- use compiled systemd-nspawn
- drop --capability=... from systemd-nspawn invocation, is is the default now
- simplify sudo make invocations
2013-01-29 19:01:41 -05:00