From a2bdbd8c37841cc507a2ad59f25d90d6467e5858 Mon Sep 17 00:00:00 2001 From: Zubin Mithra Date: Tue, 8 Oct 2019 15:57:52 -0700 Subject: pkg/bisect: add initial testing support for cause bisection (note: incomplete change) Refactor existing code as follows: * Move reusable test utility functions from git_repo_test.go to pkg/vcs/test_util.go and make them exported. * Split Run() into Run()+runImpl(). * Change type of bisect.go:env.inst to `instance.BuilderTester`. Change usage inside syz-testbuild/testbuild.go accordingly. * Move most of linux.PreviousReleaseTags() into vcs/git.go as git.previousReleaseTags(). * Allow build.CompilerIdentity to be mocked. Introduce the following changes: * instance.BuilderTester is an interface with methods BuildSyzkaller() BuildKernel() Test() NewEnv() now returns this interface. * type testEnv implements instance.BuilderTester. * type testBuilder implements builder interface. Add a entry into table inside pkg/build/build.go:getBuilder() to return testBuilder object. --- tools/syz-testbuild/testbuild.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/syz-testbuild/testbuild.go b/tools/syz-testbuild/testbuild.go index 81a3466e4..120a465c3 100644 --- a/tools/syz-testbuild/testbuild.go +++ b/tools/syz-testbuild/testbuild.go @@ -120,7 +120,7 @@ func main() { } } -func test(repo vcs.Repo, bisecter vcs.Bisecter, kernelConfig []byte, env *instance.Env, com *vcs.Commit) { +func test(repo vcs.Repo, bisecter vcs.Bisecter, kernelConfig []byte, env instance.BuilderTester, com *vcs.Commit) { bisectEnv, err := bisecter.EnvForCommit(com.Hash, kernelConfig) if err != nil { fail(err) -- cgit mrf-deployment