Skip to content

Commit 5b8fb3e

Browse files
ausphammssonicbld
authored andcommitted
chore: change logs output to logs/ folder (#20090)
Description of PR Summary: Currently snappi test cases are logging into /tmp. tmp folder are persistent and therefore unarchivable. This PR change the log direction to use container logs/ folder. This will help us to retrieve the log after run which help for debugging purpose Fixes # (issue) Type of change Bug fix Testbed and Framework(new/improvement) New Test case Skipped for non-supported platforms Test case improvement Approach What is the motivation for this PR? Described above Signed-off-by: Austin Pham <austinpham@microsoft.com>
1 parent 40befa0 commit 5b8fb3e

5 files changed

Lines changed: 90 additions & 81 deletions

File tree

tests/snappi_tests/pfc/test_pfc_mixed_speed.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def test_mixed_speed_diff_dist_over(snappi_api, # noqa: F811
109109
'DATA_FLOW_DURATION_SEC': 300,
110110
'data_flow_delay_sec': 0,
111111
'SNAPPI_POLL_DELAY_SEC': 60,
112-
'test_type': '/tmp/Single_400Gbps_Ingress_Single_100Gbps_Egress_diff_dist_',
112+
'test_type': 'logs/snappi_tests/pfc/Single_400Gbps_Ingress_Single_100Gbps_Egress_diff_dist_',
113113
'line_card_choice': testbed_subtype,
114114
'port_map': port_map,
115115
'enable_pfcwd': True,
@@ -245,7 +245,7 @@ def test_mixed_speed_uni_dist_over(snappi_api, # noqa: F811
245245
'DATA_FLOW_DURATION_SEC': 300,
246246
'data_flow_delay_sec': 0,
247247
'SNAPPI_POLL_DELAY_SEC': 60,
248-
'test_type': '/tmp/Single_400Gbps_Ingress_Single_100Gbps_Egress_uni_dist_',
248+
'test_type': 'logs/snappi_tests/pfc/Single_400Gbps_Ingress_Single_100Gbps_Egress_uni_dist_',
249249
'line_card_choice': testbed_subtype,
250250
'port_map': port_map,
251251
'enable_pfcwd': True,
@@ -379,7 +379,7 @@ def test_mixed_speed_no_congestion(snappi_api, # noqa: F811
379379
'DATA_FLOW_DURATION_SEC': 300,
380380
'data_flow_delay_sec': 0,
381381
'SNAPPI_POLL_DELAY_SEC': 60,
382-
'test_type': '/tmp/Single_400Gbps_Ingress_Single_100Gbps_Egress_no_cong_',
382+
'test_type': 'logs/snappi_tests/pfc/Single_400Gbps_Ingress_Single_100Gbps_Egress_no_cong_',
383383
'line_card_choice': testbed_subtype,
384384
'port_map': port_map,
385385
'enable_pfcwd': True,

tests/snappi_tests/pfc/test_pfc_no_congestion_throughput.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def test_multiple_prio_diff_dist(snappi_api, # noqa: F811
116116
'DATA_FLOW_DURATION_SEC': 300,
117117
'data_flow_delay_sec': 0,
118118
'SNAPPI_POLL_DELAY_SEC': 60,
119-
'test_type': '/tmp/Single_Ingress_Egress_diff_dist_'+str(port_map[1])+'Gbps',
119+
'test_type': 'logs/snappi_tests/pfc/Single_Ingress_Egress_diff_dist_'+str(port_map[1])+'Gbps',
120120
'line_card_choice': testbed_subtype,
121121
'port_map': port_map,
122122
'enable_pfcwd': True,
@@ -260,7 +260,7 @@ def test_multiple_prio_uni_dist(snappi_api, # noqa: F811
260260
'DATA_FLOW_DURATION_SEC': 300,
261261
'data_flow_delay_sec': 0,
262262
'SNAPPI_POLL_DELAY_SEC': 60,
263-
'test_type': '/tmp/Single_Ingress_Egress_uni_dist_'+str(port_map[1])+'Gbps',
263+
'test_type': 'logs/snappi_tests/pfc/Single_Ingress_Egress_uni_dist_'+str(port_map[1])+'Gbps',
264264
'line_card_choice': testbed_subtype,
265265
'port_map': port_map,
266266
'enable_pfcwd': True,
@@ -404,7 +404,7 @@ def test_single_lossless_prio(snappi_api, # noqa: F811
404404
'DATA_FLOW_DURATION_SEC': 300,
405405
'data_flow_delay_sec': 0,
406406
'SNAPPI_POLL_DELAY_SEC': 60,
407-
'test_type': '/tmp/Single_Ingress_Egress_1Prio_linerate_'+str(port_map[1])+'Gbps',
407+
'test_type': 'logs/snappi_tests/pfc/Single_Ingress_Egress_1Prio_linerate_'+str(port_map[1])+'Gbps',
408408
'line_card_choice': testbed_subtype,
409409
'port_map': port_map,
410410
'enable_pfcwd': True,

tests/snappi_tests/pfc/test_pfc_port_congestion.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def test_multiple_prio_diff_dist(snappi_api, # noqa: F811
116116
'DATA_FLOW_DURATION_SEC': 300,
117117
'data_flow_delay_sec': 0,
118118
'SNAPPI_POLL_DELAY_SEC': 60,
119-
'test_type': '/tmp/Two_Ingress_Single_Egress_diff_dist_'+str(port_map[1])+'Gbps',
119+
'test_type': 'logs/snappi_tests/pfc/Two_Ingress_Single_Egress_diff_dist_'+str(port_map[1])+'Gbps',
120120
'line_card_choice': testbed_subtype,
121121
'port_map': port_map,
122122
'enable_pfcwd': enable_pfcwd,
@@ -255,7 +255,7 @@ def test_multiple_prio_uni_dist(snappi_api, # noqa: F811
255255
'DATA_FLOW_DURATION_SEC': 300,
256256
'data_flow_delay_sec': 0,
257257
'SNAPPI_POLL_DELAY_SEC': 60,
258-
'test_type': '/tmp/Two_Ingress_Single_Egress_uni_dist_full'+str(port_map[1])+'Gbps',
258+
'test_type': 'logs/snappi_tests/pfc/Two_Ingress_Single_Egress_uni_dist_full'+str(port_map[1])+'Gbps',
259259
'line_card_choice': testbed_subtype,
260260
'port_map': port_map,
261261
'enable_pfcwd': enable_pfcwd,
@@ -396,7 +396,7 @@ def test_multiple_prio_equal_dist(snappi_api, # noqa: F811
396396
'DATA_FLOW_DURATION_SEC': 300,
397397
'data_flow_delay_sec': 0,
398398
'SNAPPI_POLL_DELAY_SEC': 60,
399-
'test_type': '/tmp/Two_Ingress_Single_Egress_equal_dist'+str(port_map[1])+'Gbps',
399+
'test_type': 'logs/snappi_tests/pfc/Two_Ingress_Single_Egress_equal_dist'+str(port_map[1])+'Gbps',
400400
'line_card_choice': testbed_subtype,
401401
'port_map': port_map,
402402
'enable_pfcwd': enable_pfcwd,
@@ -538,7 +538,7 @@ def test_multiple_prio_non_cngtn(snappi_api, # noqa: F811
538538
'DATA_FLOW_DURATION_SEC': 300,
539539
'data_flow_delay_sec': 0,
540540
'SNAPPI_POLL_DELAY_SEC': 60,
541-
'test_type': '/tmp/Two_Ingress_Single_Egress_non_cngstn_'+str(port_map[1])+'Gbps',
541+
'test_type': 'logs/snappi_tests/pfc/Two_Ingress_Single_Egress_non_cngstn_'+str(port_map[1])+'Gbps',
542542
'line_card_choice': testbed_subtype,
543543
'port_map': port_map,
544544
'enable_pfcwd': enable_pfcwd,

tests/snappi_tests/pfcwd/test_pfcwd_actions.py

Lines changed: 61 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def test_pfcwd_drop_90_10(snappi_api, # noqa: F811
132132
'DATA_FLOW_DURATION_SEC': 300,
133133
'data_flow_delay_sec': 1,
134134
'SNAPPI_POLL_DELAY_SEC': 60,
135-
'test_type': '/tmp/One_Ingress_Egress_pfcwd_drop_90_10_dist'+str(port_map[1])+'Gbps',
135+
'test_type': 'logs/snappi_tests/pfcwd/One_Ingress_Egress_pfcwd_drop_90_10_dist'+str(port_map[1])+'Gbps',
136136
'line_card_choice': "ixia_testbed",
137137
'port_map': port_map,
138138
'enable_pfcwd_drop': True,
@@ -260,7 +260,7 @@ def test_pfcwd_drop_uni(snappi_api, # noqa: F811
260260
'DATA_FLOW_DURATION_SEC': 300,
261261
'data_flow_delay_sec': 1,
262262
'SNAPPI_POLL_DELAY_SEC': 60,
263-
'test_type': '/tmp/One_Ingress_Egress_pfcwd_drop_uni_dist'+str(port_map[1])+'Gbps',
263+
'test_type': 'logs/snappi_tests/pfcwd/One_Ingress_Egress_pfcwd_drop_uni_dist'+str(port_map[1])+'Gbps',
264264
'line_card_choice': "ixia_dut_tb",
265265
'port_map': port_map,
266266
'enable_pfcwd_drop': True,
@@ -427,7 +427,7 @@ def test_pfcwd_frwd_90_10(snappi_api, # noqa: F811
427427
'DATA_FLOW_DURATION_SEC': 300,
428428
'data_flow_delay_sec': 1,
429429
'SNAPPI_POLL_DELAY_SEC': 60,
430-
'test_type': '/tmp/One_Ingress_Egress_pfcwd_frwd_90_10_dist'+str(port_map[1])+'Gbps',
430+
'test_type': 'logs/snappi_tests/pfcwd/One_Ingress_Egress_pfcwd_frwd_90_10_dist'+str(port_map[1])+'Gbps',
431431
'line_card_choice': testbed_subtype,
432432
'port_map': port_map,
433433
'enable_pfcwd_drop': False,
@@ -557,23 +557,25 @@ def test_pfcwd_drop_over_subs_40_09(snappi_api, # noqa: F811
557557
test_check = {'lossless': 100, 'lossy': 0, 'speed_tol': 83, 'loss_expected': True, 'pfc': True}
558558

559559
test_def = {}
560-
test_def = {'TEST_FLOW_AGGR_RATE_PERCENT': 40,
561-
'BG_FLOW_AGGR_RATE_PERCENT': 9,
562-
'data_flow_pkt_size': pkt_size,
563-
'DATA_FLOW_DURATION_SEC': 300,
564-
'data_flow_delay_sec': 1,
565-
'SNAPPI_POLL_DELAY_SEC': 60,
566-
'test_type': '/tmp/Two_Ingress_Single_Egress_pfcwd_drop_40_9_dist'+str(port_map[1])+'Gbps',
567-
'line_card_choice': "ixia_dut_tb",
568-
'port_map': port_map,
569-
'enable_pfcwd_drop': True,
570-
'enable_pfcwd_fwd': False,
571-
'enable_credit_wd': True,
572-
'stats_interval': 60,
573-
'background_traffic': True,
574-
'verify_flows': False,
575-
'imix': False,
576-
'test_check': test_check}
560+
test_def = {
561+
'TEST_FLOW_AGGR_RATE_PERCENT': 40,
562+
'BG_FLOW_AGGR_RATE_PERCENT': 9,
563+
'data_flow_pkt_size': pkt_size,
564+
'DATA_FLOW_DURATION_SEC': 300,
565+
'data_flow_delay_sec': 1,
566+
'SNAPPI_POLL_DELAY_SEC': 60,
567+
'test_type': 'logs/snappi_tests/pfcwd/Two_Ingress_Single_Egress_pfcwd_drop_40_9_dist'+str(port_map[1])+'Gbps',
568+
'line_card_choice': "ixia_dut_tb",
569+
'port_map': port_map,
570+
'enable_pfcwd_drop': True,
571+
'enable_pfcwd_fwd': False,
572+
'enable_credit_wd': True,
573+
'stats_interval': 60,
574+
'background_traffic': True,
575+
'verify_flows': False,
576+
'imix': False,
577+
'test_check': test_check
578+
}
577579

578580
test_prio_list = lossless_prio_list
579581
pause_prio_list = test_prio_list
@@ -724,23 +726,25 @@ def test_pfcwd_frwd_over_subs_40_09(snappi_api, # noqa: F811
724726
# loss_expected to check losses on DUT and TGEN.
725727
test_check = {'lossless': 0, 'lossy': 0, 'speed_tol': 3, 'loss_expected': False, 'pfc': True}
726728

727-
test_def = {'TEST_FLOW_AGGR_RATE_PERCENT': 40,
728-
'BG_FLOW_AGGR_RATE_PERCENT': 9,
729-
'data_flow_pkt_size': pkt_size,
730-
'DATA_FLOW_DURATION_SEC': 300,
731-
'data_flow_delay_sec': 1,
732-
'SNAPPI_POLL_DELAY_SEC': 60,
733-
'test_type': '/tmp/Two_Ingress_Single_Egress_pfcwd_frwd_40_9_dist'+str(port_map[1])+'Gbps',
734-
'line_card_choice': testbed_subtype,
735-
'port_map': port_map,
736-
'enable_pfcwd_drop': False,
737-
'enable_pfcwd_fwd': True,
738-
'enable_credit_wd': True,
739-
'stats_interval': 60,
740-
'background_traffic': True,
741-
'verify_flows': False,
742-
'imix': False,
743-
'test_check': test_check}
729+
test_def = {
730+
'TEST_FLOW_AGGR_RATE_PERCENT': 40,
731+
'BG_FLOW_AGGR_RATE_PERCENT': 9,
732+
'data_flow_pkt_size': pkt_size,
733+
'DATA_FLOW_DURATION_SEC': 300,
734+
'data_flow_delay_sec': 1,
735+
'SNAPPI_POLL_DELAY_SEC': 60,
736+
'test_type': 'logs/snappi_tests/pfcwd/Two_Ingress_Single_Egress_pfcwd_frwd_40_9_dist'+str(port_map[1])+'Gbps',
737+
'line_card_choice': testbed_subtype,
738+
'port_map': port_map,
739+
'enable_pfcwd_drop': False,
740+
'enable_pfcwd_fwd': True,
741+
'enable_credit_wd': True,
742+
'stats_interval': 60,
743+
'background_traffic': True,
744+
'verify_flows': False,
745+
'imix': False,
746+
'test_check': test_check
747+
}
744748

745749
# Selecting only one lossless priority for the test.
746750
test_prio_list = random.sample(lossless_prio_list, 1)
@@ -856,23 +860,26 @@ def test_pfcwd_disable_pause_cngtn(snappi_api, # noqa: F811
856860
# loss_expected to check losses on DUT and TGEN.
857861
test_check = {'lossless': 0, 'lossy': 0, 'speed_tol': 41, 'loss_expected': False, 'pfc': True}
858862

859-
test_def = {'TEST_FLOW_AGGR_RATE_PERCENT': 18,
860-
'BG_FLOW_AGGR_RATE_PERCENT': 27,
861-
'data_flow_pkt_size': pkt_size,
862-
'DATA_FLOW_DURATION_SEC': 300,
863-
'data_flow_delay_sec': 1,
864-
'SNAPPI_POLL_DELAY_SEC': 60,
865-
'test_type': '/tmp/Single_Ingress_Single_Egress_pause_cngstn_'+str(port_map[1])+'Gbps',
866-
'line_card_choice': "ixia_dut_tb",
867-
'port_map': port_map,
868-
'enable_pfcwd_drop': False,
869-
'enable_pfcwd_fwd': False,
870-
'enable_credit_wd': False,
871-
'stats_interval': 60,
872-
'background_traffic': True,
873-
'verify_flows': False,
874-
'imix': False,
875-
'test_check': test_check}
863+
test_def = {
864+
'TEST_FLOW_AGGR_RATE_PERCENT': 18,
865+
'BG_FLOW_AGGR_RATE_PERCENT': 27,
866+
'data_flow_pkt_size': pkt_size,
867+
'DATA_FLOW_DURATION_SEC': 300,
868+
'data_flow_delay_sec': 1,
869+
'SNAPPI_POLL_DELAY_SEC': 60,
870+
'test_type': 'logs/snappi_tests/pfcwd/Single_Ingress_Single_Egress_pause_cngstn_'+str(port_map[1])+'Gbps',
871+
'line_card_choice': "ixia_dut_tb",
872+
'port_map': port_map,
873+
'enable_pfcwd_drop': False,
874+
'enable_pfcwd_fwd': False,
875+
'enable_credit_wd': False,
876+
'stats_interval': 60,
877+
'background_traffic': True,
878+
'verify_flows': False,
879+
'imix': False,
880+
'test_check': test_check
881+
}
882+
876883
# Selecting only one lossless priority for the test.
877884
test_prio_list = random.sample(lossless_prio_list, 1)
878885
pause_prio_list = test_prio_list

tests/snappi_tests/pfcwd/test_pfcwd_mixed_speed.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def test_mixed_speed_pfcwd_enable(snappi_api, # noqa: F811
109109
'DATA_FLOW_DURATION_SEC': 300,
110110
'data_flow_delay_sec': 0,
111111
'SNAPPI_POLL_DELAY_SEC': 60,
112-
'test_type': '/tmp/Single_400Gbps_Ingress_Single_100Gbps_Egress_pause_pfcwd_enable_',
112+
'test_type': 'logs/snappi_tests/pfcwd/Single_400Gbps_Ingress_Single_100Gbps_Egress_pause_pfcwd_enable_',
113113
'line_card_choice': testbed_subtype,
114114
'port_map': port_map,
115115
'enable_pfcwd': True,
@@ -237,22 +237,24 @@ def test_mixed_speed_pfcwd_disable(snappi_api, # noqa: F811
237237
# speed_tol is speed tolerance between egress link speed and actual speed.
238238
# loss_expected to check losses on DUT and TGEN.
239239
test_check = {'lossless': 0, 'lossy': 75, 'speed_tol': 3, 'loss_expected': True, 'pfc': True}
240-
test_def = {'TEST_FLOW_AGGR_RATE_PERCENT': 40,
241-
'BG_FLOW_AGGR_RATE_PERCENT': 60,
242-
'data_flow_pkt_size': pkt_size,
243-
'DATA_FLOW_DURATION_SEC': 300,
244-
'data_flow_delay_sec': 0,
245-
'SNAPPI_POLL_DELAY_SEC': 60,
246-
'test_type': '/tmp/Single_400Gbps_Ingress_Single_100Gbps_Egress_pause_pfcwd_disable_',
247-
'line_card_choice': testbed_subtype,
248-
'port_map': port_map,
249-
'enable_pfcwd': False,
250-
'enable_credit_wd': False,
251-
'stats_interval': 60,
252-
'background_traffic': True,
253-
'imix': False,
254-
'test_check': test_check,
255-
'verify_flows': False}
240+
test_def = {
241+
'TEST_FLOW_AGGR_RATE_PERCENT': 40,
242+
'BG_FLOW_AGGR_RATE_PERCENT': 60,
243+
'data_flow_pkt_size': pkt_size,
244+
'DATA_FLOW_DURATION_SEC': 300,
245+
'data_flow_delay_sec': 0,
246+
'SNAPPI_POLL_DELAY_SEC': 60,
247+
'test_type': 'logs/snappi_tests/pfcwd/Single_400Gbps_Ingress_Single_100Gbps_Egress_pause_pfcwd_disable_',
248+
'line_card_choice': testbed_subtype,
249+
'port_map': port_map,
250+
'enable_pfcwd': False,
251+
'enable_credit_wd': False,
252+
'stats_interval': 60,
253+
'background_traffic': True,
254+
'imix': False,
255+
'test_check': test_check,
256+
'verify_flows': False
257+
}
256258

257259
test_prio_list = lossless_prio_list
258260
pause_prio_list = test_prio_list

0 commit comments

Comments
 (0)