Files
thirdparty-littlefs/tests/test_format.sh
Christopher Haster daa6577060 Renamed all prefixes to include the major version
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
2019-01-30 14:03:16 -06:00

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