aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/bisect/bisect_test.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-07-01 22:51:28 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-07-02 10:56:05 +0200
commitf30c14bfec4b49e528a756b28cc010925e2f286b (patch)
tree4a9a565f0719db6450e0832cfb09ec6b50254548 /pkg/bisect/bisect_test.go
parent39ffeee9d8f9f2d27899311d06591a7ffaba3b26 (diff)
pkg/bisect: fix noop change detection with config minimization
Config minimization did not update test results for the starting commit. Test result for the starting commit still refered to the original config, not the minimized config that was actually used during bisection.
Diffstat (limited to 'pkg/bisect/bisect_test.go')
-rw-r--r--pkg/bisect/bisect_test.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/pkg/bisect/bisect_test.go b/pkg/bisect/bisect_test.go
index 6815c1ab8..a7462a3b1 100644
--- a/pkg/bisect/bisect_test.go
+++ b/pkg/bisect/bisect_test.go
@@ -11,6 +11,7 @@ import (
"strconv"
"testing"
+ "github.com/google/syzkaller/pkg/hash"
"github.com/google/syzkaller/pkg/instance"
"github.com/google/syzkaller/pkg/mgrconfig"
"github.com/google/syzkaller/pkg/report"
@@ -34,9 +35,10 @@ func (env *testEnv) BuildSyzkaller(repo, commit string) error {
func (env *testEnv) BuildKernel(compilerBin, userspaceDir, cmdlineFile, sysctlFile string,
kernelConfig []byte) (string, string, error) {
commit := env.headCommit()
- kernelSign := fmt.Sprintf("sign-%v", commit)
+ configHash := hash.String(kernelConfig)
+ kernelSign := fmt.Sprintf("%v-%v", commit, configHash)
if commit >= env.test.sameBinaryStart && commit <= env.test.sameBinaryEnd {
- kernelSign = "same-sign"
+ kernelSign = "same-sign-" + configHash
}
env.config = string(kernelConfig)
if env.config == "baseline-fails" || env.config == "broken-build" {
@@ -233,6 +235,18 @@ var bisectionTests = []BisectionTest{
baselineConfig: "minimize-fails",
expectErr: true,
},
+ {
+ name: "config-minimize-same-hash",
+ startCommit: 905,
+ commitLen: 1,
+ expectRep: true,
+ culprit: 905,
+ sameBinaryStart: 904,
+ sameBinaryEnd: 905,
+ noopChange: true,
+ baselineConfig: "minimize-succeeds",
+ resultingConfig: "new-minimized-config",
+ },
// Tests that cause bisection returns error when crash does not reproduce
// on the original commit.
{