Commit Graph

47 Commits

Author SHA1 Message Date
Ming-Hung Tsai
9ea75ba113 [tests] Move cache_metadata_size tests to Rust
Changes for the Rust version in corresponding to command line changes:
- Disable tests 'all_args_agree' and 'conradictory_info_fails'
- Test conflicts between --nr-blocks and {--device-size|--block-size}
2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
cbc3baba45 [tests] Move era_dump tests to Rust 2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
8d3f65244d [tests] Move era_restore tests to Rust 2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
4cfe93570c [tests] Add era test fixtures 2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
321fce882f [tests] Move era_check tests to Rust 2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
c8a1da1df9 [all] Apply cargo fmt, and fix clippy warnings 2021-10-20 20:23:27 +08:00
Joe Thornber
98be38dc4c [tests] Improve stdout/stderr logging when running sub processes 2021-10-19 14:20:47 +01:00
Joe Thornber
6c5405ccf8 [tests] Get the run_* functions to log what they're doing. 2021-10-18 16:59:17 +01:00
Joe Thornber
024554c987 Merge rust tools into a single pdata_tools exe 2021-10-11 12:07:26 +01:00
Ming-Hung Tsai
5abb92838c [tests] Port the remaining cache tests 2021-09-22 17:07:56 +08:00
Ming-Hung Tsai
d436f35ed3 [thin_dump/thin_repair/thin_restore (rust)] Fix errors in tests
- Move error messages to stderr
- Fix the transaction_id and data_block_size in test fixture,
  and check the data_block_size in thin_restore.
- Disable the missing_something tests for Rust. The transaction_id
  and nr_data_blocks now could be recovered automatically.
- Limit the use of override options in test cases. Only broken
  superblocks could be overridden, and the provided values
  should be compatible to the original metadata.
- Remove unused option
2021-09-22 17:06:28 +08:00
Ming-Hung Tsai
2f22a8c55d [all (rust)] Fix errors in testing input option
- Fix file mode bits checking
- Return error reason from stat
2021-09-22 17:05:59 +08:00
Ming-Hung Tsai
59e44667a9 [tests] Port cache_restore tests 2021-09-16 21:55:46 +08:00
Ming-Hung Tsai
9253117132 [tests] Add cache fixtures
- Generate temp xml and metadata files
- Correct existing tests to use cache fixtures
- Fix cache xml generation
2021-09-16 21:55:46 +08:00
Ming-Hung Tsai
aaa84aa35a [tests] Enable tests for rust thin_repair 2021-09-16 21:55:46 +08:00
Ming-Hung Tsai
ea8dcb54d0 [tests] Fix the file size for testing 2021-09-16 21:55:46 +08:00
Ming-Hung Tsai
737cf2f67d [tests] Refine trait names 2021-09-16 21:55:20 +08:00
Ming-Hung Tsai
3dc01bf962 [tests] Use IntoIterator on the array argument (requires Rust 1.53) 2021-07-27 23:51:20 +08:00
Ming-Hung Tsai
7002a8ae8d [all (rust)] Pull out structures for intermediate representation
Also fix the data type for thin timestamp
2021-07-21 18:46:06 +08:00
Ming-Hung Tsai
222b4f0902 [tests] Do not perform Path to str conversion for compatibility 2021-07-21 18:00:20 +08:00
Ming-Hung Tsai
16190f0f9a [tests] Pull out common submodules
New modules: fixture, process, program, target, and thin
2021-07-21 17:50:34 +08:00
Ming-Hung Tsai
66b49e6f3d [tests] Change the path type to OsString for compatibility 2021-07-21 17:27:13 +08:00
Ming-Hung Tsai
f395bab7be [tests] Use traits to specify test parameters
To deal with variety in target attributes and their expected outputs,
the test parameters are categorized into traits, thus the test program
could define test parameters in a more structured way, without having
to pass multiple tightly-coupled parameters to test functions.
2021-07-09 01:22:22 +08:00
Ming-Hung Tsai
12ef69c31b [tests] Pull out common tests on i/o options into reusable modules
- Introduce modules for testing input/output options
- Provide macros for generating test cases
- Hide details of subprocess execution
2021-07-08 22:02:44 +08:00
Ming-Hung Tsai
6660fde3c4 [tests] Refine the test naming and error messages
- Make the naming of test cases less ambiguous, e.g., rename
  "missing_input_file" to "missing_input_arg" or "input_file_not_found"
