Skip to content

Commit 3c5958e

Browse files
committed
Fix func. tests to match new escaping behavior
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.
1 parent d01f803 commit 3c5958e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/functional/backends/test_netssh.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_simple_netssh
3838
"Command: /usr/bin/env ls -l\n",
3939
"Command: if test ! -d /tmp; then echo \"Directory does not exist '/tmp'\" 1>&2; false; fi\n",
4040
"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",
41-
"Command: cd /tmp && ( export RAILS_ENV=\"production\" ; sudo -u root RAILS_ENV=\"production\" -- sh -c '/usr/bin/env touch restart.txt' )\n"
41+
"Command: cd /tmp && ( export RAILS_ENV=\"production\" ; sudo -u root RAILS_ENV=\"production\" -- sh -c /usr/bin/env\\ touch\\ restart.txt )\n"
4242
], command_lines
4343
end
4444

@@ -82,7 +82,7 @@ def test_group_netssh
8282
command_lines = @output.lines.select { |line| line.start_with?('Command:') }
8383
assert_equal [
8484
"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",
85-
"Command: sudo -u root -- sh -c 'sg admin -c \"/usr/bin/env touch restart.txt\"'\n"
85+
"Command: sudo -u root -- sh -c sg\\ admin\\ -c\\ /usr/bin/env\\\\\\ touch\\\\\\ restart.txt\n"
8686
], command_lines
8787
end
8888

0 commit comments

Comments
 (0)