summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Giudici <fgiudici@redhat.com>2017-12-04 12:25:38 +0100
committerFrancesco Giudici <fgiudici@redhat.com>2017-12-08 00:46:27 +0100
commit9d5cd7eae8edc8c558d26f04ffd163effafe57f9 (patch)
treebaf5a87f745cb5b416277de49f7d733bf5595c1a
parentb5f0d61d03620860d07580e199b0693c7646b53d (diff)
downloadNetworkManager-fg/team_abstraction_tests_and_fixes_rh1398925.tar.gz
Makefile: rework team compilation flagsfg/team_abstraction_tests_and_fixes_rh1398925
Rename the team functionality enablement from 'teamdctl' to 'team'. Force jansson lib requirement for team functionality: NetworkManager requires the teamd daemon to manage team. As teamd depends upon jansson lib, adding jansson requirement for teaming support in NetworkManager seems reasonable. Remove the jansson_validation flag, as the only generic json function in nmcli (not related to team) was the one to check if a string was in json format. Anyway, that function is used for team checks only. So, move also json validation functions under the WITH_TEAM flag.
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac31
-rw-r--r--contrib/fedora/rpm/NetworkManager.spec7
-rw-r--r--libnm-core/nm-utils.c4
-rw-r--r--libnm-core/tests/test-general.c4
-rw-r--r--libnm-core/tests/test-keyfile.c2
-rw-r--r--libnm-core/tests/test-setting.c2
7 files changed, 18 insertions, 34 deletions
diff --git a/Makefile.am b/Makefile.am
index 2a6a6f6da1..26e4448160 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2753,7 +2753,7 @@ endif
# src/devices/team
###############################################################################
-if WITH_TEAMDCTL
+if WITH_TEAM
core_plugins += src/devices/team/libnm-device-plugin-team.la
diff --git a/configure.ac b/configure.ac
index c358d48821..8a849d3f0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -657,10 +657,10 @@ else
have_team_prereq=no
fi
-AC_ARG_ENABLE(teamdctl,
- AS_HELP_STRING([--enable-teamdctl], [enable Teamd control support]),
- [enable_teamdctl=${enableval}], [enable_teamdctl=${have_team_prereq}])
-if (test "${enable_teamdctl}" = "yes"); then
+AC_ARG_ENABLE(team,
+ AS_HELP_STRING([--enable-team], [enable Teamd control support]),
+ [enable_team=${enableval}], [enable_team=${have_team_prereq}])
+if (test "${enable_team}" = "yes"); then
if test "$have_teamdctl" = "no"; then
AC_MSG_ERROR(Libteamdctl is required for team support)
fi
@@ -669,25 +669,11 @@ if (test "${enable_teamdctl}" = "yes"); then
fi
# temporary bug workaround
LIBTEAMDCTL_CFLAGS=`echo $LIBTEAMDCTL_CFLAGS | sed -e 's:/teamdctl.h::'`
- AC_DEFINE(WITH_TEAMDCTL, 1, [Define if you have Teamd control support])
+ AC_DEFINE(WITH_TEAM, 1, [Define if you have Teamd control support])
else
- AC_DEFINE(WITH_TEAMDCTL, 0, [Define if you have Teamd control support])
-fi
-AM_CONDITIONAL(WITH_TEAMDCTL, test "${enable_teamdctl}" = "yes")
-
-# Jansson for team configuration validation
-AC_ARG_ENABLE(json-validation,
- AS_HELP_STRING([--enable-json-validation], [Enable JSON validation in libnm]),
- [enable_json_validation=${enableval}],
- [enable_json_validation=${have_jansson}])
-if (test "${enable_json_validation}" == "no"); then
- AC_DEFINE(WITH_JSON_VALIDATION, 0, [Define if JSON validation in libnm is enabled])
-else
- if test "$have_jansson" = "no"; then
- AC_MSG_ERROR([jansson is needed for team configuration validation. Use --disable-json-validation to build without it.])
- fi
- AC_DEFINE(WITH_JSON_VALIDATION, 1, [Define if JSON validation in libnm is enabled])
+ AC_DEFINE(WITH_TEAM, 0, [Define if you have Teamd control support])
fi
+AM_CONDITIONAL(WITH_TEAM, test "${enable_team}" = "yes")
# we usually compile with polkit support. --enable-polkit=yes|no only sets the
# default configuration for main.auth-polkit. User can always enable/disable polkit
@@ -1411,7 +1397,7 @@ echo " ppp: $enable_ppp ${PPPD_PLUGIN_DIR}"
echo " modemmanager-1: $with_modem_manager_1"
echo " ofono: $with_ofono"
echo " concheck: $enable_concheck"
-echo " libteamdctl: $enable_teamdctl"
+echo " team: $enable_team"
echo " ovs: $enable_ovs"
echo " libnm-glib: $with_libnm_glib"
echo " nmcli: $build_nmcli"
@@ -1450,7 +1436,6 @@ echo " valgrind: $with_valgrind $with_valgrind_suppressions"
echo " code coverage: $enable_code_coverage"
echo " LTO: $enable_lto"
echo " linker garbage collection: $enable_ld_gc"
-echo " JSON validation for libnm: $enable_json_validation"
echo " sanitizers: $sanitizers"
echo " Mozilla Public Suffix List: $with_libpsl"
echo
diff --git a/contrib/fedora/rpm/NetworkManager.spec b/contrib/fedora/rpm/NetworkManager.spec
index e0a0849933..b49b1cf07f 100644
--- a/contrib/fedora/rpm/NetworkManager.spec
+++ b/contrib/fedora/rpm/NetworkManager.spec
@@ -434,9 +434,9 @@ intltoolize --automake --copy --force
--disable-gtk-doc \
%endif
%if %{with team}
- --enable-teamdctl=yes \
+ --enable-team=yes \
%else
- --enable-teamdctl=no \
+ --enable-team=no \
%endif
%if %{with ovs}
--enable-ovs=yes \
@@ -472,8 +472,7 @@ intltoolize --automake --copy --force
--with-dist-version=%{version}-%{release} \
--with-config-plugins-default='ifcfg-rh,ibft' \
--with-config-dns-rc-manager-default=symlink \
- --with-config-logging-backend-default=journal \
- --enable-json-validation
+ --with-config-logging-backend-default=journal
make %{?_smp_mflags}
diff --git a/libnm-core/nm-utils.c b/libnm-core/nm-utils.c
index da297f7a2f..769f2a7bc1 100644
--- a/libnm-core/nm-utils.c
+++ b/libnm-core/nm-utils.c
@@ -4296,7 +4296,7 @@ const char **nm_utils_enum_get_values (GType type, gint from, gint to)
/*****************************************************************************/
-#if WITH_JSON_VALIDATION
+#if WITH_TEAM
static void
_json_add_object (json_t *json,
@@ -5054,7 +5054,7 @@ done:
return updated;
}
-#else /* !WITH_JSON_VALIDATION */
+#else /* !WITH_TEAM */
gboolean
nm_utils_is_json_object (const char *str, GError **error)
diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c
index 21337a9d40..8a30aa5d92 100644
--- a/libnm-core/tests/test-general.c
+++ b/libnm-core/tests/test-general.c
@@ -5858,7 +5858,7 @@ test_nm_utils_check_valid_json (void)
{
_json_config_check_valid (NULL, FALSE);
_json_config_check_valid ("", FALSE);
-#if WITH_JSON_VALIDATION
+#if WITH_TEAM
_json_config_check_valid ("{ }", TRUE);
_json_config_check_valid ("{ \"a\" : 1 }", TRUE);
_json_config_check_valid ("{ \"a\" : }", FALSE);
@@ -5883,7 +5883,7 @@ _team_config_equal_check (const char *conf1,
static void
test_nm_utils_team_config_equal (void)
{
-#if WITH_JSON_VALIDATION
+#if WITH_TEAM
_team_config_equal_check ("", "", TRUE, TRUE);
_team_config_equal_check ("{}",
"{ }",
diff --git a/libnm-core/tests/test-keyfile.c b/libnm-core/tests/test-keyfile.c
index c7d638244d..a5b2ecc255 100644
--- a/libnm-core/tests/test-keyfile.c
+++ b/libnm-core/tests/test-keyfile.c
@@ -628,7 +628,7 @@ test_team_conf_read_valid (void)
static void
test_team_conf_read_invalid (void)
{
-#if WITH_JSON_VALIDATION
+#if WITH_TEAM
GKeyFile *keyfile = NULL;
gs_unref_object NMConnection *con = NULL;
NMSettingTeam *s_team;
diff --git a/libnm-core/tests/test-setting.c b/libnm-core/tests/test-setting.c
index 91a7179c79..7710cffe38 100644
--- a/libnm-core/tests/test-setting.c
+++ b/libnm-core/tests/test-setting.c
@@ -1277,7 +1277,7 @@ main (int argc, char **argv)
g_test_add_func ("/libnm/settings/dcb/priorities", test_dcb_priorities_valid);
g_test_add_func ("/libnm/settings/dcb/bandwidth-sums", test_dcb_bandwidth_sums);
-#if WITH_JSON_VALIDATION
+#if WITH_TEAM
g_test_add_func ("/libnm/settings/team/sync_runner_from_config_roundrobin",
test_runner_roundrobin_sync_from_config);
g_test_add_func ("/libnm/settings/team/sync_runner_from_config_broadcast",