This commit is contained in:
Robert Muir 2015-12-21 17:02:50 -05:00
parent b8524bdb11
commit 5ebcf183e5
6 changed files with 138 additions and 22 deletions

View File

@ -15,8 +15,10 @@
- match: { nodes.$master.plugins.0.name: repository-hdfs }
- match: { nodes.$master.plugins.0.jvm: true }
---
#
# Check that we can't use file:// repositories or anything like that
# We only test this plugin against hdfs://
#
"HDFS only":
- do:
catch: /Invalid scheme/

View File

@ -2,20 +2,26 @@
#
# Tests creating a repository
#
"HDFS Repository Config":
"HDFS Repository Creation":
# Create repository
- do:
snapshot.create_repository:
repository: test_repo_hdfs_1
repository: test_repository_create
body:
type: hdfs
settings:
uri: "hdfs://localhost:9999"
path: "foo/bar"
path: "test/repository_create"
# Get repository
- do:
snapshot.get_repository:
repository: test_repo_hdfs_1
repository: test_repository_create
- is_true: test_repo_hdfs_1
- match: {test_repo_hdfs_1.settings.path : "foo/bar"}
- is_true: test_repository_create
- match: {test_repository_create.settings.path : "test/repository_create"}
# Remove our repository
- do:
snapshot.delete_repository:
repository: test_repository_create

View File

@ -0,0 +1,23 @@
# Integration tests for HDFS Repository plugin
#
# Tests explicit verify
#
"HDFS Repository Verify":
- do:
snapshot.create_repository:
repository: test_repository_verify
body:
type: hdfs
settings:
uri: "hdfs://localhost:9999"
path: "test/repository_verify"
# Verify repository
- do:
snapshot.verify_repository:
repository: test_repository_verify
# Remove our repository
- do:
snapshot.delete_repository:
repository: test_repository_verify

View File

@ -3,17 +3,18 @@
# Actually perform a snapshot to hdfs
#
---
setup:
"take snapshot":
# Create repository
- do:
snapshot.create_repository:
repository: test_repo_hdfs_snapshot
repository: test_snapshot_repository
body:
type: hdfs
settings:
uri: "hdfs://localhost:9999"
path: "foo/bar"
path: "test/snapshot"
# Create index
- do:
indices.create:
index: test_index
@ -22,16 +23,15 @@ setup:
number_of_shards: 1
number_of_replicas: 1
# Wait for yellow
- do:
cluster.health:
wait_for_status: yellow
---
"Create a snapshot":
# Create snapshot
- do:
snapshot.create:
repository: test_repo_hdfs_snapshot
repository: test_snapshot_repository
snapshot: test_snapshot
wait_for_completion: true
@ -40,3 +40,14 @@ setup:
- match: { snapshot.shards.successful: 1 }
- match: { snapshot.shards.failed : 0 }
# Remove our snapshot
- do:
snapshot.delete:
repository: test_snapshot_repository
snapshot: test_snapshot
# Remove our repository
- do:
snapshot.delete_repository:
repository: test_snapshot_repository

View File

@ -0,0 +1,60 @@
# Integration tests for HDFS Repository plugin
#
# Tests retrieving information about snapshot
#
---
"Get a snapshot":
# Create repository
- do:
snapshot.create_repository:
repository: test_snapshot_get_repository
body:
type: hdfs
settings:
uri: "hdfs://localhost:9999"
path: "test/snapshot_get"
# Create index
- do:
indices.create:
index: test_index
body:
settings:
number_of_shards: 1
number_of_replicas: 0
# Wait for green
- do:
cluster.health:
wait_for_status: green
# Create snapshot
- do:
snapshot.create:
repository: test_snapshot_get_repository
snapshot: test_snapshot_get
wait_for_completion: true
- match: { snapshot.snapshot: test_snapshot_get }
- match: { snapshot.state : SUCCESS }
- match: { snapshot.shards.successful: 1 }
- match: { snapshot.shards.failed : 0 }
# Get snapshot info
- do:
snapshot.get:
repository: test_snapshot_get_repository
snapshot: test_snapshot_get
- match: { snapshots.0.snapshot : test_snapshot_get }
# Remove our snapshot
- do:
snapshot.delete:
repository: test_snapshot_get_repository
snapshot: test_snapshot_get
# Remove our repository
- do:
snapshot.delete_repository:
repository: test_snapshot_get_repository

View File

@ -3,17 +3,19 @@
# Actually perform a snapshot to hdfs, then restore it
#
---
setup:
"Create a snapshot and then restore it":
# Create repository
- do:
snapshot.create_repository:
repository: test_repo_hdfs_restore
repository: test_restore_repository
body:
type: hdfs
settings:
uri: "hdfs://localhost:9999"
path: "foo/bar"
path: "test/restore"
# Create index
- do:
indices.create:
index: test_index
@ -22,16 +24,15 @@ setup:
number_of_shards: 1
number_of_replicas: 0
# Wait for green
- do:
cluster.health:
wait_for_status: green
---
"Create a snapshot and then restore it":
# Take snapshot
- do:
snapshot.create:
repository: test_repo_hdfs_restore
repository: test_restore_repository
snapshot: test_restore
wait_for_completion: true
@ -42,16 +43,19 @@ setup:
- is_true: snapshot.version
- gt: { snapshot.version_id: 0}
# Close index
- do:
indices.close:
index : test_index
# Restore index
- do:
snapshot.restore:
repository: test_repo_hdfs_restore
repository: test_restore_repository
snapshot: test_restore
wait_for_completion: true
# Check recovery stats
- do:
indices.recovery:
index: test_index
@ -63,3 +67,13 @@ setup:
- match: { test_index.shards.0.index.files.reused: 0}
- match: { test_index.shards.0.index.size.reused_in_bytes: 0}
# Remove our snapshot
- do:
snapshot.delete:
repository: test_restore_repository
snapshot: test_restore
# Remove our repository
- do:
snapshot.delete_repository:
repository: test_restore_repository