Skip to content

Commit 31b44ff

Browse files
committed
names
1 parent a524978 commit 31b44ff

File tree

9 files changed

+38
-38
lines changed

9 files changed

+38
-38
lines changed

internal/testrunner/script/agents.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ import (
2222
func installAgent(ts *testscript.TestScript, neg bool, args []string) {
2323
clearStdStreams(ts)
2424

25-
pkgRoot := ts.Getenv("PKG_ROOT")
25+
pkgRoot := ts.Getenv("PACKAGE_ROOT")
2626
if pkgRoot == "" {
27-
ts.Fatalf("PKG_ROOT is not set")
27+
ts.Fatalf("PACKAGE_ROOT is not set")
2828
}
29-
pkg := ts.Getenv("PKG")
29+
pkg := ts.Getenv("PACKAGE_BASE")
3030
if pkg == "" {
31-
ts.Fatalf("PKG is not set")
31+
ts.Fatalf("PACKAGE_BASE is not set")
3232
}
3333
ds := ts.Getenv("DATA_STREAM")
3434
if ds == "" {
@@ -158,9 +158,9 @@ func doKibanaAgent(ctx context.Context, cli *kibana.Client, fn func(a kibana.Age
158158
func uninstallAgent(ts *testscript.TestScript, neg bool, args []string) {
159159
clearStdStreams(ts)
160160

161-
pkg := ts.Getenv("PKG")
161+
pkg := ts.Getenv("PACKAGE_BASE")
162162
if pkg == "" {
163-
ts.Fatalf("PKG is not set")
163+
ts.Fatalf("PACKAGE_BASE is not set")
164164
}
165165
ds := ts.Getenv("DATA_STREAM")
166166
if ds == "" {

internal/testrunner/script/data_stream.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ import (
2626
func addDataStream(ts *testscript.TestScript, neg bool, args []string) {
2727
clearStdStreams(ts)
2828

29-
pkgRoot := ts.Getenv("PKG_ROOT")
29+
pkgRoot := ts.Getenv("PACKAGE_ROOT")
3030
if pkgRoot == "" {
31-
ts.Fatalf("PKG_ROOT is not set")
31+
ts.Fatalf("PACKAGE_ROOT is not set")
3232
}
33-
pkg := ts.Getenv("PKG")
33+
pkg := ts.Getenv("PACKAGE_BASE")
3434
if pkg == "" {
35-
ts.Fatalf("PKG is not set")
35+
ts.Fatalf("PACKAGE_BASE is not set")
3636
}
3737
ds := ts.Getenv("DATA_STREAM")
3838
if ds == "" {
@@ -123,9 +123,9 @@ func addDataStream(ts *testscript.TestScript, neg bool, args []string) {
123123
func removeDataStream(ts *testscript.TestScript, neg bool, args []string) {
124124
clearStdStreams(ts)
125125

126-
pkg := ts.Getenv("PKG")
126+
pkg := ts.Getenv("PACKAGE_BASE")
127127
if pkg == "" {
128-
ts.Fatalf("PKG is not set")
128+
ts.Fatalf("PACKAGE_BASE is not set")
129129
}
130130
ds := ts.Getenv("DATA_STREAM")
131131
if ds == "" {

internal/testrunner/script/debugging.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ var errPolicyNotFound = errors.New("not found")
2525
func getPolicyCommand(ts *testscript.TestScript, neg bool, args []string) {
2626
clearStdStreams(ts)
2727

28-
pkg := ts.Getenv("PKG")
28+
pkg := ts.Getenv("PACKAGE_BASE")
2929
if pkg == "" {
30-
ts.Fatalf("PKG is not set")
30+
ts.Fatalf("PACKAGE_BASE is not set")
3131
}
3232
ds := ts.Getenv("DATA_STREAM")
3333
if ds == "" {

internal/testrunner/script/package.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ import (
2020
func addPackage(ts *testscript.TestScript, neg bool, args []string) {
2121
clearStdStreams(ts)
2222

23-
pkgRoot := ts.Getenv("PKG_ROOT")
23+
pkgRoot := ts.Getenv("PACKAGE_ROOT")
2424
if pkgRoot == "" {
25-
ts.Fatalf("PKG_ROOT is not set")
25+
ts.Fatalf("PACKAGE_ROOT is not set")
2626
}
2727
root, err := os.OpenRoot(pkgRoot)
2828
ts.Check(err)
29-
pkg := ts.Getenv("PKG")
29+
pkg := ts.Getenv("PACKAGE_BASE")
3030
if pkg == "" {
31-
ts.Fatalf("PKG is not set")
31+
ts.Fatalf("PACKAGE_BASE is not set")
3232
}
3333

3434
stacks, ok := ts.Value(runningStackTag{}).(map[string]*runningStack)
@@ -72,15 +72,15 @@ func addPackage(ts *testscript.TestScript, neg bool, args []string) {
7272
func removePackage(ts *testscript.TestScript, neg bool, args []string) {
7373
clearStdStreams(ts)
7474

75-
pkgRoot := ts.Getenv("PKG_ROOT")
75+
pkgRoot := ts.Getenv("PACKAGE_ROOT")
7676
if pkgRoot == "" {
77-
ts.Fatalf("PKG_ROOT is not set")
77+
ts.Fatalf("PACKAGE_ROOT is not set")
7878
}
7979
root, err := os.OpenRoot(pkgRoot)
8080
ts.Check(err)
81-
pkg := ts.Getenv("PKG")
81+
pkg := ts.Getenv("PACKAGE_BASE")
8282
if pkg == "" {
83-
ts.Fatalf("PKG is not set")
83+
ts.Fatalf("PACKAGE_BASE is not set")
8484
}
8585

8686
stacks, ok := ts.Value(runningStackTag{}).(map[string]*runningStack)
@@ -124,9 +124,9 @@ func removePackage(ts *testscript.TestScript, neg bool, args []string) {
124124
func upgradePackageLatest(ts *testscript.TestScript, neg bool, args []string) {
125125
clearStdStreams(ts)
126126

127-
pkg := ts.Getenv("PKG")
127+
pkg := ts.Getenv("PACKAGE_BASE")
128128
if pkg == "" {
129-
ts.Fatalf("PKG is not set")
129+
ts.Fatalf("PACKAGE_BASE is not set")
130130
}
131131

132132
stacks, ok := ts.Value(runningStackTag{}).(map[string]*runningStack)
@@ -184,9 +184,9 @@ func upgradePackageLatest(ts *testscript.TestScript, neg bool, args []string) {
184184
func addPackageZip(ts *testscript.TestScript, neg bool, args []string) {
185185
clearStdStreams(ts)
186186

187-
pkg := ts.Getenv("PKG")
187+
pkg := ts.Getenv("PACKAGE_BASE")
188188
if pkg == "" {
189-
ts.Fatalf("PKG is not set")
189+
ts.Fatalf("PACKAGE_BASE is not set")
190190
}
191191

192192
stacks, ok := ts.Value(runningStackTag{}).(map[string]*runningStack)
@@ -228,9 +228,9 @@ func addPackageZip(ts *testscript.TestScript, neg bool, args []string) {
228228
func removePackageZip(ts *testscript.TestScript, neg bool, args []string) {
229229
clearStdStreams(ts)
230230

231-
pkg := ts.Getenv("PKG")
231+
pkg := ts.Getenv("PACKAGE_BASE")
232232
if pkg == "" {
233-
ts.Fatalf("PKG is not set")
233+
ts.Fatalf("PACKAGE_BASE is not set")
234234
}
235235

236236
stacks, ok := ts.Value(runningStackTag{}).(map[string]*runningStack)

internal/testrunner/script/script.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ func Run(dst io.Writer, cmd *cobra.Command, args []string) error {
218218
e.Setenv("CONFIG_PROFILES", loc.ProfileDir())
219219
e.Setenv("HOME", home)
220220
if pkgRoot != "" {
221-
e.Setenv("PKG", filepath.Base(pkgRoot))
222-
e.Setenv("PKG_ROOT", pkgRoot)
221+
e.Setenv("PACKAGE_BASE", filepath.Base(pkgRoot))
222+
e.Setenv("PACKAGE_ROOT", pkgRoot)
223223
}
224224
if currVersion != "" {
225225
e.Setenv("CURRENT_VERSION", currVersion)

test/packages/other/with_script/data_stream/first/_dev/test/scripts/agent_up_down.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ cmp stdout want_down.text
2424
# Uninstall the agent.
2525
uninstall_agent
2626
! stderr .
27-
stdout '^deleted agent policies for '${PKG}/${DATA_STREAM}
27+
stdout '^deleted agent policies for '${PACKAGE_BASE}/${DATA_STREAM}
2828

2929
# Take down stack.
3030
stack_down

test/packages/other/with_script/data_stream/first/_dev/test/scripts/agent_up_down_external.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ cmp stdout want_down.text
2424
# Uninstall the agent.
2525
uninstall_agent -profile ${CONFIG_PROFILES}/${PROFILE}
2626
! stderr .
27-
stdout '^deleted agent policies for '${PKG}/${DATA_STREAM}
27+
stdout '^deleted agent policies for '${PACKAGE_BASE}/${DATA_STREAM}
2828

2929
# Then attempt to take it down again.
3030
! stack_down -profile ${CONFIG_PROFILES}/${PROFILE}

test/packages/other/with_script/data_stream/first/_dev/test/scripts/env.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ stdout '/\.elastic-package$'
66
exec echo ${CONFIG_PROFILES}
77
stdout '/\.elastic-package/profiles$'
88

9-
exec echo ${PKG}
9+
exec echo ${PACKAGE_BASE}
1010
stdout '^with_script$'
1111

12-
exec echo ${PKG_ROOT}
12+
exec echo ${PACKAGE_ROOT}
1313
stdout '/elastic/elastic-package/test/packages/other/with_script$'
1414

1515
exec echo ${DATA_STREAM}

test/packages/other/with_script/data_stream/first/_dev/test/scripts/get_docs_external.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ cp stdout got_docs.json
6363
# Let's upgrade!
6464
upgrade_package_latest -profile ${CONFIG_PROFILES}/${PROFILE}
6565
! stderr .
66-
stdout 'upgraded package '${PKG}' from version '${CURRENT_VERSION@R}
66+
stdout 'upgraded package '${PACKAGE_BASE}' from version '${CURRENT_VERSION@R}
6767

6868
# Remove the data stream.
6969
remove_data_stream -profile ${CONFIG_PROFILES}/${PROFILE} ${DATA_STREAM_NAME}
@@ -72,7 +72,7 @@ cmpenv stdout want_remove_data_stream.text
7272

7373
# Uninstall the agent.
7474
uninstall_agent -profile ${CONFIG_PROFILES}/${PROFILE} -timeout 1m
75-
stdout '^deleted agent policies for '${PKG}/${DATA_STREAM}
75+
stdout '^deleted agent policies for '${PACKAGE_BASE}/${DATA_STREAM}
7676
! stderr .
7777

7878
# Remove the package resources.
@@ -128,6 +128,6 @@ data_stream:
128128
-- want_data_stream_name.pattern --
129129
logs-with_script\.first-[0-9]+
130130
-- want_add_data_stream.text --
131-
added ${DATA_STREAM_NAME} data stream policy templates for ${PKG}/${DATA_STREAM}
131+
added ${DATA_STREAM_NAME} data stream policy templates for ${PACKAGE_BASE}/${DATA_STREAM}
132132
-- want_remove_data_stream.text --
133-
removed ${DATA_STREAM_NAME} data stream policy templates for ${PKG}/${DATA_STREAM}
133+
removed ${DATA_STREAM_NAME} data stream policy templates for ${PACKAGE_BASE}/${DATA_STREAM}

0 commit comments

Comments
 (0)