コード例 #1
0
 protected void appendTemplate(String template, String destination, SshMachineLocation machine) {
   String content = ((BindDnsServerSshDriver) getDriver()).processTemplate(template);
   String temp = "/tmp/template-" + Strings.makeRandomId(6);
   machine.copyTo(new ByteArrayInputStream(content.getBytes()), temp);
   machine.execScript(
       "updating file",
       ImmutableList.of(
           BashCommands.sudo(String.format("tee -a %s < %s", destination, temp)),
           String.format("rm -f %s", temp)));
 }
コード例 #2
0
 protected void assertSshable(SshMachineLocation machine) {
   int result = machine.execScript("simplecommand", ImmutableList.of("true"));
   assertEquals(result, 0);
 }