diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-01-07 08:37:34 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-01-07 08:37:34 +0100 |
commit | 138b2890c4a874a82aff33df8e5ea37bd3a74e35 (patch) | |
tree | 769fd8ee658e008b8d3e54d44fbd0602f3ea8caa /src/systemcmds/tests/test_mount.c | |
parent | f35e6efbcaa5f9770ee4f6ef7686752b40c6a9ce (diff) | |
download | px4-firmware-138b2890c4a874a82aff33df8e5ea37bd3a74e35.tar.gz px4-firmware-138b2890c4a874a82aff33df8e5ea37bd3a74e35.tar.bz2 px4-firmware-138b2890c4a874a82aff33df8e5ea37bd3a74e35.zip |
Better mount test, still not reproducing failure very well
Diffstat (limited to 'src/systemcmds/tests/test_mount.c')
-rw-r--r-- | src/systemcmds/tests/test_mount.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/systemcmds/tests/test_mount.c b/src/systemcmds/tests/test_mount.c index 2f3a0d99e..db4ddeed9 100644 --- a/src/systemcmds/tests/test_mount.c +++ b/src/systemcmds/tests/test_mount.c @@ -54,14 +54,14 @@ #include "tests.h" -const int fsync_tries = 50; -const int abort_tries = 200; +const int fsync_tries = 1; +const int abort_tries = 10; int test_mount(int argc, char *argv[]) { - const unsigned iterations = 10; - const unsigned alignments = 4; + const unsigned iterations = 2000; + const unsigned alignments = 10; const char* cmd_filename = "/fs/microsd/mount_test_cmds.txt"; @@ -173,13 +173,13 @@ test_mount(int argc, char *argv[]) for (unsigned c = 0; c < (sizeof(chunk_sizes) / sizeof(chunk_sizes[0])); c++) { printf("\n\n====== FILE TEST: %u bytes chunks (%s) ======\n", chunk_sizes[c], (it_left_fsync > 0) ? "FSYNC" : "NO FSYNC"); + printf("unpower the system immediately (within 0.5s) when the hash (#) sign appears\n"); fsync(stdout); fsync(stderr); usleep(50000); for (unsigned a = 0; a < alignments; a++) { - // warnx("----- alignment test: %u bytes -----", a); printf("."); uint8_t write_buf[chunk_sizes[c] + alignments] __attribute__((aligned(64))); @@ -204,7 +204,7 @@ test_mount(int argc, char *argv[]) warn("WRITE ERROR!"); if ((0x3 & (uintptr_t)(write_buf + a))) - errx(1, "memory is unaligned, align shift: %d", a); + warnx("memory is unaligned, align shift: %d", a); return 1; @@ -213,14 +213,21 @@ test_mount(int argc, char *argv[]) if (it_left_fsync > 0) { fsync(fd); } else { - if (it_left_abort % 5 == 0) { - systemreset(false); - } else { - fsync(stdout); - fsync(stderr); - } + printf("#"); + fsync(stdout); + fsync(stderr); } } + + if (it_left_fsync > 0) { + printf("#"); + } + + printf("\n"); + fsync(stdout); + fsync(stderr); + usleep(1000000); + end = hrt_absolute_time(); close(fd); |