Skip to content

Commit

Permalink
Added self-hosting fuzz test using littlefs-fuse
Browse files Browse the repository at this point in the history
  • Loading branch information
geky committed Oct 10, 2017
1 parent 9db1a86 commit ac9766e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,33 @@ script:
- CFLAGS="-DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512" make test
- CFLAGS="-DLFS_BLOCK_COUNT=1023" make test
- CFLAGS="-DLFS_LOOKAHEAD=2047" make test

# self-host with littlefs-fuse for fuzz test
- make -C littlefs-fuse

- littlefs-fuse/lfs --format /dev/loop0
- littlefs-fuse/lfs /dev/loop0 mount

- ls mount
- mkdir mount/littlefs
- cp -r $(git ls-tree --name-only HEAD) mount/littlefs
- cd mount/littlefs
- ls
- make -B test_dirs

before_install:
- fusermount -V
- gcc --version

install:
- sudo apt-get install libfuse-dev
- git clone --depth 1 https://github.com/geky/littlefs-fuse

before_script:
- rm -rf littlefs-fuse/littlefs/*
- cp -r $(git ls-tree --name-only HEAD) littlefs-fuse/littlefs

- mkdir mount
- sudo chmod a+rw /dev/loop0
- dd if=/dev/zero bs=512 count=2048 of=disk
- losetup /dev/loop0 disk
4 changes: 2 additions & 2 deletions tests/template.fmt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ void test_assert(const char *file, unsigned line,
}}

if (v != e) {{
printf("\033[31m%s:%u: assert %s failed, expected %jd\033[0m\n",
file, line, s, e);
fprintf(stderr, "\033[31m%s:%u: assert %s failed with %jd, "
"expected %jd\033[0m\n", file, line, s, v, e);
exit(-2);
}}
}}
Expand Down

0 comments on commit ac9766e

Please sign in to comment.