Re: [RFC PATCH 0/3] btrfs-progs: Add support for running the tools from

2017-11-15 Thread David Sterba
On Wed, Nov 01, 2017 at 01:42:42AM +, Gu, Jinxiang wrote:
> > On 2017年10月31日 16:43, Gu Jinxiang wrote:
> > > Add support for running the tools from a given path (for
> > > example,/usr/bin) by setting $EXEC while running tests.
> > >
> > > Achieved:
> > > Specify the location of binary and run test like this:
> > > $ make EXEC=/usr/bin/ test
> > Any special reason to test system installed btrfs?
> > Even for system QA case, I think self test should be run at packaging time 
> > other than doing it after packaging.

This is supposed to extend the testing possibilities. The packaging
phase could run some tests, many tools run post-build tests, but we need
to manage devices and require root in general. This is not always
possible, besides that it requires to run from the sources directory.

> Just implement the project list below in github.
> .
> Add support for running the tools from a given path (git, /usr/bin, 
> /usr/local/bin), so the testsuite can be run independently.
> .

The idea is to export the testsuite files to a separate tar, run from a
script. In that case the system binaries will be preferred.

I've promoted the project task to 
https://github.com/kdave/btrfs-progs/issues/77 .
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [RFC PATCH 0/3] btrfs-progs: Add support for running the tools from

2017-10-31 Thread Gu, Jinxiang


> -Original Message-
> From: Qu Wenruo [mailto:quwenruo.bt...@gmx.com]
> Sent: Tuesday, October 31, 2017 6:36 PM
> To: Gu, Jinxiang/顾 金香 <g...@cn.fujitsu.com>; linux-btrfs@vger.kernel.org
> Cc: dste...@suse.cz
> Subject: Re: [RFC PATCH 0/3] btrfs-progs: Add support for running the tools 
> from
> 
> 
> 
> On 2017年10月31日 16:43, Gu Jinxiang wrote:
> > Add support for running the tools from a given path (for
> > example,/usr/bin) by setting $EXEC while running tests.
> >
> > Achieved:
> > Specify the location of binary and run test like this:
> > $ make EXEC=/usr/bin/ test
> 
> Any special reason to test system installed btrfs?
> 
> Even for system QA case, I think self test should be run at packaging time 
> other than doing it after packaging.

Just implement the project list below in github.
.
Add support for running the tools from a given path (git, /usr/bin, 
/usr/local/bin), so the testsuite can be run independently.
.

> 
> Thanks,
> Qu
> >
> > Not Achieved:
> > Can not run make in tests/ directory.
> > Because test-misc depends on fssum which relies on header files in
> > btrfs-progs.
> > And test-misc and test-fsck depend on btrfs-corrupt-block which is not
> > installed after installation of btrfs-progs.
> >
> > I am wondering that it is necessary or not to modify those tests to
> > run outside of btrfs-progs.
> >
> > Gu Jinxiang (3):
> >   btrfs-progs: Add EXEC parameter in Makefile
> >   btrfs-progs: Set EXEC to TOP when it not be defined
> >   btrfs-progs: Add support for running tools with given path(EXEC)
> >
> >  Makefile   | 32 +++-
> >  tests/README.md| 10 
> >  tests/cli-tests.sh |  2 +
> >  tests/cli-tests/001-btrfs/test.sh  | 20 
> >  .../cli-tests/002-balance-full-no-filters/test.sh  | 10 ++--
> >  tests/cli-tests/003-fi-resize-args/test.sh | 30 +--
> >  .../cli-tests/004-send-parent-multi-subvol/test.sh | 12 ++---
> >  tests/cli-tests/005-qgroup-show/test.sh| 14 ++---
> >  tests/cli-tests/006-qgroup-show-sync/test.sh   | 14 ++---
> >  tests/cli-tests/007-check-force/test.sh| 14 ++---
> >  .../008-subvolume-get-set-default/test.sh  | 20 
> >  tests/common   | 18 ---
> >  tests/common.convert   |  8 +--
> >  tests/convert-tests.sh |  2 +
> >  .../004-ext2-backup-superblock-ranges/test.sh  | 10 ++--
> >  .../convert-tests/005-delete-all-rollback/test.sh  |  2 +-
> >  .../007-unsupported-block-sizes/test.sh|  2 +-
> >  .../011-reiserfs-delete-all-rollback/test.sh   |  2 +-
> >  tests/fsck-tests.sh|  2 +
> >  tests/fsck-tests/012-leaf-corruption/test.sh   |  2 +-
> >  tests/fsck-tests/013-extent-tree-rebuild/test.sh   | 12 ++---
> >  tests/fsck-tests/018-leaf-crossing-stripes/test.sh |  2 +-
> >  tests/fsck-tests/020-extent-ref-cases/test.sh  |  2 +-
> >  .../021-partially-dropped-snapshot-case/test.sh|  2 +-
> >  tests/fsck-tests/022-qgroup-rescan-halfway/test.sh |  2 +-
> > tests/fsck-tests/023-qgroup-stack-overflow/test.sh |  2 +-
> >  tests/fsck-tests/024-clear-space-cache/test.sh | 10 ++--
> >  tests/fsck-tests/025-file-extents/test.sh  | 14 ++---
> >  tests/fsck-tests/026-bad-dir-item-name/test.sh |  2 +-
> >  .../028-unaligned-super-dev-sizes/test.sh  |  6 +--
> >  tests/fuzz-tests.sh|  2 +
> >  .../fuzz-tests/001-simple-check-unmounted/test.sh  |  2 +-
> >  tests/fuzz-tests/002-simple-image/test.sh  |  2 +-
> >  tests/fuzz-tests/003-multi-check-unmounted/test.sh | 12 ++---
> >  tests/fuzz-tests/004-simple-dump-tree/test.sh  |  2 +-
> >  tests/fuzz-tests/005-simple-dump-super/test.sh |  4 +-
> >  tests/fuzz-tests/006-simple-tree-stats/test.sh |  2 +-
> >  tests/fuzz-tests/007-simple-super-recover/test.sh  |  2 +-
> > tests/fuzz-tests/008-simple-chunk-recover/test.sh  |  2 +-
> >  tests/fuzz-tests/009-simple-zero-log/test.sh   |  2 +-
> >  tests/misc-tests.sh|  2 +
> >  tests/misc-tests/001-btrfstune-features/test.sh| 10 ++--
> >  tests/misc-tests/002-uuid-rewrite/test.sh  | 20 
> >  tests/misc-tests/003-zero-log/test.sh  | 16 +++---
> >  tests/misc-tests/004-shrink-fs/test.sh 

