feat: 测试交付 Q1 混沌压测骨架与 Q4 镜像骨架
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
# 在 Linux 容器内执行:对指定网卡注入丢包。用法:apply-loss.sh <iface> <loss_percent>
|
||||
set -euo pipefail
|
||||
|
||||
IFACE="${1:-eth0}"
|
||||
LOSS="${2:-20}"
|
||||
|
||||
if ! command -v tc >/dev/null 2>&1; then
|
||||
echo "tc not found; use an image with iproute2 (e.g. nicolaka/netshoot)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tc qdisc replace dev "$IFACE" root netem loss "${LOSS}%"
|
||||
echo "netem: iface=${IFACE} loss=${LOSS}%"
|
||||
tc qdisc show dev "$IFACE"
|
||||
Reference in New Issue
Block a user