aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/autoload.c
blob: 3693f7d133eb0082fe3c72e2c43dfc40b4be5fb5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// SPDX-License-Identifier: GPL-2.0
/* Copyright (c) 2020 Facebook */

#include <test_progs.h>
#include <time.h>
#include "test_autoload.skel.h"

void test_autoload(void)
{
	int duration = 0, err;
	struct test_autoload* skel;

	skel = test_autoload__open_and_load();
	/* prog3 should be broken */
	if (CHECK(skel, "skel_open_and_load", "unexpected success\n"))
		goto cleanup;

	skel = test_autoload__open();
	if (CHECK(!skel, "skel_open", "failed to open skeleton\n"))
		goto cleanup;

	/* don't load prog3 */
	bpf_program__set_autoload(skel->progs.prog3, false);

	err = test_autoload__load(skel);
	if (CHECK(err, "skel_load", "failed to load skeleton: %d\n", err))
		goto cleanup;

	err = test_autoload__attach(skel);
	if (CHECK(err, "skel_attach", "skeleton attach failed: %d\n", err))
		goto cleanup;

	usleep(1);

	CHECK(!skel->bss->prog1_called, "prog1", "not called\n");
	CHECK(!skel->bss->prog2_called, "prog2", "not called\n");
	CHECK(skel->bss->prog3_called, "prog3", "called?!\n");

cleanup:
	test_autoload__destroy(skel);
}
6.1&id=885c716f0f039cfe100f5d761e1011085b43fbb8&follow=1'>Rename detection: Avoid repeated filespec populationBjörn Steinbrink1-2/+7 2009-01-19shell: Document that 'cvs server' is a valid commandLars Noschinski1-2/+3 2009-01-18Documentation: avoid using undefined parametersAnders Melchiorsen1-2/+2 2009-01-18Documentation: mention branches rather than headsAnders Melchiorsen1-2/+2 2009-01-18Documentation: remove a redundant elaborationAnders Melchiorsen1-2/+1 2009-01-18Documentation: git push repository can also be a remoteAnders Melchiorsen1-1/+3 2009-01-17Update draft release notes for 1.6.1.1Junio C Hamano1-1/+6 2009-01-17builtin-fsck: fix off by one head countChristian Couder1-1/+1 2009-01-17t5540: clarify that http-push does not handle packed-refs on the remoteJohannes Schindelin1-3/+15 2009-01-17http-push: when making directories, have a trailing slash in the path nameJohannes Schindelin3-2/+11 2009-01-17http-push: fix off-by-path_lenJohannes Schindelin1-3/+7 2009-01-17Documentation: let asciidoc align related optionsMarkus Heidelberg1-1/+4 2009-01-17githooks.txt: add missing wordStephan Beyer1-1/+1 2009-01-17builtin-commit.c: do not remove COMMIT_EDITMSGStephan Beyer1-1/+0 2009-01-15t3404: Add test case for auto-amending only edited commits after "edit"Stephan Beyer1-0/+17 2009-01-15t3404: Add test case for aborted --continue after "edit"Stephan Beyer1-0/+15 2009-01-15t3501: check that commits are actually doneStephan Beyer1-0/+2 2009-01-14Update draft release notes to 1.6.1.1Junio C Hamano1-2/+23 2009-01-14Make t3411 executableMiklos Vajna1-0/+0 2009-01-14fix handling of multiple untracked files for git mv -kMichael J Gruber2-1/+2 2009-01-14add test cases for "git mv -k"Michael J Gruber1-0/+25 2009-01-13fast-import: Cleanup mode setting.Felipe Contreras1-3/+4 2009-01-13Git.pm: call Error::Simple() properlyJay Soffian1-2/+2 2009-01-13Avoid spurious error messages on error mistakes.Pierre Habouzit1-1/+1