(t *testing.T)
| 812 | } |
| 813 | |
| 814 | func TestProgramInstructions(t *testing.T) { |
| 815 | name := "test_prog" |
| 816 | spec := &ProgramSpec{ |
| 817 | Type: SocketFilter, |
| 818 | Name: name, |
| 819 | Instructions: asm.Instructions{ |
| 820 | asm.LoadImm(asm.R0, -1, asm.DWord).WithSymbol(name), |
| 821 | asm.Return(), |
| 822 | }, |
| 823 | License: "MIT", |
| 824 | } |
| 825 | |
| 826 | prog := mustNewProgram(t, spec, nil) |
| 827 | |
| 828 | pi, err := prog.Info() |
| 829 | testutils.SkipIfNotSupported(t, err) |
| 830 | if err != nil { |
| 831 | t.Fatal(err) |
| 832 | } |
| 833 | |
| 834 | if platform.IsWindows { |
| 835 | t.Skip("prog.Info() does not return a valid Tag on Windows") |
| 836 | } |
| 837 | |
| 838 | ok, err := spec.Instructions.HasTag(pi.Tag, internal.NativeEndian) |
| 839 | qt.Assert(t, qt.IsNil(err)) |
| 840 | qt.Assert(t, qt.IsTrue(ok), qt.Commentf("ProgramSpec tag differs from xlated instructions")) |
| 841 | } |
| 842 | |
| 843 | func TestProgramLoadErrors(t *testing.T) { |
| 844 | testutils.SkipOnOldKernel(t, "4.10", "stable verifier log output") |
nothing calls this directly
no test coverage detected
searching dependent graphs…