diff --git a/dist/pythonlibs/riotctrl_shell/netif.py b/dist/pythonlibs/riotctrl_shell/netif.py new file mode 100644 index 0000000000..deb11f01fd --- /dev/null +++ b/dist/pythonlibs/riotctrl_shell/netif.py @@ -0,0 +1,382 @@ +# Copyright (C) 2020 Freie Universität Berlin +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. + +""" +Shell interactions related to network interfaces + +Defines shell command interactions related to network interfaces +""" + +import re + +from riotctrl.shell import ShellInteraction, ShellInteractionParser + + +# ==== Parsers ==== + +class IfconfigListParser(ShellInteractionParser): + def __init__(self): + self.iface_c = re.compile(r"Iface\s+(?P\S+)\s") + # option values are repetitions of at least one non white space + # separated by at most one whitespace + # e.g. for MCS: 1 (BPSK, rate 1/2, 2x frequency repetition) MTU :1280 + # "1 (BPSK, rate 1/2, 2x frequency repetition)" belongs to the option + # value, "MTU" does not + self.option_c = re.compile(r"^(?P