From 9ced3eff62be0d8c04b8a37a91edbd2c0179b0c0 Mon Sep 17 00:00:00 2001 From: Tokesh Date: Sun, 17 Nov 2024 17:51:12 +0500 Subject: [PATCH] divide one file to few smaller Signed-off-by: Tokesh --- .../{replica.yaml => autofollow.yaml} | 74 +++++----------- tests/plugins/replication/index.yaml | 74 ++++++++++++++++ tests/plugins/replication/stats.yaml | 86 +++++++++++++++++++ 3 files changed, 180 insertions(+), 54 deletions(-) rename tests/plugins/replication/{replica.yaml => autofollow.yaml} (70%) create mode 100644 tests/plugins/replication/index.yaml create mode 100644 tests/plugins/replication/stats.yaml diff --git a/tests/plugins/replication/replica.yaml b/tests/plugins/replication/autofollow.yaml similarity index 70% rename from tests/plugins/replication/replica.yaml rename to tests/plugins/replication/autofollow.yaml index 65676fe98..297cc1460 100644 --- a/tests/plugins/replication/replica.yaml +++ b/tests/plugins/replication/autofollow.yaml @@ -30,22 +30,7 @@ prologues: remote: leader-cluster: seeds: ['172.22.0.3:9300'] -epilogues: - - path: /_plugins/_replication/{index}/_stop - method: POST - parameters: - index: books-names - request: - payload: {} - - path: /books-names - method: DELETE - status: [200, 404] - - path: /books - method: DELETE - status: [200, 404] -chapters: - - synopsis: Start replication. - path: /_plugins/_replication/{index}/_start + - path: /_plugins/_replication/{index}/_start version: '>= 1.1' method: PUT parameters: @@ -59,45 +44,20 @@ chapters: follower_cluster_role: all_access response: status: 200 - - synopsis: Get replication stats. - path: /_plugins/_replication/{index}/_status - version: '>= 1.1' - method: GET - parameters: - index: books-names - response: - status: 200 - - synopsis: Get leader stats. - path: /_plugins/_replication/leader_stats - version: '>= 1.1' - method: GET - response: - status: 200 - - synopsis: Get follower stats. - path: /_plugins/_replication/follower_stats - version: '>= 1.1' - method: GET - response: - status: 200 - - synopsis: Get auto-follow stats. - path: /_plugins/_replication/autofollow_stats - version: '>= 1.1' - method: GET - response: - status: 200 - - synopsis: Update settings. - path: /_plugins/_replication/{index}/_update - version: '>= 1.1' - method: PUT - parameters: +epilogues: + - path: /_plugins/_replication/{index}/_stop + method: POST + parameters: index: books-names request: - payload: - settings: - index.number_of_shards: 4 - index.number_of_replicas: 2 - response: - status: 200 + payload: {} + - path: /books-names + method: DELETE + status: [200, 404] + - path: /books + method: DELETE + status: [200, 404] +chapters: - synopsis: Create replication rule. path: /_plugins/_replication/_autofollow version: '>= 1.1' @@ -112,6 +72,12 @@ chapters: follower_cluster_role: admin response: status: 200 + - synopsis: Get auto-follow stats. + path: /_plugins/_replication/autofollow_stats + version: '>= 1.1' + method: GET + response: + status: 200 - synopsis: Delete replication rule. path: /_plugins/_replication/_autofollow version: '>= 1.1' @@ -121,4 +87,4 @@ chapters: leader_alias: leader-cluster name: books response: - status: 200 + status: 200 \ No newline at end of file diff --git a/tests/plugins/replication/index.yaml b/tests/plugins/replication/index.yaml new file mode 100644 index 000000000..a70a0b991 --- /dev/null +++ b/tests/plugins/replication/index.yaml @@ -0,0 +1,74 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test replication APIs specs. +prologues: + - path: /{index} + method: PUT + parameters: + index: books + request: + payload: {} + - path: /_bulk + method: POST + request: + content_type: application/x-ndjson + payload: + - {create: {_index: books, _id: book_1392214}} + - {author: Harper Lee, title: To Kill a Mockingbird, year: 1960} + - {create: {_index: books, _id: book_1392215}} + - {author: Elizabeth Rudnick, title: Beauty and the Beast, year: 1991} + - path: /{index}/_refresh + method: POST + parameters: + index: books + - path: /_cluster/settings + method: PUT + request: + payload: + persistent: + cluster: + remote: + leader-cluster: + seeds: ['172.22.0.3:9300'] +epilogues: + - path: /_plugins/_replication/{index}/_stop + method: POST + parameters: + index: books-names + request: + payload: {} + - path: /books-names + method: DELETE + status: [200, 404] + - path: /books + method: DELETE + status: [200, 404] +chapters: + - synopsis: Start replication. + path: /_plugins/_replication/{index}/_start + version: '>= 1.1' + method: PUT + parameters: + index: books-names + request: + payload: + leader_alias: leader-cluster + leader_index: books + use_roles: + leader_cluster_role: all_access + follower_cluster_role: all_access + response: + status: 200 + - synopsis: Update settings. + path: /_plugins/_replication/{index}/_update + version: '>= 1.1' + method: PUT + parameters: + index: books-names + request: + payload: + settings: + index.number_of_shards: 4 + index.number_of_replicas: 2 + response: + status: 200 \ No newline at end of file diff --git a/tests/plugins/replication/stats.yaml b/tests/plugins/replication/stats.yaml new file mode 100644 index 000000000..0932911fa --- /dev/null +++ b/tests/plugins/replication/stats.yaml @@ -0,0 +1,86 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test replication APIs specs. +prologues: + - path: /{index} + method: PUT + parameters: + index: books + request: + payload: {} + - path: /_bulk + method: POST + request: + content_type: application/x-ndjson + payload: + - {create: {_index: books, _id: book_1392214}} + - {author: Harper Lee, title: To Kill a Mockingbird, year: 1960} + - {create: {_index: books, _id: book_1392215}} + - {author: Elizabeth Rudnick, title: Beauty and the Beast, year: 1991} + - path: /{index}/_refresh + method: POST + parameters: + index: books + - path: /_cluster/settings + method: PUT + request: + payload: + persistent: + cluster: + remote: + leader-cluster: + seeds: ['172.22.0.3:9300'] + - path: /_plugins/_replication/{index}/_start + version: '>= 1.1' + method: PUT + parameters: + index: books-names + request: + payload: + leader_alias: leader-cluster + leader_index: books + use_roles: + leader_cluster_role: all_access + follower_cluster_role: all_access + response: + status: 200 +epilogues: + - path: /_plugins/_replication/{index}/_stop + method: POST + parameters: + index: books-names + request: + payload: {} + - path: /books-names + method: DELETE + status: [200, 404] + - path: /books + method: DELETE + status: [200, 404] +chapters: + - synopsis: Get replication stats. + path: /_plugins/_replication/{index}/_status + version: '>= 1.1' + method: GET + parameters: + index: books-names + response: + status: 200 + - synopsis: Get leader stats. + path: /_plugins/_replication/leader_stats + version: '>= 1.1' + method: GET + response: + status: 200 + - synopsis: Get follower stats. + path: /_plugins/_replication/follower_stats + version: '>= 1.1' + method: GET + response: + status: 200 + - synopsis: Get auto-follow stats. + path: /_plugins/_replication/autofollow_stats + version: '>= 1.1' + method: GET + response: + status: 200 \ No newline at end of file