From a9ca08687a80d6b197b9ce9451c1c4df8a150dc7 Mon Sep 17 00:00:00 2001 From: Usama Ahmad Date: Tue, 29 Oct 2019 11:43:56 +0500 Subject: [PATCH] add tests --- elasticsearch/tests/elasticsearch_test.py | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/elasticsearch/tests/elasticsearch_test.py b/elasticsearch/tests/elasticsearch_test.py index 4517c9fc7..4a83deaf5 100755 --- a/elasticsearch/tests/elasticsearch_test.py +++ b/elasticsearch/tests/elasticsearch_test.py @@ -659,6 +659,43 @@ def test_adding_a_nodePort(): assert r['service'][uname]['spec']['ports'][0]['nodePort'] == 30001 + +def test_adding_a_label_on_non_headless_service(): + config = '' + + r = helm_template(config) + + assert 'label1' not in r['service'][uname]['metadata']['labels'] + + config = ''' + service: + labels: + label1: value1 + ''' + + r = helm_template(config) + + assert r['service'][uname]['metadata']['labels']['label1'] == 'value1' + + + +def test_adding_a_label_on_headless_service(): + config = '' + + r = helm_template(config) + + assert 'label1' not in r['service'][uname + '-headless']['metadata']['labels'] + + config = ''' + service: + labelsHeadless: + label1: value1 + ''' + + r = helm_template(config) + + assert r['service'][uname + '-headless']['metadata']['labels']['label1'] == 'value1' + def test_master_termination_fixed_enabled(): config = ''