javanna 4a2410135f [TEST] added wait for relocationg shards to cat.shards REST test
Adding the second index might cause relocation of existing shards depending on the number of nodes available, let's wait for relocation to be finished before going ahead and checking the cat shards outpu
2014-06-03 10:48:11 +02:00

52 lines
1.3 KiB
YAML
Executable File

---
"Test cat shards output":
- do:
cat.shards: {}
- match:
$body: |
/^$/
- do:
indices.create:
index: index1
body:
settings:
number_of_shards: "5"
number_of_replicas: "1"
- do:
cluster.health:
wait_for_status: yellow
- do:
cat.shards: {}
- match:
$body: |
/^(index1 \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){10}$/
- do:
indices.create:
index: index2
body:
settings:
number_of_shards: "5"
number_of_replicas: "0"
- do:
cluster.health:
wait_for_status: yellow
wait_for_relocating_shards: 0
- do:
cat.shards: {}
- match:
$body: |
/^(index(1|2) \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){15}$/
- do:
cat.shards:
index: index2
- match:
$body: |
/^(index2 \s+ \d \s+ (p|r) \s+ ((STARTED|INITIALIZING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){5}$/