def _test_basic_port_filter_correct_mac(self):
        # Use the correct IP/MAC address pair for this one.
        mac_ip_pair = dict(mac_addr=self.mac, ip_addr=self.addr)

        filter_apply = FILTER_APPLY_TEMPLATE % mac_ip_pair
        ebtables_driver.ebtables_restore(filter_apply, self.source.execute)

        self.source.assert_ping(self.destination.ip)
Esempio n. 2
0
    def _test_basic_port_filter_correct_mac(self):
        # Use the correct IP/MAC address pair for this one.
        mac_ip_pair = dict(mac_addr=self.mac, ip_addr=self.addr)

        filter_apply = FILTER_APPLY_TEMPLATE % mac_ip_pair
        ebtables_driver.ebtables_restore(filter_apply, self.source.execute)

        self.source.assert_ping(self.destination.ip)
    def _test_basic_port_filter_wrong_mac(self):
        # Setup filter with wrong IP/MAC address pair. Basic filters only allow
        # packets with specified address combinations, thus all packets will
        # be dropped.
        mac_ip_pair = dict(mac_addr="11:11:11:22:22:22", ip_addr=self.addr)
        filter_apply = FILTER_APPLY_TEMPLATE % mac_ip_pair
        ebtables_driver.ebtables_restore(filter_apply, self.source.execute)
        self.source.assert_no_ping(self.destination.ip)

        # Assure that ping will work once we unfilter the instance
        ebtables_driver.ebtables_restore(NO_FILTER_APPLY, self.source.execute)
        self.source.assert_ping(self.destination.ip)
Esempio n. 4
0
    def _test_basic_port_filter_wrong_mac(self):
        # Setup filter with wrong IP/MAC address pair. Basic filters only allow
        # packets with specified address combinations, thus all packets will
        # be dropped.
        mac_ip_pair = dict(mac_addr="11:11:11:22:22:22", ip_addr=self.addr)
        filter_apply = FILTER_APPLY_TEMPLATE % mac_ip_pair
        ebtables_driver.ebtables_restore(filter_apply, self.source.execute)
        self.source.assert_no_ping(self.destination.ip)

        # Assure that ping will work once we unfilter the instance
        ebtables_driver.ebtables_restore(NO_FILTER_APPLY, self.source.execute)
        self.source.assert_ping(self.destination.ip)