mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 17:40:14 +01:00
initrd/tests: add more tests for "rd.ethtool" (test_rd_ethtool())
This commit is contained in:
parent
f88a608050
commit
44b8c71ed5
1 changed files with 31 additions and 0 deletions
|
|
@ -2328,6 +2328,9 @@ test_rd_ethtool(void)
|
|||
_ethtool_check_inval("rd.ethtool=::");
|
||||
|
||||
_ethtool_check("rd.ethtool=eth0:on", TRUE, 0);
|
||||
_ethtool_check("rd.ethtool=eth0:on:", TRUE, 0);
|
||||
_ethtool_check("rd.ethtool=eth0:on::", TRUE, 0);
|
||||
_ethtool_check("rd.ethtool=eth0:on:0:", TRUE, 0);
|
||||
|
||||
_ethtool_check("rd.ethtool=eth0:off", FALSE, 0);
|
||||
|
||||
|
|
@ -2361,6 +2364,22 @@ test_rd_ethtool(void)
|
|||
"cmdline-reader: Invalid value for rd.ethtool.speed, rd.ethtool.speed was not set");
|
||||
_ethtool_check("rd.ethtool=eth0::-23", FALSE, 0);
|
||||
|
||||
NMTST_EXPECT_NM_WARN(
|
||||
"cmdline-reader: Invalid value for rd.ethtool.speed, rd.ethtool.speed was not set");
|
||||
_ethtool_check("rd.ethtool=eth0::-23:", FALSE, 0);
|
||||
|
||||
NMTST_EXPECT_NM_WARN(
|
||||
"cmdline-reader: Invalid value for rd.ethtool.speed, rd.ethtool.speed was not set");
|
||||
NMTST_EXPECT_NM_WARN(
|
||||
"cmdline-reader: Invalid extra argument ':' for rd.ethtool, this value was not set");
|
||||
_ethtool_check("rd.ethtool=eth0::-23::", FALSE, 0);
|
||||
|
||||
NMTST_EXPECT_NM_WARN(
|
||||
"cmdline-reader: Invalid value for rd.ethtool.speed, rd.ethtool.speed was not set");
|
||||
NMTST_EXPECT_NM_WARN(
|
||||
"cmdline-reader: Invalid extra argument ':foo' for rd.ethtool, this value was not set");
|
||||
_ethtool_check("rd.ethtool=eth0::-23::foo", FALSE, 0);
|
||||
|
||||
_ethtool_check("rd.ethtool=eth0:1:10", TRUE, 10);
|
||||
|
||||
_ethtool_check("rd.ethtool=eth0::100", FALSE, 100);
|
||||
|
|
@ -2379,6 +2398,18 @@ test_rd_ethtool(void)
|
|||
|
||||
NMTST_EXPECT_NM_WARN("cmdline-reader: Impossible to set rd.ethtool options: invalid format");
|
||||
_ethtool_check_inval("rd.ethtool=:::");
|
||||
|
||||
_ethtool_check_v(NM_MAKE_STRV("rd.ethtool=eth0:off:0", "rd.ethtool=eth0:on"), TRUE, 0);
|
||||
_ethtool_check_v(NM_MAKE_STRV("rd.ethtool=eth0:off:0", "rd.ethtool=eth0:off"), FALSE, 0);
|
||||
_ethtool_check_v(NM_MAKE_STRV("rd.ethtool=eth0:on:0", "rd.ethtool=eth0:on"), TRUE, 0);
|
||||
_ethtool_check_v(NM_MAKE_STRV("rd.ethtool=eth0:on:0", "rd.ethtool=eth0:off"), FALSE, 0);
|
||||
_ethtool_check_v(NM_MAKE_STRV("rd.ethtool=eth0:off:100", "rd.ethtool=eth0:on"), TRUE, 100);
|
||||
_ethtool_check_v(NM_MAKE_STRV("rd.ethtool=eth0:off:100", "rd.ethtool=eth0:off"), FALSE, 100);
|
||||
_ethtool_check_v(NM_MAKE_STRV("rd.ethtool=eth0:on:100", "rd.ethtool=eth0:on"), TRUE, 100);
|
||||
_ethtool_check_v(NM_MAKE_STRV("rd.ethtool=eth0:on:100", "rd.ethtool=eth0:off"), FALSE, 100);
|
||||
|
||||
NMTST_EXPECT_NM_WARN("cmdline-reader: Could not find rd.ethtool options to set");
|
||||
_ethtool_check_v(NM_MAKE_STRV("rd.ethtool=eth0:off:100", "rd.ethtool=eth0:"), FALSE, 100);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue