Commit Graph

14030 Commits

Author SHA1 Message Date
Mooffie
b229abc1eb Merge branch '3753_extfs_tester_access_configure_parameters'
* 3753_extfs_tester_access_configure_parameters:
  Ticket #3753: extfs: tester: let test scripts easily access configure-time parameters.
2017-01-15 21:15:39 +02:00
Mooffie
69897e94fd Ticket #3753: extfs: tester: let test scripts easily access configure-time parameters.
We introduce a mechanism by which tests can easily access configure-time
parameters (like @PERL@, @AWK@, ...).

It works by "sourcing" a file named config.sh (residing in the build tree):

    . "$MC_TEST_EXTFS_CONFIG_SH"
    $PERL -e 'print "hello"'

(Although config.sh has a shell syntax, Perl and Python programs too can
benefit from it, because it can be sourced into an .env_vars file and the
values exported from there.)

Of course, one can also use the traditional method, of *.in files listed in
configure.ac, but the mechanism introduced here is a more comfortable approach.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-15 20:10:01 +02:00
Mooffie
0fdcfa6aa4 Merge branch '3752_extfs_tester_export_more_variables'
* 3752_extfs_tester_export_more_variables:
  extfs: tester: improve HTML documentation output.
  extfs: tester: export some more useful variables.
  Ticket #3752: extfs: tester: use lowercase for private variables.
2017-01-15 19:50:45 +02:00
Mooffie
f42bdb1261 extfs: tester: improve HTML documentation output.
- We now have 4'th level headers: adjust --doc-depth.
- We have many short sections: highlight the active section's header.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-15 19:43:45 +02:00
Mooffie
e4e4b214b4 extfs: tester: export some more useful variables.
New environment variables:

