From 2943faaeb627c5716960efbf1b8821a7cb719794 Mon Sep 17 00:00:00 2001 From: Lorenz Bauer Date: Mon, 12 Dec 2022 14:39:08 +0000 Subject: [PATCH] program: rename testRun to run The BPF command is now called BPF_PROG_RUN, rename testRun to reflect this. --- prog.go | 8 ++++---- prog_test.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/prog.go b/prog.go index 953533d6c..a113a5ff2 100644 --- a/prog.go +++ b/prog.go @@ -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) } @@ -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) } @@ -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) } @@ -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") } diff --git a/prog_test.go b/prog_test.go index a2c700d40..583349f6a 100644 --- a/prog_test.go +++ b/prog_test.go @@ -230,7 +230,7 @@ func TestProgramTestRunInterrupt(t *testing.T) { runtime.Goexit() }, } - _, _, err := prog.testRun(&opts) + _, _, err := prog.run(&opts) errs <- err }()