def is_phy_initial_test(self): """ :return: sets port bitmap entry ``PHY_INT`` """ self._port_type = linux_common.clear_bit(self._port_type, linux_iface.PHY_INT) if common.is_phy(self.name): self._port_type = linux_common.set_bit(self._port_type, linux_iface.PHY_INT)
def cacheinfo(ifacename=None): """ :return: hash of following format ``` {'swp1': { 'tx': { 'unicast': 1111 'broadcast': 1111 'multicast': 1111 'errors': 1111 } 'rx': { 'unicast': 1111 'broadcast': 1111 'multicast': 1111 'errors': 1111 } } } ``` """ counters_hash = {} if ifacename: counters_hash[ifacename] = get_physical_port_counters( get_ethtool_output(ifacename)) return counters_hash for _iface in os.listdir(linux_common.SYS_PATH_ROOT): if common.is_phy(_iface): counters_hash[_iface] = get_physical_port_counters( get_ethtool_output(_iface)) return counters_hash