Land #11938, fix cmd_exec tests on python/windows
Merge branch 'land-11938' into upstream-master
This commit is contained in:
commit
cd182e2014
|
@ -71,7 +71,10 @@ class MetasploitModule < Msf::Post
|
|||
|
||||
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
|
||||
|
@ -82,7 +85,10 @@ class MetasploitModule < Msf::Post
|
|||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue