Skip to content

Commit

Permalink
fix cmd_exec tests on python/windows
Browse files Browse the repository at this point in the history
  • Loading branch information
timwr committed Jun 2, 2019
1 parent d335415 commit cd460aa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/modules/post/test/cmd_exec.rb
Expand Up @@ -71,7 +71,10 @@ def test_cmd_exec_quotes

it "should return the result of echo with single quotes" do
test_string = Rex::Text.rand_text_alpha(4)
if session.platform.eql? 'windows'
if session.platform.eql? 'windows' and session.arch == ARCH_PYTHON
output = cmd_exec("cmd.exe", "/c echo \"#{test_string}\"")
output == test_string
elsif session.platform.eql? 'windows'
output = cmd_exec("cmd.exe", "/c echo '#{test_string}'")
output == "'" + test_string + "'"
else
Expand All @@ -82,7 +85,10 @@ def test_cmd_exec_quotes

it "should return the result of echo with double quotes" do
test_string = Rex::Text.rand_text_alpha(4)
if session.platform.eql? 'windows'
if session.platform.eql? 'windows' and session.arch == ARCH_PYTHON
output = cmd_exec("cmd.exe", "/c echo \"#{test_string}\"")
output == test_string
elsif session.platform.eql? 'windows'
output = cmd_exec("cmd.exe", "/c echo \"#{test_string}\"")
output == "\"" + test_string + "\""
else
Expand Down

0 comments on commit cd460aa

Please sign in to comment.