summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-12-23 10:48:39 +0100
committerThomas Haller <thaller@redhat.com>2020-12-23 10:48:57 +0100
commitd459be2dfac75cb5ea975dca204cc2228a2c6e78 (patch)
tree28e4f61a5c877d244a8d6d4f63f0fa19f2a8ed7c
parentca8162cb41ee4591f8f36e9b12bb3e60997787a7 (diff)
parent826f2083192fce3d0d3d21317a8c9fc63b8c323e (diff)
downloadNetworkManager-d459be2dfac75cb5ea975dca204cc2228a2c6e78.tar.gz
merge branch 'th/gitlab-ci-alpine' (part 4)
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/704
-rw-r--r--.gitlab-ci.yml2
-rwxr-xr-xcontrib/alpine/REQUIRED_PACKAGES3
-rwxr-xr-xcontrib/scripts/nm-ci-run.sh6
-rw-r--r--shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h12
-rw-r--r--src/devices/nm-device.c5
-rw-r--r--src/devices/tests/test-lldp.c1
-rw-r--r--src/platform/nm-linux-platform.c4
-rw-r--r--src/systemd/src/libsystemd-network/sd-dhcp6-client.c4
-rw-r--r--src/tests/test-core-with-expect.c4
-rw-r--r--src/tests/test-core.c18
10 files changed, 48 insertions, 11 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3a35f64199..f738c6f889 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -48,7 +48,7 @@ variables:
UBUNTU_TAG: '2020-11-17.0-45915bd6e380'
DEBIAN_TAG: '2020-11-17.0-45915bd6e380'
CENTOS_TAG: '2020-11-17.0-cbb87607d569'
- ALPINE_TAG: '2020-11-17.0-8309a34970a3'
+ ALPINE_TAG: '2020-11-17.0-eafb903b544b'
FEDORA_EXEC: 'bash .gitlab-ci/fedora-install.sh'
UBUNTU_EXEC: 'bash .gitlab-ci/debian-install.sh'
diff --git a/contrib/alpine/REQUIRED_PACKAGES b/contrib/alpine/REQUIRED_PACKAGES
index 6c9ad8deba..9e2fd779fd 100755
--- a/contrib/alpine/REQUIRED_PACKAGES
+++ b/contrib/alpine/REQUIRED_PACKAGES
@@ -21,6 +21,7 @@ apk add \
'gobject-introspection-dev' \
'gtk-doc' \
'intltool' \
+ 'iproute2' \
'iptables' \
'jansson-dev' \
'libgudev-dev' \
@@ -41,9 +42,11 @@ apk add \
'polkit-dev' \
'ppp' \
'ppp-dev' \
+ 'py3-dbus' \
'py3-gobject3' \
'python3' \
'readline-dev' \
'util-linux-dev' \
'vala' \
+ 'valgrind' \
'vim'
diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh
index 0a87beaa5f..03eb955148 100755
--- a/contrib/scripts/nm-ci-run.sh
+++ b/contrib/scripts/nm-ci-run.sh
@@ -101,6 +101,12 @@ _with_valgrind() {
test "$_WITH_VALGRIND_CHECKED" == "1" && return 0
_WITH_VALGRIND_CHECKED=1
+ if [ "$IS_ALPINE" = 1 ]; then
+ # on Alpine we have no debug symbols and the suppressions
+ # don't work. Skip valgrind tests.
+ WITH_VALGRIND=0
+ fi
+
# Certain glib2 versions are known to report *lots* of leaks. Disable
# valgrind tests in this case.
# https://bugzilla.redhat.com/show_bug.cgi?id=1710417
diff --git a/shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h b/shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h
index 919f8264a1..e829532566 100644
--- a/shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h
+++ b/shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h
@@ -127,6 +127,7 @@ _nm_log_get_max_level_realm(void)
#include <sys/syscall.h>
#include <sys/ioctl.h>
+ #include <pthread.h>
#define ENABLE_GSHADOW FALSE
@@ -202,6 +203,17 @@ typedef __compar_fn_t comparison_fn_t;
typedef int (*__compar_d_fn_t)(const void *, const void *, void *);
#endif
+ #ifndef __GLIBC__
+static inline int
+__register_atfork(void (*prepare)(void),
+ void (*parent)(void),
+ void (*child)(void),
+ void *dso_handle)
+{
+ return pthread_atfork(prepare, parent, child);
+}
+ #endif
+
#endif /* (NETWORKMANAGER_COMPILATION) & NM_NETWORKMANAGER_COMPILATION_WITH_SYSTEMD */
/*****************************************************************************/
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 2341ffe527..cd2101a521 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -8,7 +8,6 @@
#include "nm-device.h"
-#include <netinet/in.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <signal.h>
@@ -16,8 +15,10 @@
#include <sys/wait.h>
#include <arpa/inet.h>
#include <fcntl.h>
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#include <linux/if.h>
#include <linux/if_addr.h>
-#include <linux/if_arp.h>
#include <linux/rtnetlink.h>
#include <linux/if_ether.h>
#include <linux/if_infiniband.h>
diff --git a/src/devices/tests/test-lldp.c b/src/devices/tests/test-lldp.c
index 5c912b7d2e..6da4a7697f 100644
--- a/src/devices/tests/test-lldp.c
+++ b/src/devices/tests/test-lldp.c
@@ -6,6 +6,7 @@
#include "nm-default.h"
#include <fcntl.h>
+#include <netinet/if_ether.h>
#include <linux/if_tun.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index 28e6df1c6b..505cf82cb6 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -12,9 +12,10 @@
#include <endian.h>
#include <fcntl.h>
#include <libudev.h>
+#include <net/ethernet.h>
#include <linux/fib_rules.h>
#include <linux/ip.h>
-#include <linux/if_arp.h>
+#include <linux/if.h>
#include <linux/if_bridge.h>
#include <linux/if_link.h>
#include <linux/if_tun.h>
@@ -24,6 +25,7 @@
#include <linux/tc_act/tc_mirred.h>
#include <netinet/icmp6.h>
#include <netinet/in.h>
+#include <net/if_arp.h>
#include <poll.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
diff --git a/src/systemd/src/libsystemd-network/sd-dhcp6-client.c b/src/systemd/src/libsystemd-network/sd-dhcp6-client.c
index ec7f1be2e0..42cde93b08 100644
--- a/src/systemd/src/libsystemd-network/sd-dhcp6-client.c
+++ b/src/systemd/src/libsystemd-network/sd-dhcp6-client.c
@@ -7,7 +7,11 @@
#include <errno.h>
#include <sys/ioctl.h>
+#if 0 /* NM_IGNORED */
#include <linux/if_arp.h>
+#else /* NM_IGNORED */
+#include <net/if_arp.h>
+#endif /* NM_IGNORED */
#include <linux/if_infiniband.h>
#include "sd-dhcp6-client.h"
diff --git a/src/tests/test-core-with-expect.c b/src/tests/test-core-with-expect.c
index 547c659480..35d6bf95bf 100644
--- a/src/tests/test-core-with-expect.c
+++ b/src/tests/test-core-with-expect.c
@@ -334,7 +334,7 @@ do_test_nm_utils_kill_child(void)
* is a race here. */
NMTST_EXPECT_NM_ERROR(
"kill child process 'test-s-3-2' (*): failed due to unexpected return value -1 by waitpid "
- "(No child processes, 10) after sending no signal (0)");
+ "(No child process*, 10) after sending no signal (0)");
test_nm_utils_kill_child_sync_do("test-s-3-2", pid3s, 0, 0, FALSE, NULL);
NMTST_EXPECT_NM_DEBUG("kill child process 'test-s-4' (*): waiting up to 1 milliseconds for "
@@ -397,7 +397,7 @@ do_test_nm_utils_kill_child(void)
* is a race here. */
NMTST_EXPECT_NM_ERROR(
"kill child process 'test-a-3-2' (*): failed due to unexpected return value -1 by waitpid "
- "(No child processes, 10) after sending no signal (0)");
+ "(No child process*, 10) after sending no signal (0)");
NMTST_EXPECT_NM_DEBUG(
"kill child process 'test-a-3-2' (*): invoke callback: killing child failed");
test_nm_utils_kill_child_async_do("test-a-3-2", pid3a, 0, 0, FALSE, NULL);
diff --git a/src/tests/test-core.c b/src/tests/test-core.c
index 39c5ad46d2..b2b6612c3c 100644
--- a/src/tests/test-core.c
+++ b/src/tests/test-core.c
@@ -980,10 +980,11 @@ test_connection_match_ip6_routes(void)
g_assert(matched == copy);
}
-#define do_test_wildcard_match(str, result, ...) \
- g_assert( \
- nm_wildcard_match_check(str, (const char *const[]){__VA_ARGS__}, NM_NARG(__VA_ARGS__)) \
- == result);
+#define do_test_wildcard_match_eval(str, ...) \
+ nm_wildcard_match_check(str, (const char *const[]){__VA_ARGS__}, NM_NARG(__VA_ARGS__))
+
+#define do_test_wildcard_match(str, result, ...) \
+ g_assert(do_test_wildcard_match_eval(str, __VA_ARGS__) == result)
static void
test_wildcard_match(void)
@@ -1056,7 +1057,14 @@ test_wildcard_match(void)
do_test_wildcard_match("name3", TRUE, "name[123]");
do_test_wildcard_match("name4", FALSE, "name[123]");
- do_test_wildcard_match("[a]", TRUE, "\\[a\\]");
+ if (do_test_wildcard_match_eval("[a]", "\\[a\\]") != TRUE) {
+#if defined(__GLIBC__)
+ do_test_wildcard_match("[a]", TRUE, "\\[a\\]");
+ g_assert_not_reached();
+#endif
+ /* It seems musl's fnmatch() does not like such ranges. */
+ g_test_skip("libc does not support ranges with fnmatch()!!");
+ }
do_test_wildcard_match("aa", FALSE, "!a*");
do_test_wildcard_match("aa", FALSE, "&!a*");