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 @@ -21,7 +21,6 @@ test_lirc_mode2_user
21
21
flow_dissector_load
22
22
test_tcpnotify_user
23
23
test_libbpf
24
- test_sysctl
25
24
xdping
26
25
test_cpp
27
26
* .d
Original file line number Diff line number Diff line change 73
73
# Order correspond to 'make run_tests' order
74
74
TEST_GEN_PROGS = test_verifier test_tag test_maps test_lru_map test_progs \
75
75
test_sockmap \
76
- test_tcpnotify_user test_sysctl \
76
+ test_tcpnotify_user \
77
77
test_progs-no_alu32
78
78
TEST_INST_SUBDIRS := no_alu32
79
79
@@ -220,7 +220,7 @@ ifeq ($(VMLINUX_BTF),)
220
220
$(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)")
221
221
endif
222
222
223
- # Define simple and short `make test_progs`, `make test_sysctl `, etc targets
223
+ # Define simple and short `make test_progs`, `make test_maps `, etc targets
224
224
# to build individual tests.
225
225
# NOTE: Semicolon at the end is critical to override lib.mk's default static
226
226
# rule for binaries.
@@ -329,7 +329,6 @@ NETWORK_HELPERS := $(OUTPUT)/network_helpers.o
329
329
$(OUTPUT ) /test_sockmap : $(CGROUP_HELPERS ) $(TESTING_HELPERS )
330
330
$(OUTPUT ) /test_tcpnotify_user : $(CGROUP_HELPERS ) $(TESTING_HELPERS ) $(TRACE_HELPERS )
331
331
$(OUTPUT ) /test_sock_fields : $(CGROUP_HELPERS ) $(TESTING_HELPERS )
332
- $(OUTPUT ) /test_sysctl : $(CGROUP_HELPERS ) $(TESTING_HELPERS )
333
332
$(OUTPUT ) /test_tag : $(TESTING_HELPERS )
334
333
$(OUTPUT ) /test_lirc_mode2_user : $(TESTING_HELPERS )
335
334
$(OUTPUT ) /xdping : $(TESTING_HELPERS )
Original file line number Diff line number Diff line change 1
1
// SPDX-License-Identifier: GPL-2.0
2
2
// Copyright (c) 2019 Facebook
3
3
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"
18
5
#include "cgroup_helpers.h"
19
- #include "testing_helpers.h"
20
6
21
7
#define CG_PATH "/foo"
22
8
#define MAX_INSNS 512
@@ -1608,26 +1594,19 @@ static int run_tests(int cgfd)
1608
1594
return fails ? -1 : 0 ;
1609
1595
}
1610
1596
1611
- int main ( int argc , char * * argv )
1597
+ void test_sysctl ( void )
1612
1598
{
1613
- int cgfd = -1 ;
1614
- int err = 0 ;
1599
+ int cgfd ;
1615
1600
1616
1601
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 ;
1619
1604
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 ;
1622
1607
1623
- if (run_tests (cgfd ))
1624
- goto err ;
1625
-
1626
- goto out ;
1627
- err :
1628
- err = -1 ;
1629
1608
out :
1630
1609
close (cgfd );
1631
1610
cleanup_cgroup_environment ();
1632
- return err ;
1611
+ return ;
1633
1612
}
You can’t perform that action at this time.
0 commit comments