diff --git a/lisa/tools/ethtool.py b/lisa/tools/ethtool.py index d2cc830867..6f2b4199c7 100644 --- a/lisa/tools/ethtool.py +++ b/lisa/tools/ethtool.py @@ -1070,7 +1070,7 @@ def feature_from_device_info(self, device_feature_raw: str) -> List[str]: class EthtoolFreebsd(Ethtool): # options=8051b _interface_features_pattern = re.compile( - r"options=.+<(?P.*)>(.|\n)*ether" + r"options=.+<(?P.*)>(?:.|\n)*ether" ) _get_bsd_to_linux_features_map = { @@ -1106,7 +1106,6 @@ def get_device_enabled_features( self, interface: str, force_run: bool = False ) -> DeviceFeatures: interface_info = self.node.tools[Ip].run(interface).stdout - # Example output: # options=8051b # The features are separated by comma and enclosed by "<>" @@ -1116,7 +1115,8 @@ def get_device_enabled_features( features = [] for feature in features_pattern: - features.append(self._get_bsd_to_linux_features_map[feature]) + if feature in self._get_bsd_to_linux_features_map: + features.append(self._get_bsd_to_linux_features_map[feature]) device_features = DeviceFeatures(interface, features) return device_features