Skip to content

Commit 8ec3c9e

Browse files
Merge pull request #168 from splunk/DVPL-9706
Apps/app-install replaced with apps/local
2 parents be9be1d + 939eafb commit 8ec3c9e

File tree

10 files changed

+28
-77
lines changed

10 files changed

+28
-77
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
TEST_TCP_PORT: 10667
2727
TEST_UDP_PORT: 10668
2828
SPLUNK_HOME: "/opt/splunk"
29+
SPLUNK_APPS_URL: https://github.com/splunk/sdk-app-collection/releases/download/v1.1.0/sdkappcollection.tgz
2930
ports:
3031
- 8000:8000
3132
- 8089:8089
@@ -58,7 +59,7 @@ jobs:
5859
echo version=${{ matrix.splunk }} >> .splunkrc
5960
6061
- name: Test using maven
61-
run: make test
62+
run: mvn test -fae
6263
env:
6364
SPLUNK_HOME: "/opt/splunk"
6465
TEST_TCP_PORT: 10667

.idea/misc.xml

Lines changed: 0 additions & 29 deletions
This file was deleted.

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
- SPLUNK_START_ARGS=--accept-license
99
- SPLUNK_HEC_TOKEN=11111111-1111-1111-1111-1111111111113
1010
- SPLUNK_PASSWORD=changed!
11-
- SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.0.0/sdk-app-collection.tgz
11+
- SPLUNK_APPS_URL=https://github.com/splunk/sdk-app-collection/releases/download/v1.1.0/sdkappcollection.tgz
1212
ports:
1313
- 8000:8000
1414
- 8088:8088

splunk/src/test/java/com/splunk/ApplicationTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ public void testForEmptySetup() {
7676
Assert.assertTrue(setupXml.contains("stub"));
7777
}
7878

79-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
8079
@Test
8180
public void testForSetupPresent() throws Exception {
8281
if (!hasTestData()) {

splunk/src/test/java/com/splunk/IndexTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,6 @@ public boolean predicate() {
688688
});
689689
}
690690

691-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
692691
@Test
693692
public void testUploadArgs() throws Exception {
694693
if (!hasTestData()) {
@@ -732,7 +731,6 @@ public boolean predicate() {
732731
});
733732
}
734733

