Skip to content

Commit

Permalink
Improve acceptance test namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
adfoster-r7 committed Dec 11, 2024
1 parent a63fa68 commit 0935f0f
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 26 deletions.
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
3 changes: 2 additions & 1 deletion spec/acceptance_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

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|
puts f
require f
end

Expand Down
2 changes: 2 additions & 0 deletions spec/support/acceptance/command_shell.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module Acceptance::CommandShell
end
4 changes: 2 additions & 2 deletions spec/support/acceptance/command_shell/cmd.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Acceptance::Session
CMD = {
module Acceptance::CommandShell::Cmd
TESTS = {
payloads: [
{
name: 'windows/x64/shell_reverse_tcp',
Expand Down
4 changes: 2 additions & 2 deletions spec/support/acceptance/command_shell/powershell.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Acceptance::Session
POWERSHELL = {
module Acceptance::CommandShell::PowerShell
TESTS = {
payloads: [
{
name: 'cmd/windows/powershell_reverse_tcp',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Acceptance::Session
LINUX = {
module Acceptance::CommandShell::Unix
TESTS = {
payloads: [
{
name: "cmd/unix/reverse_bash",
Expand Down
2 changes: 2 additions & 0 deletions spec/support/acceptance/meterpreter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module Acceptance::Meterpreter
end
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Acceptance::Session
JAVA_METERPRETER = {
module Acceptance::Meterpreter::Java
TESTS = {
payloads: [
{
name: "java/meterpreter/reverse_tcp",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Acceptance::Session
METTLE_METERPRETER = {
module Acceptance::Meterpreter::Mettle
TESTS = {
payloads: [
{
name: "linux/x64/meterpreter/reverse_tcp",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Acceptance::Session
PHP_METERPRETER = {
module Acceptance::Meterpreter::Php
TESTS = {
payloads: [
{
name: "php/meterpreter_reverse_tcp",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Acceptance::Session
PYTHON_METERPRETER = {
module Acceptance::Meterpreter::Python
TESTS = {
payloads: [
{
name: "python/meterpreter_reverse_tcp",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Acceptance::Session
WINDOWS_METERPRETER = {
module Acceptance::Meterpreter::WindowsMeterpreter
TESTS = {
payloads: [
{
name: "windows/meterpreter/reverse_tcp",
Expand Down

0 comments on commit 0935f0f

Please sign in to comment.