mirror of
https://github.com/eledio-devices/thirdparty-littlefs.git
synced 2025-11-01 00:38:29 +01:00
This is needed to allow compilation of multiple versions in the same binary. Also note that the FUSE testing was removed because of related name issues. ./scripts/prefix.py lfs1
50 lines
965 B
Bash
Executable File
50 lines
965 B
Bash
Executable File
#!/bin/bash
|
|
set -eu
|
|
|
|
echo "=== Formatting tests ==="
|
|
rm -rf blocks
|
|
|
|
echo "--- Basic formatting ---"
|
|
tests/test.py << TEST
|
|
lfs1_format(&lfs1, &cfg) => 0;
|
|
TEST
|
|
|
|
echo "--- Invalid superblocks ---"
|
|
ln -f -s /dev/zero blocks/0
|
|
ln -f -s /dev/zero blocks/1
|
|
tests/test.py << TEST
|
|
lfs1_format(&lfs1, &cfg) => LFS1_ERR_CORRUPT;
|
|
TEST
|
|
rm blocks/0 blocks/1
|
|
|
|
echo "--- Basic mounting ---"
|
|
tests/test.py << TEST
|
|
lfs1_format(&lfs1, &cfg) => 0;
|
|
TEST
|
|
tests/test.py << TEST
|
|
lfs1_mount(&lfs1, &cfg) => 0;
|
|
lfs1_unmount(&lfs1) => 0;
|
|
TEST
|
|
|
|
echo "--- Invalid mount ---"
|
|
tests/test.py << TEST
|
|
lfs1_format(&lfs1, &cfg) => 0;
|
|
TEST
|
|
rm blocks/0 blocks/1
|
|
tests/test.py << TEST
|
|
lfs1_mount(&lfs1, &cfg) => LFS1_ERR_CORRUPT;
|
|
TEST
|
|
|
|
echo "--- Valid corrupt mount ---"
|
|
tests/test.py << TEST
|
|
lfs1_format(&lfs1, &cfg) => 0;
|
|
TEST
|
|
rm blocks/0
|
|
tests/test.py << TEST
|
|
lfs1_mount(&lfs1, &cfg) => 0;
|
|
lfs1_unmount(&lfs1) => 0;
|
|
TEST
|
|
|
|
echo "--- Results ---"
|
|
tests/stats.py
|