File: hsrp_spec.rb

package info (click to toggle)
ruby-packetfu 2.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,520 kB
  • sloc: ruby: 8,344; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 432 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# -*- coding: binary -*-
require 'spec_helper'
require 'packetfu'

include PacketFu

context "when parsing HSRP traffic from pcap" do
  it "should detect that it's HSRP traffic" do
    sample_packet = PcapFile.new.file_to_array(:f => 'test/sample_hsrp_pcapr.cap')[0]
    pkt = Packet.parse(sample_packet)
    expect(pkt.is_hsrp?).to be(true)
    expect(pkt.is_udp?).to be(true)
    expect(pkt.udp_sum.to_i).to eql(0x2d8d)
  end
end