From 553aab1350d0ae35bbd5c6bad48d99880246a20b Mon Sep 17 00:00:00 2001 From: chengzw Date: Fri, 25 Aug 2023 22:23:34 +0800 Subject: [PATCH] add unit test --- .../elasticsearch/nodespec/podspec_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/controller/elasticsearch/nodespec/podspec_test.go b/pkg/controller/elasticsearch/nodespec/podspec_test.go index 3db0a01ebae..f798223fae8 100644 --- a/pkg/controller/elasticsearch/nodespec/podspec_test.go +++ b/pkg/controller/elasticsearch/nodespec/podspec_test.go @@ -564,3 +564,16 @@ func Test_enableLog4JFormatMsgNoLookups(t *testing.T) { }) } } + +func Test_getScriptsConfigMapContent(t *testing.T) { + cm := &corev1.ConfigMap{ + Data: map[string]string{ + "pre-stop-hook-script.sh": "value1#", + "prepare-fs.sh": "value2#", + "readiness-probe-script.sh": "value3#", + "suspend.sh": "value4#", + "suspended_pods.txt": "value5#", + }, + } + assert.Equal(t, "value1#value2#value3#value4#", getScriptsConfigMapContent(cm)) +}