-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: **Added:** - expect.yaml: Added a new expect action example - expectstep.go: Introduced ExpectStep for managing expect commands using the go-expect library. - expectstep_test.go: Added tests for the new ExpectStep functionality. **Changed:** - .pre-commit-config.yaml: Upgraded pre-commit hooks to v4.6.0. - codespell: Updated codespell configuration to skip additional content. - go.mod: Updated to Go 1.22.0, added dependencies for go-expect and other libraries, and updated existing dependencies. - step.go: Added support for parsing ExpectStep actions. **Removed:** - Removed duplicate go-vet configurations in .pre-commit-config.yaml. Pull Request resolved: #501 Reviewed By: d0n601 Differential Revision: D59012858 Pulled By: l50 fbshipit-source-id: 24a767f983c2f3d205c4e69388cded938aae9f63
- Loading branch information
1 parent
0d980ea
commit 4e68927
Showing
10 changed files
with
796 additions
and
78 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
api_version: 2.0 | ||
uuid: 7be9d2be-49be-4114-8618-306a62eedec2 | ||
name: Complex Expect Step with Python Script | ||
description: | | ||
This TTP demonstrates the usage of an expect step to automate interaction | ||
with an interactive Python script, using the go-expect library. | ||
args: | ||
- name: command | ||
description: The command to execute | ||
default: "python3 interactive.py" | ||
steps: | ||
- name: create_python_script | ||
inline: | | ||
echo 'print("Enter your name:")' > /tmp/interactive.py | ||
echo 'name = input()' >> /tmp/interactive.py | ||
echo 'print("Enter your age:")' >> /tmp/interactive.py | ||
echo 'age = input()' >> /tmp/interactive.py | ||
echo 'print(f"Hello {name}, you are {age} years old!")' >> /tmp/interactive.py | ||
- name: run_expect_script | ||
inline: | | ||
python3 /tmp/interactive.py | ||
responses: | ||
- prompt: "Enter your name:" | ||
response: "John" | ||
- prompt: "Enter your age:" | ||
response: "30" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.