Skip to content
This repository was archived by the owner on May 25, 2025. It is now read-only.

Conversation

rzabini
Copy link

@rzabini rzabini commented Apr 23, 2015

Hi,
here is the pull request with the proposed changes.
As I wrote in the issue description, and can be seen in the tests, a shellExpect instruction may be added to the ssh session. The shellExpect has a closure parameter which is a succession of send and expectOrThrow elements: send executes a command, expectOrThrow waits for a specified number of seconds for a pattern to appear on the command output. It throws a TimeoutException if the pattern does not appear.
Thank you,
Romano

@int128 int128 added the feature label Apr 24, 2015
@int128
Copy link
Owner

int128 commented May 3, 2015

Great!
This approach is useful for not only shell but execute, as following example:

// executing a shell
shell expect: {
  send 'hello server'
  expectOrThrow 1,'please enter password:'
}
// executing a command
execute 'some command', expect: {
  send 'hello server'
  expectOrThrow 1,'please enter password:'
}

I will add some enhance on the given pull request and merge it.
Please let me know if you have some idea.
Thank you.

@int128
Copy link
Owner

int128 commented May 3, 2015

#60

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants