mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 17:14:02 +00:00
build: use default NM_BUILD_* defines for tests
Use two common defines NM_BUILD_SRCDIR and NM_BUILD_BUILDDIR for specifying the location of srcdir and builddir. Note that this is only relevant for tests, as they expect a certain layout of the directories, to find files that concern them.
This commit is contained in:
parent
7fcf33908b
commit
b7426e91db
57
Makefile.am
57
Makefile.am
|
@ -672,9 +672,10 @@ libnm_core_tests_cppflags = \
|
||||||
$(dflt_cppflags_libnm_core) \
|
$(dflt_cppflags_libnm_core) \
|
||||||
-I$(srcdir)/libnm-core/tests \
|
-I$(srcdir)/libnm-core/tests \
|
||||||
-I$(builddir)/libnm-core/tests \
|
-I$(builddir)/libnm-core/tests \
|
||||||
|
$(nm_build_cflags) \
|
||||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \
|
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE \
|
||||||
-DTEST_CERT_DIR=\"$(abs_srcdir)/libnm-core/tests/certs\"
|
$(NULL)
|
||||||
|
|
||||||
libnm_core_tests_test_compare_CPPFLAGS = $(libnm_core_tests_cppflags)
|
libnm_core_tests_test_compare_CPPFLAGS = $(libnm_core_tests_cppflags)
|
||||||
libnm_core_tests_test_crypto_CPPFLAGS = $(libnm_core_tests_cppflags)
|
libnm_core_tests_test_crypto_CPPFLAGS = $(libnm_core_tests_cppflags)
|
||||||
|
@ -870,7 +871,7 @@ libnm_lib_cppflags = \
|
||||||
-I$(builddir)/libnm \
|
-I$(builddir)/libnm \
|
||||||
-DG_LOG_DOMAIN=\""libnm"\" \
|
-DG_LOG_DOMAIN=\""libnm"\" \
|
||||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM \
|
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM \
|
||||||
-DNMRUNDIR=\"$(nmrundir)\"
|
$(NULL)
|
||||||
|
|
||||||
libnminclude_HEADERS += \
|
libnminclude_HEADERS += \
|
||||||
$(libnm_lib_h_pub_real)
|
$(libnm_lib_h_pub_real)
|
||||||
|
@ -1091,9 +1092,10 @@ libnm_tests_cppflags = \
|
||||||
$(dflt_cppflags_libnm_core) \
|
$(dflt_cppflags_libnm_core) \
|
||||||
-I$(srcdir)/libnm \
|
-I$(srcdir)/libnm \
|
||||||
-I$(builddir)/libnm \
|
-I$(builddir)/libnm \
|
||||||
|
$(nm_build_cflags) \
|
||||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM \
|
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM \
|
||||||
-DTEST_NM_SERVICE=\"$(abs_srcdir)/tools/test-networkmanager-service.py\"
|
$(NULL)
|
||||||
|
|
||||||
libnm_tests_ldadd = \
|
libnm_tests_ldadd = \
|
||||||
libnm/libnm.la \
|
libnm/libnm.la \
|
||||||
|
@ -1821,7 +1823,8 @@ EXTRA_DIST += \
|
||||||
|
|
||||||
src_dhcp_tests_cppflags = \
|
src_dhcp_tests_cppflags = \
|
||||||
$(src_tests_cppflags) \
|
$(src_tests_cppflags) \
|
||||||
-DTESTDIR="\"$(abs_srcdir)/src/dhcp/tests\""
|
$(nm_build_cflags) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
src_dhcp_tests_ldadd = \
|
src_dhcp_tests_ldadd = \
|
||||||
src/libNetworkManagerTest.la
|
src/libNetworkManagerTest.la
|
||||||
|
@ -1922,8 +1925,8 @@ check_programs += src/settings/plugins/keyfile/tests/test-keyfile
|
||||||
|
|
||||||
src_settings_plugins_keyfile_tests_test_keyfile_CPPFLAGS = \
|
src_settings_plugins_keyfile_tests_test_keyfile_CPPFLAGS = \
|
||||||
$(src_tests_cppflags) \
|
$(src_tests_cppflags) \
|
||||||
-DTEST_KEYFILES_DIR=\"$(abs_srcdir)/src/settings/plugins/keyfile/tests/keyfiles\" \
|
$(nm_build_cflags) \
|
||||||
-DTEST_SCRATCH_DIR=\"$(abs_builddir)/src/settings/plugins/keyfile/tests/keyfiles\"
|
$(NULL)
|
||||||
|
|
||||||
src_settings_plugins_keyfile_tests_test_keyfile_LDFLAGS = \
|
src_settings_plugins_keyfile_tests_test_keyfile_LDFLAGS = \
|
||||||
$(GLIB_LIBS) \
|
$(GLIB_LIBS) \
|
||||||
|
@ -2033,10 +2036,10 @@ src_settings_plugins_ibft_tests_test_ibft_CPPFLAGS = \
|
||||||
-I$(srcdir)/libnm-core \
|
-I$(srcdir)/libnm-core \
|
||||||
-I$(builddir)/libnm-core \
|
-I$(builddir)/libnm-core \
|
||||||
-I$(srcdir)/src \
|
-I$(srcdir)/src \
|
||||||
|
$(nm_build_cflags) \
|
||||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||||
-DTEST_IBFT_DIR=\"$(abs_srcdir)/src/settings/plugins/ibft/tests\" \
|
$(NULL)
|
||||||
-DTEST_SCRATCH_DIR=\"$(abs_builddir)/src/settings/plugins/ibft/tests\"
|
|
||||||
|
|
||||||
src_settings_plugins_ibft_tests_test_ibft_LDFLAGS = \
|
src_settings_plugins_ibft_tests_test_ibft_LDFLAGS = \
|
||||||
$(GLIB_LIBS) \
|
$(GLIB_LIBS) \
|
||||||
|
@ -2174,8 +2177,8 @@ src_settings_plugins_ifcfg_rh_tests_test_ifcfg_rh_SOURCES = \
|
||||||
|
|
||||||
src_settings_plugins_ifcfg_rh_tests_test_ifcfg_rh_CPPFLAGS = \
|
src_settings_plugins_ifcfg_rh_tests_test_ifcfg_rh_CPPFLAGS = \
|
||||||
$(src_tests_cppflags) \
|
$(src_tests_cppflags) \
|
||||||
-DTEST_IFCFG_DIR=\"$(abs_srcdir)/src/settings/plugins/ifcfg-rh/tests\" \
|
$(nm_build_cflags) \
|
||||||
-DTEST_SCRATCH_DIR=\"$(abs_builddir)/src/settings/plugins/ifcfg-rh/tests\"
|
$(NULL)
|
||||||
|
|
||||||
src_settings_plugins_ifcfg_rh_tests_test_ifcfg_rh_LDFLAGS = \
|
src_settings_plugins_ifcfg_rh_tests_test_ifcfg_rh_LDFLAGS = \
|
||||||
$(GLIB_LIBS) \
|
$(GLIB_LIBS) \
|
||||||
|
@ -2482,10 +2485,11 @@ src_settings_plugins_ifupdown_tests_test_ifupdown_CPPFLAGS = \
|
||||||
-I$(srcdir)/libnm-core \
|
-I$(srcdir)/libnm-core \
|
||||||
-I$(builddir)/libnm-core \
|
-I$(builddir)/libnm-core \
|
||||||
-I$(srcdir)/src \
|
-I$(srcdir)/src \
|
||||||
|
$(GLIB_CFLAGS) \
|
||||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_DAEMON \
|
||||||
$(GLIB_CFLAGS) \
|
$(nm_build_cflags) \
|
||||||
-DTEST_ENI_DIR=\"$(abs_srcdir)/src/settings/plugins/ifupdown/tests\"
|
$(NULL)
|
||||||
|
|
||||||
src_settings_plugins_ifupdown_tests_test_ifupdown_LDFLAGS = \
|
src_settings_plugins_ifupdown_tests_test_ifupdown_LDFLAGS = \
|
||||||
$(GLIB_LDFLAGS) \
|
$(GLIB_LDFLAGS) \
|
||||||
|
@ -2912,13 +2916,13 @@ check_programs += src/dnsmasq/tests/test-dnsmasq-utils
|
||||||
|
|
||||||
src_dnsmasq_tests_test_dnsmasq_utils_CPPFLAGS = \
|
src_dnsmasq_tests_test_dnsmasq_utils_CPPFLAGS = \
|
||||||
$(src_tests_cppflags) \
|
$(src_tests_cppflags) \
|
||||||
-DTESTDIR="\"$(abs_srcdir)\""
|
$(NULL)
|
||||||
|
|
||||||
src_dnsmasq_tests_test_dnsmasq_utils_LDADD = \
|
src_dnsmasq_tests_test_dnsmasq_utils_LDADD = \
|
||||||
src/libNetworkManagerTest.la
|
src/libNetworkManagerTest.la
|
||||||
|
|
||||||
src_dnsmasq_tests_test_dnsmasq_utils_LDFLAGS = \
|
src_dnsmasq_tests_test_dnsmasq_utils_LDFLAGS = \
|
||||||
$(SANITIZER_EXEC_LDFLAGS)
|
$(SANITIZER_EXEC_LDFLAGS)
|
||||||
|
|
||||||
$(src_dnsmasq_tests_test_dnsmasq_utils_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
|
$(src_dnsmasq_tests_test_dnsmasq_utils_OBJECTS): $(libnm_core_lib_h_pub_mkenums)
|
||||||
|
|
||||||
|
@ -3085,7 +3089,8 @@ check_programs += src/supplicant/tests/test-supplicant-config
|
||||||
|
|
||||||
src_supplicant_tests_test_supplicant_config_CPPFLAGS = \
|
src_supplicant_tests_test_supplicant_config_CPPFLAGS = \
|
||||||
$(src_tests_cppflags) \
|
$(src_tests_cppflags) \
|
||||||
-DTEST_CERT_DIR=\"$(abs_srcdir)/src/supplicant/tests/certs\"
|
$(nm_build_cflags) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
src_supplicant_tests_test_supplicant_config_LDADD = \
|
src_supplicant_tests_test_supplicant_config_LDADD = \
|
||||||
src/libNetworkManagerTest.la
|
src/libNetworkManagerTest.la
|
||||||
|
@ -3113,8 +3118,8 @@ src_tests_config_test_config_SOURCES = \
|
||||||
|
|
||||||
src_tests_config_test_config_CPPFLAGS = \
|
src_tests_config_test_config_CPPFLAGS = \
|
||||||
$(src_tests_cppflags) \
|
$(src_tests_cppflags) \
|
||||||
-DSRCDIR=\""$(abs_srcdir)/src/tests/config"\" \
|
$(nm_build_cflags) \
|
||||||
-DBUILDDIR=\""$(abs_builddir)/src/tests/config"\"
|
$(NULL)
|
||||||
|
|
||||||
src_tests_config_test_config_LDADD = \
|
src_tests_config_test_config_LDADD = \
|
||||||
src/libNetworkManagerTest.la
|
src/libNetworkManagerTest.la
|
||||||
|
@ -3325,11 +3330,12 @@ dispatcher_tests_test_dispatcher_envp_CPPFLAGS = \
|
||||||
-I$(builddir)/libnm \
|
-I$(builddir)/libnm \
|
||||||
-I$(srcdir)/dispatcher \
|
-I$(srcdir)/dispatcher \
|
||||||
-I$(builddir)/dispatcher \
|
-I$(builddir)/dispatcher \
|
||||||
-DSRCDIR=\"$(abs_srcdir)/dispatcher/tests\" \
|
$(nm_build_cflags) \
|
||||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT \
|
||||||
$(GLIB_CFLAGS) \
|
$(GLIB_CFLAGS) \
|
||||||
$(SANITIZER_EXEC_CFLAGS)
|
$(SANITIZER_EXEC_CFLAGS) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
dispatcher_tests_test_dispatcher_envp_LDFLAGS = \
|
dispatcher_tests_test_dispatcher_envp_LDFLAGS = \
|
||||||
$(SANITIZER_EXEC_LDFLAGS)
|
$(SANITIZER_EXEC_LDFLAGS)
|
||||||
|
@ -4128,11 +4134,11 @@ libnm_util_tests_cppflags = \
|
||||||
-I$(builddir)/libnm-util \
|
-I$(builddir)/libnm-util \
|
||||||
$(GLIB_CFLAGS) \
|
$(GLIB_CFLAGS) \
|
||||||
$(DBUS_CFLAGS) \
|
$(DBUS_CFLAGS) \
|
||||||
-DBUILD_DIR=\"$(abs_builddir)/libnm-util/tests\" \
|
$(nm_build_cflags) \
|
||||||
-DTEST_CERT_DIR=\"$(abs_srcdir)/libnm-core/tests/certs\" \
|
|
||||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL \
|
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_UTIL \
|
||||||
$(SANITIZER_EXEC_CFLAGS)
|
$(SANITIZER_EXEC_CFLAGS) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
libnm_util_tests_ldadd = \
|
libnm_util_tests_ldadd = \
|
||||||
libnm-util/libnm-util.la \
|
libnm-util/libnm-util.la \
|
||||||
|
@ -4344,7 +4350,7 @@ nodist_libnm_glib_libnm_glib_la_SOURCES = \
|
||||||
libnm_glib_libnm_glib_la_CPPFLAGS = \
|
libnm_glib_libnm_glib_la_CPPFLAGS = \
|
||||||
$(libnm_glib_cppflags) \
|
$(libnm_glib_cppflags) \
|
||||||
$(LIBUDEV_CFLAGS) \
|
$(LIBUDEV_CFLAGS) \
|
||||||
-DNMRUNDIR=\"$(nmrundir)\"
|
$(NULL)
|
||||||
|
|
||||||
libnm_glib_libnm_glib_la_LDFLAGS = \
|
libnm_glib_libnm_glib_la_LDFLAGS = \
|
||||||
-Wl,--version-script=$(srcdir)/libnm-glib/libnm-glib.ver \
|
-Wl,--version-script=$(srcdir)/libnm-glib/libnm-glib.ver \
|
||||||
|
@ -4485,11 +4491,12 @@ libnm_glib_tests_cppflags = \
|
||||||
-I$(srcdir)/libnm-util \
|
-I$(srcdir)/libnm-util \
|
||||||
-I$(builddir)/libnm-util \
|
-I$(builddir)/libnm-util \
|
||||||
-I$(srcdir)/libnm-glib \
|
-I$(srcdir)/libnm-glib \
|
||||||
|
$(nm_build_cflags) \
|
||||||
-DNETWORKMANAGER_COMPILATION_TEST \
|
-DNETWORKMANAGER_COMPILATION_TEST \
|
||||||
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_GLIB \
|
-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_GLIB \
|
||||||
-DTEST_NM_SERVICE=\"$(abs_srcdir)/tools/test-networkmanager-service.py\" \
|
|
||||||
$(GLIB_CFLAGS) \
|
$(GLIB_CFLAGS) \
|
||||||
$(DBUS_CFLAGS)
|
$(DBUS_CFLAGS) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
libnm_glib_tests_programs_req_introspection = \
|
libnm_glib_tests_programs_req_introspection = \
|
||||||
libnm-glib/tests/test-nm-client \
|
libnm-glib/tests/test-nm-client \
|
||||||
|
|
|
@ -5,18 +5,16 @@ incs = [
|
||||||
libnm_inc
|
libnm_inc
|
||||||
]
|
]
|
||||||
|
|
||||||
cflags = [
|
|
||||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
|
||||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
|
|
||||||
'-DSRCDIR="@0@"'.format(meson.current_source_dir()),
|
|
||||||
]
|
|
||||||
|
|
||||||
exe = executable(
|
exe = executable(
|
||||||
test_unit,
|
test_unit,
|
||||||
test_unit + '.c',
|
test_unit + '.c',
|
||||||
include_directories: incs,
|
include_directories: incs,
|
||||||
dependencies: nm_core_dep,
|
dependencies: nm_core_dep,
|
||||||
c_args: cflags,
|
c_args: [
|
||||||
|
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||||
|
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_CLIENT',
|
||||||
|
] +
|
||||||
|
nm_build_cflags,
|
||||||
link_with: libnm_dispatcher_core
|
link_with: libnm_dispatcher_core
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
|
|
||||||
#include "nm-utils/nm-test-utils.h"
|
#include "nm-utils/nm-test-utils.h"
|
||||||
|
|
||||||
|
#define TEST_DIR NM_BUILD_SRCDIR"/dispatcher/tests"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -525,8 +527,7 @@ test_generic (const char *file, const char *override_vpn_ip_iface)
|
||||||
gs_strfreev char **denv = NULL;
|
gs_strfreev char **denv = NULL;
|
||||||
char **iter;
|
char **iter;
|
||||||
|
|
||||||
/* Read in the test file */
|
p = g_build_filename (TEST_DIR, file, NULL);
|
||||||
p = g_build_filename (SRCDIR, file, NULL);
|
|
||||||
success = get_dispatcher_file (p,
|
success = get_dispatcher_file (p,
|
||||||
&con_dict,
|
&con_dict,
|
||||||
&con_props,
|
&con_props,
|
||||||
|
|
|
@ -29,18 +29,16 @@ test_units = [
|
||||||
|
|
||||||
test_cert_dir = join_paths(meson.current_source_dir(), 'certs')
|
test_cert_dir = join_paths(meson.current_source_dir(), 'certs')
|
||||||
|
|
||||||
cflags = [
|
|
||||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
|
||||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE',
|
|
||||||
'-DTEST_CERT_DIR="@0@"'.format(test_cert_dir),
|
|
||||||
]
|
|
||||||
|
|
||||||
foreach test_unit: test_units
|
foreach test_unit: test_units
|
||||||
exe = executable(
|
exe = executable(
|
||||||
'libnm-core-' + test_unit,
|
'libnm-core-' + test_unit,
|
||||||
[test_unit + '.c'] + enum,
|
[test_unit + '.c'] + enum,
|
||||||
dependencies: nm_core_dep,
|
dependencies: nm_core_dep,
|
||||||
c_args: cflags,
|
c_args: [
|
||||||
|
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||||
|
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM_CORE',
|
||||||
|
] +
|
||||||
|
nm_build_cflags,
|
||||||
link_with: libnm_core
|
link_with: libnm_core
|
||||||
)
|
)
|
||||||
test(
|
test(
|
||||||
|
|
|
@ -35,6 +35,8 @@
|
||||||
|
|
||||||
#include "nm-utils/nm-test-utils.h"
|
#include "nm-utils/nm-test-utils.h"
|
||||||
|
|
||||||
|
#define TEST_CERT_DIR NM_BUILD_SRCDIR"/libnm-core/tests/certs"
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static const char *pem_rsa_key_begin = "-----BEGIN RSA PRIVATE KEY-----";
|
static const char *pem_rsa_key_begin = "-----BEGIN RSA PRIVATE KEY-----";
|
||||||
static const char *pem_rsa_key_end = "-----END RSA PRIVATE KEY-----";
|
static const char *pem_rsa_key_end = "-----END RSA PRIVATE KEY-----";
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
#include "nm-utils/nm-test-utils.h"
|
#include "nm-utils/nm-test-utils.h"
|
||||||
|
|
||||||
|
#define TEST_CERT_DIR NM_BUILD_SRCDIR"/libnm-core/tests/certs"
|
||||||
#define TEST_WIRED_TLS_CA_CERT TEST_CERT_DIR"/test-ca-cert.pem"
|
#define TEST_WIRED_TLS_CA_CERT TEST_CERT_DIR"/test-ca-cert.pem"
|
||||||
#define TEST_WIRED_TLS_PRIVKEY TEST_CERT_DIR"/test-key-and-cert.pem"
|
#define TEST_WIRED_TLS_PRIVKEY TEST_CERT_DIR"/test-key-and-cert.pem"
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,8 @@
|
||||||
|
|
||||||
#include "nm-utils/nm-test-utils.h"
|
#include "nm-utils/nm-test-utils.h"
|
||||||
|
|
||||||
#define TEST_NEED_SECRETS_EAP_TLS_CA_CERT TEST_CERT_DIR "/test_ca_cert.pem"
|
#define TEST_CERT_DIR NM_BUILD_SRCDIR"/libnm-core/tests/certs"
|
||||||
|
#define TEST_NEED_SECRETS_EAP_TLS_CA_CERT TEST_CERT_DIR "/test_ca_cert.pem"
|
||||||
#define TEST_NEED_SECRETS_EAP_TLS_CLIENT_CERT TEST_CERT_DIR "/test_key_and_cert.pem"
|
#define TEST_NEED_SECRETS_EAP_TLS_CLIENT_CERT TEST_CERT_DIR "/test_key_and_cert.pem"
|
||||||
#define TEST_NEED_SECRETS_EAP_TLS_PRIVATE_KEY TEST_CERT_DIR "/test_key_and_cert.pem"
|
#define TEST_NEED_SECRETS_EAP_TLS_PRIVATE_KEY TEST_CERT_DIR "/test_key_and_cert.pem"
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@
|
||||||
|
|
||||||
#include "nm-utils/nm-test-utils.h"
|
#include "nm-utils/nm-test-utils.h"
|
||||||
|
|
||||||
|
#define TEST_CERT_DIR NM_BUILD_SRCDIR"/libnm-core/tests/certs"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -197,9 +197,7 @@ libnm_glib = shared_library(
|
||||||
sources: sources + libnm_glib_enum + [nm_secret_agent_glue],
|
sources: sources + libnm_glib_enum + [nm_secret_agent_glue],
|
||||||
version: libnm_glib_version,
|
version: libnm_glib_version,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: cflags + [
|
c_args: cflags,
|
||||||
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir),
|
|
||||||
],
|
|
||||||
link_whole: libdeprecated_nm_glib,
|
link_whole: libdeprecated_nm_glib,
|
||||||
link_args: [
|
link_args: [
|
||||||
'-Wl,--version-script,@0@'.format(linker_script),
|
'-Wl,--version-script,@0@'.format(linker_script),
|
||||||
|
|
|
@ -16,10 +16,11 @@ foreach test_unit: test_units
|
||||||
test_unit,
|
test_unit,
|
||||||
[test_unit + '.c'] + shared_test_utils,
|
[test_unit + '.c'] + shared_test_utils,
|
||||||
dependencies: deps,
|
dependencies: deps,
|
||||||
c_args: common_cflags + [
|
c_args:
|
||||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
common_cflags + [
|
||||||
'-DTEST_NM_SERVICE="@0@"'.format(join_paths(meson.source_root(), 'tools', 'test-networkmanager-service.py')),
|
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||||
],
|
] +
|
||||||
|
nm_build_cflags,
|
||||||
)
|
)
|
||||||
|
|
||||||
test(
|
test(
|
||||||
|
|
|
@ -6,10 +6,8 @@ deps = [
|
||||||
]
|
]
|
||||||
|
|
||||||
cflags = common_cflags + [
|
cflags = common_cflags + [
|
||||||
'-DBUILD_DIR="@0@"'.format(meson.current_build_dir()),
|
|
||||||
'-DTEST_CERT_DIR="@0@"'.format(test_cert_dir),
|
|
||||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||||
]
|
] + nm_build_cflags
|
||||||
|
|
||||||
test = 'test-libnm-linking'
|
test = 'test-libnm-linking'
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
|
|
||||||
#include "nm-utils/nm-test-utils.h"
|
#include "nm-utils/nm-test-utils.h"
|
||||||
|
|
||||||
|
#define TEST_CERT_DIR NM_BUILD_SRCDIR"/libnm-core/tests/certs"
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static const char *pem_rsa_key_begin = "-----BEGIN RSA PRIVATE KEY-----";
|
static const char *pem_rsa_key_begin = "-----BEGIN RSA PRIVATE KEY-----";
|
||||||
static const char *pem_rsa_key_end = "-----END RSA PRIVATE KEY-----";
|
static const char *pem_rsa_key_end = "-----END RSA PRIVATE KEY-----";
|
||||||
|
|
|
@ -2428,7 +2428,8 @@ test_libnm_linking (void)
|
||||||
int status;
|
int status;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
g_spawn_sync (BUILD_DIR, argv, NULL, 0 /*G_SPAWN_DEFAULT*/,
|
g_spawn_sync (NM_BUILD_BUILDDIR"/libnm-util/tests",
|
||||||
|
argv, NULL, 0 /*G_SPAWN_DEFAULT*/,
|
||||||
_test_libnm_linking_setup_child_process, NULL,
|
_test_libnm_linking_setup_child_process, NULL,
|
||||||
&out, &err, &status, &error);
|
&out, &err, &status, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
|
|
|
@ -39,7 +39,8 @@
|
||||||
|
|
||||||
#include "nm-utils/nm-test-utils.h"
|
#include "nm-utils/nm-test-utils.h"
|
||||||
|
|
||||||
#define TEST_NEED_SECRETS_EAP_TLS_CA_CERT TEST_CERT_DIR "/test_ca_cert.pem"
|
#define TEST_CERT_DIR NM_BUILD_SRCDIR"/libnm-core/tests/certs"
|
||||||
|
#define TEST_NEED_SECRETS_EAP_TLS_CA_CERT TEST_CERT_DIR "/test_ca_cert.pem"
|
||||||
#define TEST_NEED_SECRETS_EAP_TLS_CLIENT_CERT TEST_CERT_DIR "/test_key_and_cert.pem"
|
#define TEST_NEED_SECRETS_EAP_TLS_CLIENT_CERT TEST_CERT_DIR "/test_key_and_cert.pem"
|
||||||
#define TEST_NEED_SECRETS_EAP_TLS_PRIVATE_KEY TEST_CERT_DIR "/test_key_and_cert.pem"
|
#define TEST_NEED_SECRETS_EAP_TLS_PRIVATE_KEY TEST_CERT_DIR "/test_key_and_cert.pem"
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@
|
||||||
|
|
||||||
#include "nm-utils/nm-test-utils.h"
|
#include "nm-utils/nm-test-utils.h"
|
||||||
|
|
||||||
|
#define TEST_CERT_DIR NM_BUILD_SRCDIR"/libnm-core/tests/certs"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
compare_blob_data (const char *test,
|
compare_blob_data (const char *test,
|
||||||
const char *key_path,
|
const char *key_path,
|
||||||
|
|
|
@ -10,7 +10,6 @@ deps = [
|
||||||
cflags = [
|
cflags = [
|
||||||
'-DG_LOG_DOMAIN="@0@"'.format(libnm_name),
|
'-DG_LOG_DOMAIN="@0@"'.format(libnm_name),
|
||||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM',
|
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM',
|
||||||
'-DNMRUNDIR="@0@"'.format(nm_pkgrundir)
|
|
||||||
]
|
]
|
||||||
|
|
||||||
if have_fake_typelibs
|
if have_fake_typelibs
|
||||||
|
|
|
@ -13,8 +13,7 @@ deps = [
|
||||||
cflags = [
|
cflags = [
|
||||||
'-DNETWORKMANAGER_COMPILATION_TEST',
|
'-DNETWORKMANAGER_COMPILATION_TEST',
|
||||||
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM',
|
'-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_LIBNM',
|
||||||
'-DTEST_NM_SERVICE="@0@"'.format(join_paths(meson.source_root(), 'tools', 'test-networkmanager-service.py'))
|
] + nm_build_cflags
|
||||||
]
|
|
||||||
|
|
||||||
foreach test_unit: test_units
|
foreach test_unit: test_units
|
||||||
exe = executable(
|
exe = executable(
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
|
|
||||||
#include "nm-test-libnm-utils.h"
|
#include "nm-test-libnm-utils.h"
|
||||||
|
|
||||||
|
#define NMTSTC_NM_SERVICE NM_BUILD_SRCDIR"/tools/test-networkmanager-service.py"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -116,7 +118,7 @@ nmtstc_service_available (NMTstcServiceInfo *info)
|
||||||
|
|
||||||
/* This happens, when test-networkmanager-service.py exits with 77 status
|
/* This happens, when test-networkmanager-service.py exits with 77 status
|
||||||
* code. */
|
* code. */
|
||||||
m = g_strdup_printf ("missing dependency for running NetworkManager stub service %s", TEST_NM_SERVICE);
|
m = g_strdup_printf ("missing dependency for running NetworkManager stub service %s", NMTSTC_NM_SERVICE);
|
||||||
g_test_skip (m);
|
g_test_skip (m);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -125,7 +127,7 @@ NMTstcServiceInfo *
|
||||||
nmtstc_service_init (void)
|
nmtstc_service_init (void)
|
||||||
{
|
{
|
||||||
NMTstcServiceInfo *info;
|
NMTstcServiceInfo *info;
|
||||||
const char *args[] = { TEST_NM_PYTHON, TEST_NM_SERVICE, NULL };
|
const char *args[] = { TEST_NM_PYTHON, NMTSTC_NM_SERVICE, NULL };
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
info = g_malloc0 (sizeof (*info));
|
info = g_malloc0 (sizeof (*info));
|
||||||
|
@ -170,7 +172,7 @@ nmtstc_service_init (void)
|
||||||
g_main_context_unref (context);
|
g_main_context_unref (context);
|
||||||
|
|
||||||
if (had_timeout)
|
if (had_timeout)
|
||||||
g_error ("test service %s did not start in time", TEST_NM_SERVICE);
|
g_error ("test service %s did not start in time", NMTSTC_NM_SERVICE);
|
||||||
if (!data.name_found) {
|
if (!data.name_found) {
|
||||||
g_assert (data.exited);
|
g_assert (data.exited);
|
||||||
info->pid = NM_PID_T_INVAL;
|
info->pid = NM_PID_T_INVAL;
|
||||||
|
@ -184,7 +186,7 @@ nmtstc_service_init (void)
|
||||||
* via pygobject. */
|
* via pygobject. */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
g_error ("test service %s exited with error code %d", TEST_NM_SERVICE, data.exit_code);
|
g_error ("test service %s exited with error code %d", NMTSTC_NM_SERVICE, data.exit_code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ foreach test_unit: test_units
|
||||||
test_unit,
|
test_unit,
|
||||||
test_unit + '.c',
|
test_unit + '.c',
|
||||||
dependencies: test_nm_dep,
|
dependencies: test_nm_dep,
|
||||||
c_args: '-DTESTDIR="@0@"'.format(meson.current_source_dir())
|
c_args: nm_build_cflags,
|
||||||
)
|
)
|
||||||
|
|
||||||
test(
|
test(
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
|
|
||||||
#include "nm-test-utils-core.h"
|
#include "nm-test-utils-core.h"
|
||||||
|
|
||||||
|
#define TEST_DIR NM_BUILD_SRCDIR"/src/dhcp/tests"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_config (const char *orig,
|
test_config (const char *orig,
|
||||||
const char *expected,
|
const char *expected,
|
||||||
|
@ -736,7 +738,7 @@ test_read_duid_from_leasefile (void)
|
||||||
gconstpointer duid_arr;
|
gconstpointer duid_arr;
|
||||||
gsize duid_len;
|
gsize duid_len;
|
||||||
|
|
||||||
duid = nm_dhcp_dhclient_read_duid (TESTDIR "/test-dhclient-duid.leases", &error);
|
duid = nm_dhcp_dhclient_read_duid (TEST_DIR"/test-dhclient-duid.leases", &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
g_assert (duid);
|
g_assert (duid);
|
||||||
duid_arr = g_bytes_get_data (duid, &duid_len);
|
duid_arr = g_bytes_get_data (duid, &duid_len);
|
||||||
|
@ -750,7 +752,7 @@ test_read_commented_duid_from_leasefile (void)
|
||||||
GBytes *duid;
|
GBytes *duid;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
duid = nm_dhcp_dhclient_read_duid (TESTDIR "/test-dhclient-commented-duid.leases", &error);
|
duid = nm_dhcp_dhclient_read_duid (TEST_DIR"/test-dhclient-commented-duid.leases", &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
g_assert (duid == NULL);
|
g_assert (duid == NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ exe = executable(
|
||||||
test_unit,
|
test_unit,
|
||||||
test_unit + '.c',
|
test_unit + '.c',
|
||||||
dependencies: test_nm_dep,
|
dependencies: test_nm_dep,
|
||||||
c_args: '-DTESTDIR="@0@"'.format(meson.source_root())
|
|
||||||
)
|
)
|
||||||
|
|
||||||
test(
|
test(
|
||||||
|
|
|
@ -2,16 +2,11 @@ test_unit = 'test-ibft'
|
||||||
|
|
||||||
test_ibft_dir = meson.current_source_dir()
|
test_ibft_dir = meson.current_source_dir()
|
||||||
|
|
||||||
cflags = [
|
|
||||||
'-DTEST_IBFT_DIR="@0@"'.format(test_ibft_dir),
|
|
||||||
'-DTEST_SCRATCH_DIR="@0@"'.format(test_ibft_dir)
|
|
||||||
]
|
|
||||||
|
|
||||||
exe = executable(
|
exe = executable(
|
||||||
test_unit,
|
test_unit,
|
||||||
test_unit + '.c',
|
test_unit + '.c',
|
||||||
dependencies: test_nm_dep,
|
dependencies: test_nm_dep,
|
||||||
c_args: cflags,
|
c_args: nm_build_cflags,
|
||||||
link_with: libnms_ibft_core
|
link_with: libnms_ibft_core
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
|
|
||||||
#include "nm-test-utils-core.h"
|
#include "nm-test-utils-core.h"
|
||||||
|
|
||||||
|
#define TEST_DIR NM_BUILD_SRCDIR"/src/settings/plugins/ibft/tests"
|
||||||
|
|
||||||
static GPtrArray *
|
static GPtrArray *
|
||||||
read_block (const char *iscsiadm_path, const char *expected_mac)
|
read_block (const char *iscsiadm_path, const char *expected_mac)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +80,7 @@ test_read_ibft_dhcp (void)
|
||||||
const char *expected_mac_address = "00:33:21:98:b9:f1";
|
const char *expected_mac_address = "00:33:21:98:b9:f1";
|
||||||
GPtrArray *block;
|
GPtrArray *block;
|
||||||
|
|
||||||
block = read_block (TEST_IBFT_DIR "/iscsiadm-test-dhcp", expected_mac_address);
|
block = read_block (TEST_DIR "/iscsiadm-test-dhcp", expected_mac_address);
|
||||||
|
|
||||||
connection = nms_ibft_reader_get_connection_from_block (block, &error);
|
connection = nms_ibft_reader_get_connection_from_block (block, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
|
@ -125,7 +127,7 @@ test_read_ibft_static (void)
|
||||||
NMIPAddress *ip4_addr;
|
NMIPAddress *ip4_addr;
|
||||||
GPtrArray *block;
|
GPtrArray *block;
|
||||||
|
|
||||||
block = read_block (TEST_IBFT_DIR "/iscsiadm-test-static", expected_mac_address);
|
block = read_block (TEST_DIR "/iscsiadm-test-static", expected_mac_address);
|
||||||
|
|
||||||
connection = nms_ibft_reader_get_connection_from_block (block, &error);
|
connection = nms_ibft_reader_get_connection_from_block (block, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
|
@ -227,7 +229,7 @@ test_read_ibft_vlan (void)
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GPtrArray *block;
|
GPtrArray *block;
|
||||||
|
|
||||||
block = read_block (TEST_IBFT_DIR "/iscsiadm-test-vlan", expected_mac_address);
|
block = read_block (TEST_DIR "/iscsiadm-test-vlan", expected_mac_address);
|
||||||
|
|
||||||
connection = nms_ibft_reader_get_connection_from_block (block, &error);
|
connection = nms_ibft_reader_get_connection_from_block (block, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
|
@ -280,12 +282,12 @@ int main (int argc, char **argv)
|
||||||
g_test_add_func (TPATH "ibft/dhcp", test_read_ibft_dhcp);
|
g_test_add_func (TPATH "ibft/dhcp", test_read_ibft_dhcp);
|
||||||
g_test_add_func (TPATH "ibft/static", test_read_ibft_static);
|
g_test_add_func (TPATH "ibft/static", test_read_ibft_static);
|
||||||
g_test_add_func (TPATH "ibft/vlan", test_read_ibft_vlan);
|
g_test_add_func (TPATH "ibft/vlan", test_read_ibft_vlan);
|
||||||
g_test_add_data_func (TPATH "ibft/bad-record-read", TEST_IBFT_DIR "/iscsiadm-test-bad-record", test_read_ibft_malformed);
|
g_test_add_data_func (TPATH "ibft/bad-record-read", TEST_DIR "/iscsiadm-test-bad-record", test_read_ibft_malformed);
|
||||||
g_test_add_data_func (TPATH "ibft/bad-entry-read", TEST_IBFT_DIR "/iscsiadm-test-bad-entry", test_read_ibft_malformed);
|
g_test_add_data_func (TPATH "ibft/bad-entry-read", TEST_DIR "/iscsiadm-test-bad-entry", test_read_ibft_malformed);
|
||||||
g_test_add_data_func (TPATH "ibft/bad-ipaddr-read", TEST_IBFT_DIR "/iscsiadm-test-bad-ipaddr", test_read_ibft_bad_address);
|
g_test_add_data_func (TPATH "ibft/bad-ipaddr-read", TEST_DIR "/iscsiadm-test-bad-ipaddr", test_read_ibft_bad_address);
|
||||||
g_test_add_data_func (TPATH "ibft/bad-gateway-read", TEST_IBFT_DIR "/iscsiadm-test-bad-gateway", test_read_ibft_bad_address);
|
g_test_add_data_func (TPATH "ibft/bad-gateway-read", TEST_DIR "/iscsiadm-test-bad-gateway", test_read_ibft_bad_address);
|
||||||
g_test_add_data_func (TPATH "ibft/bad-dns1-read", TEST_IBFT_DIR "/iscsiadm-test-bad-dns1", test_read_ibft_bad_address);
|
g_test_add_data_func (TPATH "ibft/bad-dns1-read", TEST_DIR "/iscsiadm-test-bad-dns1", test_read_ibft_bad_address);
|
||||||
g_test_add_data_func (TPATH "ibft/bad-dns2-read", TEST_IBFT_DIR "/iscsiadm-test-bad-dns2", test_read_ibft_bad_address);
|
g_test_add_data_func (TPATH "ibft/bad-dns2-read", TEST_DIR "/iscsiadm-test-bad-dns2", test_read_ibft_bad_address);
|
||||||
|
|
||||||
return g_test_run ();
|
return g_test_run ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,16 +2,11 @@ test_unit = 'test-ifcfg-rh'
|
||||||
|
|
||||||
test_ifcfg_dir = meson.current_source_dir()
|
test_ifcfg_dir = meson.current_source_dir()
|
||||||
|
|
||||||
cflags = [
|
|
||||||
'-DTEST_IFCFG_DIR="@0@"'.format(test_ifcfg_dir),
|
|
||||||
'-DTEST_SCRATCH_DIR="@0@"'.format(test_ifcfg_dir)
|
|
||||||
]
|
|
||||||
|
|
||||||
exe = executable(
|
exe = executable(
|
||||||
test_unit,
|
test_unit,
|
||||||
test_unit + '.c',
|
test_unit + '.c',
|
||||||
dependencies: test_nm_dep,
|
dependencies: test_nm_dep,
|
||||||
c_args: cflags,
|
c_args: nm_build_cflags,
|
||||||
link_with: libnms_ifcfg_rh_core
|
link_with: libnms_ifcfg_rh_core
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,12 +1,10 @@
|
||||||
test_unit = 'test-ifupdown'
|
test_unit = 'test-ifupdown'
|
||||||
|
|
||||||
cflags = '-DTEST_ENI_DIR="@0@"'.format(meson.current_source_dir())
|
|
||||||
|
|
||||||
exe = executable(
|
exe = executable(
|
||||||
test_unit,
|
test_unit,
|
||||||
test_unit + '.c',
|
test_unit + '.c',
|
||||||
dependencies: test_nm_dep,
|
dependencies: test_nm_dep,
|
||||||
c_args: cflags,
|
c_args: nm_build_cflags,
|
||||||
link_with: libnms_ifupdown_core
|
link_with: libnms_ifupdown_core
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,10 @@
|
||||||
|
|
||||||
#include "nm-test-utils-core.h"
|
#include "nm-test-utils-core.h"
|
||||||
|
|
||||||
|
#define TEST_DIR NM_BUILD_SRCDIR"/src/settings/plugins/ifupdown/tests"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *key;
|
char *key;
|
||||||
char *data;
|
char *data;
|
||||||
|
@ -659,45 +663,45 @@ main (int argc, char **argv)
|
||||||
if (0)
|
if (0)
|
||||||
dump_blocks ();
|
dump_blocks ();
|
||||||
|
|
||||||
g_test_add_data_func ("/ifupdate/ignore_line_before_first_block", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/ignore_line_before_first_block", TEST_DIR,
|
||||||
(GTestDataFunc) test1_ignore_line_before_first_block);
|
(GTestDataFunc) test1_ignore_line_before_first_block);
|
||||||
g_test_add_data_func ("/ifupdate/wrapped_line", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/wrapped_line", TEST_DIR,
|
||||||
(GTestDataFunc) test2_wrapped_line);
|
(GTestDataFunc) test2_wrapped_line);
|
||||||
g_test_add_data_func ("/ifupdate/wrapped_multiline_multiarg", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/wrapped_multiline_multiarg", TEST_DIR,
|
||||||
(GTestDataFunc) test3_wrapped_multiline_multiarg);
|
(GTestDataFunc) test3_wrapped_multiline_multiarg);
|
||||||
g_test_add_data_func ("/ifupdate/allow_auto_is_auto", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/allow_auto_is_auto", TEST_DIR,
|
||||||
(GTestDataFunc) test4_allow_auto_is_auto);
|
(GTestDataFunc) test4_allow_auto_is_auto);
|
||||||
g_test_add_data_func ("/ifupdate/allow_auto_multiarg", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/allow_auto_multiarg", TEST_DIR,
|
||||||
(GTestDataFunc) test5_allow_auto_multiarg);
|
(GTestDataFunc) test5_allow_auto_multiarg);
|
||||||
g_test_add_data_func ("/ifupdate/mixed_whitespace", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/mixed_whitespace", TEST_DIR,
|
||||||
(GTestDataFunc) test6_mixed_whitespace);
|
(GTestDataFunc) test6_mixed_whitespace);
|
||||||
g_test_add_data_func ("/ifupdate/long_line", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/long_line", TEST_DIR,
|
||||||
(GTestDataFunc) test7_long_line);
|
(GTestDataFunc) test7_long_line);
|
||||||
g_test_add_data_func ("/ifupdate/long_line_wrapped", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/long_line_wrapped", TEST_DIR,
|
||||||
(GTestDataFunc) test8_long_line_wrapped);
|
(GTestDataFunc) test8_long_line_wrapped);
|
||||||
g_test_add_data_func ("/ifupdate/wrapped_lines_in_block", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/wrapped_lines_in_block", TEST_DIR,
|
||||||
(GTestDataFunc) test9_wrapped_lines_in_block);
|
(GTestDataFunc) test9_wrapped_lines_in_block);
|
||||||
g_test_add_data_func ("/ifupdate/complex_wrap", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/complex_wrap", TEST_DIR,
|
||||||
(GTestDataFunc) test11_complex_wrap);
|
(GTestDataFunc) test11_complex_wrap);
|
||||||
g_test_add_data_func ("/ifupdate/complex_wrap_split_word", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/complex_wrap_split_word", TEST_DIR,
|
||||||
(GTestDataFunc) test12_complex_wrap_split_word);
|
(GTestDataFunc) test12_complex_wrap_split_word);
|
||||||
g_test_add_data_func ("/ifupdate/more_mixed_whitespace", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/more_mixed_whitespace", TEST_DIR,
|
||||||
(GTestDataFunc) test13_more_mixed_whitespace);
|
(GTestDataFunc) test13_more_mixed_whitespace);
|
||||||
g_test_add_data_func ("/ifupdate/mixed_whitespace_block_start", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/mixed_whitespace_block_start", TEST_DIR,
|
||||||
(GTestDataFunc) test14_mixed_whitespace_block_start);
|
(GTestDataFunc) test14_mixed_whitespace_block_start);
|
||||||
g_test_add_data_func ("/ifupdate/trailing_space", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/trailing_space", TEST_DIR,
|
||||||
(GTestDataFunc) test15_trailing_space);
|
(GTestDataFunc) test15_trailing_space);
|
||||||
g_test_add_data_func ("/ifupdate/missing_newline", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/missing_newline", TEST_DIR,
|
||||||
(GTestDataFunc) test16_missing_newline);
|
(GTestDataFunc) test16_missing_newline);
|
||||||
g_test_add_data_func ("/ifupdate/read_static_ipv4", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/read_static_ipv4", TEST_DIR,
|
||||||
(GTestDataFunc) test17_read_static_ipv4);
|
(GTestDataFunc) test17_read_static_ipv4);
|
||||||
g_test_add_data_func ("/ifupdate/read_static_ipv6", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/read_static_ipv6", TEST_DIR,
|
||||||
(GTestDataFunc) test18_read_static_ipv6);
|
(GTestDataFunc) test18_read_static_ipv6);
|
||||||
g_test_add_data_func ("/ifupdate/read_static_ipv4_plen", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/read_static_ipv4_plen", TEST_DIR,
|
||||||
(GTestDataFunc) test19_read_static_ipv4_plen);
|
(GTestDataFunc) test19_read_static_ipv4_plen);
|
||||||
g_test_add_data_func ("/ifupdate/source_stanza", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/source_stanza", TEST_DIR,
|
||||||
(GTestDataFunc) test20_source_stanza);
|
(GTestDataFunc) test20_source_stanza);
|
||||||
g_test_add_data_func ("/ifupdate/source_dir_stanza", TEST_ENI_DIR,
|
g_test_add_data_func ("/ifupdate/source_dir_stanza", TEST_DIR,
|
||||||
(GTestDataFunc) test21_source_dir_stanza);
|
(GTestDataFunc) test21_source_dir_stanza);
|
||||||
|
|
||||||
return g_test_run ();
|
return g_test_run ();
|
||||||
|
|
|
@ -2,16 +2,11 @@ test_unit = 'test-keyfile'
|
||||||
|
|
||||||
test_keyfiles_dir = join_paths(meson.current_source_dir(), 'keyfiles')
|
test_keyfiles_dir = join_paths(meson.current_source_dir(), 'keyfiles')
|
||||||
|
|
||||||
cflags = [
|
|
||||||
'-DTEST_KEYFILES_DIR="@0@"'.format(test_keyfiles_dir),
|
|
||||||
'-DTEST_SCRATCH_DIR="@0@"'.format(test_keyfiles_dir)
|
|
||||||
]
|
|
||||||
|
|
||||||
exe = executable(
|
exe = executable(
|
||||||
test_unit,
|
test_unit,
|
||||||
test_unit + '.c',
|
test_unit + '.c',
|
||||||
dependencies: test_nm_dep,
|
dependencies: test_nm_dep,
|
||||||
c_args: cflags
|
c_args: nm_build_cflags,
|
||||||
)
|
)
|
||||||
|
|
||||||
test(
|
test(
|
||||||
|
|
|
@ -37,6 +37,9 @@
|
||||||
|
|
||||||
#include "nm-test-utils-core.h"
|
#include "nm-test-utils-core.h"
|
||||||
|
|
||||||
|
#define TEST_KEYFILES_DIR NM_BUILD_SRCDIR"/src/settings/plugins/keyfile/tests/keyfiles"
|
||||||
|
#define TEST_SCRATCH_DIR NM_BUILD_BUILDDIR"/src/settings/plugins/keyfile/tests/keyfiles"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -4,7 +4,7 @@ exe = executable(
|
||||||
test_unit,
|
test_unit,
|
||||||
test_unit + '.c',
|
test_unit + '.c',
|
||||||
dependencies: test_nm_dep,
|
dependencies: test_nm_dep,
|
||||||
c_args: '-DTEST_CERT_DIR="@0@"'.format(join_paths(meson.current_source_dir(), 'certs'))
|
c_args: nm_build_cflags,
|
||||||
)
|
)
|
||||||
|
|
||||||
test(
|
test(
|
||||||
|
|
|
@ -37,6 +37,10 @@
|
||||||
|
|
||||||
#include "nm-test-utils-core.h"
|
#include "nm-test-utils-core.h"
|
||||||
|
|
||||||
|
#define TEST_CERT_DIR NM_BUILD_SRCDIR"/src/supplicant/tests/certs"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
validate_opt (const char *detail,
|
validate_opt (const char *detail,
|
||||||
GVariant *config,
|
GVariant *config,
|
||||||
|
|
|
@ -7,16 +7,11 @@ sources = files(
|
||||||
|
|
||||||
test_config_dir = meson.current_source_dir()
|
test_config_dir = meson.current_source_dir()
|
||||||
|
|
||||||
cflags = [
|
|
||||||
'-DSRCDIR="@0@"'.format(test_config_dir),
|
|
||||||
'-DBUILDDIR="@0@"'.format(test_config_dir)
|
|
||||||
]
|
|
||||||
|
|
||||||
exe = executable(
|
exe = executable(
|
||||||
test_unit,
|
test_unit,
|
||||||
sources,
|
sources,
|
||||||
dependencies: test_nm_dep,
|
dependencies: test_nm_dep,
|
||||||
c_args: cflags
|
c_args: nm_build_cflags,
|
||||||
)
|
)
|
||||||
|
|
||||||
test(
|
test(
|
||||||
|
|
|
@ -30,6 +30,9 @@
|
||||||
|
|
||||||
#include "nm-test-utils-core.h"
|
#include "nm-test-utils-core.h"
|
||||||
|
|
||||||
|
#define TEST_DIR NM_BUILD_SRCDIR"/src/tests/config"
|
||||||
|
#define BUILD_DIR NM_BUILD_BUILDDIR"/src/tests/config"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -133,9 +136,9 @@ test_config_simple (void)
|
||||||
gs_unref_object NMDevice *dev51 = nm_test_device_new ("00:00:00:00:00:51");
|
gs_unref_object NMDevice *dev51 = nm_test_device_new ("00:00:00:00:00:51");
|
||||||
gs_unref_object NMDevice *dev52 = nm_test_device_new ("00:00:00:00:00:52");
|
gs_unref_object NMDevice *dev52 = nm_test_device_new ("00:00:00:00:00:52");
|
||||||
|
|
||||||
config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "", NULL, "/no/such/dir", "", NULL);
|
config = setup_config (NULL, TEST_DIR "/NetworkManager.conf", "", NULL, "/no/such/dir", "", NULL);
|
||||||
|
|
||||||
g_assert_cmpstr (nm_config_data_get_config_main_file (nm_config_get_data_orig (config)), ==, SRCDIR "/NetworkManager.conf");
|
g_assert_cmpstr (nm_config_data_get_config_main_file (nm_config_get_data_orig (config)), ==, TEST_DIR "/NetworkManager.conf");
|
||||||
g_assert_cmpstr (_config_get_dhcp_client_a (config), ==, "dhclient");
|
g_assert_cmpstr (_config_get_dhcp_client_a (config), ==, "dhclient");
|
||||||
g_assert_cmpstr (nm_config_get_log_level (config), ==, "INFO");
|
g_assert_cmpstr (nm_config_get_log_level (config), ==, "INFO");
|
||||||
g_assert_cmpint (nm_config_data_get_connectivity_interval (nm_config_get_data_orig (config)), ==, 100);
|
g_assert_cmpint (nm_config_data_get_connectivity_interval (nm_config_get_data_orig (config)), ==, 100);
|
||||||
|
@ -206,7 +209,7 @@ test_config_non_existent (void)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
setup_config (&error, SRCDIR "/no-such-file", "", NULL, "/no/such/dir", "", NULL);
|
setup_config (&error, TEST_DIR "/no-such-file", "", NULL, "/no/such/dir", "", NULL);
|
||||||
g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_NOT_FOUND);
|
g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_NOT_FOUND);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
|
@ -216,7 +219,7 @@ test_config_parse_error (void)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
setup_config (&error, SRCDIR "/bad.conf", "", NULL, "/no/such/dir", "", NULL);
|
setup_config (&error, TEST_DIR "/bad.conf", "", NULL, "/no/such/dir", "", NULL);
|
||||||
g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_PARSE);
|
g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_PARSE);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
|
@ -227,12 +230,12 @@ test_config_override (void)
|
||||||
gs_unref_object NMConfig *config = NULL;
|
gs_unref_object NMConfig *config = NULL;
|
||||||
gs_strfreev char **plugins = NULL;
|
gs_strfreev char **plugins = NULL;
|
||||||
|
|
||||||
config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "", NULL, "/no/such/dir", "",
|
config = setup_config (NULL, TEST_DIR "/NetworkManager.conf", "", NULL, "/no/such/dir", "",
|
||||||
"--plugins", "alpha,beta,gamma,delta",
|
"--plugins", "alpha,beta,gamma,delta",
|
||||||
"--connectivity-interval", "12",
|
"--connectivity-interval", "12",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
g_assert_cmpstr (nm_config_data_get_config_main_file (nm_config_get_data_orig (config)), ==, SRCDIR "/NetworkManager.conf");
|
g_assert_cmpstr (nm_config_data_get_config_main_file (nm_config_get_data_orig (config)), ==, TEST_DIR "/NetworkManager.conf");
|
||||||
g_assert_cmpstr (_config_get_dhcp_client_a (config), ==, "dhclient");
|
g_assert_cmpstr (_config_get_dhcp_client_a (config), ==, "dhclient");
|
||||||
g_assert_cmpstr (nm_config_get_log_level (config), ==, "INFO");
|
g_assert_cmpstr (nm_config_get_log_level (config), ==, "INFO");
|
||||||
g_assert_cmpint (nm_config_data_get_connectivity_interval (nm_config_get_data_orig (config)), ==, 12);
|
g_assert_cmpint (nm_config_data_get_connectivity_interval (nm_config_get_data_orig (config)), ==, 12);
|
||||||
|
@ -253,7 +256,7 @@ test_config_global_dns (void)
|
||||||
NMGlobalDnsDomain *domain;
|
NMGlobalDnsDomain *domain;
|
||||||
const char *const*strv;
|
const char *const*strv;
|
||||||
|
|
||||||
config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "", NULL,
|
config = setup_config (NULL, TEST_DIR "/NetworkManager.conf", "", NULL,
|
||||||
"/no/such/dir", "", NULL);
|
"/no/such/dir", "", NULL);
|
||||||
|
|
||||||
dns = nm_config_data_get_global_dns_config (nm_config_get_data_orig (config));
|
dns = nm_config_data_get_global_dns_config (nm_config_get_data_orig (config));
|
||||||
|
@ -308,7 +311,7 @@ test_config_global_dns (void)
|
||||||
g_object_unref (config);
|
g_object_unref (config);
|
||||||
|
|
||||||
/* Check that a file without a default domain section gives a NULL configuration */
|
/* Check that a file without a default domain section gives a NULL configuration */
|
||||||
config = setup_config (NULL, SRCDIR "/global-dns-invalid.conf", "", NULL,
|
config = setup_config (NULL, TEST_DIR "/global-dns-invalid.conf", "", NULL,
|
||||||
"/no/such/dir", "", NULL);
|
"/no/such/dir", "", NULL);
|
||||||
dns = nm_config_data_get_global_dns_config (nm_config_get_data_orig (config));
|
dns = nm_config_data_get_global_dns_config (nm_config_get_data_orig (config));
|
||||||
g_assert (!dns);
|
g_assert (!dns);
|
||||||
|
@ -319,12 +322,12 @@ static void
|
||||||
test_config_connectivity_check (void)
|
test_config_connectivity_check (void)
|
||||||
{
|
{
|
||||||
#if WITH_CONCHECK
|
#if WITH_CONCHECK
|
||||||
const char *CONFIG_INTERN = BUILDDIR"/test-connectivity-check-intern.conf";
|
const char *CONFIG_INTERN = BUILD_DIR"/test-connectivity-check-intern.conf";
|
||||||
NMConfig *config;
|
NMConfig *config;
|
||||||
NMConnectivity *connectivity;
|
NMConnectivity *connectivity;
|
||||||
|
|
||||||
g_assert (g_file_set_contents (CONFIG_INTERN, "", 0, NULL));
|
g_assert (g_file_set_contents (CONFIG_INTERN, "", 0, NULL));
|
||||||
config = setup_config (NULL, SRCDIR "/NetworkManager.conf", CONFIG_INTERN, NULL,
|
config = setup_config (NULL, TEST_DIR "/NetworkManager.conf", CONFIG_INTERN, NULL,
|
||||||
"/no/such/dir", "", NULL);
|
"/no/such/dir", "", NULL);
|
||||||
connectivity = nm_connectivity_get();
|
connectivity = nm_connectivity_get();
|
||||||
|
|
||||||
|
@ -371,7 +374,7 @@ test_config_no_auto_default (void)
|
||||||
g_assert_cmpint (nwrote, ==, 18);
|
g_assert_cmpint (nwrote, ==, 18);
|
||||||
nm_close (fd);
|
nm_close (fd);
|
||||||
|
|
||||||
config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "", NULL, "/no/such/dir", "",
|
config = setup_config (NULL, TEST_DIR "/NetworkManager.conf", "", NULL, "/no/such/dir", "",
|
||||||
"--no-auto-default", state_file,
|
"--no-auto-default", state_file,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -393,7 +396,7 @@ test_config_no_auto_default (void)
|
||||||
|
|
||||||
g_object_unref (config);
|
g_object_unref (config);
|
||||||
|
|
||||||
config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "", NULL, "/no/such/dir", "",
|
config = setup_config (NULL, TEST_DIR "/NetworkManager.conf", "", NULL, "/no/such/dir", "",
|
||||||
"--no-auto-default", state_file,
|
"--no-auto-default", state_file,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -421,9 +424,9 @@ test_config_confdir (void)
|
||||||
char *value;
|
char *value;
|
||||||
GSList *specs;
|
GSList *specs;
|
||||||
|
|
||||||
config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "", NULL, SRCDIR "/conf.d", "", NULL);
|
config = setup_config (NULL, TEST_DIR "/NetworkManager.conf", "", NULL, TEST_DIR "/conf.d", "", NULL);
|
||||||
|
|
||||||
g_assert_cmpstr (nm_config_data_get_config_main_file (nm_config_get_data_orig (config)), ==, SRCDIR "/NetworkManager.conf");
|
g_assert_cmpstr (nm_config_data_get_config_main_file (nm_config_get_data_orig (config)), ==, TEST_DIR "/NetworkManager.conf");
|
||||||
g_assert_cmpstr (_config_get_dhcp_client_a (config), ==, "dhcpcd");
|
g_assert_cmpstr (_config_get_dhcp_client_a (config), ==, "dhcpcd");
|
||||||
g_assert_cmpstr (nm_config_get_log_level (config), ==, "INFO");
|
g_assert_cmpstr (nm_config_get_log_level (config), ==, "INFO");
|
||||||
g_assert_cmpstr (nm_config_get_log_domains (config), ==, "PLATFORM,DNS,WIFI");
|
g_assert_cmpstr (nm_config_get_log_domains (config), ==, "PLATFORM,DNS,WIFI");
|
||||||
|
@ -524,8 +527,8 @@ test_config_confdir_parse_error (void)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
/* Using SRCDIR as the conf dir will pick up bad.conf */
|
/* Using TEST_DIR as the conf dir will pick up bad.conf */
|
||||||
setup_config (&error, SRCDIR "/NetworkManager.conf", "", NULL, SRCDIR, "", NULL);
|
setup_config (&error, TEST_DIR "/NetworkManager.conf", "", NULL, TEST_DIR, "", NULL);
|
||||||
g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_PARSE);
|
g_assert_error (error, G_KEY_FILE_ERROR, G_KEY_FILE_ERROR_PARSE);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
|
@ -808,8 +811,8 @@ static void
|
||||||
test_config_set_values (void)
|
test_config_set_values (void)
|
||||||
{
|
{
|
||||||
gs_unref_object NMConfig *config = NULL;
|
gs_unref_object NMConfig *config = NULL;
|
||||||
const char *CONFIG_USER = BUILDDIR"/test-set-values-user.conf";
|
const char *CONFIG_USER = BUILD_DIR"/test-set-values-user.conf";
|
||||||
const char *CONFIG_INTERN = BUILDDIR"/test-set-values-intern.conf";
|
const char *CONFIG_INTERN = BUILD_DIR"/test-set-values-intern.conf";
|
||||||
const char *atomic_section_prefixes[] = {
|
const char *atomic_section_prefixes[] = {
|
||||||
"atomic-prefix-1.",
|
"atomic-prefix-1.",
|
||||||
"atomic-prefix-2.",
|
"atomic-prefix-2.",
|
||||||
|
@ -893,7 +896,7 @@ test_config_signal (void)
|
||||||
NMConfigChangeFlags expected;
|
NMConfigChangeFlags expected;
|
||||||
gs_unref_object NMConfigData *config_data_orig = NULL;
|
gs_unref_object NMConfigData *config_data_orig = NULL;
|
||||||
|
|
||||||
config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "", NULL, SRCDIR "/conf.d", "", NULL);
|
config = setup_config (NULL, TEST_DIR "/NetworkManager.conf", "", NULL, TEST_DIR "/conf.d", "", NULL);
|
||||||
|
|
||||||
config_data_orig = g_object_ref (nm_config_get_data_orig (config));
|
config_data_orig = g_object_ref (nm_config_get_data_orig (config));
|
||||||
|
|
||||||
|
@ -945,19 +948,19 @@ test_config_enable (void)
|
||||||
_nm_config_match_env = g_strdup ("something-else");
|
_nm_config_match_env = g_strdup ("something-else");
|
||||||
|
|
||||||
_nm_config_match_nm_version = nm_encode_version (1, 3, 4);
|
_nm_config_match_nm_version = nm_encode_version (1, 3, 4);
|
||||||
config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "", NULL, SRCDIR "/conf.d", "", NULL);
|
config = setup_config (NULL, TEST_DIR "/NetworkManager.conf", "", NULL, TEST_DIR "/conf.d", "", NULL);
|
||||||
assert_config_value (nm_config_get_data_orig (config), "test-group-config-enable-1", "key1", NULL);
|
assert_config_value (nm_config_get_data_orig (config), "test-group-config-enable-1", "key1", NULL);
|
||||||
g_clear_object (&config);
|
g_clear_object (&config);
|
||||||
|
|
||||||
_nm_config_match_nm_version = nm_encode_version (1, 5, 32);
|
_nm_config_match_nm_version = nm_encode_version (1, 5, 32);
|
||||||
config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "", NULL, SRCDIR "/conf.d", "", NULL);
|
config = setup_config (NULL, TEST_DIR "/NetworkManager.conf", "", NULL, TEST_DIR "/conf.d", "", NULL);
|
||||||
assert_config_value (nm_config_get_data_orig (config), "test-group-config-enable-1", "key1", "enabled");
|
assert_config_value (nm_config_get_data_orig (config), "test-group-config-enable-1", "key1", "enabled");
|
||||||
g_clear_object (&config);
|
g_clear_object (&config);
|
||||||
|
|
||||||
_nm_config_match_nm_version = nm_encode_version (1, 5, 3);
|
_nm_config_match_nm_version = nm_encode_version (1, 5, 3);
|
||||||
g_clear_pointer (&_nm_config_match_env, g_free);
|
g_clear_pointer (&_nm_config_match_env, g_free);
|
||||||
_nm_config_match_env = g_strdup ("test-match-env-1");
|
_nm_config_match_env = g_strdup ("test-match-env-1");
|
||||||
config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "", NULL, SRCDIR "/conf.d", "", NULL);
|
config = setup_config (NULL, TEST_DIR "/NetworkManager.conf", "", NULL, TEST_DIR "/conf.d", "", NULL);
|
||||||
assert_config_value (nm_config_get_data_orig (config), "test-group-config-enable-1", "key1", "enabled");
|
assert_config_value (nm_config_get_data_orig (config), "test-group-config-enable-1", "key1", "enabled");
|
||||||
g_clear_object (&config);
|
g_clear_object (&config);
|
||||||
|
|
||||||
|
@ -977,14 +980,14 @@ test_config_state_file (void)
|
||||||
gboolean ret;
|
gboolean ret;
|
||||||
gs_free char *file_data = NULL;
|
gs_free char *file_data = NULL;
|
||||||
gsize file_size;
|
gsize file_size;
|
||||||
const char *const TMP_FILE = BUILDDIR "/tmp.state";
|
const char *const TMP_FILE = BUILD_DIR "/tmp.state";
|
||||||
|
|
||||||
ret = g_file_get_contents (SRCDIR "/NetworkManager.state", &file_data, &file_size, &error);
|
ret = g_file_get_contents (TEST_DIR "/NetworkManager.state", &file_data, &file_size, &error);
|
||||||
nmtst_assert_success (ret, error);
|
nmtst_assert_success (ret, error);
|
||||||
ret = g_file_set_contents (TMP_FILE, file_data, file_size, &error);
|
ret = g_file_set_contents (TMP_FILE, file_data, file_size, &error);
|
||||||
nmtst_assert_success (ret, error);
|
nmtst_assert_success (ret, error);
|
||||||
|
|
||||||
config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "", NULL, SRCDIR "/conf.d", "",
|
config = setup_config (NULL, TEST_DIR "/NetworkManager.conf", "", NULL, TEST_DIR "/conf.d", "",
|
||||||
"--state-file", TMP_FILE, NULL);
|
"--state-file", TMP_FILE, NULL);
|
||||||
g_assert (config);
|
g_assert (config);
|
||||||
|
|
||||||
|
@ -1010,7 +1013,7 @@ test_config_state_file (void)
|
||||||
g_object_unref (config);
|
g_object_unref (config);
|
||||||
|
|
||||||
/* Reload configuration */
|
/* Reload configuration */
|
||||||
config = setup_config (NULL, SRCDIR "/NetworkManager.conf", "", NULL, SRCDIR "/conf.d", "",
|
config = setup_config (NULL, TEST_DIR "/NetworkManager.conf", "", NULL, TEST_DIR "/conf.d", "",
|
||||||
"--state-file", TMP_FILE, NULL);
|
"--state-file", TMP_FILE, NULL);
|
||||||
g_assert (config);
|
g_assert (config);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue