diff --git a/tests/snapshot/snapshot/cleanup.yaml b/tests/snapshot/snapshot/cleanup.yaml new file mode 100644 index 00000000..09fd08eb --- /dev/null +++ b/tests/snapshot/snapshot/cleanup.yaml @@ -0,0 +1,27 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test cleaning up a snapshot repository. +prologues: + - path: /_snapshot/my-fs-repository + method: POST + request: + payload: + type: fs + settings: + location: /tmp/opensearch/repo +epilogues: + - path: /_snapshot/my-fs-repository + method: DELETE + status: [200, 404] +chapters: + - synopsis: Verify snapshot repository. + path: /_snapshot/{repository}/_cleanup + method: POST + parameters: + repository: my-fs-repository + response: + status: 200 + payload: + results: + deleted_bytes: 0 + deleted_blobs: 0 diff --git a/tests/snapshot/snapshot/clone.yaml b/tests/snapshot/snapshot/clone.yaml new file mode 100644 index 00000000..8e6491ca --- /dev/null +++ b/tests/snapshot/snapshot/clone.yaml @@ -0,0 +1,40 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test cloning a snapshot. +prologues: + - path: /_snapshot/my-fs-repository + method: POST + request: + payload: + type: fs + settings: + location: /tmp/opensearch/repo + - path: /_snapshot/my-fs-repository/my-test-snapshot + method: PUT + parameters: + wait_for_completion: true + request: + payload: + indices: '*' + partial: true +epilogues: + - path: /_snapshot/my-fs-repository/my-test-snapshot + method: DELETE + status: [200, 404] + - path: /_snapshot/my-fs-repository/my-cloned-snapshot + method: DELETE + status: [200, 404] + - path: /_snapshot/my-fs-repository + method: DELETE + status: [200, 404] +chapters: + - synopsis: Clone a snapshot. + path: /_snapshot/{repository}/{snapshot}/_clone/{target_snapshot} + method: PUT + parameters: + repository: my-fs-repository + snapshot: my-test-snapshot + target_snapshot: my-cloned-snapshot + request: + payload: + indices: '*' diff --git a/tests/snapshot/snapshot/snapshot.yaml b/tests/snapshot/snapshot/snapshot.yaml index ca77a39b..2ce557f4 100644 --- a/tests/snapshot/snapshot/snapshot.yaml +++ b/tests/snapshot/snapshot/snapshot.yaml @@ -13,9 +13,12 @@ epilogues: status: [200, 404] parameters: repository: my-fs-repository -prologues: - - path: /_snapshot/{repository} - method: PUT +chapters: + - synopsis: Create and update a snapshot repository. + path: /_snapshot/{repository} + method: + - POST + - PUT parameters: repository: my-fs-repository request: @@ -23,7 +26,16 @@ prologues: type: fs settings: location: /tmp/opensearch/repo -chapters: + - synopsis: Get all snapshot repositories. + path: /_snapshot + method: GET + response: + status: 200 + payload: + my-fs-repository: + type: fs + settings: + location: /tmp/opensearch/repo - synopsis: Get information about a repository. path: /_snapshot/{repository} method: GET @@ -77,3 +89,14 @@ chapters: payload: snapshots: - snapshot: my-test-snapshot + - synopsis: Delete a snapshot. + path: /_snapshot/{repository}/{snapshot} + method: DELETE + parameters: + repository: my-fs-repository + snapshot: my-test-snapshot + - synopsis: Delete a snapshot repository. + path: /_snapshot/{repository} + method: DELETE + parameters: + repository: my-fs-repository diff --git a/tests/snapshot/snapshot/verify.yaml b/tests/snapshot/snapshot/verify.yaml new file mode 100644 index 00000000..fa2347f4 --- /dev/null +++ b/tests/snapshot/snapshot/verify.yaml @@ -0,0 +1,25 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +description: Test verifying a snapshot repository. +prologues: + - path: /_snapshot/my-fs-repository + method: POST + request: + payload: + type: fs + settings: + location: /tmp/opensearch/repo +epilogues: + - path: /_snapshot/my-fs-repository + method: DELETE + status: [200, 404] +chapters: + - synopsis: Verify snapshot repository. + path: /_snapshot/{repository}/_verify + method: POST + parameters: + repository: my-fs-repository + response: + status: 200 + payload: + nodes: {} \ No newline at end of file