Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR for issue #60: expect-like interaction support #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants