summaryrefslogtreecommitdiffstats
path: root/testsuite/tests/tc/mpls.t
blob: cb25f3619adfbe8f4a43c1f86f00995a1d0c81e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/sh

. lib/generic.sh

DEV="$(rand_dev)"
ts_ip "$0" "Add $DEV dummy interface" link add dev $DEV up type dummy
ts_tc "$0" "Add ingress qdisc" qdisc add dev $DEV ingress

reset_qdisc()
{
	ts_tc "$0" "Remove ingress qdisc" qdisc del dev $DEV ingress
	ts_tc "$0" "Add ingress qdisc" qdisc add dev $DEV ingress
}

ts_tc "$0" "Add mpls action pop"                              \
	filter add dev $DEV ingress protocol mpls_uc matchall \
	action mpls pop protocol ip
ts_tc "$0" "Show ingress filters" filter show dev $DEV ingress
test_on "mpls"
test_on "pop protocol ip pipe"

reset_qdisc
ts_tc "$0" "Add mpls action push"                        \
	filter add dev $DEV ingress protocol ip matchall \
	action mpls push protocol mpls_uc label 20 tc 3 bos 1 ttl 64
ts_tc "$0" "Show ingress filters" filter show dev $DEV ingress
test_on "mpls"
test_on "push"
test_on "protocol mpls_uc"
test_on "label 20"
test_on "tc 3"
test_on "bos 1"
test_on "ttl 64"
test_on "pipe"

reset_qdisc
ts_tc "$0" "Add mpls action mac_push"        \
	filter add dev $DEV ingress matchall \
	action mpls mac_push protocol mpls_uc label 20 tc 3 bos 1 ttl 64
ts_tc "$0" "Show ingress filters" filter show dev $DEV ingress
test_on "mpls"
test_on "mac_push"
test_on "protocol mpls_uc"
test_on "label 20"
test_on "tc 3"
test_on "bos 1"
test_on "ttl 64"
test_on "pipe"

reset_qdisc
ts_tc "$0" "Add mpls action modify"                           \
	filter add dev $DEV ingress protocol mpls_uc matchall \
	action mpls modify label 20 tc 3 ttl 64
ts_tc "$0" "Show ingress filters" filter show dev $DEV ingress
test_on "mpls"
test_on "modify"
test_on "label 20"
test_on "tc 3"
test_on "ttl 64"
test_on "pipe"

reset_qdisc
ts_tc "$0" "Add mpls action dec_ttl"                          \
	filter add dev $DEV ingress protocol mpls_uc matchall \
	action mpls dec_ttl
ts_tc "$0" "Show ingress filters" filter show dev $DEV ingress
test_on "mpls"
test_on "dec_ttl"
test_on "pipe"