Re: [PATCH net v6 3/4] selftests: Add MACsec VLAN propagation traffic test

Sabrina Dubroca
2026-04-02T11:37:05Z

2026-03-30, 16:01:29 +0300, Cosmin Ratiu wrote:
> +def _get_mac(ifname, host=None):
> + """Gets MAC address of an interface."""
> + dev = ip(f"-d link show dev {ifname}", json=True, host=host)

nit: MAC address doesn't need '-d'

I would have used fixed SCI on both ends to avoid this mess with the
local/remote MAC address, but it's ok as you wrote it.

> + return dev[0]["address"]

[...]
> +def _check_nsim_vid(cfg, vid, expected) -> None:
> + """Checks if a VLAN is present. Only works on netdevsim."""
> +
> + nsim = cfg.get_local_nsim_dev()
> + if not nsim:
> + return
> +
> + vlan_path = nsim.nsims[0].dfs_dir + "vlan"

nit: os.path.join for consistency with other users

> + with open(vlan_path, encoding="utf-8") as f:
> + vids = f.read()
> + found = f"ctag {vid}\n" in vids
> + ksft_eq(found, expected,
> + f"VLAN {vid} {'expected' if expected else 'not expected'}"
> + f" in debugfs")

--
Sabrina