- Unify the error messages on input/output options
2021-07-08 01:05:15 +08:00
Kay Lin
c18cd42d35 [build] Update dependencies
- Update crc32c to 0.6, which allows it to be built on AArch64.

  - Update base64 to 0.13
  - Update byteorder to 0.14
  - Update io-uring to 0.4
  - Update libc to 0.2.83
  - Update nix to 0.19
  - Update nom to 6.0.1
  - Update quick-xml to 0.20
  - Update rand to 0.8
  - Update tempfile to 3.2
  - Update tui to 0.14

Signed-off-by: Kay Lin <i@v2bv.net>
2021-06-26 00:08:58 +08:00
Ming-Hung Tsai
fba2adbe56 [tests] Fix minor test errors
- Fix command line arguments
- Adapt error messages for rust implementations
2021-06-21 23:27:51 +08:00
Ming-Hung Tsai
bfc7f96d9f [tests] Enable testing the rust targets
This is a temporary solution for development.
Usage: cargo test --features rust_tests
2021-06-21 23:27:51 +08:00
Ming-Hung Tsai
5ecae3ad88 [tests] Fix numeric literal annotation 2021-05-28 03:19:42 +08:00
Ming-Hung Tsai
5baeab4a5c Merge branch 'main' into rust-cache-tools 2021-05-11 23:16:08 +08:00
Ming-Hung Tsai
43e433149b [all] Apply cargo fmt 2021-05-04 16:10:23 +08:00
Ming-Hung Tsai
74fcb9d505 [cache (rust)] Fix data types 2021-02-26 23:31:12 +08:00
Joe Thornber
7834d661e2 [thin_check (rust)] auto repair space map leaks 2020-08-19 14:31:01 +01:00
Joe Thornber
7466cd7182 [functional-tests (rust)] TestDir now creates dir in ./
O_DIRECT doesn't work with /tmp/
2020-08-14 10:54:31 +01:00
Joe Thornber
2fa732a93c [functional tests] Port some of Hank's sh tests to Rust.
Run with 'cargo test'
2020-08-13 14:20:29 +01:00
Joe Thornber
8f76371bb2 [functional-tests] Fix clippy warnings 2020-08-07 15:41:21 +01:00
Joe Thornber
fa4ea3e2d9 [functional-tests] port some of the cache_check tests to Rust 2020-08-07 14:30:00 +01:00
Joe Thornber
d2678fdf27 [functional-tests] port thin_metadata_pack tests to Rust.
cargo test
2020-08-05 09:09:18 +01:00
Joe Thornber
23568aaa11 [functional-tests] port thin_delta tests to rust.
cargo test
2020-08-05 08:24:52 +01:00
Joe Thornber
4ac428128a [functional-tests (rust)] port thin_repair tests to rust.
cargo test
2020-08-04 11:30:46 +01:00
Joe Thornber
39822a7165 [functional-tests (rust)] squash warnings 2020-08-03 10:59:19 +01:00
Joe Thornber
9552cb4817 [functional-tests] Port thin_rmap tests to Rust.
cargo test
2020-08-03 10:47:03 +01:00
Joe Thornber
ad29fe65fa [functional-tests] Use thin_restore macro 2020-07-31 16:34:04 +01:00
Joe Thornber
baf1fe325f [functional-tests] Move thin_dump tests to Rust.
cargo test
2020-07-31 16:31:10 +01:00
Joe Thornber
78db9a24fa [functional-tests (rust)] factor out TestDir 2020-07-31 14:26:22 +01:00
Joe Thornber
084a26bf85 [functional-tests] Recode thin_restore tests in Rust.
Now part of 'cargo test'
2020-07-31 12:12:40 +01:00
Joe Thornber
fcfcc60b89 [functional-tests] Move thin_check functional tests to Rust.
They'll be run as part of 'cargo test' now.
2020-07-31 11:04:12 +01:00