Skip to content

Commit

Permalink
program: rename testRun to run
Browse files Browse the repository at this point in the history
The BPF command is now called BPF_PROG_RUN, rename testRun to reflect this.
  • Loading branch information
lmb authored and ti-mo committed Dec 13, 2022
1 parent 1c4363b commit 2943faa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions prog.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ func (p *Program) Test(in []byte) (uint32, []byte, error) {
Repeat: 1,
}

ret, _, err := p.testRun(&opts)
ret, _, err := p.run(&opts)
if err != nil {
return ret, nil, fmt.Errorf("test program: %w", err)
}
Expand All @@ -565,7 +565,7 @@ func (p *Program) Test(in []byte) (uint32, []byte, error) {
//
// Note: the same restrictions from Test apply.
func (p *Program) Run(opts *RunOptions) (uint32, error) {
ret, _, err := p.testRun(opts)
ret, _, err := p.run(opts)
if err != nil {
return ret, fmt.Errorf("run program: %w", err)
}
Expand Down Expand Up @@ -594,7 +594,7 @@ func (p *Program) Benchmark(in []byte, repeat int, reset func()) (uint32, time.D
Reset: reset,
}

ret, total, err := p.testRun(&opts)
ret, total, err := p.run(&opts)
if err != nil {
return ret, total, fmt.Errorf("benchmark program: %w", err)
}
Expand Down Expand Up @@ -645,7 +645,7 @@ var haveProgRun = internal.NewFeatureTest("BPF_PROG_RUN", "4.12", func() error {
return err
})

func (p *Program) testRun(opts *RunOptions) (uint32, time.Duration, error) {
func (p *Program) run(opts *RunOptions) (uint32, time.Duration, error) {
if uint(len(opts.Data)) > math.MaxUint32 {
return 0, 0, fmt.Errorf("input is too long")
}
Expand Down
2 changes: 1 addition & 1 deletion prog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func TestProgramTestRunInterrupt(t *testing.T) {
runtime.Goexit()
},
}
_, _, err := prog.testRun(&opts)
_, _, err := prog.run(&opts)

errs <- err
}()
Expand Down

0 comments on commit 2943faa

Please sign in to comment.