ahgittin commented on code in PR #1399:
URL: https://github.com/apache/brooklyn-server/pull/1399#discussion_r1195387856


##########
camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/WorkflowYamlTest.java:
##########
@@ -1315,4 +1314,79 @@ public void 
testAddPolicyWithDslFromDeployableBlueprint() throws Exception {
         EntityAsserts.assertAttributeEquals(entity, 
Sensors.newSensor(Object.class, "result"), "yes");
     }
 
+    @Test
+    public void testSshStepOnLocalhostLocation() throws Exception {
+        String yaml =
+                "location: localhost\n" +
+                "services:\n" +
+                "  - type: " + WorkflowSoftwareProcess.class.getName() +"\n" +
+                "    name: sample-server\n" ;
+        Entity app = createStartWaitAndLogApplication(yaml);
+
+        WorkflowExecutionContext x1 = 
WorkflowBasicTest.runWorkflow(app.getChildren().iterator().next(), 
Strings.lines(
+                "lock: x",
+                "steps:",
+                "- type: ssh\n" +
+                "  command: |\n" +
+                "    echo \"init-done\" >> wf.log"), "test");
+        Object result  = x1.getTask(false).get().get();
+        Asserts.assertEquals(((Map)result).get("exit_code"), 0);
+    }
+
+    @Test
+    public void testSshStepOnLocalhostDefinition() throws Exception {

Review Comment:
   remove `lock: x`
   
   make integration test - or support mocks for connection definition.  that 
seems harder, but quite useful.  i think another mechanism we use is to specify 
the `RecordingSshTool`, so if there is a way to supply a tool class that could 
work.  (the recording tool does nothing and returns 0 for all ssh commands, but 
just records the commands.)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to