@@ -21,9 +21,10 @@ import (
2121
2222func Test_UnmarshalText (t * testing.T ) {
2323 testcases := []struct {
24- name string
25- output string
26- actions DataPathActions
24+ name string
25+ output string
26+ datapathActions DataPathActions
27+ flowActions []string
2728 }{
2829 {
2930 name : "action output port" ,
@@ -39,7 +40,11 @@ bridge("br0")
3940Final flow: unchanged
4041Megaflow: recirc_id=0,tcp,in_port=3,nw_src=192.0.2.0/24,nw_frag=no,tp_dst=22
4142Datapath actions: 1` ,
42- actions : NewDataPathActions ("1" ),
43+ datapathActions : NewDataPathActions ("1" ),
44+ flowActions : []string {
45+ "resubmit(,2)" ,
46+ "output:1" ,
47+ },
4348 },
4449 {
4550 name : "in_port is LOCAL" ,
@@ -55,7 +60,11 @@ bridge("br0")
5560Final flow: unchanged
5661Megaflow: recirc_id=0,tcp,in_port=LOCAL,nw_src=192.0.2.0/24,nw_frag=no,tp_dst=22
5762Datapath actions: 1` ,
58- actions : NewDataPathActions ("1" ),
63+ datapathActions : NewDataPathActions ("1" ),
64+ flowActions : []string {
65+ "resubmit(,2)" ,
66+ "output:1" ,
67+ },
5968 },
6069 {
6170 name : "popvlan and output port" ,
@@ -71,7 +80,11 @@ bridge("br0")
7180Final flow: unchanged
7281Megaflow: recirc_id=0,tcp,in_port=3,nw_src=192.0.2.0/24,nw_frag=no,tp_dst=22
7382Datapath actions: popvlan,1` ,
74- actions : NewDataPathActions ("popvlan,1" ),
83+ datapathActions : NewDataPathActions ("popvlan,1" ),
84+ flowActions : []string {
85+ "resubmit(,2)" ,
86+ "output:1" ,
87+ },
7588 },
7689 {
7790 name : "pushvlan and output port" ,
@@ -87,7 +100,11 @@ bridge("br0")
87100Final flow: unchanged
88101Megaflow: recirc_id=0,tcp,in_port=3,nw_src=192.0.2.0/24,nw_frag=no,tp_dst=22
89102Datapath 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+ },
91108 },
92109 {
93110 name : "drop" ,
@@ -103,7 +120,11 @@ bridge("br0")
103120Final flow: unchanged
104121Megaflow: recirc_id=0,tcp,in_port=3,nw_src=192.0.2.0/24,nw_frag=no,tp_dst=22
105122Datapath actions: drop` ,
106- actions : NewDataPathActions ("drop" ),
123+ datapathActions : NewDataPathActions ("drop" ),
124+ flowActions : []string {
125+ "resubmit(,2)" ,
126+ "output:1" ,
127+ },
107128 },
108129 }
109130
@@ -115,11 +136,17 @@ Datapath actions: drop`,
115136 t .Errorf ("error unmarshalling tests: %q" , err )
116137 }
117138
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 )
120141 t .Logf ("actual: %v" , pt .DataPathActions )
121142 t .Error ("unexpected datapath actions" )
122143 }
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+ }
123150 })
124151 }
125152}
0 commit comments