From 3c5958eb2293b593dff8bced30762cce46a61053 Mon Sep 17 00:00:00 2001 From: Matt Brictson Date: Sun, 30 Jun 2019 17:45:42 -0700 Subject: [PATCH] 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. --- test/functional/backends/test_netssh.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/backends/test_netssh.rb b/test/functional/backends/test_netssh.rb index 52837eee..76cb50d7 100644 --- a/test/functional/backends/test_netssh.rb +++ b/test/functional/backends/test_netssh.rb @@ -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 @@ -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