On Wed, 5 Jul 2017 17:32:59 +0200 Greg KH <greg@xxxxxxxxx> wrote: > On Wed, Jul 05, 2017 at 08:16:33AM -0700, Guenter Roeck wrote: > > If we start shaming people for not providing unit tests, all we'll accomplish is > > that people will stop providing bug fixes. > > Yes, this is the key! And I mentioned this in my initial email. > > Steven, just look at everything marked with a "Fixes:" or "stable@" tag > from 4.12-rc1..4.12 and try to determine how you would write a test for > the majority of them. It only makes sense if there's a reproducible case. For cases where stress testing is required and you hope to hit the bug, well, that's never an easy answer, and this is not something that will fix it. > > Yes, for some subsystems this can work (look at xfstests as one great > example for filesystems, same for the i915 tests), but for the majority > of the kernel, at this point in time, it doesn't make sense. I already do. Actually, I have just fixed a bug that I need to add a selftest for. Yes, it is easier for non hardware, but for cases which has specs on hardware behavior, why can't we have tests to test if the hardware matches the spec? Everyone is focusing on that "shaming" comment and not looking at the rest of what I wrote. My main point is, there's a lot of reproducers in change logs or emails that are not in selftests. There's no excuse for that. Lets fix that issue, and not go into a bike shedding fight about the entire approach. > > So take Carlos's advice, start small, do it for your subsystem if you Yes, lets start small. What do you think about all reproducers getting into selftests? If it's not 100% reproducing, then it's up to the individual, but any test that can trigger a bug 100% should be added. I'd like to expand selftests to include configs too. If there's a config that triggers a bug, that should be added to a list of "configs" to be tested as well. > don't touch hardware (easy peasy, right?), and let's see how it goes, > and see if we have the infrastructure to do it even today. Right now, > kselftests is finally getting a unified output format, which is great, > it shows that people are starting to use and rely on it. What else will > we need to make this more widely used, we don't know yet... I've been using selftests for ftrace for some time. I have my own tests that I run (which do test any config that has failed me in the past), and I'm slowing getting those into the selftests directory as well. -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-api" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html