Skip to content

Commit

Permalink
Fix func. tests to match new escaping behavior
Browse files Browse the repository at this point in the history
PR #453 changed how commands were escaped but did not update the
functional tests to match. Two functional tests were failing as a
result. This commit fixes those tests.
  • Loading branch information
mattbrictson committed Jul 1, 2019
1 parent d01f803 commit 3c5958e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/functional/backends/test_netssh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_simple_netssh
"Command: /usr/bin/env ls -l\n",
"Command: if test ! -d /tmp; then echo \"Directory does not exist '/tmp'\" 1>&2; false; fi\n",
"Command: if ! sudo -u root whoami > /dev/null; then echo \"You cannot switch to user 'root' using sudo, please check the sudoers file\" 1>&2; false; fi\n",
"Command: cd /tmp && ( export RAILS_ENV=\"production\" ; sudo -u root RAILS_ENV=\"production\" -- sh -c '/usr/bin/env touch restart.txt' )\n"
"Command: cd /tmp && ( export RAILS_ENV=\"production\" ; sudo -u root RAILS_ENV=\"production\" -- sh -c /usr/bin/env\\ touch\\ restart.txt )\n"
], command_lines
end

Expand Down Expand Up @@ -82,7 +82,7 @@ def test_group_netssh
command_lines = @output.lines.select { |line| line.start_with?('Command:') }
assert_equal [
"Command: if ! sudo -u root whoami > /dev/null; then echo \"You cannot switch to user 'root' using sudo, please check the sudoers file\" 1>&2; false; fi\n",
"Command: sudo -u root -- sh -c 'sg admin -c \"/usr/bin/env touch restart.txt\"'\n"
"Command: sudo -u root -- sh -c sg\\ admin\\ -c\\ /usr/bin/env\\\\\\ touch\\\\\\ restart.txt\n"
], command_lines
end

Expand Down

1 comment on commit 3c5958e

@Fudoshiki
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.