aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/bisect/bisect_test.go
Commit message (Collapse)AuthorAgeFilesLines
* all: use `t.TempDir` to create temporary test directoryEng Zer Jun2022-03-281-17/+4
| | | | | | | | | This commit replaces all `ioutil.TempDir` with `t.TempDir` in tests. The directory created by `t.TempDir` is automatically removed when the test and all its subtests complete. Reference: https://pkg.go.dev/testing#T.TempDir Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* all: capture compiler id during the build processAleksandr Nogikh2021-07-201-5/+7
| | | | | | | | | Default compilers are specified in the OS- and platform-dependent logic. It is more convenient to extract info about them during the kernel build itself, rather than during the manager object initialization. Apply the necessary changes throughout the code that is involved in building the kernels and processing information about this process.
* pkg/kconfig: store minimization resultsJouni Hogander2020-12-101-4/+2
| | | | | Store config options identified using DebugTracer. Also change bisection and configuration minimization code to use new DebugTracer.
* pkg/mgrconfig: add prog&sys.targets targets to ConfigDmitry Vyukov2020-11-301-1/+1
| | | | | | These are widely used with the config as the refactoring shows. This removes a bunch of unnecessary code. Also fixes a number of bugs where we confused Arch with VMArch.
* pkg/mgrconfig: move derived fields into separate structDmitry Vyukov2020-11-301-4/+6
| | | | | | Users should not be concerned with the internal derived fields. Move all derived fields into a separate struct before adding more. This leaves config.go as a better documentation for end users.
* pkg/bisect: add flaky flagJouni Hogander2020-11-171-3/+21
| | | | | On first test (original commit) bump up number of tests always. Also bump up number of tests if observing more good results than bad.
* sys/targets: add OS/Arch name constsDmitry Vyukov2020-10-261-3/+4
| | | | | | | | | | | | We use strings to identify OS/Arch. These strings are duplicated throughout the code base massively. golangci-lint points to possiblity of typos and duplication. We already had to define these names in pkg/csource and disable checking for prog package. A future change triggers such warnings in another package. Add OS/Arch name consts to sys/targets so that they can be used to refer to OS/Arch. Use the consts everywhere.
* pkg/bisect: switch to kconfig.MinimizeDmitry Vyukov2020-10-211-10/+1
| | | | | | | | | | | | | | | Use the new kconfig.Minimize for config minization instead of the config-bisect.pl script. This is mostly just deleting code. Also update tests: - minimization is now supposed to test the baseline config (update "testos" stub accordingly) - minimization is not supposed to return a config that does not build (a reasonable config minimization procedure can't arrive to such config), remove test that tests this Update #2171
* pkg/vcs: add repo OptPrecious and OptDontSandbox optionsDmitry Vyukov2020-10-211-1/+1
| | | | | | | | | | The pkg/vcs code assumed that we fully manage the repo within an autonomous program. In particular it tried to repair any errors by dropping and re-creating the repo. This does not work well for command-line tools that work with a user-provided repo. Add OptPrecious for such uses. Update #2171
* pkg/bisect: add ccache optionJouni Hogander2020-09-211-1/+1
| | | | | | Add option to use ccache in kernel builds. Signed-off-by: Jouni Hogander <jouni.hoegander@partner.bmw.de>
* all: fix log/error text starting with capital letterDmitry Vyukov2020-07-051-1/+1
| | | | Update #1876
* pkg/bisect: fix noop change detection with config minimizationDmitry Vyukov2020-07-021-2/+16
| | | | | | 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.
* pkg/bisect: improve config minimization testsDmitry Vyukov2020-07-021-3/+12
| | | | | | | Change a test to actually produce a new config as it is supposed to do during config minimization and check the resulting config. Add a regression test for the bug where we committed a broken config.
* pkg/bisect: test resulting configDmitry Vyukov2020-07-021-33/+47
| | | | | | One of main outputs of the config minimization is the new config, but tests don't do any single check of it. Check the resulting config (is it correct in all cases?).
* pkg/bisect: don't ignore errors during config minimizationDmitry Vyukov2020-07-021-5/+3
| | | | | | | Ignoring errors is bad. It leads to silent failures. If there is some particular error condition that is expected to happen and we want to ignore, we need to ignore that one only rather than all potenital errors in the whole process.
* pkg/bisect: minor style fix upsDmitry Vyukov2020-07-021-3/+2
|
* pkg/bisect: fix crash when all releases are brokenDmitry Vyukov2020-07-021-0/+8
| | | | Currently we crash with nil deref in this special case.
* pkg/bisect: Implement config bisectionJouni Hogander2020-07-021-9/+72
| | | | | | | | | Implement Linux kernel configuration bisection. Use bisected minimalistic configuration in commit bisection. Utilizes config_bisect.pl script from Linux kernel tree in bisection. Modify syz-bisect to read in kernel.baseline_config. This is used as a "good" configuration when bisection is run.
* .golangci.yml: enable funlen checkerDmitry Vyukov2020-06-051-173/+174
| | | | Checks for too long functions (based on lines and statements).
* pkg/bisect: speed up testsDmitry Vyukov2020-05-181-56/+86
| | | | | | Creating new repos takes majority of test time. Reuse them across tests. With GOMAXPROCS=2 (CI) this speeds up tests from 33 sec to 7 secs.
* pkg/bisect: always test parent commitDmitry Vyukov2019-12-101-3/+2
| | | | Fixes #1527
* pkg/bisect: add test for #1527Dmitry Vyukov2019-12-101-2/+24
| | | | Update #1527
* dashboard/app: don't report bisections pointing to release commitsDmitry Vyukov2019-11-271-0/+14
| | | | | | | | | | | They should have been detected by "same binary" logic. But the problem is that we may use different compilers for different commits and they switch exactly at release commits. So we can build the release with a differnet compiler than the rest of commits and then obviously it won't be "same binary". Detect release commits separately. Update #1271
* pkg/bisect: fix some off-by-onesDmitry Vyukov2019-11-271-0/+40
| | | | | | | | | | 3/4 added tests currently fail. The problem is that we don't collect results from initial bisection range detection. As the result we won't detect "same binary" for release and first commit in a release. Update #1271
* pkg/bisect: detect wrong bisectionsDmitry Vyukov2019-11-071-163/+171
| | | | | | | | Detect bisection to merge commits and to commits that don't affect kernel binary (comments, other arches, whitespaces, etc). Such bisections are not reported in emails (but shown on web). Update #1271
* pkg/bisect: modify Run() to return information about commitZubin Mithra2019-11-051-22/+29
| | | | | | | * Modify Run() to return the commit object when a failure occurs on the oldest tested release(for BisectCause) and latest tested release(for BisectFix). * Modify tests to check the returned commit object.
* pkg/bisect: add more tests for various possible bisection resultsZubin Mithra2019-11-041-47/+210
| | | | | | | | Add tests for the following cases(1 each for cause and fix): - bisection returns the correct commit - bisection failed due to crash not occuring on the original commit - bisection failed as crash occurs on oldest/latest commit - bisection is inconclusive
* pkg/vcs: detect old git binary that can't do bisectionDmitry Vyukov2019-10-221-0/+3
|
* pkg/vcs: make EnvForCommit return full compiler pathDmitry Vyukov2019-10-221-4/+0
| | | | | | | All callers of EnvForCommit need the compiler path, so move this logic into EnvForCommit to avoid duplication. Also simplifies tests because test impl can now return an empty compiler (which should be unused).
* pkg/bisect: add initial testing support for cause bisectionZubin Mithra2019-10-221-0/+133
(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.