skel = bad_struct_ops2__open(); if (!ASSERT_OK_PTR(skel, "bad_struct_ops2__open")) return;
/* struct_ops programs not referenced from any maps are open * with autoload set to true.
*/
ASSERT_TRUE(bpf_program__autoload(skel->progs.foo), "foo autoload == true");
if (start_libbpf_log_capture()) goto cleanup;
err = bad_struct_ops2__load(skel);
ASSERT_ERR(err, "bad_struct_ops2__load should fail");
log = stop_libbpf_log_capture();
ASSERT_HAS_SUBSTR(log, "prog 'foo': failed to load", "message about 'foo' failing to load");
void test_bad_struct_ops(void)
{ if (test__start_subtest("invalid_prog_reuse"))
invalid_prog_reuse(); if (test__start_subtest("unused_program"))
unused_program();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.