Blame testsuite/tests/tc/mpls.t

Packit Bot 867fae
#!/bin/sh
Packit Bot 867fae
Packit Bot 867fae
. lib/generic.sh
Packit Bot 867fae
Packit Bot 867fae
DEV="$(rand_dev)"
Packit Bot 867fae
ts_ip "$0" "Add $DEV dummy interface" link add dev $DEV up type dummy
Packit Bot 867fae
ts_tc "$0" "Add ingress qdisc" qdisc add dev $DEV ingress
Packit Bot 867fae
Packit Bot 867fae
reset_qdisc()
Packit Bot 867fae
{
Packit Bot 867fae
	ts_tc "$0" "Remove ingress qdisc" qdisc del dev $DEV ingress
Packit Bot 867fae
	ts_tc "$0" "Add ingress qdisc" qdisc add dev $DEV ingress
Packit Bot 867fae
}
Packit Bot 867fae
Packit Bot 867fae
ts_tc "$0" "Add mpls action pop"                              \
Packit Bot 867fae
	filter add dev $DEV ingress protocol mpls_uc matchall \
Packit Bot 867fae
	action mpls pop protocol ip
Packit Bot 867fae
ts_tc "$0" "Show ingress filters" filter show dev $DEV ingress
Packit Bot 867fae
test_on "mpls"
Packit Bot 867fae
test_on "pop protocol ip pipe"
Packit Bot 867fae
Packit Bot 867fae
reset_qdisc
Packit Bot 867fae
ts_tc "$0" "Add mpls action push"                        \
Packit Bot 867fae
	filter add dev $DEV ingress protocol ip matchall \
Packit Bot 867fae
	action mpls push protocol mpls_uc label 20 tc 3 bos 1 ttl 64
Packit Bot 867fae
ts_tc "$0" "Show ingress filters" filter show dev $DEV ingress
Packit Bot 867fae
test_on "mpls"
Packit Bot 867fae
test_on "push"
Packit Bot 867fae
test_on "protocol mpls_uc"
Packit Bot 867fae
test_on "label 20"
Packit Bot 867fae
test_on "tc 3"
Packit Bot 867fae
test_on "bos 1"
Packit Bot 867fae
test_on "ttl 64"
Packit Bot 867fae
test_on "pipe"
Packit Bot 867fae
Packit Bot 867fae
reset_qdisc
Packit Bot 867fae
ts_tc "$0" "Add mpls action mac_push"        \
Packit Bot 867fae
	filter add dev $DEV ingress matchall \
Packit Bot 867fae
	action mpls mac_push protocol mpls_uc label 20 tc 3 bos 1 ttl 64
Packit Bot 867fae
ts_tc "$0" "Show ingress filters" filter show dev $DEV ingress
Packit Bot 867fae
test_on "mpls"
Packit Bot 867fae
test_on "mac_push"
Packit Bot 867fae
test_on "protocol mpls_uc"
Packit Bot 867fae
test_on "label 20"
Packit Bot 867fae
test_on "tc 3"
Packit Bot 867fae
test_on "bos 1"
Packit Bot 867fae
test_on "ttl 64"
Packit Bot 867fae
test_on "pipe"
Packit Bot 867fae
Packit Bot 867fae
reset_qdisc
Packit Bot 867fae
ts_tc "$0" "Add mpls action modify"                           \
Packit Bot 867fae
	filter add dev $DEV ingress protocol mpls_uc matchall \
Packit Bot 867fae
	action mpls modify label 20 tc 3 ttl 64
Packit Bot 867fae
ts_tc "$0" "Show ingress filters" filter show dev $DEV ingress
Packit Bot 867fae
test_on "mpls"
Packit Bot 867fae
test_on "modify"
Packit Bot 867fae
test_on "label 20"
Packit Bot 867fae
test_on "tc 3"
Packit Bot 867fae
test_on "ttl 64"
Packit Bot 867fae
test_on "pipe"
Packit Bot 867fae
Packit Bot 867fae
reset_qdisc
Packit Bot 867fae
ts_tc "$0" "Add mpls action dec_ttl"                          \
Packit Bot 867fae
	filter add dev $DEV ingress protocol mpls_uc matchall \
Packit Bot 867fae
	action mpls dec_ttl
Packit Bot 867fae
ts_tc "$0" "Show ingress filters" filter show dev $DEV ingress
Packit Bot 867fae
test_on "mpls"
Packit Bot 867fae
test_on "dec_ttl"
Packit Bot 867fae
test_on "pipe"