[dts] [PATCH V2] kni/ethtool add judgment before the -a parameter

Lijuan Tu lijuan.tu at intel.com
Thu Nov 15 20:43:22 CET 2018


Applied with comments changed.


On 2018年11月12日 14:41, zhuwenhui wrote:
> According to whether the kernel supports
> "ETHTOOL_GLINKSETTINGS & ETHTOOL_SLINKSETTINGS", it is judged
>   whether "ethtool "-a|--show-pause" works normally.
>
> Signed-off-by: zhuwenhui <wenhuix.zhu at intel.com>
> ---
>   tests/TestSuite_kni.py | 19 ++++++++++++-------
>   1 file changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/tests/TestSuite_kni.py b/tests/TestSuite_kni.py
> index 23d6d04..91408e4 100644
> --- a/tests/TestSuite_kni.py
> +++ b/tests/TestSuite_kni.py
> @@ -675,14 +675,19 @@ class TestKni(TestCase):
>                           "'ethtool -i' not supported")
>               self.verify("Operation not supported" not in out,
>                           "'ethtool -i' not supported")
> -
> +
>               # Request pause parameters
> -            out = self.dut.send_expect("ethtool -a %s" % virtual_interface,
> -                                       "# ")
> -            self.verify("Pause parameters for %s" % virtual_interface in out,
> -                        "'ethtool -a' not supported")
> -            self.verify("Operation not supported" not in out,
> -                        "ethtool '-a' not supported")
> +            with open("/usr/include/linux/ethtool.h","r") as ethtool_h:
> +                ethtool_contents = ethtool_h.read()
> +                GSET = "ETHTOOL_GLINKSETTINGS"
> +                SSET = "ETHTOOL_SLINKSETTINGS"
> +                if (GSET in ethtool_contents) and (SSET in ethtool_contents):
> +                    out = self.dut.send_expect("ethtool -a %s" % virtual_interface,
> +                                               "# ")
> +                    self.verify("Pause parameters for %s" % virtual_interface in out,
> +                                "'ethtool -a' not supported")
> +                    self.verify("Operation not supported" not in out,
> +                                "ethtool '-a' not supported")
>   
>               # Request statistics
>               out = self.dut.send_expect("ethtool -S %s" % virtual_interface,



More information about the dts mailing list