Sha256: adce8a472946112a639ca7310545b27e67983e6a49c568f3087b7e18ee85618f

Contents?: true

Size: 1.35 KB

Versions: 37

Compression:

Stored size: 1.35 KB

Contents

RSpec.describe RubySMB::Dcerpc::Samr::SamrRidToSidRequest do
  subject(:packet) { described_class.new }

  it { is_expected.to respond_to :object_handle }
  it { is_expected.to respond_to :rid }
  it { is_expected.to respond_to :opnum }

  it 'is little endian' do
    expect(described_class.fields.instance_variable_get(:@hints)[:endian]).to eq :little
  end
  it 'is a BinData::Record' do
    expect(packet).to be_a(BinData::Record)
  end
  describe '#object_handle' do
    it 'is a SamprHandle structure' do
      expect(packet.object_handle).to be_a RubySMB::Dcerpc::Samr::SamprHandle
    end
  end
  describe '#rid' do
    it 'is a NdrUint32 structure' do
      expect(packet.rid).to be_a RubySMB::Dcerpc::Ndr::NdrUint32
    end
  end
  describe '#initialize_instance' do
    it 'sets #opnum to SAMR_RID_TO_SID constant' do
      expect(packet.opnum).to eq(RubySMB::Dcerpc::Samr::SAMR_RID_TO_SID)
    end
  end
  it 'reads itself' do
    new_class = described_class.new(
      object_handle: {
        context_handle_attributes: 0,
        context_handle_uuid: '2ef54a87-e29e-4d24-90e9-9da49b94449e'
      },
      rid: 502
    )
    expect(packet.read(new_class.to_binary_s)).to eq(
      {
        object_handle: {
          context_handle_attributes: 0,
          context_handle_uuid: '2ef54a87-e29e-4d24-90e9-9da49b94449e'
        },
        rid: 502
      }
    )
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
ruby_smb-3.3.12 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.3.11 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.3.10 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.3.9 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.3.7 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.3.6 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.3.5 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.3.4 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.3.3 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.3.2 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.3.1 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.3.0 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.2.8 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.2.7 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.2.6 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.2.5 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.2.4 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.2.3 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.2.2 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb
ruby_smb-3.2.1 spec/lib/ruby_smb/dcerpc/samr/samr_rid_to_sid_request_spec.rb