Skip to content

Commit c3e3867

Browse files
committed
Fix dual gstreamer tests
1 parent 9e42c6a commit c3e3867

File tree

10 files changed

+286
-821
lines changed

10 files changed

+286
-821
lines changed

tests/validation/mtl_engine/GstreamerApp.py

Lines changed: 128 additions & 759 deletions
Large diffs are not rendered by default.

tests/validation/tests/dual/gstreamer/__init__.py

100644100755
File mode changed.

tests/validation/tests/dual/gstreamer/anc_format/__init__.py

100644100755
File mode changed.

tests/validation/tests/dual/gstreamer/anc_format/test_anc_format_dual.py

100644100755
Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,32 +39,55 @@ def test_st40p_fps_size_dual(
3939
host=tx_host,
4040
)
4141

42+
# Create output file path for RX host
43+
output_file_path = os.path.join(media, "output_anc_dual.txt")
44+
45+
# Setup TX pipeline using existing function
46+
tx_config = GstreamerApp.setup_gstreamer_st40p_tx_pipeline(
47+
build=build,
48+
nic_port_list=tx_host.vfs[0],
49+
input_path=input_file_path,
50+
tx_payload_type=113,
51+
tx_queues=4,
52+
tx_framebuff_cnt=framebuff,
53+
tx_fps=fps,
54+
tx_did=67,
55+
tx_sdid=2,
56+
)
57+
58+
# Setup RX pipeline using existing function
59+
rx_config = GstreamerApp.setup_gstreamer_st40p_rx_pipeline(
60+
build=build,
61+
nic_port_list=rx_host.vfs[0],
62+
output_path=output_file_path,
63+
rx_payload_type=113,
64+
rx_queues=4,
65+
timeout=15,
66+
)
67+
4268
capture_cfg = dict(test_config.get("capture_cfg", {})) if test_config else {}
4369
capture_cfg["test_name"] = (
4470
f"test_st40p_fps_size_dual_{fps}_{file_size_kb}kb_{framebuff}"
4571
)
4672

