Skip to content

Commit f58ebb9

Browse files
committed
test vlan: Fix race condition on MAC address
When creating VLAN parent dummy interface without `address` property defined, systemd/udevd will generate random MAC address and change it, hence we have race problem during creation and query. Fixed by explicitly set MAC address when creating VLAN parent interface in tests. Signed-off-by: Gris Ge <cnfourt@gmail.com>
1 parent c72f59e commit f58ebb9

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/ip/link/tests/vlan.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,15 @@ where
247247
let parent_name = format!("p{vlan_name}");
248248

249249
// create parent dummy interface using ip-rs
250-
ip_rs_exec_cmd(&["link", "add", &parent_name, "type", "dummy"]);
250+
ip_rs_exec_cmd(&[
251+
"link",
252+
"add",
253+
&parent_name,
254+
"address",
255+
"0e:d1:49:08:27:84",
256+
"type",
257+
"dummy",
258+
]);
251259
exec_cmd(&["ip", "link", "set", &parent_name, "up"]);
252260

253261
let mut args = vec![

0 commit comments

Comments
 (0)