Commit e52a8b96 authored by Andrii Nakryiko's avatar Andrii Nakryiko
Browse files

Merge branch 'selftests/bpf: Add parallelism to test_progs'



Yucong Sun says:

====================

This patch series adds "-j" parelell execution to test_progs, with "--debug" to
display server/worker communications. Also, some Tests that often fails in
parallel are marked as serial test, and it will run in sequence after parallel
execution is done.

This patch series also adds a error summary after all tests execution finished.

V6 -> V5:
  * adding error summary logic for non parallel mode too.
  * changed how serial tests are implemented, use main process instead of worker 0.
  * fixed a dozen broken test when running in parallel.

V5 -> V4:
  * change to SOCK_SEQPACKET for close notification.
  * move all debug output to "--debug" mode
  * output log as test finish, and all error logs again after summary line.
  * variable naming / style changes
  * adds serial_test_name() to replace serial test lists.
====================

Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
parents a1852ce0 d3f7b166
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <ftw.h>
#include <unistd.h>

#include "cgroup_helpers.h"

@@ -33,10 +34,9 @@
#define CGROUP_MOUNT_DFLT		"/sys/fs/cgroup"
#define NETCLS_MOUNT_PATH		CGROUP_MOUNT_DFLT "/net_cls"
#define CGROUP_WORK_DIR			"/cgroup-test-work-dir"

#define format_cgroup_path(buf, path) \
	snprintf(buf, sizeof(buf), "%s%s%s", CGROUP_MOUNT_PATH, \
		 CGROUP_WORK_DIR, path)
	snprintf(buf, sizeof(buf), "%s%s%d%s", CGROUP_MOUNT_PATH, \
	CGROUP_WORK_DIR, getpid(), path)

#define format_classid_path(buf)				\
	snprintf(buf, sizeof(buf), "%s%s", NETCLS_MOUNT_PATH,	\
+1 −0
Original line number Diff line number Diff line
@@ -225,6 +225,7 @@ void test_atomics(void)
		test__skip();
		goto cleanup;
	}
	skel->bss->pid = getpid();

	if (test__start_subtest("add"))
		test_add(skel);
+1 −1
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ static void do_bpf_iter_setsockopt(struct bpf_iter_setsockopt *iter_skel,
	free_fds(est_fds, nr_est);
}

void test_bpf_iter_setsockopt(void)
void serial_test_bpf_iter_setsockopt(void)
{
	struct bpf_iter_setsockopt *iter_skel = NULL;
	struct bpf_cubic *cubic_skel = NULL;
+1 −1
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@

#define nr_iters 2

void test_bpf_obj_id(void)
void serial_test_bpf_obj_id(void)
{
	const __u64 array_magic_value = 0xfaceb00c;
	const __u32 array_key = 0;
+1 −1
Original line number Diff line number Diff line
@@ -363,7 +363,7 @@ static void test_shared(int parent_cgroup_fd, int child_cgroup_fd)
	cg_storage_multi_shared__destroy(obj);
}

void test_cg_storage_multi(void)
void serial_test_cg_storage_multi(void)
{
	int parent_cgroup_fd = -1, child_cgroup_fd = -1;

Loading