コード例 #1
0
    def hwsrc_adrNotExist(self):
        src_ref = 'FB:1E:DC:3A:69:00'
        dst_ref = 'FB:23:C0:22:0F:85'
        
        ref_pkt = l2.ARP(hwsrc=src_ref, hwdst=dst_ref)
        mac_pkt = l2.ARP(hwsrc=src_ref, hwdst=dst_ref)

        data = lib.build_mock_dict()

        pp.arp_hwsrc_change(mac_pkt, data)

        self.assertTrue( lib.compare_mac_pkts(ref_pkt, mac_pkt), msg= (str(ref_pkt) + ' == ' + str(mac_pkt)) )
コード例 #2
0
    def hwsrc_adrExists(self):
        src_ref = 'F6:DA:77:F3:E2:E0'
        dst_ref = 'FB:23:C0:22:0F:85'
        
        ref_pkt = l2.ARP(hwsrc='8C:37:E1:F2:C8:E5', hwdst=dst_ref)
        mac_pkt = l2.ARP(hwsrc=src_ref, hwdst=dst_ref)

        data = lib.build_mock_dict()

        pp.arp_hwsrc_change(mac_pkt, data)

        self.assertTrue( lib.compare_mac_pkts(ref_pkt, mac_pkt), msg= (str(ref_pkt) + ' == ' + str(mac_pkt)) )