Re: [RFC PATCH 0/3] btrfs-progs: Add support for running the tools from

2017-10-31 Thread Qu Wenruo


On 2017年10月31日 16:43, Gu Jinxiang wrote:
> Add support for running the tools from a given path
> (for example,/usr/bin) by setting $EXEC while running tests.
> 
> Achieved:
> Specify the location of binary and run test like this:
> $ make EXEC=/usr/bin/ test

Any special reason to test system installed btrfs?

Even for system QA case, I think self test should be run at packaging
time other than doing it after packaging.

Thanks,
Qu
> 
> Not Achieved:
> Can not run make in tests/ directory.
> Because test-misc depends on fssum which relies on header files in
> btrfs-progs.
> And test-misc and test-fsck depend on btrfs-corrupt-block which is
> not installed after installation of btrfs-progs.
> 
> I am wondering that it is necessary or not to modify those tests to
> run outside of btrfs-progs.
> 
> Gu Jinxiang (3):
>   btrfs-progs: Add EXEC parameter in Makefile
>   btrfs-progs: Set EXEC to TOP when it not be defined
>   btrfs-progs: Add support for running tools with given path(EXEC)
> 
>  Makefile   | 32 +++-
>  tests/README.md| 10 
>  tests/cli-tests.sh |  2 +
>  tests/cli-tests/001-btrfs/test.sh  | 20 
>  .../cli-tests/002-balance-full-no-filters/test.sh  | 10 ++--
>  tests/cli-tests/003-fi-resize-args/test.sh | 30 +--
>  .../cli-tests/004-send-parent-multi-subvol/test.sh | 12 ++---
>  tests/cli-tests/005-qgroup-show/test.sh| 14 ++---
>  tests/cli-tests/006-qgroup-show-sync/test.sh   | 14 ++---
>  tests/cli-tests/007-check-force/test.sh| 14 ++---
>  .../008-subvolume-get-set-default/test.sh  | 20 
>  tests/common   | 18 ---
>  tests/common.convert   |  8 +--
>  tests/convert-tests.sh |  2 +
>  .../004-ext2-backup-superblock-ranges/test.sh  | 10 ++--
>  .../convert-tests/005-delete-all-rollback/test.sh  |  2 +-
>  .../007-unsupported-block-sizes/test.sh|  2 +-
>  .../011-reiserfs-delete-all-rollback/test.sh   |  2 +-
>  tests/fsck-tests.sh|  2 +
>  tests/fsck-tests/012-leaf-corruption/test.sh   |  2 +-
>  tests/fsck-tests/013-extent-tree-rebuild/test.sh   | 12 ++---
>  tests/fsck-tests/018-leaf-crossing-stripes/test.sh |  2 +-
>  tests/fsck-tests/020-extent-ref-cases/test.sh  |  2 +-
>  .../021-partially-dropped-snapshot-case/test.sh|  2 +-
>  tests/fsck-tests/022-qgroup-rescan-halfway/test.sh |  2 +-
>  tests/fsck-tests/023-qgroup-stack-overflow/test.sh |  2 +-
>  tests/fsck-tests/024-clear-space-cache/test.sh | 10 ++--
>  tests/fsck-tests/025-file-extents/test.sh  | 14 ++---
>  tests/fsck-tests/026-bad-dir-item-name/test.sh |  2 +-
>  .../028-unaligned-super-dev-sizes/test.sh  |  6 +--
>  tests/fuzz-tests.sh|  2 +
>  .../fuzz-tests/001-simple-check-unmounted/test.sh  |  2 +-
>  tests/fuzz-tests/002-simple-image/test.sh  |  2 +-
>  tests/fuzz-tests/003-multi-check-unmounted/test.sh | 12 ++---
>  tests/fuzz-tests/004-simple-dump-tree/test.sh  |  2 +-
>  tests/fuzz-tests/005-simple-dump-super/test.sh |  4 +-
>  tests/fuzz-tests/006-simple-tree-stats/test.sh |  2 +-
>  tests/fuzz-tests/007-simple-super-recover/test.sh  |  2 +-
>  tests/fuzz-tests/008-simple-chunk-recover/test.sh  |  2 +-
>  tests/fuzz-tests/009-simple-zero-log/test.sh   |  2 +-
>  tests/misc-tests.sh|  2 +
>  tests/misc-tests/001-btrfstune-features/test.sh| 10 ++--
>  tests/misc-tests/002-uuid-rewrite/test.sh  | 20 
>  tests/misc-tests/003-zero-log/test.sh  | 16 +++---
>  tests/misc-tests/004-shrink-fs/test.sh | 14 ++---
>  .../005-convert-progress-thread-crash/test.sh  |  2 +-
>  .../misc-tests/006-image-on-missing-device/test.sh | 10 ++--
>  tests/misc-tests/007-subvolume-sync/test.sh| 18 +++
>  tests/misc-tests/008-leaf-crossing-stripes/test.sh |  4 +-
>  .../009-subvolume-sync-must-wait/test.sh   | 22 
>  .../010-convert-delete-ext2-subvol/test.sh | 10 ++--
>  tests/misc-tests/011-delete-missing-device/test.sh | 18 +++
>  tests/misc-tests/012-find-root-no-result/test.sh   |  4 +-
>  tests/misc-tests/013-subvolume-sync-crash/test.sh  | 20 
>  tests/misc-tests/014-filesystem-label/test.sh  | 22 
>  tests/misc-tests/015-dump-super-garbage/test.sh| 18 +++
>  tests/misc-tests/016-send-clone-src/test.sh| 12 ++---
>  .../017-recv-stream-malformatted/test.sh   |  8 +--
>  tests/misc-tests/018-recv-end-of-stream/test.sh| 60 
> +++---
>  .../019-receive-clones-on-munted-subvol/test.sh| 38 +++---
>  .../020-fix-superblock-corruption/test.sh  |  8 +--
>  tests/misc-tests/021-image-multi-devices/test.sh   |  6 

