summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-05-28 14:24:19 +0200
committerGitHub <noreply@github.com>2018-05-28 14:24:19 +0200
commitd32d473d66caafb4e448fa5fc056589b7763c478 (patch)
treedb5807477deee96de2c57178e40261a125eeed48
parent0c02e235e732e984ce8923c81e749338cbf53486 (diff)
parent8514095fe69821531b776654f43c1b84ce747f89 (diff)
downloadsystemd-d32d473d66caafb4e448fa5fc056589b7763c478.tar.gz
systemd-d32d473d66caafb4e448fa5fc056589b7763c478.tar.bz2
systemd-d32d473d66caafb4e448fa5fc056589b7763c478.zip
Merge pull request #9103 from keszybz/more-tables-tests
More tables tests
-rw-r--r--meson.build11
-rw-r--r--src/machine/test-machine-tables.c2
-rw-r--r--src/network/test-network-tables.c30
-rw-r--r--src/nspawn/meson.build27
-rw-r--r--src/nspawn/test-nspawn-tables.c11
-rw-r--r--src/test/test-tables.c26
6 files changed, 81 insertions, 26 deletions
diff --git a/meson.build b/meson.build
index 48851d4af2..83fed46cc7 100644
--- a/meson.build
+++ b/meson.build
@@ -1258,6 +1258,7 @@ includes = include_directories('src/basic',
'src/shared',
'src/systemd',
'src/journal',
+ 'src/nspawn',
'src/resolve',
'src/timesync',
'src/time-wait-sync',
@@ -2461,12 +2462,10 @@ exe = executable('systemd-nspawn',
'src/core/mount-setup.h',
'src/core/loopback-setup.c',
'src/core/loopback-setup.h',
- include_directories : [includes, include_directories('src/nspawn')],
- link_with : [libshared],
- dependencies : [libacl,
- libblkid,
- libseccomp,
- libselinux],
+ include_directories : includes,
+ link_with : [libnspawn_core,
+ libshared],
+ dependencies : [libblkid],
install_rpath : rootlibexecdir,
install : true)
public_programs += [exe]
diff --git a/src/machine/test-machine-tables.c b/src/machine/test-machine-tables.c
index 0e39e895e8..78ba00c2a4 100644
--- a/src/machine/test-machine-tables.c
+++ b/src/machine/test-machine-tables.c
@@ -9,9 +9,9 @@
#include "test-tables.h"
int main(int argc, char **argv) {
+ test_table(kill_who, KILL_WHO);
test_table(machine_class, MACHINE_CLASS);
test_table(machine_state, MACHINE_STATE);
- test_table(kill_who, KILL_WHO);
return EXIT_SUCCESS;
}
diff --git a/src/network/test-network-tables.c b/src/network/test-network-tables.c
index eee91d11d2..11cd7faa8b 100644
--- a/src/network/test-network-tables.c
+++ b/src/network/test-network-tables.c
@@ -1,28 +1,42 @@
#include "dhcp6-internal.h"
#include "dhcp6-protocol.h"
#include "ethtool-util.h"
-#include "netlink-internal.h"
#include "netdev/bond.h"
#include "netdev/ipvlan.h"
#include "netdev/macvlan.h"
+#include "netdev/tunnel.h"
+#include "netlink-internal.h"
#include "networkd-link.h"
+#include "networkd-network.h"
#include "networkd-util.h"
#include "test-tables.h"
int main(int argc, char **argv) {
- test_table(bond_mode, NETDEV_BOND_MODE);
- /* test_table(link_state, LINK_STATE); — not a reversible mapping */
- test_table(link_operstate, LINK_OPERSTATE);
test_table(address_family_boolean, ADDRESS_FAMILY_BOOLEAN);
- test_table(netdev_kind, NETDEV_KIND);
+ test_table(bond_ad_select, NETDEV_BOND_AD_SELECT);
+ test_table(bond_arp_all_targets, NETDEV_BOND_ARP_ALL_TARGETS);
+ test_table(bond_arp_validate, NETDEV_BOND_ARP_VALIDATE);
+ test_table(bond_fail_over_mac, NETDEV_BOND_FAIL_OVER_MAC);
+ test_table(bond_lacp_rate, NETDEV_BOND_LACP_RATE);
+ test_table(bond_mode, NETDEV_BOND_MODE);
+ test_table(bond_primary_reselect, NETDEV_BOND_PRIMARY_RESELECT);
+ test_table(bond_xmit_hash_policy, NETDEV_BOND_XMIT_HASH_POLICY);
test_table(dhcp6_message_status, DHCP6_STATUS);
+ test_table(dhcp_use_domains, DHCP_USE_DOMAINS);
test_table(duplex, DUP);
- test_table(wol, WOL);
+ test_table(ip6tnl_mode, NETDEV_IP6_TNL_MODE);
+ test_table(ipv6_privacy_extensions, IPV6_PRIVACY_EXTENSIONS);
+ test_table(ipvlan_flags, NETDEV_IPVLAN_FLAGS);
+ test_table(link_operstate, LINK_OPERSTATE);
+ /* test_table(link_state, LINK_STATE); — not a reversible mapping */
+ test_table(lldp_mode, LLDP_MODE);
+ test_table(netdev_kind, NETDEV_KIND);
test_table(nl_union_link_info_data, NL_UNION_LINK_INFO_DATA);
+ test_table(wol, WOL);
- test_table_sparse(macvlan_mode, NETDEV_MACVLAN_MODE);
- test_table_sparse(ipvlan_mode, NETDEV_IPVLAN_MODE);
test_table_sparse(dhcp6_message_type, DHCP6_MESSAGE);
+ test_table_sparse(ipvlan_mode, NETDEV_IPVLAN_MODE);
+ test_table_sparse(macvlan_mode, NETDEV_MACVLAN_MODE);
return EXIT_SUCCESS;
}
diff --git a/src/nspawn/meson.build b/src/nspawn/meson.build
index 0dae12f25f..9ca463b370 100644
--- a/src/nspawn/meson.build
+++ b/src/nspawn/meson.build
@@ -2,7 +2,7 @@
#
# Copyright 2017 Zbigniew Jędrzejewski-Szmek
-systemd_nspawn_sources = files('''
+libnspawn_core_sources = files('''
nspawn-cgroup.c
nspawn-cgroup.h
nspawn-def.h
@@ -24,7 +24,6 @@ systemd_nspawn_sources = files('''
nspawn-setuid.h
nspawn-stub-pid1.c
nspawn-stub-pid1.h
- nspawn.c
'''.split())
nspawn_gperf_c = custom_target(
@@ -33,13 +32,27 @@ nspawn_gperf_c = custom_target(
output : 'nspawn-gperf.c',
command : [gperf, '@INPUT@', '--output-file', '@OUTPUT@'])
-systemd_nspawn_sources += [nspawn_gperf_c]
+libnspawn_core_sources += [nspawn_gperf_c]
+
+libnspawn_core = static_library(
+ 'nspawn-core',
+ libnspawn_core_sources,
+ include_directories : includes,
+ dependencies : [libacl,
+ libseccomp,
+ libselinux])
+
+systemd_nspawn_sources = files('nspawn.c')
tests += [
- [['src/nspawn/test-patch-uid.c',
- 'src/nspawn/nspawn-patch-uid.c',
- 'src/nspawn/nspawn-patch-uid.h'],
- [libshared],
+ [['src/nspawn/test-nspawn-tables.c'],
+ [libnspawn_core,
+ libshared],
+ []],
+
+ [['src/nspawn/test-patch-uid.c'],
+ [libnspawn_core,
+ libshared],
[libacl],
'', 'manual'],
]
diff --git a/src/nspawn/test-nspawn-tables.c b/src/nspawn/test-nspawn-tables.c
new file mode 100644
index 0000000000..2c5f2ef6db
--- /dev/null
+++ b/src/nspawn/test-nspawn-tables.c
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: LGPL-2.1+ */
+
+#include "nspawn-settings.h"
+#include "test-tables.h"
+
+int main(int argc, char **argv) {
+ test_table(resolv_conf_mode, RESOLV_CONF_MODE);
+ test_table(timezone_mode, TIMEZONE_MODE);
+
+ return 0;
+}
diff --git a/src/test/test-tables.c b/src/test/test-tables.c
index 164bce0e98..3341fe2e25 100644
--- a/src/test/test-tables.c
+++ b/src/test/test-tables.c
@@ -12,6 +12,7 @@
#include "condition.h"
#include "device.h"
#include "execute.h"
+#include "import-util.h"
#include "install.h"
#include "job.h"
#include "journald-server.h"
@@ -20,8 +21,11 @@
#include "locale-util.h"
#include "log.h"
#include "logs-show.h"
+#include "machine-image.h"
#include "mount.h"
#include "path.h"
+#include "process-util.h"
+#include "resolve-util.h"
#include "rlimit-util.h"
#include "scope.h"
#include "service.h"
@@ -39,36 +43,51 @@
int main(int argc, char **argv) {
test_table(architecture, ARCHITECTURE);
+ test_table(assert_type, CONDITION_TYPE);
test_table(automount_result, AUTOMOUNT_RESULT);
test_table(automount_state, AUTOMOUNT_STATE);
+ test_table(cgroup_controller, CGROUP_CONTROLLER);
test_table(cgroup_device_policy, CGROUP_DEVICE_POLICY);
- test_table(condition_type, CONDITION_TYPE);
- test_table(assert_type, CONDITION_TYPE);
+ test_table(cgroup_io_limit_type, CGROUP_IO_LIMIT_TYPE);
+ test_table(collect_mode, COLLECT_MODE);
test_table(condition_result, CONDITION_RESULT);
+ test_table(condition_type, CONDITION_TYPE);
test_table(device_state, DEVICE_STATE);
+ test_table(dnssec_mode, DNSSEC_MODE);
+ test_table(emergency_action, EMERGENCY_ACTION);
+ test_table(exec_directory_type, EXEC_DIRECTORY_TYPE);
test_table(exec_input, EXEC_INPUT);
+ test_table(exec_keyring_mode, EXEC_KEYRING_MODE);
test_table(exec_output, EXEC_OUTPUT);
- test_table(emergency_action, EMERGENCY_ACTION);
+ test_table(exec_preserve_mode, EXEC_PRESERVE_MODE);
+ test_table(exec_utmp_mode, EXEC_UTMP_MODE);
+ test_table(image_type, IMAGE_TYPE);
+ test_table(import_verify, IMPORT_VERIFY);
test_table(job_mode, JOB_MODE);
test_table(job_result, JOB_RESULT);
test_table(job_state, JOB_STATE);
test_table(job_type, JOB_TYPE);
test_table(kill_mode, KILL_MODE);
test_table(kill_who, KILL_WHO);
+ test_table(locale_variable, VARIABLE_LC);
test_table(log_target, LOG_TARGET);
test_table(mac_policy, MACPOLICY);
test_table(manager_state, MANAGER_STATE);
+ test_table(manager_timestamp, MANAGER_TIMESTAMP);
test_table(mount_exec_command, MOUNT_EXEC_COMMAND);
test_table(mount_result, MOUNT_RESULT);
test_table(mount_state, MOUNT_STATE);
test_table(name_policy, NAMEPOLICY);
+ test_table(namespace_type, NAMESPACE_TYPE);
test_table(notify_access, NOTIFY_ACCESS);
test_table(output_mode, OUTPUT_MODE);
+ test_table(partition_designator, PARTITION_DESIGNATOR);
test_table(path_result, PATH_RESULT);
test_table(path_state, PATH_STATE);
test_table(path_type, PATH_TYPE);
test_table(protect_home, PROTECT_HOME);
test_table(protect_system, PROTECT_SYSTEM);
+ test_table(resolve_support, RESOLVE_SUPPORT);
test_table(rlimit, RLIMIT);
test_table(scope_result, SCOPE_RESULT);
test_table(scope_state, SCOPE_STATE);
@@ -98,7 +117,6 @@ int main(int argc, char **argv) {
test_table(unit_file_state, UNIT_FILE_STATE);
test_table(unit_load_state, UNIT_LOAD_STATE);
test_table(unit_type, UNIT_TYPE);
- test_table(locale_variable, VARIABLE_LC);
test_table(virtualization, VIRTUALIZATION);
test_table_sparse(object_compressed, OBJECT_COMPRESSED);