TIL /dev/full
That's awesome.
I've had to resort to grotesque hacks before to simulate full disks in test suites — e.g. replacing a file descriptor with a nonsense number to trigger an error at the call site where a write would have failed.
Now that I know /dev/full exists, I can write a test which, although it works only on a subset of operating systems, still exercises a code path which applies to all of them.
You can also create a tiny filesystem in a file, set root user reservation to 100%, mount the file with `-o loop`. That should give you a "real" full device.
I typically use LD_PRELOAD hacks to simulate failure conditions. That way you can get deeper into your code than simply something that always fails.
Re:How the GNU coreutils are tested
by AlexDenisov on Monday December 06, 2021 @02:53PM
(#29464699)
I have a "series" of articles from a few years ago covering FreeBSD, LLVM, and GNU Make (https://lowlevelbits.org/categories/system-under-test/) and even created a separate website with a few more articles https://systemundertest.org, but stopped later.
SQLite is such an amazing piece of software. Public domain, amazing testing, as well as being so lightweight and efficient. It's a breath of fresh air in a bloated software world.
[dead]
Re:How the GNU coreutils are tested
by RicoElectrico on Monday December 06, 2021 @11:40AM
(#29461949)
Religious (source header comments) and warships (General Dynamics) sure, but an extremist?
"Testing Firefox more efficiently with machine learning": https://hacks.mozilla.org/2020/07/testing-firefox-more-effic...
This feels like a passion project site idea
Re:How the GNU coreutils are tested
by AlexDenisov on Monday December 06, 2021 @02:51PM
(#29464679)
I started building exactly this some years ago, but eventually stopped for some reason https://systemundertest.org
Re:How the GNU coreutils are tested
by stevenhuang on Monday December 06, 2021 @05:20PM
(#29466452)
Off topic, but why do people quote things like ,,'' this?
Here’s one on SQLite: https://www.sqlite.org/testing.html