Package com.splunk.shuttl.archiver.importexport

Examples of com.splunk.shuttl.archiver.importexport.ShellExecutor.executeCommand()


    private void executeArchiveScript(LocalBucket bucket) {
      ShellExecutor shellExecutor = ShellExecutor.getInstance();
      Map<String, String> env = getSplunkHomeEnvironment();
      List<String> command = createCommand(bucket);
      int exit = shellExecutor.executeCommand(env, command);
      assertEquals(0, exit);
    }

    private Map<String, String> getSplunkHomeEnvironment() {
      Map<String, String> env = new HashMap<String, String>();
View Full Code Here


    ShellExecutor shellExecutor = ShellExecutor.getInstance();
    Map<String, String> env = new HashMap<String, String>();
    env.put("SPLUNK_HOME", new File(splunkHome).getAbsolutePath());
    List<String> command = createCommand(bucket, copyScript,
        movedBucketDirectory, "additional-parameter-to-sleep-the-script");
    int exit = shellExecutor.executeCommand(env, command);
    assertEquals(exit, 0);
  }

  private List<String> createCommand(LocalBucket bucket, File copyScript,
      File movedBucketDirectory, String additionalParameter) {
View Full Code Here

  @SuppressWarnings("unchecked")
  @Test(expectedExceptions = { TgzImportFailedException.class })
  public void _unsuccessfulImport_throws() {
    ShellExecutor shellExecutor = mock(ShellExecutor.class);
    when(shellExecutor.executeCommand(anyMap(), anyList())).thenReturn(3);
    new TgzImporter(shellExecutor).importBucket(tgzBucket);
  }
}
View Full Code Here

  private void executeWarmToColdRetryScript(String splunkHome) {
    HashMap<String, String> env = new HashMap<String, String>();
    env.put("SPLUNK_HOME", splunkHome);
    ShellExecutor shellExecutor = ShellExecutor.getInstance();
    int exit = shellExecutor.executeCommand(env,
        asList(getWarmToColdRetryScript(splunkHome).getAbsolutePath()));
    assertEquals(exit, 0);
  }

  private File getWarmToColdRetryScript(String splunkHome) {
View Full Code Here

  private void executeCommand(File coldToFrozenRetryScript) {
    ShellExecutor executor = ShellExecutor.getInstance();
    HashMap<String, String> env = new HashMap<String, String>();
    env.put("SPLUNK_HOME", System.getenv("SPLUNK_HOME"));
    int exit = executor.executeCommand(env,
        asList(coldToFrozenRetryScript.getAbsolutePath()));
    assertEquals(exit, 0);
  }

  private void asserBucketWasArchived(LocalBucket bucket) throws IOException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.