Welcome to mirror list, hosted at ThFree Co, Russian Federation.

test_format.sh « tests - github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cff0bacab41970142133340edc47e97d2c639a3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -eu

echo "=== Formatting tests ==="
rm -rf blocks

echo "--- Basic formatting ---"
tests/test.py << TEST
    lfs_format(&lfs, &cfg) => 0;
TEST

echo "--- Invalid superblocks ---"
ln -f -s /dev/zero blocks/0
ln -f -s /dev/zero blocks/1
tests/test.py << TEST
    lfs_format(&lfs, &cfg) => LFS_ERR_CORRUPT;
TEST
rm blocks/0 blocks/1

echo "--- Basic mounting ---"
tests/test.py << TEST
    lfs_format(&lfs, &cfg) => 0;
TEST
tests/test.py << TEST
    lfs_mount(&lfs, &cfg) => 0;
    lfs_unmount(&lfs) => 0;
TEST

echo "--- Invalid mount ---"
tests/test.py << TEST
    lfs_format(&lfs, &cfg) => 0;
TEST
rm -f blocks/0 blocks/1
tests/test.py << TEST
    lfs_mount(&lfs, &cfg) => LFS_ERR_CORRUPT;
TEST

echo "--- Results ---"
tests/stats.py