From 5d7569fde4524ebacbdefe5a1d27c9af5a8138ea Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Tue, 17 Dec 2024 11:54:54 -0500 Subject: [PATCH] Added tests for /_validate/query. (#739) * Added tests for /_validate/query. Signed-off-by: dblock * Added retry for https://github.com/opensearch-project/opensearch-api-specification/issues/738. Signed-off-by: dblock --------- Signed-off-by: dblock --- tests/default/_core/validate/query.yaml | 17 +++++++++++++++++ tests/default/indices/validate/query.yaml | 23 +++++------------------ tests/plugins/security/api/nodesdn.yaml | 2 ++ 3 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 tests/default/_core/validate/query.yaml diff --git a/tests/default/_core/validate/query.yaml b/tests/default/_core/validate/query.yaml new file mode 100644 index 000000000..1c5849c01 --- /dev/null +++ b/tests/default/_core/validate/query.yaml @@ -0,0 +1,17 @@ +$schema: ../../../../json_schemas/test_story.schema.yaml + +description: Test validating queries. +chapters: + - synopsis: Validate a query. + path: /_validate/query + method: + - GET + - POST + request: + payload: + query: + match_all: {} + response: + status: 200 + payload: + valid: true diff --git a/tests/default/indices/validate/query.yaml b/tests/default/indices/validate/query.yaml index 264579058..55ced1fb8 100644 --- a/tests/default/indices/validate/query.yaml +++ b/tests/default/indices/validate/query.yaml @@ -1,6 +1,6 @@ $schema: ../../../../json_schemas/test_story.schema.yaml -description: Test validating queries for a specific index using both GET and POST methods. +description: Test validating queries for a specific index. epilogues: - path: /movies method: DELETE @@ -18,9 +18,11 @@ prologues: - {create: {_index: movies, _id: movie2}} - {director: Nicolas Winding Refn, title: Drive, year: 1960} chapters: - - synopsis: Validate a match query (GET). + - synopsis: Validate a match query. path: /{index}/_validate/query - method: GET + method: + - GET + - POST parameters: index: movies request: @@ -32,18 +34,3 @@ chapters: status: 200 payload: valid: true - - - synopsis: Validate a match query (POST). - path: /{index}/_validate/query - method: POST - parameters: - index: movies - request: - payload: - query: - match: - title: Drive - response: - status: 200 - payload: - valid: true \ No newline at end of file diff --git a/tests/plugins/security/api/nodesdn.yaml b/tests/plugins/security/api/nodesdn.yaml index 176a748c9..6a4611ef3 100644 --- a/tests/plugins/security/api/nodesdn.yaml +++ b/tests/plugins/security/api/nodesdn.yaml @@ -15,6 +15,8 @@ chapters: payload: nodes_dn: - CN=cluster.example.com + retry: + count: 3 response: status: 201 payload: