Skip to content

Commit 0d53b74

Browse files
Test: fix path joining for gstreamer tests
The hosts were using the os package wchich does not work while running test from os remotly. Change it to use host path joining methods.
1 parent 54f706d commit 0d53b74

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

tests/validation/tests/single/gstreamer/anc_format/test_anc_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
# helper function to setup input and output file paths for ancillary files
13-
def setup_paths(media_file):
13+
def setup_paths(media_file, host):
1414
media_file_info, media_file_path = media_file
1515
if not media_file_path:
1616
raise ValueError("ramdisk was not setup correctly for media_file fixture")

tests/validation/tests/single/gstreamer/audio_format/test_audio_format.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ def test_audio_format(
4646
if not media_file_path:
4747
raise ValueError("ramdisk was not setup correctly for media_file fixture")
4848

49+
# Get the first host for remote execution
50+
host = list(hosts.values())[0]
4951
input_file_path = os.path.join(media_file_path, "input_test_audio.pcm")
5052
output_file_path = os.path.join(media_file_path, "output_test_audio.pcm")
5153

52-
# Get the first host for remote execution
53-
host = list(hosts.values())[0]
5454
interfaces_list = setup_interfaces.get_interfaces_list_single(
5555
test_config.get("interface_type", "VF")
5656
)

tests/validation/tests/single/gstreamer/video_format/test_video_format.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,39 @@
1111

1212

1313
@pytest.mark.nightly
14+
@pytest.mark.parametrize(
15+
"media_file",
16+
list(gstreamer_formats.values()),
17+
indirect=["media_file"],
18+
ids=list(gstreamer_formats.keys()),
19+
)
1420
@pytest.mark.parametrize("file", gstreamer_formats.keys())
1521
def test_video_format(
1622
hosts,
1723
build,
18-
media,
1924
setup_interfaces: InterfaceSetup,
2025
file,
2126
test_time,
2227
test_config,
28+
media_file,
2329
prepare_ramdisk,
2430
):
25-
video_file = gstreamer_formats[file]
31+
video_file, media_file_path = media_file
2632

2733
# Get the first host for remote execution
2834
host = list(hosts.values())[0]
2935
interfaces_list = setup_interfaces.get_interfaces_list_single(
3036
test_config.get("interface_type", "VF")
3137
)
3238

39+
media_dir = host.path.dirname(media_file_path)
40+
output_file_path = os.path.join(media_file_path, "output_video.yuv")
3341
input_file_path = media_create.create_video_file(
3442
width=video_file["width"],
3543
height=video_file["height"],
3644
framerate=video_file["fps"],
3745
format=GstreamerApp.video_format_change(video_file["format"]),
38-
media_path=media,
46+
media_path=media_dir,
3947
duration=3,
4048
host=host,
4149
)
@@ -55,7 +63,7 @@ def test_video_format(
5563
rx_config = GstreamerApp.setup_gstreamer_st20p_rx_pipeline(
5664
build=build,
5765
nic_port_list=interfaces_list[1],
58-
output_path=os.path.join(media, "output_video.yuv"),
66+
output_path=output_file_path,
5967
width=video_file["width"],
6068
height=video_file["height"],
6169
framerate=video_file["fps"],
@@ -70,7 +78,7 @@ def test_video_format(
7078
tx_command=tx_config,
7179
rx_command=rx_config,
7280
input_file=input_file_path,
73-
output_file=os.path.join(media, "output_video.yuv"),
81+
output_file=output_file_path,
7482
test_time=test_time,
7583
host=host,
7684
tx_first=False,
@@ -79,4 +87,4 @@ def test_video_format(
7987
finally:
8088
# Remove the video file after the test
8189
media_create.remove_file(input_file_path, host=host)
82-
media_create.remove_file(os.path.join(media, "output_video.yuv"), host=host)
90+
media_create.remove_file(output_file_path, host=host)

tests/validation/tests/single/gstreamer/video_resolution/test_video_resolution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_video_resolutions(
5252
request=request,
5353
)
5454

55-
media_dir = os.path.dirname(media_file_path)
55+
media_dir = host.path.dirname(media_file_path)
5656
input_file_path = media_create.create_video_file(
5757
width=video_file["width"],
5858
height=video_file["height"],

0 commit comments

Comments
 (0)