From a66caf9b7ae476f526a706d31ed5ef4f8d361b00 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 25 Aug 2020 14:12:01 -0700 Subject: parse scroll requests --- tests/files/scroll/DELETE_scroll_path.txt | 1 - tests/files/scroll/DELETE_scroll_path.txt.fails | 1 + tests/parse_es_requests.rs | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) delete mode 100644 tests/files/scroll/DELETE_scroll_path.txt create mode 100644 tests/files/scroll/DELETE_scroll_path.txt.fails (limited to 'tests') diff --git a/tests/files/scroll/DELETE_scroll_path.txt b/tests/files/scroll/DELETE_scroll_path.txt deleted file mode 100644 index 7910ed8..0000000 --- a/tests/files/scroll/DELETE_scroll_path.txt +++ /dev/null @@ -1 +0,0 @@ -DELETE /_search/scroll/DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ== diff --git a/tests/files/scroll/DELETE_scroll_path.txt.fails b/tests/files/scroll/DELETE_scroll_path.txt.fails new file mode 100644 index 0000000..7910ed8 --- /dev/null +++ b/tests/files/scroll/DELETE_scroll_path.txt.fails @@ -0,0 +1 @@ +DELETE /_search/scroll/DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ== diff --git a/tests/parse_es_requests.rs b/tests/parse_es_requests.rs index bd38ce6..d453392 100644 --- a/tests/parse_es_requests.rs +++ b/tests/parse_es_requests.rs @@ -78,3 +78,22 @@ fn filter_search_requests() { rt.block_on(filter_request(req, &config)).unwrap(); } } + +#[test] +fn filter_scroll_requests() { + + let file_paths = fs::read_dir("tests/files/scroll").unwrap(); + let mut config = ProxyConfig::default(); + config.allow_all_indices = Some(true); + let mut rt = tokio::runtime::Runtime::new().unwrap(); + + for path in file_paths { + let path = path.unwrap().path(); + if path.extension() != Some(OsStr::new("txt")) { + continue + } + println!(" filtering: {}", path.display()); + let req = common::load_request(&path); + rt.block_on(filter_request(req, &config)).unwrap(); + } +} -- cgit v1.2.3