Skip to content

test the 3 run command modes- local,ssh and docker#12

Merged
aravindavk merged 4 commits intokadalu-tech:mainfrom
divyashreej:test-ssh-commands
Apr 19, 2025
Merged

test the 3 run command modes- local,ssh and docker#12
aravindavk merged 4 commits intokadalu-tech:mainfrom
divyashreej:test-ssh-commands

Conversation

@divyashreej
Copy link
Copy Markdown

fixes #3 and #4

Signed-off-by: Divyashree Jayaram <divyashreej15@gmail.com>
Signed-off-by: Divyashree Jayaram <divyashreej15@gmail.com>
@divyashreej
Copy link
Copy Markdown
Author

verified output for run command in ssh mode:
OK [318.35ms] [ 1] file=test_commands_ssh.py:13 [command_run("cat /tmp/hello") ]

Summary:

OK [418.08ms] total=1 passed=1 failed=0

verified output for run command in docker mode:
OK [255.31ms] [ 1] file=test_commands_docker.py:8 [command_run("echo 'Hello World!' > /root/r...]
OK [ 78.48ms] [ 2] file=test_commands_docker.py:9 [command_run("stat /root/reports.txt") #rep...]
OK [ 70.36ms] [ 3] file=test_commands_docker.py:10 [command_run("stat /root/reports1.txt 2>/de...]

@divyashreej
Copy link
Copy Markdown
Author

@aravindavk could you please assign this PR to me, Assignee option is disabled for me.

Copy link
Copy Markdown
Member

@aravindavk aravindavk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. A few minor comments

from binnacle.plugins.compare import compare_equal, compare_not_equal
from binnacle.core import debug, show_summary
from binnacle.plugins.http import http_get, http_post, http_put, http_delete, validated_json, http_base_url, http_set_header
from binnacle.plugins.commands import command_run,command_mode, command_node,command_ssh_user,command_ssh_sudo,command_ssh_pem_file,command_port,command_container
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format this as

from binnacle.plugins.commands import (
    command_run, command_mode, command_node,
    command_ssh_user, command_ssh_sudo, command_ssh_pem_file,
    command_port, command_container
)



def escaped_ssh_cmd(cmd):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this extra line



def full_cmd(cmd):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

-i {_command_config.ssh_pem_file} -p {_command_config.ssh_port} \
'{escaped_ssh_cmd(cmd)}'
"""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@aravindavk aravindavk merged commit 2601cb9 into kadalu-tech:main Apr 19, 2025
@divyashreej
Copy link
Copy Markdown
Author

@aravindavk Thank you, sure I will do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SSH support to run the commands

2 participants