Sha256: b488bf6917cb92f17ab4e592ad6bcf8818ac19df9304cdbc4a4dd79b82ab7a1f

Contents?: true

Size: 1.53 KB

Versions: 23

Compression:

Stored size: 1.53 KB

Contents

RSpec.describe RubySMB::Dcerpc::Dfsnm::NetrDfsRemoveStdRootRequest do
  subject(:packet) { described_class.new }

  it { is_expected.to respond_to :server_name }
  it { is_expected.to respond_to :root_share }
  it { is_expected.to respond_to :api_flags }
  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 '#server_name' do
    it 'is a NdrConfVarWideStringz structure' do
      expect(packet.server_name).to be_a RubySMB::Dcerpc::Ndr::NdrConfVarWideStringz
    end
  end
  describe '#root_share' do
    it 'is a NdrConfVarWideStringz structure' do
      expect(packet.root_share).to be_a RubySMB::Dcerpc::Ndr::NdrConfVarWideStringz
    end
  end
  describe '#api_flags' do
    it 'is a NdrUint32 structure' do
      expect(packet.api_flags).to be_a RubySMB::Dcerpc::Ndr::NdrUint32
    end
  end
  describe '#initialize_instance' do
    it 'sets #opnum to NETR_DFS_REMOVE_STD_ROOT constant' do
      expect(packet.opnum).to eq(RubySMB::Dcerpc::Dfsnm::NETR_DFS_REMOVE_STD_ROOT)
    end
  end
  it 'reads itself' do
    new_packet = described_class.new({
      server_name: 'serverName',
      root_share: 'rootShare',
    })
    expected_output = {
      server_name: 'serverName'.encode('utf-16le'),
      root_share: 'rootShare'.encode('utf-16le'),
      api_flags: 0
    }
    expect(packet.read(new_packet.to_binary_s)).to eq(expected_output)
  end
end


Version data entries

23 entries across 23 versions & 1 rubygems

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