chaos-mesh / chaosd

A Chaos Engineering toolkit.
Apache License 2.0
136 stars 63 forks source link

fail to specify network device #185

Closed YangKeao closed 2 years ago

YangKeao commented 2 years ago
❯ sudo ./chaosd attack network delay -d wlo1 -l 1s
2022-07-21T14:51:50.527+0800    INFO    chaosd/network.go:78    Set iptables chains     {"request": ""}
2022-07-21T14:51:50.533+0800    INFO    chaosd/network.go:84    handling tc request     {"tcs": "tcs:{netem:{time:1000000}}"}
2022-07-21T14:51:50.534+0800    INFO    chaosd/network.go:187   get interfaces from ip command{"ifaces": ["lo", "enp42s0", "wlo1", "wlp45s0f3u2u1", "tailscale0", "docker0", "br-b710d8160043", "br-086c929bcc6c"]}
2022-07-21T14:51:50.542+0800    INFO    chaosdaemon/tc_server.go:171    add tc  {"tc": "netem:{time:1000000} device:\"eth0\""}
2022-07-21T14:51:50.542+0800    INFO    chaosdaemon/tc_server.go:209    adding netem    {"device": "eth0", "parent": "root", "handle": "handle 1:"}
2022-07-21T14:51:50.545+0800    ERROR   chaosd/network.go:187   error while adding tc 
FingerLeader commented 2 years ago

I run the command successfully in my ubuntu, can you give some information about your test envirnment?

YangKeao commented 2 years ago

I run the command successfully in my ubuntu, can you give some information about your test envirnment?

@FingerLeader

See the fifth line, add tc {"tc": "netem:{time:1000000} device:\"eth0\""} the device is still eth0 even I have specified the wlo1. This command could success iff you have eth0 device (however, I don't.)

I tested this command on CentOS7, but I don't have more information now (as it has been destroyed.)