and move *type=='v' check back under distinguishing between vfat/iso9660
instead of run for all filetypes and potentially triggering if a new
4 letter physical filesystem type starting with v shows up in future.
Fixes `blkid -L`, and uses that to implement `mount LABEL=...`, the same way
`mount UUID=...` was implemented.
Previously blkid would erroneously print SEC_TYPE="msdos" for vfat filesystems
when the -L option was passed. This line is moved to only print it when neither
-U or -L are passed.
Also fixed to match util-linux's blkid behavior better: SEC_TYPE="msdos" is not
added to the list of tags when the vfat filesystem is fat32 (presumably because
fat32 is not compatible with msdos). A test is added to check this behavior.
To create the fat32.bz2 file used by the test, run the following commands:
$ fallocate -l33M fat32
$ mkfs.vfat -n myfat32 -i 0xB25B2ECB -F 32 fat32
$ bzip2 fat32
It's my first time submitting a patch to any project, so if there's anything I
should do differently in the future, please let me know.
By default, known broken tests are skipped, use "BROKEN= make test_sh" to
run them. This yanks 65 tests, leaving 289 which currently pass.
(A lot of the toysh test suite was always aspirational, notes-to-self
to handle some corner case. Unfortunately, that made it less useful for
regression testing changes...)
Add --no-mmap flag to indicate seek and read/write access. This allows
accessing devices that do not support mapping into memory - eg.
/dev/nvram, /dev/msr0 etc.
Also currently only WIDTH bytes are mapped into memory even when more
data is accessed. Fix this by mapping WIDTH * number of data.
Test: ./post_update.sh && m toybox. Push devmem test into DUT and access
/dev/mem through memory mapped access, /dev/nvram & /dev/msr* through
non memory-mapped access. Also update the toybox test cases to include
the non memory mapped access and confirm that all the tests are passing.
PASS: devmem read --no-mmap default (4)
PASS: devmem read --no-mmap 1
PASS: devmem read --no-mmap 2
PASS: devmem read --no-mmap 4
PASS: devmem read --no-mmap 8
PASS: devmem write 1
PASS: devmem write 2
PASS: devmem write 4
PASS: devmem write 8
PASS: devmem write --no-mmap 1
PASS: devmem write --no-mmap 2
PASS: devmem write --no-mmap 4
PASS: devmem write --no-mmap 8
PASS: devmem write 1 multiple
PASS: devmem write 2 multiple
PASS: devmem write 4 multiple
PASS: devmem write 8 multiple
PASS: devmem write --no-mmap 1 multiple
PASS: devmem write --no-mmap 2 multiple
PASS: devmem write --no-mmap 4 multiple
PASS: devmem write --no-mmap 8 multiple
Changelog since v1:
- Removed android specific files
- Removed xlseek after xwrite since xwrite advances the position
- Added test cases for --no-mmap access
diff should allow comparison between regular files and fifos
Added a few tests to help catch regressions here, and added
some cleanup for files the test creates.
The nextfile statement was failing because it left unprocessed input in the
record buffer from the current file. Mod to reset the buffer so it will get
data from the next file immediately. Add a test for the nextfile fix and also
for the preceding commit that fixed the 'getline var' bug (not setting it as a
numeric string if needed).
Yet again, I am victim of my own bad habit of only testing on my Debian
desktop... It turns out that [current] Debian od uses a single space
between fields, macOS od uses a tab between fields, and toybox od uses 4
spaces between fields. (Given that POSIX just says "one or more <blank>
characters", I assume this isn't a new problem.)
Sidestep this with NOSPACE=1 for all the od-using tests.
-f lets people use /dev/port for x86 i/o ports (rather than needing a
separate x86-only command), or /dev/nvram, or /dev/cpu/*/msr, or
/sys/bus/pci/devices/*:*:*.* ... you get the idea.
It also means we can write some tests. (Though of course, the tests
don't tell us whether this actually works with, /dev/foo, or whether
you actually need to lseek()+write() rather than mmap().)
Also support arbitrary numbers of writes (with address auto-increment).
I wrapped the repeated test infrastructure in a `vitest` function and inlined the dozens of tiny input files.
I shortened some of the test inputs to be clearer and discovered a couple bugs, left for now as commented out tests:
* `b` movement is off by one.
* Deleting/moving the last part of the last line of the file is off by one, usually leaving the final character in place.
In commit 2c96060, the tests for getfattr and setfattr were updated to
only query specific names and avoid any unexpected extended attributes.
Reintroduce the generic tests by filtering out any attribute in the
`security` namespace.
(If we exit instead of return from scripts/test.sh the subshell doesn't
marshall $FAILCOUNT into the file "continue", which is interpreted as the
test having crashed so the plumbing exits with 1.)