Sha256: 70953f924f87c14dd483b2b4ecc3af3678ec1bf5692afea01477401eec17d35a

Contents?: true

Size: 1.17 KB

Versions: 10

Compression:

Stored size: 1.17 KB

Contents

RSpec.describe RubySMB::Dcerpc::Svcctl::QueryServiceStatusResponse do
  subject(:packet) { described_class.new }

  it { is_expected.to respond_to :lp_service_status }
  it { is_expected.to respond_to :error_status }

  it 'is little endian' do
    expect(described_class.fields.instance_variable_get(:@hints)[:endian]).to eq :little
  end

  describe '#lp_service_status' do
    it 'is a ServiceStatus structure' do
      expect(packet.lp_service_status).to be_a RubySMB::Dcerpc::Svcctl::ServiceStatus
    end
  end

  describe '#error_status' do
    it 'is a 32-bit unsigned integer' do
      expect(packet.error_status).to be_a BinData::Uint32le
    end
  end

  describe '#initialize_instance' do
    it 'sets #opnum to QUERY_SERVICE_STATUS constant' do
      expect(packet.opnum).to eq(RubySMB::Dcerpc::Svcctl::QUERY_SERVICE_STATUS)
    end
  end

  it 'reads its own binary representation and outputs the same packet' do
    packet = described_class.new(
      lp_service_status: RubySMB::Dcerpc::Svcctl::ServiceStatus.new(dw_service_type: 1, dw_current_state: 3),
      error_status: 3
    )
    binary = packet.to_binary_s
    expect(described_class.read(binary)).to eq(packet)
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby_smb-2.0.12 spec/lib/ruby_smb/dcerpc/svcctl/query_service_status_response_spec.rb
ruby_smb-2.0.11 spec/lib/ruby_smb/dcerpc/svcctl/query_service_status_response_spec.rb
ruby_smb-2.0.10 spec/lib/ruby_smb/dcerpc/svcctl/query_service_status_response_spec.rb
ruby_smb-2.0.9 spec/lib/ruby_smb/dcerpc/svcctl/query_service_status_response_spec.rb
ruby_smb-2.0.8 spec/lib/ruby_smb/dcerpc/svcctl/query_service_status_response_spec.rb
ruby_smb-2.0.7 spec/lib/ruby_smb/dcerpc/svcctl/query_service_status_response_spec.rb
ruby_smb-2.0.6 spec/lib/ruby_smb/dcerpc/svcctl/query_service_status_response_spec.rb
ruby_smb-2.0.5 spec/lib/ruby_smb/dcerpc/svcctl/query_service_status_response_spec.rb
ruby_smb-2.0.4 spec/lib/ruby_smb/dcerpc/svcctl/query_service_status_response_spec.rb
ruby_smb-2.0.3 spec/lib/ruby_smb/dcerpc/svcctl/query_service_status_response_spec.rb