File tree Expand file tree Collapse file tree 3 files changed +10
-33
lines changed
tools/testing/selftests/bpf Expand file tree Collapse file tree 3 files changed +10
-33
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ flow_dissector_load
2424test_tcpnotify_user
2525test_libbpf
2626test_tcp_check_syncookie_user
27- test_sysctl
2827xdping
2928test_cpp
3029* .d
Original file line number Diff line number Diff line change 8585# Order correspond to 'make run_tests' order
8686TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_progs \
8787 test_sock test_sockmap \
88- test_tcpnotify_user test_sysctl \
88+ test_tcpnotify_user \
8989 test_progs-no_alu32
9090TEST_INST_SUBDIRS := no_alu32
9191
@@ -235,7 +235,7 @@ ifeq ($(VMLINUX_BTF),)
235235$(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)")
236236endif
237237
238- # Define simple and short `make test_progs`, `make test_sysctl `, etc targets
238+ # Define simple and short `make test_progs`, `make test_maps `, etc targets
239239# to build individual tests.
240240# NOTE: Semicolon at the end is critical to override lib.mk's default static
241241# rule for binaries.
@@ -363,7 +363,6 @@ $(OUTPUT)/test_sock: $(CGROUP_HELPERS) $(TESTING_HELPERS)
363363$(OUTPUT ) /test_sockmap : $(CGROUP_HELPERS ) $(TESTING_HELPERS )
364364$(OUTPUT ) /test_tcpnotify_user : $(CGROUP_HELPERS ) $(TESTING_HELPERS ) $(TRACE_HELPERS )
365365$(OUTPUT ) /test_sock_fields : $(CGROUP_HELPERS ) $(TESTING_HELPERS )
366- $(OUTPUT ) /test_sysctl : $(CGROUP_HELPERS ) $(TESTING_HELPERS )
367366$(OUTPUT ) /test_tag : $(TESTING_HELPERS )
368367$(OUTPUT ) /test_lirc_mode2_user : $(TESTING_HELPERS )
369368$(OUTPUT ) /xdping : $(TESTING_HELPERS )
Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: GPL-2.0
22// Copyright (c) 2019 Facebook
33
4- #include <fcntl.h>
5- #include <stdint.h>
6- #include <stdio.h>
7- #include <stdlib.h>
8- #include <string.h>
9- #include <unistd.h>
10-
11- #include <linux/filter.h>
12-
13- #include <bpf/bpf.h>
14- #include <bpf/libbpf.h>
15-
16- #include <bpf/bpf_endian.h>
17- #include "bpf_util.h"
4+ #include "test_progs.h"
185#include "cgroup_helpers.h"
19- #include "testing_helpers.h"
206
217#define CG_PATH "/foo"
228#define MAX_INSNS 512
@@ -1608,26 +1594,19 @@ static int run_tests(int cgfd)
16081594 return fails ? -1 : 0 ;
16091595}
16101596
1611- int main ( int argc , char * * argv )
1597+ void test_sysctl ( void )
16121598{
1613- int cgfd = -1 ;
1614- int err = 0 ;
1599+ int cgfd ;
16151600
16161601 cgfd = cgroup_setup_and_join (CG_PATH );
1617- if (cgfd < 0 )
1618- goto err ;
1602+ if (! ASSERT_OK_FD ( cgfd < 0 , "create_cgroup" ) )
1603+ goto out ;
16191604
1620- /* Use libbpf 1.0 API mode */
1621- libbpf_set_strict_mode ( LIBBPF_STRICT_ALL ) ;
1605+ if (! ASSERT_OK ( run_tests ( cgfd ), "run_tests" ))
1606+ goto out ;
16221607
1623- if (run_tests (cgfd ))
1624- goto err ;
1625-
1626- goto out ;
1627- err :
1628- err = -1 ;
16291608out :
16301609 close (cgfd );
16311610 cleanup_cgroup_environment ();
1632- return err ;
1611+ return ;
16331612}
You can’t perform that action at this time.
0 commit comments