Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added snapshot tests. #728

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions tests/snapshot/snapshot/cleanup.yaml
Original file line number Diff line number Diff line change
@@ -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
40 changes: 40 additions & 0 deletions tests/snapshot/snapshot/clone.yaml
Original file line number Diff line number Diff line change
@@ -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: '*'
31 changes: 27 additions & 4 deletions tests/snapshot/snapshot/snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,29 @@ 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:
payload:
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
Expand Down Expand Up @@ -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
25 changes: 25 additions & 0 deletions tests/snapshot/snapshot/verify.yaml
Original file line number Diff line number Diff line change
@@ -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: {}
Loading