Skip to content

Commit d31d282

Browse files
authored
Land rapid7#19256, Fix warnings in acceptance tests
2 parents f5aea8c + b48fbc6 commit d31d282

File tree

11 files changed

+29
-40
lines changed

11 files changed

+29
-40
lines changed

.github/workflows/ldap_acceptance.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ on:
4242
# - cron: '*/15 * * * *'
4343

4444
jobs:
45-
env:
46-
BUNDLE_WITHOUT: "coverage development pcap"
47-
4845
ldap:
4946
runs-on: ${{ matrix.os }}
5047
timeout-minutes: 40
@@ -59,6 +56,7 @@ jobs:
5956

6057
env:
6158
RAILS_ENV: test
59+
BUNDLE_WITHOUT: "coverage development pcap"
6260

6361
name: LDAP Acceptance - ${{ matrix.os }} - Ruby ${{ matrix.ruby }}
6462
steps:

.github/workflows/mssql_acceptance.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ on:
4242
# - cron: '*/15 * * * *'
4343

4444
jobs:
45-
env:
46-
BUNDLE_WITHOUT: "coverage development pcap"
47-
4845
mssql:
4946
runs-on: ${{ matrix.os }}
5047
timeout-minutes: 40
@@ -75,6 +72,8 @@ jobs:
7572

7673
env:
7774
RAILS_ENV: test
75+
BUNDLE_WITHOUT: "coverage development pcap"
76+
7877

7978
name: ${{ matrix.docker_image }} - ${{ matrix.os }} - Ruby ${{ matrix.ruby }}
8079
steps:

.github/workflows/mysql_acceptance.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ on:
4242
# - cron: '*/15 * * * *'
4343

4444
jobs:
45-
env:
46-
BUNDLE_WITHOUT: "coverage development pcap"
47-
4845
mysql:
4946
runs-on: ${{ matrix.os }}
5047
timeout-minutes: 40
@@ -69,12 +66,11 @@ jobs:
6966
- ubuntu-latest
7067
target:
7168
- { version: "mariadb:latest", health_cmd: "mariadb -uroot -ppassword -e 'SELECT version()'" }
72-
- { version: "mariadb:5.5.42", health_cmd: "mysql -uroot -ppassword -e 'SELECT version()'" }
7369
- { version: "mysql:latest", health_cmd: "mysql -uroot -ppassword -e 'SELECT version()'" }
74-
- { version: "mysql:5.5.42", health_cmd: "mysql -uroot -ppassword -e 'SELECT version()'" }
7570

7671
env:
7772
RAILS_ENV: test
73+
BUNDLE_WITHOUT: "coverage development pcap"
7874

7975
name: ${{ matrix.target.version }} - ${{ matrix.os }} - Ruby ${{ matrix.ruby }}
8076
steps:

.github/workflows/postgres_acceptance.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ on:
4242
# - cron: '*/15 * * * *'
4343

4444
jobs:
45-
env:
46-
BUNDLE_WITHOUT: "coverage development pcap"
47-
4845
postgres:
4946
runs-on: ${{ matrix.os }}
5047
timeout-minutes: 40
@@ -75,6 +72,7 @@ jobs:
7572

7673
env:
7774
RAILS_ENV: test
75+
BUNDLE_WITHOUT: "coverage development pcap"
7876

7977
name: ${{ matrix.docker_image }} - ${{ matrix.os }} - Ruby ${{ matrix.ruby }}
8078
steps:

.github/workflows/smb_acceptance.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ on:
4242
# - cron: '*/15 * * * *'
4343

4444
jobs:
45-
env:
46-
BUNDLE_WITHOUT: "coverage development pcap"
47-
4845
smb:
4946
runs-on: ${{ matrix.os }}
5047
timeout-minutes: 40
@@ -61,6 +58,7 @@ jobs:
6158
RAILS_ENV: test
6259
SMB_USERNAME: acceptance_tests_user
6360
SMB_PASSWORD: acceptance_tests_password
61+
BUNDLE_WITHOUT: "coverage development pcap"
6462

6563
name: SMB Acceptance - ${{ matrix.os }} - Ruby ${{ matrix.ruby }}
6664
steps:

spec/acceptance/ldap_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
RHOST_REGEX = /\d+\.\d+\.\d+\.\d+:\d+/
77

