# Interacting with individual nodes in REST API integration tests using esplugin support

**URL:** <https://discuss.elastic.co/t/interacting-with-individual-nodes-in-rest-api-integration-tests-using-esplugin-support/152095>\
**Category:** Elasticsearch\
**Created:** [October 11, 2018, 4:19pm UTC](https://discuss.elastic.co/t/interacting-with-individual-nodes-in-rest-api-integration-tests-using-esplugin-support/152095 "2018-10-11T16:19:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukas\_vlcek](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@lukas\_vlcek](https://discuss.elastic.co/u/lukas_vlcek)\
**Post date:** [October 11, 2018, 4:19pm UTC](https://discuss.elastic.co/t/interacting-with-individual-nodes-in-rest-api-integration-tests-using-esplugin-support/152095/1 "2018-10-11T16:19:35Z")

</div>

Hi,

I am running integration tests using the REST API `esplugin` tooling and I want to make sure the [`do:`](https://github.com/elastic/elasticsearch/tree/v6.4.2/rest-api-spec/src/main/resources/rest-api-spec/test#do) operators are executed against specific node only.

I am aware of the `node-selector` filter but I do not know how I can assign different attributes to individual test nodes so that I can filter them using this attribute. Is there any way how I can enhance default `elasticsearch.yml` config for test nodes and add different attributes to individual nodes? Or is there any other way how I can do it?

I use

```auto
integTestCluster {
    numNodes = 2 //or more
}

```

in `build.gradle` to tell `esplugin` to start cluster with more than a single node.

One alternative would be if I could address individual nodes using node name (`node-0`, `node-1`, ...) but that does not seem to be supported atm.

Regards,  
Lukáš

---

<div class="post-metadata">

**Author:** ![lukas\_vlcek](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@lukas\_vlcek](https://discuss.elastic.co/u/lukas_vlcek)\
**Post date:** [October 12, 2018, 12:53pm UTC](https://discuss.elastic.co/t/interacting-with-individual-nodes-in-rest-api-integration-tests-using-esplugin-support/152095/2 "2018-10-12T12:53:59Z")

</div>

Seems to me that if I find out how to propagate distinct attributes here: [https://github.com/elastic/elasticsearch/blob/master/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy#L344](https://github.com/elastic/elasticsearch/blob/master/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy#L344)

for example `node.attr.label=foo` for the first node and `node.attr.label=bar` for the second node then I should be able to use:

```auto
- do:
    node_selector:
      attribute:
        label: foo

```

to send request to node having label=foo.

Alternative is to find out how to pass arguments via System property to Node here: [https://github.com/elastic/elasticsearch/blob/master/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy#L194](https://github.com/elastic/elasticsearch/blob/master/buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy#L194)  
Arguments like `tests.es.node.attr.label=foo`

Anyone tried this before?

Thanks,  
Lukáš

---

<div class="post-metadata">

**Author:** ![lukas\_vlcek](https://avatars.discourse-cdn.com/v4/letter/l/dfb087/32.png) [@lukas\_vlcek](https://discuss.elastic.co/u/lukas_vlcek)\
**Post date:** [November 1, 2018, 3:42pm UTC](https://discuss.elastic.co/t/interacting-with-individual-nodes-in-rest-api-integration-tests-using-esplugin-support/152095/3 "2018-11-01T15:42:48Z")

</div>

Bump.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 29, 2018, 3:43pm UTC](https://discuss.elastic.co/t/interacting-with-individual-nodes-in-rest-api-integration-tests-using-esplugin-support/152095/4 "2018-11-29T15:43:02Z")

</div>

Closed on November 29, 2018, 3:43pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