- MC_TEST_EXTFS_DATA_DIR
- MC_TEST_EXTFS_INPUT

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-15 19:43:40 +02:00
Mooffie
9f99838fbe Ticket #3752: extfs: tester: use lowercase for private variables.
We switch to a modern practice of using lowercase for private variables ("shell
variables") and uppercase for the system's ("environment variables"). Constants
too are made lowercase, as it takes a philosopher to define "constant".

This gives us two advantages:

- If an .env_vars file accesses a private variable (e.g. $DATA_DIR or $INPUT),
  something we want to discourage, we'll easily see this.

- Somewhat confusing code like "MC_TEST_DATA_DIR=$DATA_DIR" (which was to occur
  in the following patch) becomes self-documenting after the change.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-13 15:36:18 +02:00
Andrew Borodin
9d735e02f1 Merge branch '3749_vfs_blksize'
* 3749_vfs_blksize:
  (vfs_adjust_stat): new VFS API, currently used to calculate st_blocks.
  Clarify usage of st_rdev. Use it if HAVE_STRUCT_STAT_ST_RDEV is defined.
  ftpfs: define st_blksize as equal to 64K.
  fishfs: define st_blksize as equal to 64K.
  Modify VFS APIs.
  tarfs: define st_blksize as equal to 8K.
  sftpfs: (sftpfs_fix_filename): refactoring: return length of result.
  sftpfs: minor optimization.
  sftpfs: define st_blksize and st_blocks.
  (vfs_s_default_stat): define st_blksize and st_blocks explicitly.
  Clarify usage of st_blocks. Use it if HAVE_STRUCT_STAT_ST_BLOCKS is defined.
  Ticket #3749: fix segfault in VFS if block size is not set.
2017-01-11 14:53:02 +03:00
Andrew Borodin
aae43d362f (vfs_adjust_stat): new VFS API, currently used to calculate st_blocks.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
bf40acf420 Clarify usage of st_rdev. Use it if HAVE_STRUCT_STAT_ST_RDEV is defined.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
d1c2c2d47e ftpfs: define st_blksize as equal to 64K.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
21fd0c3fec fishfs: define st_blksize as equal to 64K.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
061d60b82f Modify VFS APIs.
* vfs_s_stat: make public.
  * vfs_s_lstat: likewise.
  * vfs_s_fstat: likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
560ca526bd tarfs: define st_blksize as equal to 8K.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
110f4eae60 sftpfs: (sftpfs_fix_filename): refactoring: return length of result.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
ffe49251f7 sftpfs: minor optimization.
* (sftpfs_opendir): get rid of extra calculation of file name length.
  * (sftpfs_open_file): likewise.
  * (sftpfs_readlink): likewise.
  * (sftpfs_symlink): likewise.
  * (sftpfs_rename): likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
95556224a6 sftpfs: define st_blksize and st_blocks.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
a8a8e85279 (vfs_s_default_stat): define st_blksize and st_blocks explicitly.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
7e4a59e8d6 Clarify usage of st_blocks. Use it if HAVE_STRUCT_STAT_ST_BLOCKS is defined.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Andrew Borodin
8dabd9ac2a Ticket #3749: fix segfault in VFS if block size is not set.
Initial commit: clarify usage of st_blksize. Use it if
HAVE_STRUCT_STAT_ST_BLKSIZE is defined.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-11 14:52:35 +03:00
Yury V. Zaytsev
94787407f1 Merge branch '3747_hp48_extfs' 2017-01-01 17:30:09 +04:00
Mooffie
8b65c36d3f Ticket #3747: extfs: hp48: make the code more readable.
Whitespace tweaking here. There's no change in the code itself except for
using '%c' in the first printf too, to make it like the second printf.

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-01-01 17:29:59 +04:00
Mooffie
501a3122ff Ticket #3747: extfs: hp48: fix float truncation.
Some printf implementations can't process with %d anything other than integers.

We solve this by re-using the awk snippet for this purpose. This makes
hp48_retsize() unecessary. And hp48_retdir() too.

(The "case" statement was left unindented to, hopefully, not affect diff's
output much. This aesthetic issue will be fixed in a following patch.)

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2017-01-01 17:29:59 +04:00
Andrew Borodin
55f4dce8ac PULL_REQUEST_TEMPLATE.md: use https for m-c.o.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-01 09:39:06 +03:00
Yury V. Zaytsev
569569d1e4 maint: add GitHub pull request template trying to direct contributors to Trac
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-12-30 17:45:06 +04:00
Yury V. Zaytsev
67b3d64957 Merge branch '3708_tests_usability' 2016-12-27 16:47:33 +04:00
Mooffie
4a559344fb Ticket #3708: fix usability problems with --enable-tests
Signed-off-by: Mooffie <mooffie@gmail.com>
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-12-27 16:46:38 +04:00
Yury V. Zaytsev
f40caa3e71 Merge branch '3729_vfs_date_fixes' 2016-12-25 10:06:37 +04:00
Yury V. Zaytsev
940fab955c maint: shorten commit hash if git describe fails
Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
2016-12-25 10:06:23 +04:00
Mooffie
d376f0ca43 extfs: hp48: add tests. 2016-12-25 10:06:23 +04:00
Mooffie
4557ee3c7a extfs: hp48: make it testable. 2016-12-25 10:06:23 +04:00
Mooffie
c91476ac4a Ticket #3729: extfs: hp48: fix date format.
Use "MM-DD-YYYY hh:mm" instead of "Mon DD YYYY hh:mm".

Note: we assign to $NOW at the top-level, not inside hp48_parser(), because the
communication is slow and we don't want each recursive call to hp48_parser() to
potentially print a different time.
2016-12-25 10:06:23 +04:00
Mooffie
019ab5c012 extfs: hp48: misc fixes.
Two bugs fixed:

* "printf -rw-r--r--" made printf complain about invalid option (although
  changing it to "printf -- -rw-r--r-" is possible, we don't know how portble
  this is).

* Quotes around $INPUT defeat the purpose of the function calls (botched in
  commit 61b4642af4).
2016-12-25 10:06:23 +04:00
Mooffie
4d04aa40b0 extfs: hp48: documentation: explain the reply to the DIRECTORY command.
It was not at all easy to find a sample reply on the internet (the one found
was in a screenshot actually), so we record it here.
2016-12-25 10:06:23 +04:00
Mooffie
644682ad2c extfs: uarc: add tests. 2016-12-25 10:06:23 +04:00
Mooffie
22846550d3 extfs: uarc: make it testable. 2016-12-25 10:06:23 +04:00
Mooffie
61eb5cca37 Ticket #3729: extfs: uarc: fix date format.
Use "MM-DD-YYYY hh:mm" instead of "Mon DD YYYY hh:mm".
2016-12-25 10:06:23 +04:00
Mooffie
0e4e80cf79 extfs: uace: add tests. 2016-12-25 10:06:23 +04:00
Mooffie
057ba6d73a extfs: uace: make it testable. 2016-12-25 10:06:22 +04:00
Mooffie
5225a1d21b extfs: uace: documentation: clarify versions issue. 2016-12-25 10:06:22 +04:00
Mooffie
08a8621fc5 extfs: uace: print the correct file size.
As a comment in that file notes: 3'rd column is the compressed size, 4'th
column is the actual size.
2016-12-25 10:06:22 +04:00
Mooffie
105501ba9c Ticket #3729: extfs: uace: fix date format.
Use "MM-DD-YYYY hh:mm" instead of "Mon DD YYYY hh:mm".
2016-12-25 10:06:22 +04:00
Andrew Borodin
4a6fb3b534 Merge branch '3575_nanoseconds'
* 3575_nanoseconds:
  FISH VFS: generate timestamps with nanosecond precision for touch.
  (fish_utime): avoid buffer overflow: allocate buffer for command dynamically.
  Ticket #3575: preserve timestamps with nanosecond precisions during file copy
2016-12-25 08:47:47 +03:00
Andrey Gursky
0075944f1e FISH VFS: generate timestamps with nanosecond precision for touch.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-12-25 08:46:10 +03:00
Andrew Borodin
53a1d52ed9 (fish_utime): avoid buffer overflow: allocate buffer for command dynamically.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-12-25 08:46:10 +03:00
Andrey Gursky
4c418047b2 Ticket #3575: preserve timestamps with nanosecond precisions during file copy
MC truncates timestamps during file copy and drops sub-second precision.

Make use of utimensat(), introduced in Linux kernel 2.6.22 (and since
2.6.26 compatible with POSIX-1.2008).

Signed-off-by: Andrey Gursky <andrey.gursky@e-mail.ua>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2016-12-25 08:46:10 +03:00
Yury V. Zaytsev
9f47eecc91 Merge branch '3744_u7z_tests' 2016-12-24 15:30:50 +04:00
Mooffie
d4ec872f37 Ticket #3744: extfs: u7z: add tests. 2016-12-24 09:58:53 +04:00
Mooffie
fad265c5bd Ticket #3744: extfs: u7z: make it testable. 2016-12-24 09:58:53 +04:00
Yury V. Zaytsev
12dbd957c0 Merge branch '2707_extfs_u7z' 2016-12-24 09:46:13 +04:00
Mooffie
f84c14bbce Ticket #2707: extfs: u7z: print() cleanup.
AWK's print() already writes OFS between expressions.
2016-12-24 09:45:59 +04:00