[RFC PATCH 0/3] btrfs-progs: Add support for running the tools from

2017-10-31 Thread Gu Jinxiang
Add support for running the tools from a given path
(for example,/usr/bin) by setting $EXEC while running tests.

Achieved:
Specify the location of binary and run test like this:
$ make EXEC=/usr/bin/ test

Not Achieved:
Can not run make in tests/ directory.
Because test-misc depends on fssum which relies on header files in
btrfs-progs.
And test-misc and test-fsck depend on btrfs-corrupt-block which is
not installed after installation of btrfs-progs.

I am wondering that it is necessary or not to modify those tests to
run outside of btrfs-progs.

Gu Jinxiang (3):
  btrfs-progs: Add EXEC parameter in Makefile
  btrfs-progs: Set EXEC to TOP when it not be defined
  btrfs-progs: Add support for running tools with given path(EXEC)

 Makefile   | 32 +++-
 tests/README.md| 10 
 tests/cli-tests.sh |  2 +
 tests/cli-tests/001-btrfs/test.sh  | 20 
 .../cli-tests/002-balance-full-no-filters/test.sh  | 10 ++--
 tests/cli-tests/003-fi-resize-args/test.sh | 30 +--
 .../cli-tests/004-send-parent-multi-subvol/test.sh | 12 ++---
 tests/cli-tests/005-qgroup-show/test.sh| 14 ++---
 tests/cli-tests/006-qgroup-show-sync/test.sh   | 14 ++---
 tests/cli-tests/007-check-force/test.sh| 14 ++---
 .../008-subvolume-get-set-default/test.sh  | 20 
 tests/common   | 18 ---
 tests/common.convert   |  8 +--
 tests/convert-tests.sh |  2 +
 .../004-ext2-backup-superblock-ranges/test.sh  | 10 ++--
 .../convert-tests/005-delete-all-rollback/test.sh  |  2 +-
 .../007-unsupported-block-sizes/test.sh|  2 +-
 .../011-reiserfs-delete-all-rollback/test.sh   |  2 +-
 tests/fsck-tests.sh|  2 +
 tests/fsck-tests/012-leaf-corruption/test.sh   |  2 +-
 tests/fsck-tests/013-extent-tree-rebuild/test.sh   | 12 ++---
 tests/fsck-tests/018-leaf-crossing-stripes/test.sh |  2 +-
 tests/fsck-tests/020-extent-ref-cases/test.sh  |  2 +-
 .../021-partially-dropped-snapshot-case/test.sh|  2 +-
 tests/fsck-tests/022-qgroup-rescan-halfway/test.sh |  2 +-
 tests/fsck-tests/023-qgroup-stack-overflow/test.sh |  2 +-
 tests/fsck-tests/024-clear-space-cache/test.sh | 10 ++--
 tests/fsck-tests/025-file-extents/test.sh  | 14 ++---
 tests/fsck-tests/026-bad-dir-item-name/test.sh |  2 +-
 .../028-unaligned-super-dev-sizes/test.sh  |  6 +--
 tests/fuzz-tests.sh|  2 +
 .../fuzz-tests/001-simple-check-unmounted/test.sh  |  2 +-
 tests/fuzz-tests/002-simple-image/test.sh  |  2 +-
 tests/fuzz-tests/003-multi-check-unmounted/test.sh | 12 ++---
 tests/fuzz-tests/004-simple-dump-tree/test.sh  |  2 +-
 tests/fuzz-tests/005-simple-dump-super/test.sh |  4 +-
 tests/fuzz-tests/006-simple-tree-stats/test.sh |  2 +-
 tests/fuzz-tests/007-simple-super-recover/test.sh  |  2 +-
 tests/fuzz-tests/008-simple-chunk-recover/test.sh  |  2 +-
 tests/fuzz-tests/009-simple-zero-log/test.sh   |  2 +-
 tests/misc-tests.sh|  2 +
 tests/misc-tests/001-btrfstune-features/test.sh| 10 ++--
 tests/misc-tests/002-uuid-rewrite/test.sh  | 20 
 tests/misc-tests/003-zero-log/test.sh  | 16 +++---
 tests/misc-tests/004-shrink-fs/test.sh | 14 ++---
 .../005-convert-progress-thread-crash/test.sh  |  2 +-
 .../misc-tests/006-image-on-missing-device/test.sh | 10 ++--
 tests/misc-tests/007-subvolume-sync/test.sh| 18 +++
 tests/misc-tests/008-leaf-crossing-stripes/test.sh |  4 +-
 .../009-subvolume-sync-must-wait/test.sh   | 22 
 .../010-convert-delete-ext2-subvol/test.sh | 10 ++--
 tests/misc-tests/011-delete-missing-device/test.sh | 18 +++
 tests/misc-tests/012-find-root-no-result/test.sh   |  4 +-
 tests/misc-tests/013-subvolume-sync-crash/test.sh  | 20 
 tests/misc-tests/014-filesystem-label/test.sh  | 22 
 tests/misc-tests/015-dump-super-garbage/test.sh| 18 +++
 tests/misc-tests/016-send-clone-src/test.sh| 12 ++---
 .../017-recv-stream-malformatted/test.sh   |  8 +--
 tests/misc-tests/018-recv-end-of-stream/test.sh| 60 +++---
 .../019-receive-clones-on-munted-subvol/test.sh| 38 +++---
 .../020-fix-superblock-corruption/test.sh  |  8 +--
 tests/misc-tests/021-image-multi-devices/test.sh   |  6 +--
 .../022-filesystem-du-on-empty-subvol/test.sh  | 12 ++---
 .../023-device-usage-with-missing-device/test.sh   | 10 ++--
 .../misc-tests/024-inspect-internal-rootid/test.sh | 24 -
 tests/misc-tests/025-zstd-compression/test.sh  |  6 +--
 .../026-image-non-printable-chars/test.sh  |  8 +--
 .../027-subvol-list-deleted-toplevel/test.sh   |  6 +--