Loading tests/tests.cpp +1 −120 Original line number Diff line number Diff line Loading @@ -389,67 +389,7 @@ SCENARIO("POSIX reads", "[flex_stager][posix_reads]") { } } SCENARIO("Posix writes", "[flex_stager][posix_writes]") { std::size_t file_size = 1000; // GENERATE(1000, 10000); [[maybe_unused]] ascii_data_generator ascii_gen{512}; [[maybe_unused]] random_data_generator rng{ catch2_seed, 0, std::numeric_limits<std::uint64_t>::max() - 1u}; GIVEN("Some input datasets from a POSIX storage system") { REQUIRE(!server_address.empty()); cargo::server server{server_address}; const auto sources = prepare_datasets( cargo::dataset::type::posix, "pxw-source-dataset-{}", NDATASETS); const auto targets = prepare_datasets(cargo::dataset::type::parallel, "pxw-target-dataset-{}", NDATASETS); static std::vector<scoped_file> input_files; input_files.reserve(sources.size()); for(const auto& d : sources) { input_files.emplace_back( create_temporary_file(d.path(), file_size, rng)); } // ensure there are no danling output files from another test run std::for_each(targets.begin(), targets.end(), [](auto&& dataset) { std::filesystem::remove(dataset.path()); }); WHEN("Transferring datasets to a PFS") { const auto tx = cargo::transfer_datasets(server, sources, targets); // wait for the transfer to complete auto s = tx.wait(); CAPTURE(s.error()); REQUIRE(s.state() == cargo::transfer_state::completed); REQUIRE(s.error() == cargo::error_code::success); THEN("Output datasets are identical to input datasets") { std::vector<scoped_file> output_files; std::transform(targets.cbegin(), targets.cend(), std::back_inserter(output_files), [](auto&& target) { return scoped_file{target.path()}; }); for(std::size_t i = 0; i < input_files.size(); ++i) { REQUIRE(::equal(input_files[i].path(), targets[i].path())); } } } } } SCENARIO("Big POSIX reads", "[flex_stager][Big_posix_reads]") { SCENARIO("Big POSIX", "[flex_stager][Big_posix]") { random_data_generator rng{catch2_seed, 0, std::numeric_limits<std::uint64_t>::max() - 1u}; Loading Loading @@ -509,65 +449,6 @@ SCENARIO("Big POSIX reads", "[flex_stager][Big_posix_reads]") { } } SCENARIO("Big Posix writes", "[flex_stager][big_posix_writes]") { std::size_t file_size = 712*1024; // GENERATE(1000, 10000); [[maybe_unused]] ascii_data_generator ascii_gen{512}; [[maybe_unused]] random_data_generator rng{ catch2_seed, 0, std::numeric_limits<std::uint64_t>::max() - 1u}; GIVEN("Some input datasets from a POSIX storage system") { REQUIRE(!server_address.empty()); cargo::server server{server_address}; const auto sources = prepare_datasets( cargo::dataset::type::posix, "pxbw-source-dataset-{}", NDATASETS); const auto targets = prepare_datasets(cargo::dataset::type::parallel, "pxbw-target-dataset-{}", NDATASETS); static std::vector<scoped_file> input_files; input_files.reserve(sources.size()); for(const auto& d : sources) { input_files.emplace_back( create_temporary_file(d.path(), file_size, rng)); } // ensure there are no danling output files from another test run std::for_each(targets.begin(), targets.end(), [](auto&& dataset) { std::filesystem::remove(dataset.path()); }); WHEN("Transferring datasets to a PFS") { const auto tx = cargo::transfer_datasets(server, sources, targets); // wait for the transfer to complete auto s = tx.wait(); CAPTURE(s.error()); REQUIRE(s.state() == cargo::transfer_state::completed); REQUIRE(s.error() == cargo::error_code::success); THEN("Output datasets are identical to input datasets") { std::vector<scoped_file> output_files; std::transform(targets.cbegin(), targets.cend(), std::back_inserter(output_files), [](auto&& target) { return scoped_file{target.path()}; }); for(std::size_t i = 0; i < input_files.size(); ++i) { REQUIRE(::equal(input_files[i].path(), targets[i].path())); } } } } } int main(int argc, char* argv[]) { Loading Loading
tests/tests.cpp +1 −120 Original line number Diff line number Diff line Loading @@ -389,67 +389,7 @@ SCENARIO("POSIX reads", "[flex_stager][posix_reads]") { } } SCENARIO("Posix writes", "[flex_stager][posix_writes]") { std::size_t file_size = 1000; // GENERATE(1000, 10000); [[maybe_unused]] ascii_data_generator ascii_gen{512}; [[maybe_unused]] random_data_generator rng{ catch2_seed, 0, std::numeric_limits<std::uint64_t>::max() - 1u}; GIVEN("Some input datasets from a POSIX storage system") { REQUIRE(!server_address.empty()); cargo::server server{server_address}; const auto sources = prepare_datasets( cargo::dataset::type::posix, "pxw-source-dataset-{}", NDATASETS); const auto targets = prepare_datasets(cargo::dataset::type::parallel, "pxw-target-dataset-{}", NDATASETS); static std::vector<scoped_file> input_files; input_files.reserve(sources.size()); for(const auto& d : sources) { input_files.emplace_back( create_temporary_file(d.path(), file_size, rng)); } // ensure there are no danling output files from another test run std::for_each(targets.begin(), targets.end(), [](auto&& dataset) { std::filesystem::remove(dataset.path()); }); WHEN("Transferring datasets to a PFS") { const auto tx = cargo::transfer_datasets(server, sources, targets); // wait for the transfer to complete auto s = tx.wait(); CAPTURE(s.error()); REQUIRE(s.state() == cargo::transfer_state::completed); REQUIRE(s.error() == cargo::error_code::success); THEN("Output datasets are identical to input datasets") { std::vector<scoped_file> output_files; std::transform(targets.cbegin(), targets.cend(), std::back_inserter(output_files), [](auto&& target) { return scoped_file{target.path()}; }); for(std::size_t i = 0; i < input_files.size(); ++i) { REQUIRE(::equal(input_files[i].path(), targets[i].path())); } } } } } SCENARIO("Big POSIX reads", "[flex_stager][Big_posix_reads]") { SCENARIO("Big POSIX", "[flex_stager][Big_posix]") { random_data_generator rng{catch2_seed, 0, std::numeric_limits<std::uint64_t>::max() - 1u}; Loading Loading @@ -509,65 +449,6 @@ SCENARIO("Big POSIX reads", "[flex_stager][Big_posix_reads]") { } } SCENARIO("Big Posix writes", "[flex_stager][big_posix_writes]") { std::size_t file_size = 712*1024; // GENERATE(1000, 10000); [[maybe_unused]] ascii_data_generator ascii_gen{512}; [[maybe_unused]] random_data_generator rng{ catch2_seed, 0, std::numeric_limits<std::uint64_t>::max() - 1u}; GIVEN("Some input datasets from a POSIX storage system") { REQUIRE(!server_address.empty()); cargo::server server{server_address}; const auto sources = prepare_datasets( cargo::dataset::type::posix, "pxbw-source-dataset-{}", NDATASETS); const auto targets = prepare_datasets(cargo::dataset::type::parallel, "pxbw-target-dataset-{}", NDATASETS); static std::vector<scoped_file> input_files; input_files.reserve(sources.size()); for(const auto& d : sources) { input_files.emplace_back( create_temporary_file(d.path(), file_size, rng)); } // ensure there are no danling output files from another test run std::for_each(targets.begin(), targets.end(), [](auto&& dataset) { std::filesystem::remove(dataset.path()); }); WHEN("Transferring datasets to a PFS") { const auto tx = cargo::transfer_datasets(server, sources, targets); // wait for the transfer to complete auto s = tx.wait(); CAPTURE(s.error()); REQUIRE(s.state() == cargo::transfer_state::completed); REQUIRE(s.error() == cargo::error_code::success); THEN("Output datasets are identical to input datasets") { std::vector<scoped_file> output_files; std::transform(targets.cbegin(), targets.cend(), std::back_inserter(output_files), [](auto&& target) { return scoped_file{target.path()}; }); for(std::size_t i = 0; i < input_files.size(); ++i) { REQUIRE(::equal(input_files[i].path(), targets[i].path())); } } } } } int main(int argc, char* argv[]) { Loading