@@ -16,7 +16,7 @@ def skip_all(testbed_instance):
16
16
if testbed is not None and len (testbed .npu ) != 1 :
17
17
pytest .skip ('invalid for {} testbed' .format (testbed .name ))
18
18
19
- def test_l2_untagged_vlan_traffic (npu , dataplane ):
19
+ def test_l2_tagged_vlan_traffic (npu , dataplane ):
20
20
"""
21
21
Creates vlan 10 and adds two ports to the vlan 10 member
22
22
and validates the config using l2 traffic
@@ -38,7 +38,7 @@ def test_l2_untagged_vlan_traffic(npu, dataplane):
38
38
"SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID" ,
39
39
"$BRIDGE_PORT_2" ,
40
40
"SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE" ,
41
- "SAI_VLAN_TAGGING_MODE_UNTAGGED " ,
41
+ "SAI_VLAN_TAGGING_MODE_TAGGED " ,
42
42
],
43
43
},
44
44
{
@@ -60,7 +60,7 @@ def test_l2_untagged_vlan_traffic(npu, dataplane):
60
60
"SAI_VLAN_MEMBER_ATTR_BRIDGE_PORT_ID" ,
61
61
"$BRIDGE_PORT_3" ,
62
62
"SAI_VLAN_MEMBER_ATTR_VLAN_TAGGING_MODE" ,
63
- "SAI_VLAN_TAGGING_MODE_UNTAGGED " ,
63
+ "SAI_VLAN_TAGGING_MODE_TAGGED " ,
64
64
],
65
65
},
66
66
{
@@ -96,7 +96,7 @@ def test_l2_untagged_vlan_traffic(npu, dataplane):
96
96
flow1 .tx_rx .port .tx_name = config .ports [0 ].name
97
97
flow1 .tx_rx .port .rx_name = config .ports [1 ].name
98
98
flow1 .size .fixed = 1024
99
- flow1 .rate .percentage = 100
99
+ flow1 .rate .pps = 1000
100
100
flow1 .metrics .enable = True
101
101
flow1 .metrics .loss = True
102
102
source = macs [1 ]
@@ -114,14 +114,41 @@ def test_l2_untagged_vlan_traffic(npu, dataplane):
114
114
115
115
ts = dataplane .api .transmit_state ()
116
116
ts .flow_names = [flow1 .name ]
117
+ print ('Starting Data Traffic' )
117
118
ts .state = ts .START
118
119
dataplane .api .set_transmit_state (ts )
119
- time .sleep (10 )
120
+ time .sleep (5 )
120
121
ts = dataplane .api .transmit_state ()
121
122
ts .flow_names = [flow1 .name ]
123
+
124
+ ixnet .Vport .find ()[1 ].Capture .HardwareEnabled = True
125
+ print ('Starting Data Capture' )
126
+ ixnet .StartCapture ()
127
+ time .sleep (10 )
128
+ print ('Stopping Data Capture' )
129
+ ixnet .StopCapture ()
130
+ print ('Stopping Data Traffic' )
122
131
ts .state = ts .STOP
123
132
dataplane .api .set_transmit_state (ts )
124
- time .sleep (10 )
133
+ time .sleep (5 )
134
+
135
+ counter = 0
136
+ while ixnet .Vport .find ()[1 ].Capture .DataCaptureState != 'ready' :
137
+ time .sleep (1 )
138
+ if counter > 120 :
139
+ raise Exception ('FAIL: Data Capture state not ready for Port {} after 120 Seconds' )
140
+ counter += 1
141
+ print ('Data Capture State for Rx Port : {}' .format (ixnet .Vport .find ()[1 ].Capture .DataCaptureState ))
142
+
143
+ print ('Total Data packets captured on Rx Port: {}' .format (ixnet .Vport .find ()[1 ].Capture .DataPacketCounter ))
144
+ ixnet .Vport .find ()[1 ].Capture .CurrentPacket .GetPacketFromDataCapture (Arg2 = 1 )
145
+ packetHeaderStacks = ixnet .Vport .find ()[1 ].Capture .CurrentPacket .Stack .find ()
146
+ for packetHeader in packetHeaderStacks .find ()[2 ]:
147
+ print ('\n PacketHeaderName: {}' .format (packetHeader .DisplayName ))
148
+ for field in packetHeader .Field .find ():
149
+ print ('\t {}: {}' .format (field .DisplayName , field .FieldValue ))
150
+ assert int (packetHeader .Field .find ()[2 ].FieldValue ) == 10 , "Vlan ID Field is not as expected in the packet"
151
+
125
152
request = dataplane .api .metrics_request ()
126
153
request .flow .flow_names = [flow1 .name ]
127
154
rows = dataplane .api .get_metrics (request ).flow_metrics
0 commit comments