Age | Commit message (Collapse) | Author |
|
Do not use the shared 'tests_get_free_space' function but use own
implementation instead. This is another step to make integck independent
on the common infrastructure.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Aggregate all the information about the tested file-system in
the fsinf object for better readability and cleanness. Move
'can_mmap' and 'check_nospc_files' there as well.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
The fsinfo structure will aggregate all the information about the
tested file-system. Move 'mem_page_size' which we use for 'mmap()'
there as well.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Turn the 'void integck(void)' function into 'static int integck(void)'.
We need to teach the test to gracefully handle some error cases like
'EROFS' instead of failing and exiting straight away. And the ground
work for this is making all functions return errors. This is the first
tiny step in this direction.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Stop using the shared 'tests_check_test_file_system()' function but
instead, use own independed version of this function. This is another
step forward the goal to make integck independent of the common
shared code.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
This is a clean-up patch which:
1. Simplifies copy_string by useng strdup instead of malloc
2. Adds an assertion which checks the input parameter agains NULL,
instead of checking it.
3. Re-names it to dup_string which looks more readable to me.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Instead of using shared command line arguments parsing routine
implement own. The reason is that I want to add more parameters,
which are integck-specific. Also, longer-term plan is to make
integck independent of the common tests.c file.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Currently integck assumes that by default the file-system cannot
do shared writable mmap-ing and does not preserve accurate file
size after ENOSPC errors. And then it overrides these default
settings if this is UBIFS.
But it seems that only JFFS2 has those limitations. So make the
defaults to be the opposite and override them for JFFS2 only.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
The 'struct write_info' data strucutre records information about
truncation, and has a separate integer field to specify if this is
a truncation or not. But it is too wasteful because we have huge
amount of these objects.
But it is easy to notice that the 'random_seed' field is not used
for truncation records, so we can use that as the truncation flag.
This patch introduces MAX_RANDOM_SEED macro and when the 'random_seed'
field is greater than that, we treat it as the truncation flag.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Currently integck uses the 'random_offset' filed to store the new file
length sometimes, thus abusing this field. But we can do this nicer -
introduce an anonymous union and add 'new_length' filed which will be
used instead of 'random_offset' to make the code look nicer.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
The 'check_run_no' field does not have to be 64-bit, it can be
32-bit instead and we can save 4 bytes per object. Actually, it
could also be 16-bit, and we could make link_count 16-bit as well,
but that would need a bit more work.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
We do not have to store boolean flags in 'int' variables which
consume 4 bytes each, we can store those in bit-fields instead.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Turn "int checked" flag into 'char' flag to lessen memory
consumption a bit. Indeed, the test allocates a lot of these
data objects, so the size decrease from 36 to 32 bytes on
32-bit platforms is good to have.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
The common.mk contains clean target that removes *.o and $(TARGETS). Thus, make
custom clean target only for libubi.a
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
This patch brings common Makefile (in terms of mtd-utils project) to the
checkfs test suite. Additionally it fixes a build error related to usage of
open().
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Use ssize_t instead of size_t.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
The compiler warns us about cast mismatch for %9lu specifier. In original code
the argument has __off64_t type. Here is a simple type casting fix.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Instead of using printf() directly, use the shared mtd-utils printing
macros.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Include the commong mtd-utils "common.h" header in integck test to
make it possible to use shared macros.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
The 'link_new()' function has only one user, and the user checks
that the third 'file' argument is non NULL, so remove this check
from 'link_new()'. Let's be consistent and assume the 3rd argument
is never NULL, just like the first and the second ones.
This is just a minor improvement.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Instead of using named union 'entry' in 'struct dir_entry_info'
and having to type long 'entry->entry.file', 'entry->entry.symlink',
etc, use anonymous union which makes the syntax simpler: 'entry->file',
'entry->symlink', etc.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
The malloc function returns 'void *', so it is not necessary to
cast it when assigning. This is just a small clean-up patch.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
The integck test often allocates memory and fills it with zeroes.
Introduce a helper function for this frequent operation.
This is just a clean-up patch which makes the code 23 lines shorter.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Instead of using strtol and Co directly, use our share simple_strtoX()
helpers. This is just a cleanup.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Currently the stress tests may run up to 1 hour, make the limit
to be 6 minutes instead.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Add a "cscope" target to make it easier to develop in the repository.
Indeed, many people like me are accustomed to "make cscope" in the
kernel, and it is very convenient to have this in mtd-utils as well.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
This patch appends Makefile to the tests subdirectory and introduces tests
target in the root Makefile.
Additionally the clean target removes temporary stuff under tests subdirectory
as well.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
- time() was used without prototype.
- the return value of read() and write() wasn't checked
- classificator in printf() was wrong for argument of size_t type
Don't continue to read the /proc/profile in case when write was failed.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
chdir() returns negative value in case of error.
fscanf() returns amount of successfully parsed parameters.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
The sys_errlist[errno] is deprecated. We should use strerror(errno) instead.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
There are two warnings:
- strlen() is used without prototype
- argument of printf() is unsigned long, but used specifier is for int
This patch fixes them.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Artem: this is jut a clean-up, no functional changes.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
When reading and writing OOB we specify the address as absolute
offset from the beginning of the MTD device. This offset is
basically an absolute page offset plus the OOB offset. And it does
not have to be aligned to the min. I/O unit size (NAND page size).
So fix the 'do_oob_op()' function and remove incorrect checking
that the offset is page-aligned. This check leads to the following
errors:
libmtd: error!: unaligned address 2, mtd0 page size is 2048
But obviously, the intent was to write to offset 2 of the OOB area
of the very first NAND page.
Instead of that incorrect check, we should check that the OOB offset
we write to is within the OOB size and the length is withing the OOB
size. This patch adds such check.
Reported-by: Kelly Anderson <kelly@silka.with-linux.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tested-by: Kelly Anderson <kelly@silka.with-linux.com>
|
|
The integck tests re-mounts the file-system from time to time
and checks the integrity afterwords. And it re-mounts always
the same-way: unmount and then mount R/W back. However, it is
better to do it differently some times, e.g.:
* re-mount R/O then re-mount R/W
* unmount then mount R/W
* both of the above
* unmount, mount R/O, then re-mount R/W
* etc.
This will give better test coverage. This patch does exactly
that by improving the 'tests_remount()' function.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Fix the following compilation warning:
perf.c: In function ‘perf’:
perf.c:144: warning: format ‘%lld’ expects type ‘long long int’, but argument 2 has type ‘int64_t’
by adding a (long long int) cast.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Fix the following compilation warnings:
test_1.c: In function ‘test_1’:
test_1.c:67:4: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’
test_1.c:88:3: warning: format ‘%llu’ expects type ‘long long unsigned int’, but argument 3 has type ‘uint64_t’
The fix is to cast the argument with (unsigned long long).
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Implement the feature which we planned long time ago - make nanddump
fail if the -s parameter is not NAND page-aligned. Also bump nanddump
version.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
As we have planned, make --nosquash-rino-perm option to be the
default. Deprecate both options at the same time and print a
warning if they are used. Later we can remove them
Also, bump mkfs.ubifs version number.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Commit a8801d8 (unify flash_erase and flash_eraseall) changed the
flash_erase interface in a backwards incompatible way. Before that
commit start position was given in bytes, and now it must be provided
in blocks.
While I agree the new interface is nicer, we shouldn't break the
interface. I have scripts that expect the old behaviour, and I'm
most likely not alone, so change the interface back to the old
way.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Write only oob part goes different path in nand_base.c, it is better
to have userland program so that we could easy debug this path when
the write only oob fail like the mtd_oobtest in mtd_test suit.
Signed-off-by: Lei Wen <leiwen@marvell.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
We must use "long long" and "unsigned long long" types when
implementing the functions "simple_strtoll()" and "simple_strtoull()",
respectively. This prevents casting/truncation errors on systems where
"long" is not the same size as "long long" (that is, on most systems).
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Fix the repeated nodes with the same primary name in device_table.txt.
They were not generated correctly.
/dev/tty c 666 0 0 5 0 0 0 -
/dev/tty c 666 0 0 4 0 0 1 6
# IDE Devices
/dev/hda b 640 0 0 3 0 0 0 -
/dev/hda b 640 0 0 3 1 1 1 15
/dev/hdb b 640 0 0 3 64 0 0 -
/dev/hdb b 640 0 0 3 65 1 1 15
Only created,
/dev/tty
/dev/hda
/dev/hdb
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
The counting was incorrect. Follow that of mkfs.ubifs.
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
errmsg_die() should be nearly the equivalent of the error message used
here. This saves a few lines.
Also edited the error message to include the offending option and got
rid of the quotes.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
Includes error messages for negative blockalign, telling the user what
the offending option and value were.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|
|
The mtd-descriptor attributes contain signed data, not unsigned.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
|