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

munet: fix bug in cli.py #45

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

liambrady
Copy link
Contributor

When a target node and command share the same same substring in host_cmd_split, then an incorrect index will be used. This results in returning a bad command.

For example, define the following in munet.yaml:

topology:
  nodes:
    - name: shoo
    - name: foo
cmd:
  commands:
    - name: ""
      exec: "bash -c \"{}\""
      format: "[NODE ...] COMMAND [ARGUMENT ...]"
      interactive: true

and the following results can be observed:

munet> foo sh echo hi
hi
munet> shoo sh echo hi
*** non-zero exit status: 127
/bin/bash: line 1: oo: command not found
munet>

when a target node and command share the same
same substring in host_cmd_split, then an incorrect
index will be used. This results in returning a bad
command.

Signed-off-by: Liam Brady <lbrady@labn.net>
@liambrady liambrady requested a review from choppsv1 January 15, 2025 21:46
@liambrady liambrady self-assigned this Jan 15, 2025
@liambrady liambrady added the bug Something isn't working label Jan 15, 2025
Copy link

codecov bot commented Jan 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.83%. Comparing base (6345948) to head (f9a2da7).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #45      +/-   ##
==========================================
- Coverage   59.98%   58.83%   -1.15%     
==========================================
  Files          19       19              
  Lines        5665     5728      +63     
==========================================
- Hits         3398     3370      -28     
- Misses       2267     2358      +91     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@choppsv1 choppsv1 merged commit cad5481 into LabNConsulting:main Jan 23, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants