Skip to content

Commit 442e924

Browse files
committed
Changed filename for Linux os
- test cases is failing for dockerized Splunk instance because '/etc/fstab' file is not exist so changed it's value to '/etc/hosts'
1 parent f7442a1 commit 442e924

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,13 @@ private void testSpecializedGetters(Input input) {
166166

167167
@Test
168168
public void testMonitorInputCrud() {
169-
final String filename = locateSystemLog();
170-
169+
final String filename;
170+
if (System.getenv("SPLUNK_HOME") != null) {
171+
filename = System.getenv("SPLUNK_HOME") + "/copyright.txt";
172+
} else {
173+
filename = locateSystemLog();
174+
}
175+
171176
// Create variants
172177
try {
173178
inputs.create(filename);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ protected static String locateSystemLog() {
375375
if (osName.equals("Windows"))
376376
filename = "C:\\Windows\\WindowsUpdate.log";
377377
else if (osName.equals("Linux")) {
378-
filename = "/etc/fstab";
378+
filename = "/etc/hosts";
379379
}
380380
else if (osName.equals("Darwin")) {
381381
filename = "/var/log/system.log";

0 commit comments

Comments
 (0)