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);
}
d>1-1/+4 2008-06-14git add: add long equivalents of '-u' and '-f' optionsSZEDER Gábor2-4/+7 2008-06-14git-svn: test that extra blank lines aren't inserted in commit messages.Avery Pennarun1-1/+15 2008-06-14git-svn: don't append extra newlines at the end of commit messages.Avery Pennarun1-3/+5 2008-06-14enable whitespace checking of test scriptsJeff King1-1/+0 2008-06-14avoid trailing whitespace in zero-change diffstat linesJeff King2-8/+9 2008-06-14avoid whitespace on empty line in automatic usage messageJeff King2-3/+7 2008-06-14mask necessary whitespace policy violations in test scriptsJeff King8-136/+131 2008-06-14fix whitespace violations in test scriptsJeff King4-6/+6 2008-06-14git-submodule - Fix errors regarding resolve_relative_urlMark Levedahl1-4/+5 2008-06-14documentation: bisect: remove bits talking about a bisection branchChristian Couder1-4/+3 2008-06-13sha1_file.c: dead code removalJunio C Hamano2-145/+0 2008-06-13git-instaweb: improve auto-discovery of httpd and call conventions.Flavio Poletti1-15/+33 2008-06-13t4126: fix test that happened to work due to timingJunio C Hamano1-4/+0 2008-06-12fast-export: Correctly generate initial commits with no parentsShawn O. Pearce1-0/+2 2008-06-12t/.gitattributes: only ignore whitespace errors in test filesLea Wiemann2-2/+3 2008-06-12document --pretty=tformat: optionJeff King1-0/+22 2008-06-12Improve sed portabilityChris Ridd1-1/+1 2008-06-12user-manual: describe how higher stages are set during a mergeJunio C Hamano1-8/+7 2008-06-12doc: adding gitman.info and *.texi to .gitignoreGeoffrey Irving1-0/+2 2008-06-12Documentation: exclude @pxref{[REMOTES]} from texinfo intermediate outputJunio C Hamano1-1/+1 2008-06-12Documentation/git-pull.txt: Use more standard [NOTE] markupJunio C Hamano1-1/+2 2008-06-11"remote prune": be quiet when there is nothing to pruneJunio C Hamano1-2/+3 2008-06-11Typo in RelNotes.Mikael Magnusson1-1/+1 2008-06-11fix typo in tutorialFred Maranhão1-1/+1 2008-06-10gitweb: Separate generating 'sort by' table headerJakub Narebski1-37/+39 2008-06-10gitweb: Separate filling list of projects infoJakub Narebski1-12/+23 2008-06-10remote show: list tracked remote branches with -nOlivier Marin2-2/+22 2008-06-10remote prune: print the list of pruned branchesOlivier Marin3-8/+37 2008-06-10builtin-remote: split show_or_prune() in two separate functionsOlivier Marin1-34/+67 2008-06-10remote show: fix the -n optionOlivier Marin3-22/+41 2008-06-10git-cvsimport: do not fail when CVSROOT is /Philippe Bruhat (BooK)1-0/+1 2008-06-10Consolidate SHA1 object file closeLinus Torvalds1-6/+11 2008-06-09Documentation/git-cat-file.txt: add missing line breakLea Wiemann1-0/+1 2008-06-09merge-recursive: respect core.autocrlf when writing out the resultJohannes Schindelin2-1/+12 2008-06-09git-read-tree: document -v option.Miklos Vajna1-0/+3 2008-06-09Add configuration option for default untracked files modeMarius Storm-Olsen4-0/+54 2008-06-09Add argument 'no' commit/status option -u|--untracked-filesMarius Storm-Olsen5-6/+34 2008-06-09Add an optional <mode> argument to commit/status -u|--untracked-files optionMarius Storm-Olsen5-10/+92