aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2019-06-26losetup: fix Android.Elliott Hughes
Use /dev/block/loop* more uniformly, and teach the tests which to expect.
2019-06-26Fix cp.test to pass even if you're root or have a restrictive umask.Elliott Hughes
2019-06-25killall.test: don't assume the shell is /bin/sh.Elliott Hughes
The killall test still fails with toybox. Seems like right now killall and pidof share name to pid logic, but playing about with the desktop killall (which does pass this test), it seems like killall actually behaves more like pgrep than pidof (which does seem to be this limited on the desktop too)...
2019-06-25Make chgrp and chown tests work on Android.Elliott Hughes
There's no /etc/passwd and /etc/group, but there are enough users and groups that we can test with. ("bin" and "daemon" were added for LTP; "shell" is what you get with `adb shell`.)
2019-06-25blkid: adapt tests for util-linux blkid.Elliott Hughes
util-linux's blkid doesn't support reading from stdin, so move that to being a special toyonly test rather than the default. toybox blkid differs from util-linux in that it doesn't seem to find the LABEL for the checked-in example f2fs file system (the offset is wrong, but also f2fs uses LE16 strings), nor does it support the SEC_TYPE that util-linux blkid shows for several of the test file systems.
2019-06-25losetup: minor fixes.Elliott Hughes
Fix `losetup -f` to not fail with an error. Add the missing \n for `losetup -f --show FILE`. Use decimal for the device number, like the desktop losetup. Switch to the FLAG macro. Make the tests runnable as tests, and expand coverage a bit. With this patch, the tests pass both with and without TEST_HOST on the desktop. Note though that this patch is part of fixing some real-life losetup issues, not part of the "test cleanup" I'm also looking at. losetup is low down that list!
2019-06-25tar: implement --mode.Elliott Hughes
Used by build/make/tools/mktarball.sh in AOSP. (Which is why today's switch to toybox tar got reverted.)
2019-06-22Don't test shell builtin for kill.Rob Landley
2019-06-22Fix mv with trailing slash in source.Denys Nykula
Press tab, have bash complete dir name with a slash, notice musl rename() dislikes that. Replace trailing slash in the cp loop with a null character, if the command name is mv. Add the slash back if an error occurs.
2019-06-21bc: remove a power test that is now an errorGavin Howard
2019-06-21Fix cp -r dir/. symlink child.makepost
Remove the existing link before trying to re-create, passing the test. Add -p to the -r test as a regression guard, portage calls cp with both.
2019-06-11find: add -true/-false.Elliott Hughes
Used near the end of the AOSP build. Almost there! (This patch also fiddles with the help text to be able to slip the new options in without requiring so much extra space.)
2019-06-10kill: add trivial -l tests.Elliott Hughes
(`kill -l HUP` and `kill -l 1` both said "HUP" instead of giving you back the one you didn't provide, before my real-time signal patch.)
2019-06-10Add failing test for cp -r dir/. symlink child.makepost
Gentoo packages that build multiple variants, like once for every version of a slotted dependency, currently fail to install if their source dir includes a relative symlink to own child. Affects lots of Python infrastructure, for example meson and setuptools. You've already run into this issue, since cp.test has a todo. It's from 2008 though, so I guess I'll bump with an expanded test case. Libc is musl-1.1.22.
2019-06-03Clean up remaining TAIL_SEEK references.Elliott Hughes
2019-05-29Teach find -printf about %.Ns patterns, tweak help text, add tests.Rob Landley
2019-05-28Workaround for mkshRob Landley
(which doesn't handle "VAR=blah thingy" right if thingy is a function, the variable winds up staying set after the function returns.)
2019-05-26Teach sed about +N range ending.Rob Landley
2019-05-25grep: add --exclude-dir.Elliott Hughes
Used quite a lot, especially with `--exclude-dir=.git`.
2019-05-19Fix tar sparse extract with extension blocks.Rob Landley
2019-05-19More tar tests.Rob Landley
2019-05-17Fix a missing else, and an inverted test hidden by the missing else.Rob Landley
Add test to show failure case.
2019-05-16Add human_readable_long() for more than 3 digits of output.Rob Landley
2019-05-12Disable lsattr from "make tests" because behavior differs with filesystem.Rob Landley
Also, debian's lsattr is producing longer output lines with new fields, possibly an ioctl switch from FS_IOC_GETFLAGS -> FS_IOC_FSGETXATTR? Anyway, todo items here...
2019-05-10Walk -M /dir:/dir0:/dirN in man.makepost
Iterate over MANPATH and ordered sections using a manpath() helper equivalent of indenting logic of man x, man 1 x, and man -k each with a strsep loop.
2019-05-06Greatly simplify and speed up regexec0() using REG_STARTEND.Rob Landley
This is a 15 year old freebsd extension (presumably thus also available on MacOS) that glibc adopted in 2004, uClibc adopted in 2005, and bionic supports. The only thing that DOESN'T support it is musl, once again because its maintainer explicitly decided not to (https://www.openwall.com/lists/musl/2013/01/15/26), so add an #ifdef to let musl stay uniquely broken. (It'll stop at first NUL, everything else can match NULs). Finally fixes "s/x/y/g on a megabyte line of x's takes forever" issue.
2019-05-03env: fix case where a variable is replaced.Elliott Hughes
Found when trying to update the toybox prebuilt used for the Android build. Also add the corresponding test.
2019-04-30Make echo -E switch off -e.Rob Landley
2019-04-30echo: add -E.Elliott Hughes
POSIX finally gave us a way to use echo in a portable way despite differences of opinion about whether to default interpretation of escape sequences to on or off: -e enables and -E disables (as already implemented by busybox and coreutils). http://austingroupbugs.net/view.php?id=1222
2019-04-29Search name and first line with man -k regex.makepost
Exec -k value as regex on basename, and on the first content line outside a tag or on a referenced see-other, whichever appears earlier. Reuse zcat choice as a function when looping over files. Fix \-\- and glob.h include leftover. Handle man-pages example newlines. Clarify the todos, naming package and issue. Remaining items are more of a wishlist than a plan. Remove `<1>2` because it doesn't let `-k .` work, please look into that.
2019-04-26Add -M and switch test suite to use it (so test doesn't need to run as root).Rob Landley
2019-04-26more: better behavior with directories.Elliott Hughes
Also fix the non-tty output. Also tweak our output so the tests pass with TEST_HOST=1 too.
2019-04-26file: improve test coverage.Elliott Hughes
Use a real .class file and add tests for the other formats that file(1) recognizes and we already have sample input in tests/files/.
2019-04-26file: add test ELF binaries.Elliott Hughes
We keep regressing on this, and the ELF stuff is quite complicated, so even though checking in binaries isn't my first choice, this seems like a good use of 20KiB...
2019-04-22More TEST_HOST -> toyonlyRob Landley
2019-04-22Switch some SKIP_HOST tests to toyonly. (The host could be toybox.)Rob Landley
2019-04-20Implement man.makepost@firemail.cc
To look up docs on my netbook and server. Practically deroff.1, with heuristic for where to put spaces and newlines. How would you simplify file resolution and bzcat? What have I got wrong when escaping slashes, because while \-\^\- is -- ok, \-\- becomes -\-, e.g. in git-pull.1?
2019-04-20New xsetenv() plumbing (repeatedly set same environment variables withoutRob Landley
leaking memory), and mod env command to test it.
2019-04-04Add decompressed version.Rob Landley
2019-04-03More tar tests, and fix tar to pass them.Rob Landley
2019-04-02More tar cleanup, more tests.Rob Landley
2019-04-02Fix a test that wasn't deterministic.Rob Landley
2019-04-02Don't check in todo notes.Rob Landley
2019-04-02More tar cleanup and tests.Rob Landley
2019-04-01More tar cleanup.Rob Landley
2019-03-31More tar cleanup, some tests.Rob Landley
2019-03-28bc: add a trivial regression test for input from stdin.Elliott Hughes
A trivial test, but it would have caught the previous bug...
2019-03-26Make touch use xparsedate() (result: -t and -d the same, autodetects format),Rob Landley
and fix tests to pass on host too.
2019-03-25Add rm -v.makepost@firemail.cc
Gentoo removes verbosely when building packages, for example vim-core: https://github.com/gentoo/gentoo/blob/665eaa8/app-editors/vim-core/vim-core-8.1.0648.ebuild#L120 Implement like toy cp, without prepending an escape sign to quotation marks in filenames. Document in a test this difference from coreutils but similarity to busybox. How do other implementations handle such escapes? If it matters, would you approach it with a loop and multiple prints or somehow else? Short help description follows 141a075, consistent with other commands.
2019-03-25find: fix inverted -exec exit statusVidar Holen
The return value of -exec was the command's exit code, which did not account for the fact that an exit code of zero means success, while in C, zero means failure. From POSIX: > the primary shall evaluate as true if the utility returns a zero > value as exit status This commit flips the return value, and adds two tests.