@@ -21,9 +21,10 @@ import (
21
21
22
22
func Test_UnmarshalText (t * testing.T ) {
23
23
testcases := []struct {
24
- name string
25
- output string
26
- actions DataPathActions
24
+ name string
25
+ output string
26
+ datapathActions DataPathActions
27
+ flowActions []string
27
28
}{
28
29
{
29
30
name : "action output port" ,
@@ -39,7 +40,11 @@ bridge("br0")
39
40
Final flow: unchanged
40
41
Megaflow: recirc_id=0,tcp,in_port=3,nw_src=192.0.2.0/24,nw_frag=no,tp_dst=22
41
42
Datapath actions: 1` ,
42
- actions : NewDataPathActions ("1" ),
43
+ datapathActions : NewDataPathActions ("1" ),
44
+ flowActions : []string {
45
+ "resubmit(,2)" ,
46
+ "output:1" ,
47
+ },
43
48
},
44
49
{
45
50
name : "in_port is LOCAL" ,
@@ -55,7 +60,11 @@ bridge("br0")
55
60
Final flow: unchanged
56
61
Megaflow: recirc_id=0,tcp,in_port=LOCAL,nw_src=192.0.2.0/24,nw_frag=no,tp_dst=22
57
62
Datapath actions: 1` ,
58
- actions : NewDataPathActions ("1" ),
63
+ datapathActions : NewDataPathActions ("1" ),
64
+ flowActions : []string {
65
+ "resubmit(,2)" ,
66
+ "output:1" ,
67
+ },
59
68
},
60
69
{
61
70
name : "popvlan and output port" ,
@@ -71,7 +80,11 @@ bridge("br0")
71
80
Final flow: unchanged
72
81
Megaflow: recirc_id=0,tcp,in_port=3,nw_src=192.0.2.0/24,nw_frag=no,tp_dst=22
73
82
Datapath actions: popvlan,1` ,
74
- actions : NewDataPathActions ("popvlan,1" ),
83
+ datapathActions : NewDataPathActions ("popvlan,1" ),
84
+ flowActions : []string {
85
+ "resubmit(,2)" ,
86
+ "output:1" ,
87
+ },
75
88
},
76
89
{
77
90
name : "pushvlan and output port" ,
@@ -87,7 +100,11 @@ bridge("br0")
87
100
Final flow: unchanged
88
101
Megaflow: recirc_id=0,tcp,in_port=3,nw_src=192.0.2.0/24,nw_frag=no,tp_dst=22
89
102
Datapath actions: push_vlan(vid=20,pcp=0),4` ,
90
- actions : NewDataPathActions ("push_vlan(vid=20,pcp=0),4" ),
103
+ datapathActions : NewDataPathActions ("push_vlan(vid=20,pcp=0),4" ),
104
+ flowActions : []string {
105
+ "resubmit(,2)" ,
106
+ "output:1" ,
107
+ },
91
108
},
92
109
{
93
110
name : "drop" ,
@@ -103,7 +120,11 @@ bridge("br0")
103
120
Final flow: unchanged
104
121
Megaflow: recirc_id=0,tcp,in_port=3,nw_src=192.0.2.0/24,nw_frag=no,tp_dst=22
105
122
Datapath actions: drop` ,
106
- actions : NewDataPathActions ("drop" ),
123
+ datapathActions : NewDataPathActions ("drop" ),
124
+ flowActions : []string {
125
+ "resubmit(,2)" ,
126
+ "output:1" ,
127
+ },
107
128
},
108
129
}
109
130
@@ -115,11 +136,17 @@ Datapath actions: drop`,
115
136
t .Errorf ("error unmarshalling tests: %q" , err )
116
137
}
117
138
118
- if ! reflect .DeepEqual (testcase .actions , pt .DataPathActions ) {
119
- t .Logf ("expected: %v" , testcase .actions )
139
+ if ! reflect .DeepEqual (testcase .datapathActions , pt .DataPathActions ) {
140
+ t .Logf ("expected: %v" , testcase .datapathActions )
120
141
t .Logf ("actual: %v" , pt .DataPathActions )
121
142
t .Error ("unexpected datapath actions" )
122
143
}
144
+
145
+ if ! reflect .DeepEqual (testcase .flowActions , pt .FlowActions ) {
146
+ t .Logf ("expected: %v" , testcase .flowActions )
147
+ t .Logf ("actual: %v" , pt .FlowActions )
148
+ t .Error ("unexpected trace actions" )
149
+ }
123
150
})
124
151
}
125
152
}
0 commit comments