735-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
736734
@Test
737735
public void testUploadArgsFailure() throws Exception{
738736
if (!hasTestData()) {
@@ -764,7 +762,6 @@ public void testUploadArgsFailure() throws Exception{
764762

765763
}
766764

767-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
768765
@Test
769766
public void testUpload() throws Exception {
770767
if (!hasTestData()) {

splunk/src/test/java/com/splunk/InputCrudTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,24 +248,23 @@ public boolean predicate() {
248248
});
249249
}
250250

251-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
252251
@Test
253252
public void testScriptInputCrud() {
254253
if (!hasTestData()) {
255254
System.out.println("WARNING: sdk-app-collection not installed in Splunk; skipping test.");
256255
return;
257256
}
258257

259-
installApplicationFromTestData("modular-inputs");
258+
installApplicationFromTestData("modular_inputs");
260259

261260
// Determine what script to use for the input
262261
String filename;
263262
if (service.getInfo().getOsName().equals("Windows")) {
264263
// Windows
265-
filename = "etc\\apps\\modular-inputs\\bin\\echo.bat";
264+
filename = "etc\\apps\\modular_inputs\\bin\\echo.bat";
266265
} else {
267266
// Linux or Mac OS X
268-
filename = "etc/apps/modular-inputs/bin/echo.sh";
267+
filename = "etc/apps/modular_inputs/bin/echo.sh";
269268
}
270269

271270
// Create

splunk/src/test/java/com/splunk/ModularInputKindsTest.java

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public void checkModularInputKind(ModularInputKind m) {
2929
if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
3030
return;
3131
} else {
32-
installApplicationFromTestData("modular-inputs");
32+
installApplicationFromTestData("modular_inputs");
3333
inputKinds = service.getModularInputKinds();
3434
}
3535

@@ -43,28 +43,25 @@ public void checkModularInputKind(ModularInputKind m) {
4343

4444
}
4545

46-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
4746
@Test
4847
public void testListInputKinds() {
4948
if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
5049
return;
5150
} else {
52-
installApplicationFromTestData("modular-inputs");
51+
installApplicationFromTestData("modular_inputs");
5352
inputKinds = service.getModularInputKinds();
5453
}
55-
5654
for (ModularInputKind kind : inputKinds.values()) {
5755
checkModularInputKind(kind);
5856
}
5957
}
6058

61-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
6259
@Test
6360
public void testInputByName() {
6461
if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
6562
return;
6663
} else {
67-
installApplicationFromTestData("modular-inputs");
64+
installApplicationFromTestData("modular_inputs");
6865
inputKinds = service.getModularInputKinds();
6966
}
7067
ModularInputKind m;
@@ -74,27 +71,25 @@ public void testInputByName() {
7471
checkModularInputKind(m);
7572
}
7673

77-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
7874
@Test
7975
public void testNonexistantArg() {
8076
if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
8177
return;
8278
} else {
83-
installApplicationFromTestData("modular-inputs");
79+
installApplicationFromTestData("modular_inputs");
8480
inputKinds = service.getModularInputKinds();
8581
}
8682
ModularInputKind test1 = inputKinds.get("test1");
8783
Assert.assertFalse(test1.hasArgument("nonexistant_argument"));
8884
Assert.assertNull(test1.getArgument("nonexistant_argument"));
8985
}
9086

91-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
9287
@Test
9388
public void testInputKindDescriptionAndTitle() {
9489
if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
9590
return;
9691
} else {
97-
installApplicationFromTestData("modular-inputs");
92+
installApplicationFromTestData("modular_inputs");
9893
inputKinds = service.getModularInputKinds();
9994
}
10095
ModularInputKind test1 = inputKinds.get("test1");
@@ -107,13 +102,12 @@ public void testInputKindDescriptionAndTitle() {
107102
Assert.assertEquals("test2", test2.getTitle());
108103
}
109104

110-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
111105
@Test
112106
public void testArgDescription() {
113107
if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
114108
return;
115109
} else {
116-
installApplicationFromTestData("modular-inputs");
110+
installApplicationFromTestData("modular_inputs");
117111
inputKinds = service.getModularInputKinds();
118112
}
119113

@@ -135,13 +129,12 @@ public void testArgDescription() {
135129
}
136130
}
137131

138-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
139132
@Test
140133
public void testArgDataType() {
141134
if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
142135
return;
143136
} else {
144-
installApplicationFromTestData("modular-inputs");
137+
installApplicationFromTestData("modular_inputs");
145138
inputKinds = service.getModularInputKinds();
146139
}
147140

@@ -162,13 +155,12 @@ public void testArgDataType() {
162155
}
163156
}
164157

165-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
166158
@Test
167159
public void testRequiredOnCreate() {
168160
if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
169161
return;
170162
} else {
171-
installApplicationFromTestData("modular-inputs");
163+
installApplicationFromTestData("modular_inputs");
172164
inputKinds = service.getModularInputKinds();
173165
}
174166

@@ -187,13 +179,12 @@ public void testRequiredOnCreate() {
187179
}
188180
}
189181

190-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
191182
@Test
192183
public void testRequiredOnEdit() {
193184
if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
194185
return;
195186
} else {
196-
installApplicationFromTestData("modular-inputs");
187+
installApplicationFromTestData("modular_inputs");
197188
inputKinds = service.getModularInputKinds();
198189
}
199190

@@ -212,13 +203,12 @@ public void testRequiredOnEdit() {
212203
}
213204
}
214205

