brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Support scriptDir location config
Date Thu, 29 Jan 2015 11:00:44 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/476#discussion_r23760148
  
    --- Diff: core/src/test/java/brooklyn/location/basic/SshMachineLocationIntegrationTest.java
---
    @@ -75,7 +81,36 @@ public void testExtractingConnectablePassphraselessKey() throws Exception
{
             ByteArrayOutputStream out = new ByteArrayOutputStream();
             int result = tool.execCommands(MutableMap.<String,Object>of("out", out),
Arrays.asList("date"));
             Assert.assertTrue(out.toString().contains(" 20"), "out="+out);
    -        Assert.assertEquals(result, 0);
    +        assertEquals(result, 0);
    +    }
    +
    +    @Test(groups = "Integration")
    +    public void testExecScriptScriptDirFlagIsRespected() throws Exception {
    +        // For explanation of (some of) the magic behind this command, see http://stackoverflow.com/a/229606/68898
    +        final String command = "if [[ \"$0\" == \"/var/tmp/\"* ]]; then true; else false;
fi";
    +
    +        LocalhostMachineProvisioningLocation lhp = (LocalhostMachineProvisioningLocation)
mgmt.getLocationRegistry().resolve("localhost", true, null).orNull();
    +        SshMachineLocation sm = lhp.obtain();
    +
    +        Map<String, Object> props = ImmutableMap.<String, Object>builder()
    +                .put(SshTool.PROP_SCRIPT_DIR.getName(), "/var/tmp")
    +                .build();
    +        sm.execScript(props, "Test script directory execution", ImmutableList.of(command));
    --- End diff --
    
    I think you need to assert that the return value is 0.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message