8-
TESTS = {
8+
tests = {
99
ldap: {
1010
target: {
1111
session_module: 'auxiliary/scanner/ldap/ldap_login',
@@ -119,7 +119,7 @@
119119
}
120120
}
121121

122-
TEST_ENVIRONMENT = AllureRspec.configuration.environment_properties
122+
allure_test_environment = AllureRspec.configuration.environment_properties
123123

124124
let_it_be(:current_platform) { Acceptance::Meterpreter.current_platform }
125125

@@ -283,7 +283,7 @@ def with_test_harness(module_test)
283283
raise console_reset_error if console_reset_error
284284
end
285285

286-
TESTS.each do |runtime_name, test_config|
286+
tests.each do |runtime_name, test_config|
287287
runtime_name = "#{runtime_name}#{ENV.fetch('RUNTIME_VERSION', '')}"
288288

289289
describe "#{Acceptance::Meterpreter.current_platform}/#{runtime_name}", focus: test_config[:focus] do
@@ -299,7 +299,7 @@ def with_test_harness(module_test)
299299
{}
300300
end
301301

302-
let(:test_environment) { TEST_ENVIRONMENT }
302+
let(:test_environment) { allure_test_environment }
303303

304304
let(:default_module_datastore) do
305305
{

spec/acceptance/meterpreter_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515
)
1616

17-
TEST_ENVIRONMENT = AllureRspec.configuration.environment_properties
17+
allure_test_environment = AllureRspec.configuration.environment_properties
1818

1919
let_it_be(:current_platform) { Acceptance::Meterpreter::current_platform }
2020

@@ -92,7 +92,7 @@ def initialize(path)
9292
}
9393
end
9494

95-
let(:test_environment) { TEST_ENVIRONMENT }
95+
let(:test_environment) { allure_test_environment }
9696

9797
let(:default_module_datastore) do
9898
{
@@ -342,7 +342,7 @@ def get_file_attachment_contents(path)
342342
Acceptance::Meterpreter.supported_platform?(payload_config) &&
343343
Acceptance::Meterpreter.supported_platform?(module_test) &&
344344
# Skip tests that are explicitly skipped, or won't pass in the current environment
345-
!Acceptance::Meterpreter.skipped_module_test?(module_test, TEST_ENVIRONMENT)
345+
!Acceptance::Meterpreter.skipped_module_test?(module_test, allure_test_environment)
346346
),
347347
# test metadata - will appear in allure report
348348
module_test: module_test[:name]

spec/acceptance/mssql_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
RSpec.describe 'MSSQL sessions and MSSQL modules' do
44
include_context 'wait_for_expect'
55

6-
TESTS = {
6+
tests = {
77
mssql: {
88
target: {
99
session_module: "auxiliary/scanner/mssql/mssql_login",
@@ -106,7 +106,7 @@
106106
}
107107
}
108108

109-
TEST_ENVIRONMENT = AllureRspec.configuration.environment_properties
109+
allure_test_environment = AllureRspec.configuration.environment_properties
110110

111111
let_it_be(:current_platform) { Acceptance::Meterpreter::current_platform }
112112

@@ -269,7 +269,7 @@ def with_test_harness(module_test)
269269
raise console_reset_error if console_reset_error
270270
end
271271

272-
TESTS.each do |runtime_name, test_config|
272+
tests.each do |runtime_name, test_config|
273273
runtime_name = "#{runtime_name}#{ENV.fetch('RUNTIME_VERSION', '')}"
274274

275275
describe "#{Acceptance::Meterpreter.current_platform}/#{runtime_name}", focus: test_config[:focus] do
@@ -287,7 +287,7 @@ def with_test_harness(module_test)
287287
}
288288
end
289289

290-
let(:test_environment) { TEST_ENVIRONMENT }
290+
let(:test_environment) { allure_test_environment }
291291

292292
let(:default_module_datastore) do
293293
{

spec/acceptance/mysql_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
RHOST_REGEX = /\d+\.\d+\.\d+\.\d+:\d+/
77

8-
TESTS = {
8+
tests = {
99
mysql: {
1010
target: {
1111
session_module: "auxiliary/scanner/mysql/mysql_login",
@@ -84,7 +84,7 @@
8484
}
8585
}
8686

87-
TEST_ENVIRONMENT = AllureRspec.configuration.environment_properties
87+
allure_test_environment = AllureRspec.configuration.environment_properties
8888

8989
let_it_be(:current_platform) { Acceptance::Meterpreter::current_platform }
9090

@@ -247,7 +247,7 @@ def with_test_harness(module_test)
247247
raise console_reset_error if console_reset_error
248248
end
249249

250-
TESTS.each do |runtime_name, test_config|
250+
tests.each do |runtime_name, test_config|
251251
runtime_name = "#{runtime_name}#{ENV.fetch('RUNTIME_VERSION', '')}"
252252

253253
describe "#{Acceptance::Meterpreter.current_platform}/#{runtime_name}", focus: test_config[:focus] do
@@ -265,7 +265,7 @@ def with_test_harness(module_test)
265265
}
266266
end
267267

268-
let(:test_environment) { TEST_ENVIRONMENT }
268+
let(:test_environment) { allure_test_environment }
269269

270270
let(:default_module_datastore) do
271271
{

spec/acceptance/postgres_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
RSpec.describe 'Postgres sessions and postgres modules' do
44
include_context 'wait_for_expect'
55

6-
TESTS = {
6+
tests = {
77
postgres: {
88
target: {
99
session_module: "auxiliary/scanner/postgres/postgres_login",
@@ -90,7 +90,7 @@
9090
}
9191
}
9292

93-
TEST_ENVIRONMENT = AllureRspec.configuration.environment_properties
93+
allure_test_environment = AllureRspec.configuration.environment_properties
9494

9595
let_it_be(:current_platform) { Acceptance::Meterpreter::current_platform }
9696

@@ -253,7 +253,7 @@ def with_test_harness(module_test)
253253
raise console_reset_error if console_reset_error
254254
end
255255

256-
TESTS.each do |runtime_name, test_config|
256+
tests.each do |runtime_name, test_config|
257257
runtime_name = "#{runtime_name}#{ENV.fetch('RUNTIME_VERSION', '')}"
258258

259259
describe "#{Acceptance::Meterpreter.current_platform}/#{runtime_name}", focus: test_config[:focus] do
@@ -271,7 +271,7 @@ def with_test_harness(module_test)
271271
}
272272
end
273273

274-
let(:test_environment) { TEST_ENVIRONMENT }
274+
let(:test_environment) { allure_test_environment }
275275

276276
let(:default_module_datastore) do
277277
{

0 commit comments

Comments
 (0)