update rocketmq tests

This commit is contained in:
h00die 2023-06-16 16:26:35 -04:00
parent 67225650de
commit e49e70ce93
2 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ module Msf
# Errors will result in "UNKNOWN_VERSION_ID_<id>" and may be caused by needing to update the version table
# from https://github.com/apache/rocketmq/blob/develop/common/src/4d82b307ef50f5cba5717d0ebafeb3cabf336873/java/org/apache/rocketmq/common/MQVersion.java
version_list = JSON.parse(File.read(::File.join(Msf::Config.data_directory, 'rocketmq_versions_list.json'), mode: 'rb'))
version_list.fetch(id, "UNKNOWN_VERSION_ID_#{id})").gsub('_', '.')
version_list.fetch(id, "UNKNOWN_VERSION_ID_#{id}").gsub('_', '.')
end
end
end

View File

@ -14,9 +14,9 @@ RSpec.describe Msf::Auxiliary::Rocketmq do
end
end
context 'correctly looks up id 99999 as UNKNOWN_VERSION_ID_99999' do
context 'correctly looks up id 99999 as UNKNOWN.VERSION.ID.99999' do
it 'returns that version' do
expect(subject.get_rocketmq_version(99999)).to eql('UNKNOWN_VERSION_ID_99999')
expect(subject.get_rocketmq_version(99999)).to eql('UNKNOWN.VERSION.ID.99999')
end
end
end