added cve tag to xml file

This commit is contained in:
Christian Mehlmauer
2013-08-23 14:02:09 +02:00
parent 55089646c2
commit 1f5cb4b0a0
7 changed files with 126 additions and 52 deletions

View File

@@ -19,7 +19,13 @@ describe Vulnerability::Output do
@module = 'gathering/yolo'
@expected = modules_url + @module
end
end
end
describe '::cve_url' do
it 'returns the correct url' do
Vulnerability::Output.cve_url('1111-1111').should == 'http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-1111-1111'
end
end
describe '#output' do
# How to test it ? oO

View File

@@ -18,6 +18,7 @@ describe Vulnerability do
its(:type) { should be type }
its(:metasploit_modules) { should be_empty }
its(:fixed_in) { should be_empty }
its(:cve) { should be_empty }
end
context 'with metasploit modules argument' do
@@ -26,6 +27,7 @@ describe Vulnerability do
its(:metasploit_modules) { should be modules }
its(:fixed_in) { should be_empty }
its(:cve) { should be_empty }
end
context 'with metasploit modules and fixed version argument' do
@@ -33,8 +35,19 @@ describe Vulnerability do
let(:fixed_version) { '1.0' }
its(:metasploit_modules) { should be modules }
its(:fixed_in) { should == '1.0' }
its(:fixed_in) { should == '1.0' }
its(:cve) { should be_empty }
end
context 'with cve argument' do
subject(:vulnerability) { Vulnerability.new(title, type, references, [], '', cve) }
let(:cve) { %w{2011-001 2011-002} }
its(:metasploit_modules) { should be_empty }
its(:fixed_in) { should be_empty }
its(:cve) { should be cve }
end
end
describe '::load_from_xml_node' do
@@ -47,6 +60,7 @@ describe Vulnerability do
its(:type) { should == 'CSRF' }
its(:references) { should == ['Ref 1', 'Ref 2'] }
its(:metasploit_modules) { should == %w{exploit/ex1} }
its(:cve) { should == %w{2011-001} }
its(:fixed_in) { should == '1.0'}
end