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

Get node ID from nodes info in REST tests #40052

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
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@

- match: { acknowledged: true }

- do:
cluster.state:
metric: [ master_node ]

- do:
cluster.allocation_explain:
body: { "index": "test", "shard": 0, "primary": true }
Expand All @@ -37,10 +33,6 @@
index: test
body: { "settings": { "index.number_of_shards": 1, "index.number_of_replicas": 9 } }

- do:
cluster.state:
metric: [ master_node ]

- do:
cluster.allocation_explain:
include_disk_info: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ setup:

---
"Explain API for non-existent node & shard":
- skip:
features: [arbitrary_key]

- do:
cluster.state:
metric: [ master_node ]

- set: {master_node: node_id}
nodes.info:
node_id: data:true
- set:
nodes._arbitrary_key_: node_id

- do:
cluster.reroute:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,29 @@
- skip:
version: " - 6.9.99"
reason: expects warnings that pre-7.0.0 will not send
features: "warnings"
# creates an index with one document solely allocated on the master node
features: [warnings, arbitrary_key]

# creates an index with one document solely allocated on a particular data node
# and shrinks it into a new index with a single shard
# we don't do the relocation to a single node after the index is created
# here since in a mixed version cluster we can't identify
# which node is the one with the highest version and that is the only one that can safely
# be used to shrink the index.
- do:
cluster.state: {}
# Get master node id

- set: { master_node: master }
- do:
nodes.info:
node_id: data:true
- set:
nodes._arbitrary_key_: node_id

- do:
indices.create:
index: source
wait_for_active_shards: 1
body:
settings:
# ensure everything is allocated on a single node
index.routing.allocation.include._id: $master
# ensure everything is allocated on the same data node
index.routing.allocation.include._id: $node_id
index.number_of_shards: 2
index.number_of_replicas: 0
- do:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
- skip:
version: " - 6.9.99"
reason: expects warnings that pre-7.0.0 will not send
features: "warnings"
features: [warnings, arbitrary_key]

- do:
cluster.state: {}
# Get master node id

- set: { master_node: master }
nodes.info:
node_id: data:true
- set:
nodes._arbitrary_key_: node_id

# create index
- do:
Expand All @@ -19,7 +19,7 @@
body:
settings:
# ensure everything is allocated on a single node
index.routing.allocation.include._id: $master
index.routing.allocation.include._id: $node_id
index.number_of_shards: 2
index.number_of_replicas: 0
mappings:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
- skip:
version: " - 6.9.99"
reason: expects warnings that pre-7.0.0 will not send
features: "warnings"
features: [warnings, arbitrary_key]

- do:
cluster.state: {}

# get master node id
- set: { master_node: master }
nodes.info:
node_id: data:true
- set:
nodes._arbitrary_key_: node_id

- do:
indices.create:
index: source
wait_for_active_shards: 1
body:
settings:
# ensure everything is allocated on the master node
index.routing.allocation.include._id: $master
# ensure everything is allocated on the same node
index.routing.allocation.include._id: $node_id
index.number_of_shards: 2
index.number_of_replicas: 0
index.merge.scheduler.max_merge_count: 4
Expand Down Expand Up @@ -60,4 +60,4 @@
- match: { copy-settings-target.settings.index.merge.scheduler.max_merge_count: "4" }
- match: { copy-settings-target.settings.index.merge.scheduler.max_thread_count: "2" }
- match: { copy-settings-target.settings.index.blocks.write: "true" }
- match: { copy-settings-target.settings.index.routing.allocation.include._id: $master }
- match: { copy-settings-target.settings.index.routing.allocation.include._id: $node_id }
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
- skip:
version: " - 6.9.99"
reason: expects warnings that pre-7.0.0 will not send
features: "warnings"
features: [arbitrary_key, warnings]

- do:
cluster.state: {}

# get master node id
- set: { master_node: master }
nodes.info:
node_id: data:true
- set:
nodes._arbitrary_key_: node_id

- do:
indices.create:
index: source
wait_for_active_shards: 1
body:
settings:
# ensure everything is allocated on the master node
index.routing.allocation.include._id: $master
# ensure everything is allocated on the same node
index.routing.allocation.include._id: $node_id
index.number_of_replicas: 0
index.number_of_shards: 1
index.number_of_routing_shards: 4
Expand Down Expand Up @@ -62,4 +62,4 @@
- match: { copy-settings-target.settings.index.merge.scheduler.max_merge_count: "4" }
- match: { copy-settings-target.settings.index.merge.scheduler.max_thread_count: "2" }
- match: { copy-settings-target.settings.index.blocks.write: "true" }
- match: { copy-settings-target.settings.index.routing.allocation.include._id: $master }
- match: { copy-settings-target.settings.index.routing.allocation.include._id: $node_id }
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
setup:
- skip:
features: [arbitrary_key]
---
"node_info test":
- do:
cluster.state: {}

# Get master node id
- set: { master_node: master }

- do:
nodes.info: {}
- set:
nodes._arbitrary_key_: node_id

- is_true: nodes
- is_true: cluster_name
- is_true: nodes.$master.roles
- is_true: nodes.$node_id.roles
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

"node_info test profile is empty":
- skip:
features: stash_in_path
features: [stash_in_path, arbitrary_key]

- do:
cluster.state: {}

- set: {master_node: master}
nodes.info: {}
- set:
nodes._arbitrary_key_: node_id

- do:
nodes.info:
metric: [ transport ]

- is_true: nodes.$master.transport.profiles
- is_true: nodes.$node_id.transport.profiles
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
---
"node_info test flat_settings":
- do:
cluster.state: {}
- skip:
features: [arbitrary_key]

- set: { master_node: master }
- do:
nodes.info: {}
- set:
nodes._arbitrary_key_: node_id

- do:
nodes.info:
metric: [ settings ]

- match : { nodes.$master.settings.client.type: node }
- match : { nodes.$node_id.settings.client.type: node }

- do:
nodes.info:
metric: [ settings ]
flat_settings: true

- match : { nodes.$master.settings.client\.type: node }
- match : { nodes.$node_id.settings.client\.type: node }
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@

---
"Nodes stats level":
- do:
cluster.state: {}
- skip:
features: [arbitrary_key]

- set: { master_node: master }
- do:
nodes.info: {}
- set:
nodes._arbitrary_key_: node_id

- do:
nodes.stats:
metric: [ indices ]
level: "indices"

- is_true: nodes.$master.indices.indices
- is_true: nodes.$node_id.indices.indices

---
"Nodes stats unrecognized parameter":
Expand Down
Loading