aboutsummaryrefslogtreecommitdiff
path: root/tests/ubi-tests/io_paral.c
AgeCommit message (Collapse)Author
2020-02-09mtd-utils: Fix printf format specifiers with the wrong typeDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2019-06-16ubi-tests: ubi_mkvol_request: Fully initialize 'struct ubi_mkvol_request req'Zhihao Cheng
'struct ubi_mkvol_request req' is one parameter of the function 'ubi_mkvol' , this parameter will be passed to kernel and then be checked. It acts as a local variable in many ubi tests, such as io_basic, io_read, mkvol_bad, mkvol_basic, etc. After commit c355aa465fce ("ubi: expose the volume CRC check skip flag") in linux-stable, 'struct ubi_mkvol_request' supports a new configuration named 'flags', and req.flags will be checked in kernel function 'verify_mkvol_req'. Currently, there is no initialization for req.flags before 'ubi_mkvol' invoked. So, req.flags can be an arbitrary number passed to kernel. When we run ubi tests in qemu (x86_64, kernel image: 5.2.0-rc4), the following errors may occur: ====================================================================== ====================================================================== ====================================================================== Test on mtdram, fastmap enabled, VID header offset factor 1 ====================================================================== ====================================================================== ====================================================================== mtdram: 16MiB, PEB size 16KiB, fastmap enabled Running mkvol_basic /dev/ubi0 Running mkvol_bad /dev/ubi0 [mkvol_bad] test_mkvol():105: ubi_mkvol failed with error 22 (Invalid argument), expected 28 (No space left on device) [mkvol_bad] test_mkvol():105: bytes = 16060929 Error: mkvol_bad failed FAILURE This patch fully initializes every 'struct ubi_mkvol_request req' passed to 'ubi_mkvol', which can fix the bug that the ubi test failed caused by that req.flags was not initialized. And it is still compatible with old kernel before kernel commit c355aa465fce ("ubi: expose the volume CRC check skip flag"). ---------------------------------------- Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2018-09-08ubi-tests: io_paral: Fix error handling of update_volume()Martin Lund
The io_paral test returns success even in case it throws e.g. the following error message: [io_paral] update_volume():125: written and read data are different This patch fixes so that the io_paral application returns a non-zero error code when an error is detected. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2017-02-21ubi: tests: Speedup io_paral by using rand_r()Richard Weinberger
rand() is not thread safe, but glibc seems to use a shared state which is protected by a mutex. io_paral spawns a few threads and they call rand() more or less in parallel, which causes heavy lock contention. That makes the test extremely slow on some setups. Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: David Gstir <david@sigma-star.at> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2012-11-16ubi-tests: switch to using common.h from the top levelArtem Bityutskiy
Sorry, the commit is huge, I just did not have time to split it. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-11-16ubi-tests: rename common.[ch] to helpers.[ch]Artem Bityutskiy
... to avoid confusion when the local common.h shadows the top-level common.h. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-08-22UBI: sync ubi-user.h with kernel v3.6-rc1Richard Genoud
Also remove the eraseblock type support, because kernel commit a65a0eb6d198e058687a9214683bd1c418f20d39 set the dtype parameter as obsolete. Also adjust to some renames: * 'UBI_PROP_DIRECT_WRITE' -> 'UBI_VOL_PROP_DIRECT_WRITE' * 'struct ubi_set_prop_req' -> 'struct ubi_set_vol_prop_req'. * 'UBI_IOCSETPROP' -> 'UBI_IOCSETVOLPROP' Signed-off-by: Richard Genoud <richard.genoud@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2011-06-29mtd-tests: io_paral: build error, "variable length strings"Brian Norris
Some compilers will complain about use of strlen() within a static array size declaration. For this type of string, "sizeof() - 1" is equivalent and prevents the build error. Error: io_paral.c:48:13: error: variably modified 'vol_nodes' at file scope Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
2010-06-15ubi-test: seed the random genrator in testsArtem Bityutskiy
Add a common seed_random_generator() and make tests use it for seeding the random generator. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-06-15ubi-tests: use rand instead of random in io_paralArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-06-14ubi-tests: rename err_msg to errmsgArtem Bityutskiy
For consistency with ubi-utils. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-08ubi-tests: improve io_paral testArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-08ubi-tests: various changesArtem Bityutskiy
Mostly improvments in io_paral. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-05-07ubi-tests: make tests compile againArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-01-16ubi-tests: fix build and some warningsArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-06-04ubi-tests: fix compilationArtem Bityutskiy
libubi_open interface was changed, but the tests were not amended. Fix this. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2008-01-25ubi-tests: stylistic amendmentsArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-12-23ubi-tests: update to recent libubi changesArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-12-20ubi-utils: move UBI tests to tests/ubi-tests/Artem Bityutskiy
Clean-up ubi-utils a little by moving tests to a proper place. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>