4773
try:
48-
result = GstreamerApp.execute_dual_st40_test(
74+
result = GstreamerApp.execute_test(
4975
build=build,
50-
tx_nic_port=tx_host.vfs[0],
51-
rx_nic_port=rx_host.vfs[0],
52-
input_path=input_file_path,
53-
payload_type=113,
54-
queues=4,
55-
tx_framebuff_cnt=framebuff,
56-
tx_fps=fps,
57-
tx_did=67,
58-
tx_sdid=2,
59-
timeout=40000,
76+
tx_command=tx_config,
77+
rx_command=rx_config,
78+
input_file=input_file_path,
79+
output_file=output_file_path,
6080
test_time=test_time,
6181
tx_host=tx_host,
6282
rx_host=rx_host,
83+
sleep_interval=3,
84+
tx_first=False,
6385
capture_cfg=capture_cfg,
6486
)
6587

6688
assert result, f"GStreamer dual ST40P test failed for fps={fps}, size={file_size_kb}KB"
6789

6890
finally:
69-
# Remove the input file on TX host
91+
# Remove the input file on TX host and output file on RX host
7092
media_create.remove_file(input_file_path, host=tx_host)
93+
media_create.remove_file(output_file_path, host=rx_host)

tests/validation/tests/dual/gstreamer/audio_format/__init__.py

100644100755
File mode changed.

tests/validation/tests/dual/gstreamer/audio_format/test_audio_format_dual.py

100644100755
Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from mtl_engine import GstreamerApp
99

1010

11-
@pytest.mark.parametrize("audio_format", ["s8", "s16le", "s24le"])
11+
@pytest.mark.parametrize("audio_format", ["S8", "S16BE", "S24BE"])
1212
@pytest.mark.parametrize("audio_channel", [1, 2])
1313
@pytest.mark.parametrize("audio_rate", [44100, 48000, 96000])
1414
def test_audio_format_dual(
@@ -35,14 +35,41 @@ def test_audio_format_dual(
3535
# Create input file on TX host
3636
input_file_path = os.path.join(media, "test_audio.pcm")
3737

38-
media_create.create_audio_file_sox(
39-
sample_rate=audio_rate,
38+
# media_create.create_audio_file_sox(
39+
# sample_rate=audio_rate,
40+
# channels=audio_channel,
41+
# bit_depth=GstreamerApp.audio_format_change(audio_format),
42+
# duration=10,
43+
# frequency=440,
44+
# output_path=input_file_path,
45+
# host=tx_host,
46+
# )
47+
48+
# Create output file path for RX host
49+
output_file_path = os.path.join(media, f"output_audio_dual_{audio_format}_{audio_channel}_{audio_rate}.pcm")
50+
51+
# Setup TX pipeline using existing function
52+
tx_config = GstreamerApp.setup_gstreamer_st30_tx_pipeline(
53+
build=build,
54+
nic_port_list=tx_host.vfs[0],
55+
input_path=input_file_path,
56+
tx_payload_type=111,
57+
tx_queues=4,
58+
audio_format=audio_format,
4059
channels=audio_channel,
41-
bit_depth=GstreamerApp.audio_format_change(audio_format),
42-
duration=10,
43-
frequency=440,
44-
output_path=input_file_path,
45-
host=tx_host,
60+
sampling=audio_rate,
61+
)
62+
63+
# Setup RX pipeline using existing function
64+
rx_config = GstreamerApp.setup_gstreamer_st30_rx_pipeline(
65+
build=build,
66+
nic_port_list=rx_host.vfs[0],
67+
output_path=output_file_path,
68+
rx_payload_type=111,
69+
rx_queues=4,
70+
rx_audio_format=GstreamerApp.audio_format_change(audio_format, rx_side=True),
71+
rx_channels=audio_channel,
72+
rx_sampling=audio_rate,
4673
)
4774

4875
capture_cfg = dict(test_config.get("capture_cfg", {})) if test_config else {}
@@ -51,24 +78,23 @@ def test_audio_format_dual(
5178
)
5279

5380
try:
54-
result = GstreamerApp.execute_dual_st30_test(
81+
result = GstreamerApp.execute_test(
5582
build=build,
56-
tx_nic_port=tx_host.vfs[0],
57-
rx_nic_port=rx_host.vfs[0],
58-
input_path=input_file_path,
59-
payload_type=111,
60-
queues=4,
61-
audio_format=audio_format,
62-
channels=audio_channel,
63-
sampling=audio_rate,
83+
tx_command=tx_config,
84+
rx_command=rx_config,
85+
input_file=input_file_path,
86+
output_file=output_file_path,
6487
test_time=test_time,
6588
tx_host=tx_host,
6689
rx_host=rx_host,
90+
tx_first=False,
91+
sleep_interval=1,
6792
capture_cfg=capture_cfg,
6893
)
6994

7095
assert result, f"GStreamer dual audio format test failed for format {audio_format}"
7196

7297
finally:
73-
# Remove the input file on TX host
74-
media_create.remove_file(input_file_path, host=tx_host)
98+
# Remove the output file on RX host
99+
# media_create.remove_file(input_file_path, host=tx_host)
100+
media_create.remove_file(output_file_path, host=rx_host)

tests/validation/tests/dual/gstreamer/video_format/__init__.py

100644100755
File mode changed.

tests/validation/tests/dual/gstreamer/video_format/test_video_format_dual.py

100644100755
Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ def test_video_format_dual(
2020
test_config,
2121
prepare_ramdisk,
2222
):
23-
"""
24-
Test GStreamer ST20P video format in dual host configuration using single host setup functions.
25-
This test now reuses single host pipeline setup functions with dual host networking updates.
26-
"""
2723
video_file = gstreamer_formats[file]
2824

2925
# Get TX and RX hosts
@@ -40,33 +36,61 @@ def test_video_format_dual(
4036
height=video_file["height"],
4137
framerate=video_file["fps"],
4238
format=GstreamerApp.video_format_change(video_file["format"]),
39+
duration=3,
4340
media_path=media,
4441
host=tx_host,
4542
)
4643

44+
# Create output file path for RX host
45+
output_file_path = os.path.join(media, f"output_video_dual_{file}.yuv")
46+
47+
# Setup TX pipeline using existing function
48+
tx_config = GstreamerApp.setup_gstreamer_st20p_tx_pipeline(
49+
build=build,
50+
nic_port_list=tx_host.vfs[0],
51+
input_path=input_file_path,
52+
width=video_file["width"],
53+
height=video_file["height"],
54+
framerate=video_file["fps"],
55+
format=GstreamerApp.video_format_change(video_file["format"]),
56+
tx_payload_type=112,
57+
tx_queues=4,
58+
)
59+
60+
# Setup RX pipeline using existing function
61+
rx_config = GstreamerApp.setup_gstreamer_st20p_rx_pipeline(
62+
build=build,
63+
nic_port_list=rx_host.vfs[0],
64+
output_path=output_file_path,
65+
width=video_file["width"],
66+
height=video_file["height"],
67+
framerate=video_file["fps"],
68+
format=GstreamerApp.video_format_change(video_file["format"]),
69+
rx_payload_type=112,
70+
rx_queues=4,
71+
)
72+
4773
capture_cfg = dict(test_config.get("capture_cfg", {})) if test_config else {}
4874
capture_cfg["test_name"] = f"test_video_format_dual_{file}"
4975

5076
try:
51-
result = GstreamerApp.execute_dual_st20p_test(
77+
# Use the unified execute_test function for dual host execution
78+
result = GstreamerApp.execute_test(
5279
build=build,
53-
tx_nic_port=tx_host.vfs[0],
54-
rx_nic_port=rx_host.vfs[0],
55-
input_path=input_file_path,
56-
width=video_file["width"],
57-
height=video_file["height"],
58-
framerate=video_file["fps"],
59-
format=GstreamerApp.video_format_change(video_file["format"]),
60-
payload_type=112,
61-
queues=4,
80+
tx_command=tx_config,
81+
rx_command=rx_config,
82+
input_file=input_file_path,
83+
output_file=output_file_path,
6284
test_time=test_time,
6385
tx_host=tx_host,
6486
rx_host=rx_host,
87+
tx_first=False,
6588
capture_cfg=capture_cfg,
6689
)
6790

6891
assert result, f"GStreamer dual video format test failed for format {file}"
6992

7093
finally:
71-
# Remove the input file on TX host
94+
# Remove the input file on TX host and output file on RX host
7295
media_create.remove_file(input_file_path, host=tx_host)
96+
media_create.remove_file(output_file_path, host=rx_host)

tests/validation/tests/dual/gstreamer/video_resolution/__init__.py

100644100755
File mode changed.

tests/validation/tests/dual/gstreamer/video_resolution/test_video_resolution_dual.py

100644100755
Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111

1212

1313
@pytest.mark.parametrize(
14-
"file",
15-
[
16-
pytest.param(f, marks=pytest.mark.smoke) if f == "i1080p59" else f
17-
for f in yuv_files.keys()
18-
],
14+
"file", yuv_files.keys()
1915
)
2016
def test_video_resolutions_dual(
2117
hosts,
@@ -53,32 +49,59 @@ def test_video_resolutions_dual(
5349
framerate=video_file["fps"],
5450
format=GstreamerApp.video_format_change(video_file["format"]),
5551
media_path=media,
52+
duration=2,
5653
host=tx_host,
5754
)
5855

56+
# Create output file path for RX host
57+
output_file_path = os.path.join(media, f"output_video_resolution_dual_{file}.yuv")
58+
59+
# Setup TX pipeline using existing function
60+
tx_config = GstreamerApp.setup_gstreamer_st20p_tx_pipeline(
61+
build=build,
62+
nic_port_list=tx_host.vfs[0],
63+
input_path=input_file_path,
64+
width=video_file["width"],
65+
height=video_file["height"],
66+
framerate=video_file["fps"],
67+
format=GstreamerApp.video_format_change(video_file["format"]),
68+
tx_payload_type=112,
69+
tx_queues=4,
70+
)
71+
72+
# Setup RX pipeline using existing function
73+
rx_config = GstreamerApp.setup_gstreamer_st20p_rx_pipeline(
74+
build=build,
75+
nic_port_list=rx_host.vfs[0],
76+
output_path=output_file_path,
77+
width=video_file["width"],
78+
height=video_file["height"],
79+
framerate=video_file["fps"],
80+
format=GstreamerApp.video_format_change(video_file["format"]),
81+
rx_payload_type=112,
82+
rx_queues=4,
83+
)
84+
5985
capture_cfg = dict(test_config.get("capture_cfg", {})) if test_config else {}
6086
capture_cfg["test_name"] = f"test_video_resolutions_dual_{file}"
6187

6288
try:
63-
result = GstreamerApp.execute_dual_st20p_test(
89+
result = GstreamerApp.execute_test(
6490
build=build,
65-
tx_nic_port=tx_host.vfs[0],
66-
rx_nic_port=rx_host.vfs[0],
67-
input_path=input_file_path,
68-
width=video_file["width"],
69-
height=video_file["height"],
70-
framerate=video_file["fps"],
71-
format=GstreamerApp.video_format_change(video_file["format"]),
72-
payload_type=112,
73-
queues=4,
91+
tx_command=tx_config,
92+
rx_command=rx_config,
93+
input_file=input_file_path,
94+
output_file=output_file_path,
7495
test_time=test_time,
7596
tx_host=tx_host,
7697
rx_host=rx_host,
98+
tx_first=False,
7799
capture_cfg=capture_cfg,
78100
)
79101

80102
assert result, f"GStreamer dual video resolution test failed for resolution {file}"
81103

82104
finally:
83-
# Remove the input file on TX host
105+
# Remove the input file on TX host and output file on RX host
84106
media_create.remove_file(input_file_path, host=tx_host)
107+
media_create.remove_file(output_file_path, host=rx_host)

0 commit comments

Comments
 (0)