Sha256: 279b07032047982fcc471d8348f9434f2927c2666496508dddc8335e2571b91b

Contents?: true

Size: 1.17 KB

Versions: 37

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 NdrUint32' do
      expect(packet.error_status).to be_a RubySMB::Dcerpc::Ndr::NdrUint32
    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

37 entries across 37 versions & 1 rubygems

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