Commit Graph

14094 Commits

Author SHA1 Message Date
Andrew Borodin
aa6055b6aa Ticket #3693: code cleanup before 4.8.19 release.
WRadio: remove unused 'state' field.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2017-01-22 18:44:22 +03:00
Mooffie
43d7fce730 Merge branch '3750_extfs_rpm_trans_scripts'
* 3750_extfs_rpm_trans_scripts:
  extfs: rpm: fix tests for transaction scripts.
  Ticket #3750: Adding support for RPM transaction scripts.
2017-01-17 12:12:59 +02:00
Mooffie
65299b8310 extfs: rpm: fix tests for transaction scripts.
We update our .output file to include the entries
`INFO/SCRIPTS/{PRE,POST}TRANS[PROG]`, which the rpm helper now emits.

(Tip: here's how we do this: we delete the output file and recreate it by
running the tester thus: "./run --create-output".)

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 17:14:38 +02:00
Jiri Tyr
4310b066e2 Ticket #3750: Adding support for RPM transaction scripts.
Adding support for PRETRANS, PRETRANSPROG, POSTTRANS and
POSTTRANSPROG RPM tags which allow the relevant scripts to be visible
in the INFO/SCRIPTS vfs directory.

Signed-off-by: Jiri Tyr <jiri.tyr@gmail.com>
Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 17:01:31 +02:00
Mooffie
91ca170e1b Merge branch '3751_extfs_rpm_tests'
* 3751_extfs_rpm_tests:
  extfs: rpm: move misc/* to misc/rpm/*.
  extfs: rpm: add test for a custom package.
  extfs: rpm: add tests.
  extfs: rpm: introduce the rpm2tags tool.
  extfs: rpm: make it testable.
  Ticket #3751: extfs: rpm: introduce the $RPM_QUERY_FMT variable.
2017-01-16 15:00:48 +02:00
Mooffie
a3b9b95c2d extfs: rpm: move misc/* to misc/rpm/*.
In the future we will probably place each helper's tests in a separate folder.
We'll then get rid of this 'misc/rpm' folder by moving it there.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie
b10f34e898 extfs: rpm: add test for a custom package.
We use a 'spec' contributed by Jiri Tyr.

We keep the previous test (by renaming rpm.* to rpm.glib.*), though, in case
somebody wants to work on data from "the real world".

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie
4b8785ead6 extfs: rpm: add tests.
Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie
e3cef7576b extfs: rpm: introduce the rpm2tags tool.
This is a preliminary step before being able to write tests for our rpm helper.

We introduce 'rpm2tags', a tool for converting RPM packages to parsable text
files. This will enable us to write tests that can run even where the 'rpm'
program isn't installed.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie
97bc2af3b2 extfs: rpm: make it testable.
The way we make this helper testable is a bit different than with other
helpers:

While in other helpers we make it possible to override just one or two
variables, here we make it possible to inject a code snippet into it. This is a
more powerful approach which lets us override even functions, as will be shown
in a following patch.

(As for relocating the "AllTAGS=..." line: all non-declarative code needs to be
moved past our new injection point, or else this code won't be affected by the
injection. BTW, the "$1" on that line isn't used; a vestige from old days.)

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie
65ebc83f88 Ticket #3751: extfs: rpm: introduce the $RPM_QUERY_FMT variable.
This minor refactoring will enable us to make this helper testable.

Instead of doing:

    $RPM -qp --qf a b c

we are now doing:

    $RPM_QUERY_FMT a b c

In a future patch we'll then be able to point $RPM_QUERY_FMT to some mock
program.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:58:07 +02:00
Mooffie
3078e74afe Merge branch '3757_two_plus_columns_broken'
* 3757_two_plus_columns_broken:
  Documentation: panels nowadays can display more than 2 columns.
  Ticket #3757: cannot show more than one column in user defined listing mode.
2017-01-16 13:57:44 +02:00
Mooffie
76c2c42bd9 Documentation: panels nowadays can display more than 2 columns.
In the past panels supported up to 2 "columns" only. We update the
documentation.

Note: a naive fix is to change it to say "After the panel size, you may specify
the number of columns to display in the panel". Unfortunately, users may think
by "columns" we mean "fields", so we have to word it differrently.

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 13:54:24 +02:00
Mooffie
05661eda1d Ticket #3757: cannot show more than one column in user defined listing mode.
In user-defined listing mode, the format string lets us specify how many
columns to display. E.g., for 3 columns:

    "half 3 type name | size | perm"

However, parse_panel_size() reads this digit only when `panel->list_type ==
list_brief`. We remove this check.

Incidentally, the assignment there to `panel->brief_cols` isn't needed. In
list_brief mode, `panel->brief_cols` is already set.

We also fix a related problem in the mouse handler: it erroneously assumes
`panel->list_cols > 1` happens only in list_brief mode.

(These bugs were introduced in commit fb474bc1c157.)

Signed-off-by: Mooffie <mooffie@gmail.com>
2017-01-16 00:23:03 +02:00
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