Skip to content

Commit e62929e

Browse files
committed
clean up post-start-script regex pattern
1 parent c87cd40 commit e62929e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/unit/post_start_script_test.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,7 @@ tests:
6565
st2:
6666
packs: { sensors: [] } # ensure only 1 sensor
6767
st2web:
68-
postStartScript: &custom_post_start_script
69-
echo hello world
68+
postStartScript: &custom_post_start_script echo hello world
7069
st2auth:
7170
postStartScript: *custom_post_start_script
7271
st2api:
@@ -105,9 +104,10 @@ tests:
105104
path: data.[post-start.sh]
106105
- matchRegex:
107106
path: data.[post-start.sh]
108-
# Could also match the shebang at the begginning
109-
# but I'm not sure how to match more than one line.
110-
pattern: echo hello world
107+
# (?m) = multi-line mode: ^ and $ match begin/end line in addition to begin/end text
108+
# (?s) = let . match \n
109+
# .*? = any character zero or more times, prefer fewer
110+
pattern: '(?ms)^#!/bin/bash$.*?^echo hello world$'
111111

112112
- it: Deployments st2actionrunner and st2client have lifecycle.postStartScipt by default
113113
template: deployments.yaml

0 commit comments

Comments
 (0)