Skip to content

Commit

Permalink
Tests working on Windows 10 meterp
Browse files Browse the repository at this point in the history
  • Loading branch information
smashery committed Sep 25, 2024
1 parent 5c43cf5 commit 630ff97
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions test/modules/post/test/cmd_exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ def show_args_binary_space

def show_args_binary_special
result = show_args_binary_base
result[:upload_path] = result[:path].gsub('show_args','~!@#$%^&*(){}')
result[:cmd] = result[:cmd].gsub('show_args','~!@#$%^&*(){}')
chars = '~!@#$%^&*(){}`\'"<>,.;:=?+|'
if session.platform == 'windows'
chars = '~!@#$%^&(){}`\',.;=+'
end
result[:upload_path] = result[:path].gsub('show_args', chars)
result[:cmd] = result[:cmd].gsub('show_args', chars)

result
end
Expand Down Expand Up @@ -252,11 +256,6 @@ def test_create_process
end

it 'should accept special characters and return the create_process output' do
if session.platform.eql? 'windows'
# TODO: Fix this functionality
vprint_status('test skipped for Windows - functionality not correct')
true
end
output = create_process(show_args_binary[:cmd], args: ['~!@#$%^&*(){`1234567890[]",.\'<>'])
valid_show_args_response?(output, expected: [show_args_binary[:upload_path], '~!@#$%^&*(){`1234567890[]",.\'<>'])
end
Expand Down Expand Up @@ -284,23 +283,11 @@ def test_create_process
end

it 'should accept spaces in the filename and return the create_process output' do
if session.platform.eql? 'windows'
# TODO: Fix this functionality
vprint_status('test skipped for Windows CMD - functionality not correct')
true
end

output = create_process(show_args_binary_space[:cmd], args: [test_string, test_string])
valid_show_args_response?(output, expected: [show_args_binary_space[:cmd], test_string, test_string])
end

it 'should accept special characters in the filename and return the create_process output' do
if session.platform.eql? 'windows'
# TODO: Fix this functionality
vprint_status('test skipped for Windows CMD - functionality not correct')
true
end

output = create_process(show_args_binary_special[:cmd], args: [test_string, test_string])
valid_show_args_response?(output, expected: [show_args_binary_special[:cmd], test_string, test_string])
end
Expand Down

0 comments on commit 630ff97

Please sign in to comment.