Sha256: 5f976c6dd05ed7fe3a9a2ca15e3a5570812665bd374c3749c06a5cea69880fdc

Contents?: true

Size: 1.22 KB

Versions: 61

Compression:

Stored size: 1.22 KB

Contents

require 'spec_helper'

RSpec.describe RubySMB::SMB1::Packet::Trans::PeekNmpipeRequest do

  subject(:packet) { described_class.new }

  describe '#smb_header' do
    subject(:header) { packet.smb_header }

    it 'is a standard SMB Header' do
      expect(header).to be_a RubySMB::SMB1::SMBHeader
    end

    it 'should have the command set to SMB_COM_TRANSACTION' do
      expect(header.command).to eq RubySMB::SMB1::Commands::SMB_COM_TRANSACTION
    end

    it 'should not have the response flag set' do
      expect(header.flags.reply).to eq 0
    end
  end

  describe '#parameter_block' do
    subject(:parameter_block) { packet.parameter_block }

    it 'is a standard Trans ParameterBlock' do
      expect(parameter_block).to be_a RubySMB::SMB1::Packet::Trans::Request::ParameterBlock
    end

    it 'should have a setup_count of 2' do
      expect(parameter_block.setup_count).to eq 2
    end

    it 'should have subcommand PEEK_NMPIPE' do
      expect(parameter_block.setup[0]).to eq RubySMB::SMB1::Packet::Trans::Subcommands::PEEK_NMPIPE
    end
  end

  describe '#data_block' do
    subject(:data_block) { packet.data_block }

    it 'should have a name of \\PIPE\\' do
      expect(data_block.name).to eq "\\PIPE\\"
    end
  end

end

Version data entries

61 entries across 61 versions & 1 rubygems

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