diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index c09959ee..9367da2b 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -1,5 +1,21 @@ name: Verify +# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions +permissions: + actions: none + checks: none + contents: none + deployments: none + id-token: none + issues: none + discussions: none + packages: none + pages: none + pull-requests: none + repository-projects: none + security-events: none + statuses: none + on: push: branches: @@ -10,7 +26,7 @@ on: jobs: test: - runs-on: ubuntu-18.04 + runs-on: ${{ matrix.os }} timeout-minutes: 40 services: @@ -34,11 +50,18 @@ jobs: - 2.7 - 3.0 - 3.1 + os: + - ubuntu-18.04 + - ubuntu-22.04 + exclude: + - { os: ubuntu-22.04, ruby: 2.6 } + - { os: ubuntu-22.04, ruby: 2.7 } + - { os: ubuntu-22.04, ruby: 3.0 } env: RAILS_ENV: test - name: Ruby ${{ matrix.ruby }} + name: ${{ matrix.os }} - Ruby ${{ matrix.ruby }} steps: - name: Install system dependencies run: sudo apt-get install libpcap-dev graphviz diff --git a/metasploit_data_models.gemspec b/metasploit_data_models.gemspec index 9e07ade6..7bada57d 100644 --- a/metasploit_data_models.gemspec +++ b/metasploit_data_models.gemspec @@ -41,7 +41,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'webrick' # os fingerprinting - s.add_runtime_dependency 'recog', '~> 2.0' + s.add_runtime_dependency 'recog' # arel-helpers: Useful tools to help construct database queries with ActiveRecord and Arel. s.add_runtime_dependency 'arel-helpers' diff --git a/spec/app/models/mdm/host_spec.rb b/spec/app/models/mdm/host_spec.rb index e3624fda..58216152 100644 --- a/spec/app/models/mdm/host_spec.rb +++ b/spec/app/models/mdm/host_spec.rb @@ -547,14 +547,14 @@ def search_for(str) it "when the string contains 'ppc'" do expect(host.send(:get_arch_from_string, 'blahppcblah')).to eq('PowerPC') end - end - context 'should return nil' do it 'when PowerPC is cased incorrectly' do - expect(host.send(:get_arch_from_string, 'powerPC')).to eq(nil) - expect(host.send(:get_arch_from_string, 'Powerpc')).to eq(nil) + expect(host.send(:get_arch_from_string, 'powerPC')).to eq('PowerPC') + expect(host.send(:get_arch_from_string, 'Powerpc')).to eq('PowerPC') end + end + context 'should return nil' do it 'when no recognized arch string is present' do expect(host.send(:get_arch_from_string, 'blahblah')).to eq(nil) end diff --git a/spec/app/models/mdm/web_page_spec.rb b/spec/app/models/mdm/web_page_spec.rb index 80471d76..f4b36080 100644 --- a/spec/app/models/mdm/web_page_spec.rb +++ b/spec/app/models/mdm/web_page_spec.rb @@ -1,3 +1,5 @@ +require 'webrick' + RSpec.describe Mdm::WebPage, type: :model do it_should_behave_like 'Metasploit::Concern.run' diff --git a/spec/app/models/metasploit_data_models/ip_address/v4/range_spec.rb b/spec/app/models/metasploit_data_models/ip_address/v4/range_spec.rb index b85673e0..4f3a9cbc 100644 --- a/spec/app/models/metasploit_data_models/ip_address/v4/range_spec.rb +++ b/spec/app/models/metasploit_data_models/ip_address/v4/range_spec.rb @@ -185,7 +185,7 @@ end context '#to_s' do - subject(:to_s) { + subject(:to_s_result) { range.to_s } @@ -195,7 +195,7 @@ } it 'equals the original formatted value' do - expect(to_s).to eq(formatted_value) + expect(to_s_result).to eq(formatted_value) end end @@ -295,4 +295,4 @@ it { is_expected.not_to be_a Range } end end -end \ No newline at end of file +end diff --git a/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/list_spec.rb b/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/list_spec.rb index 4d51547d..c0aaa41b 100644 --- a/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/list_spec.rb +++ b/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/list_spec.rb @@ -135,7 +135,7 @@ end context '#to_s' do - subject(:to_s) do + subject(:to_s_value) do nmap.to_s end @@ -145,7 +145,7 @@ } it 'returns a string equal to the original formatted value' do - expect(to_s).to eq(formatted_value) + expect(to_s_value).to eq(formatted_value) end end @@ -155,7 +155,7 @@ } it 'returned the formatted value as a string' do - expect(to_s).to eq(formatted_value.to_s) + expect(to_s_value).to eq(formatted_value.to_s) end end end @@ -273,4 +273,4 @@ end end end -end \ No newline at end of file +end diff --git a/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/range_spec.rb b/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/range_spec.rb index 371ab6c0..6c99fb8d 100644 --- a/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/range_spec.rb +++ b/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/range_spec.rb @@ -185,7 +185,7 @@ end context '#to_s' do - subject(:to_s) { + subject(:to_s_result) { range.to_s } @@ -195,7 +195,7 @@ } it 'equals the original formatted value' do - expect(to_s).to eq(formatted_value) + expect(to_s_result).to eq(formatted_value) end end @@ -299,4 +299,4 @@ it { is_expected.not_to be_a Range } end end -end \ No newline at end of file +end