Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve acceptance test namespace #19717

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions spec/acceptance/command_shell_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
RSpec.describe 'CommandShell' do
include_context 'wait_for_expect'

# Tests to ensure that CMD/Powershell/Linux is consistent across all implementations/operation systems
# Tests to ensure that CMD/Powershell/unix is consistent across all implementations/operation systems
COMMAND_SHELL_PAYLOADS = Acceptance::Session.with_session_name_merged(
{
powershell: Acceptance::Session::POWERSHELL,
cmd: Acceptance::Session::CMD,
linux: Acceptance::Session::LINUX
powershell: Acceptance::CommandShell::PowerShell::TESTS,
cmd: Acceptance::CommandShell::PowerShell::TESTS,
unix: Acceptance::CommandShell::Unix::TESTS,
}
)

Expand Down
10 changes: 5 additions & 5 deletions spec/acceptance/meterpreter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
# Tests to ensure that Meterpreter is consistent across all implementations/operation systems
METERPRETER_PAYLOADS = Acceptance::Session.with_session_name_merged(
{
python: Acceptance::Session::PYTHON_METERPRETER,
php: Acceptance::Session::PHP_METERPRETER,
java: Acceptance::Session::JAVA_METERPRETER,
mettle: Acceptance::Session::METTLE_METERPRETER,
windows_meterpreter: Acceptance::Session::WINDOWS_METERPRETER
python: Acceptance::Meterpreter::Python::TESTS,
php: Acceptance::Meterpreter::Php::TESTS,
java: Acceptance::Meterpreter::Java::TESTS,
mettle: Acceptance::Meterpreter::Mettle::TESTS,
windows_meterpreter: Acceptance::Meterpreter::WindowsMeterpreter::TESTS
}
)

Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

acceptance_support_glob = File.expand_path(File.join(File.dirname(__FILE__), 'support', 'acceptance', '**', '*.rb'))
shared_contexts_glob = File.expand_path(File.join(File.dirname(__FILE__), 'support', 'shared', 'contexts', '**', '*.rb'))
Dir[acceptance_support_glob, shared_contexts_glob].each do |f|
Dir[acceptance_support_glob, shared_contexts_glob].sort.each do |f|
require f
end

Expand Down
282 changes: 143 additions & 139 deletions spec/support/acceptance/command_shell/cmd.rb
Original file line number Diff line number Diff line change
@@ -1,150 +1,154 @@
module Acceptance::Session
CMD = {
payloads: [
{
name: 'windows/x64/shell_reverse_tcp',
extension: '.exe',
platforms: [:windows],
execute_cmd: ['${payload_path}'],
executable: true,
generate_options: {
'-f': 'exe'
},
datastore: {
global: {},
module: {}
}
}
],
module_tests: [
{
name: 'post/test/cmd_exec',
platforms: [
[
:linux,
{
skip: true,
reason: 'Payload not compiled for platform'
}
],
[
:osx,
{
skip: true,
reason: 'Payload not compiled for platform'
module Acceptance
module CommandShell
module Cmd
TESTS = {
payloads: [
{
name: 'windows/x64/shell_reverse_tcp',
extension: '.exe',
platforms: [:windows],
execute_cmd: ['${payload_path}'],
executable: true,
generate_options: {
'-f': 'exe'
},
datastore: {
global: {},
module: {}
}
],
:windows
],
skipped: false,
lines: {
linux: {
known_failures: []
},
osx: {
known_failures: []
},
windows: {
known_failures: []
}
}
},
{
name: 'post/test/file',
platforms: [
[
:linux,
{
skip: true,
reason: 'Payload not compiled for platform'
}
],
[
:osx,
{
skip: true,
reason: 'Payload not compiled for platform'
}
],
:windows
],
skipped: false,
lines: {
linux: {
known_failures: []
},
osx: {
known_failures: []
},
windows: {
known_failures: []
}
}
},
{
name: 'post/test/get_env',
platforms: [
[
:linux,
{
skip: true,
reason: 'Payload not compiled for platform'
}
],
[
:osx,
{
skip: true,
reason: 'Payload not compiled for platform'
module_tests: [
{
name: 'post/test/cmd_exec',
platforms: [
[
:linux,
{
skip: true,
reason: 'Payload not compiled for platform'
}
],
[
:osx,
{
skip: true,
reason: 'Payload not compiled for platform'
}
],
:windows
],
skipped: false,
lines: {
linux: {
known_failures: []
},
osx: {
known_failures: []
},
windows: {
known_failures: []
}
}
],
:windows
],
skipped: false,
lines: {
linux: {
known_failures: []
},
osx: {
known_failures: []
},
windows: {
known_failures: []
}
}
},
{
name: 'post/test/registry',
platforms: [
[
:linux,
{
skip: true,
reason: 'Windows only test'
{
name: 'post/test/file',
platforms: [
[
:linux,
{
skip: true,
reason: 'Payload not compiled for platform'
}
],
[
:osx,
{
skip: true,
reason: 'Payload not compiled for platform'
}
],
:windows
],
skipped: false,
lines: {
linux: {
known_failures: []
},
osx: {
known_failures: []
},
windows: {
known_failures: []
}
}
],
[
:osx,
{
skip: true,
reason: 'Windows only test'
}
],
:windows
],
skipped: false,
lines: {
linux: {
known_failures: []
},
osx: {
known_failures: []
{
name: 'post/test/get_env',
platforms: [
[
:linux,
{
skip: true,
reason: 'Payload not compiled for platform'
}
],
[
:osx,
{
skip: true,
reason: 'Payload not compiled for platform'
}
],
:windows
],
skipped: false,
lines: {
linux: {
known_failures: []
},
osx: {
known_failures: []
},
windows: {
known_failures: []
}
}
},
windows: {
known_failures: []
{
name: 'post/test/registry',
platforms: [
[
:linux,
{
skip: true,
reason: 'Windows only test'
}
],
[
:osx,
{
skip: true,
reason: 'Windows only test'
}
],
:windows
],
skipped: false,
lines: {
linux: {
known_failures: []
},
osx: {
known_failures: []
},
windows: {
known_failures: []
}
}
}
}
]
}
]
}
end
end
end
Loading
Loading