215-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
216206
@Test
217207
public void testGetArguments() {
218208
if (service.versionIsEarlierThan("5.0") || !hasTestData()) {
219209
return;
220210
} else {
221-
installApplicationFromTestData("modular-inputs");
211+
installApplicationFromTestData("modular_inputs");
222212
inputKinds = service.getModularInputKinds();
223213
}
224214

splunk/src/test/java/com/splunk/ModularInputTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@
2121
import org.junit.Test;
2222

2323
public class ModularInputTest extends InputTest {
24-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
2524
@Test
2625
public void testModularInputKinds() {
2726
if (service.versionCompare("5.0") < 0 || !hasTestData()) {
2827
return;
2928
} else {
30-
installApplicationFromTestData("modular-inputs");
29+
installApplicationFromTestData("modular_inputs");
3130
// Will not pick up the new inputs unless a restart is done.
3231
// Nevertheless Splunk does not request a restart after app installation.
3332
uncheckedSplunkRestart();
@@ -43,13 +42,12 @@ public void testModularInputKinds() {
4342
Assert.assertTrue(hasTest2);
4443
}
4544

46-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
4745
@Test
4846
public void testListModularInputs() {
4947
if (service.versionCompare("5.0") < 0 || !hasTestData()) {
5048
return;
5149
} else {
52-
installApplicationFromTestData("modular-inputs");
50+
installApplicationFromTestData("modular_inputs");
5351
// Will not pick up the new inputs unless a restart is done.
5452
// Nevertheless Splunk does not request a restart after app installation.
5553
uncheckedSplunkRestart();

splunk/src/test/java/com/splunk/SDKTestCase.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,13 @@ public static boolean assertEventuallyTrue(EventuallyTrueBehavior behavior) {
213213
// === Test Data Installation ===
214214

215215
public boolean hasTestData() {
216-
String collectionName = "sdk-app-collection";
217-
return service.getApplications().containsKey("sdk-app-collection");
216+
String collectionName = "sdkappcollection";
217+
return service.getApplications().containsKey("sdkappcollection");
218218
}
219219

220220
public void installApplicationFromTestData(String applicationName) {
221-
String collectionName = "sdk-app-collection";
222-
if (!service.getApplications().containsKey("sdk-app-collection")) {
221+
String collectionName = "sdkappcollection";
222+
if (!service.getApplications().containsKey("sdkappcollection")) {
223223
throw new TestDataNotInstalledException();
224224
}
225225

@@ -248,10 +248,13 @@ public void installApplicationFromTestData(String applicationName) {
248248
String appPath = Util.join(separator, pathComponents);
249249

250250
Args args = new Args();
251+
251252
args.put("name", appPath);
252-
args.put("update", "1");
253-
service.post("apps/appinstall", args);
254-
253+
args.put("filename", true);
254+
args.put("update", true);
255+
256+
service.post("apps/local", args);
257+
255258
installedApps.add(applicationName);
256259
}
257260

splunk/src/test/java/com/splunk/SearchJobTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,6 @@ public void testAttributes() {
656656
job.cancel();
657657
}
658658

659-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
660659
@Test
661660
public void testEnablePreview() throws InterruptedException {
662661
if (!hasTestData()) {
@@ -709,7 +708,6 @@ public boolean predicate() {
709708
waitForSleepingJobToDie(job);
710709
}
711710

712-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
713711
@Test
714712
public void testDisablePreview() throws InterruptedException {
715713
if (!hasTestData()) {
@@ -782,7 +780,6 @@ public boolean predicate() {
782780
} catch (InterruptedException e) {}
783781
}
784782

785-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
786783
@Test
787784
public void testSetPriority() throws InterruptedException {
788785
if (!hasTestData()) {
@@ -833,7 +830,6 @@ public boolean predicate() {
833830
job.cancel();
834831
}
835832

836-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
837833
@Test
838834
public void testPause() throws InterruptedException {
839835
if (!hasTestData()) {
@@ -867,7 +863,6 @@ public boolean predicate() {
867863
job.cancel();
868864
}
869865

870-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
871866
@Test
872867
public void testUnpause() throws InterruptedException {
873868
if (!hasTestData()) {
@@ -901,7 +896,6 @@ public boolean predicate() {
901896
job.cancel();
902897
}
903898

904-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
905899
@Test
906900
public void testFinalize() throws InterruptedException {
907901
if (!hasTestData()) {
@@ -932,7 +926,6 @@ public boolean predicate() {
932926
job.cancel();
933927
}
934928

935-
@Ignore("apps/appinstall endpoint is removed in version 8.1.0")
936929
@Test
937930
public void testDone() throws InterruptedException {
938931
if (!hasTestData()) {

0 commit comments

Comments
 (0)