MCPcopy
hub / github.com/cilium/ebpf / TestLinkedELF

Function TestLinkedELF

collection_test.go:840–857  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

838}
839
840func TestLinkedELF(t *testing.T) {
841 spec, err := LoadCollectionSpec("testdata/linked-el.elf")
842 qt.Assert(t, qt.IsNil(err))
843
844 // Require all maps that won during linking to have a MaxEntries of 1.
845 for name, m := range spec.Maps {
846 qt.Assert(t, qt.Equals(m.MaxEntries, 1), qt.Commentf(name))
847 }
848
849 // Require all programs that won during linking to return 0 when executed.
850 // Programs that should be overridden during linking should return their line
851 // numbers.
852 coll := mustNewCollection(t, spec, nil)
853 for name, prog := range coll.Programs {
854 res := mustRun(t, prog, nil)
855 qt.Assert(t, qt.Equals(res, 0), qt.Commentf(name))
856 }
857}

Callers

nothing calls this directly

Calls 4

LoadCollectionSpecFunction · 0.85
mustNewCollectionFunction · 0.85
IsNilMethod · 0.80
mustRunFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…