-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Memif native library based functional tests (#177)
Memif native library based functional tests. Executables have been fixed and added to the build tests process: - media-proxy/tests/memif_test_rx.c - media-proxy/tests/memif_test_tx.c Functional tests for inter process communication have been added, as an extension to exisiting tests: - tests/single-node-sample-apps/test_memif.sh Tests include 2 cases where: - sender is media_proxy sdk app and receiver is memif native app - sender is memif native app and receiver is media_proxy sdk app Signed-off-by: Milosz Linkiewicz <[email protected]>
- Loading branch information
Showing
9 changed files
with
175 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2024 Intel Corporation | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
cmake_minimum_required(VERSION 3.16) | ||
project(McmMeifTests VERSION 0.1.0 LANGUAGES CXX C) | ||
|
||
set(CMAKE_C_STANDARD 11) | ||
|
||
add_executable(memif_test_rx memif_test_rx.c) | ||
target_include_directories(memif_test_rx PRIVATE ../include) | ||
target_link_libraries(memif_test_rx PRIVATE mcm_dp) | ||
|
||
add_executable(memif_test_tx memif_test_tx.c) | ||
target_include_directories(memif_test_tx PRIVATE ../include) | ||
target_link_libraries(memif_test_tx PRIVATE mcm_dp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
#!/bin/bash | ||
|
||
# SPDX-License-Identifier: BSD-3-Clause | ||
# Copyright 2024 Intel Corporation | ||
|
||
function run_test_memif_rx() { | ||
# Notice: media_proxy does not take part in the direct memif communication. | ||
# However, we start Tx and Rx media_proxy to check if they print expected | ||
# messages and do not produce any errors. | ||
|
||
# Notice: sender_app should be started before recver_app. Currently, this is | ||
# the only successful scenario. | ||
mkdir -p "$out_dir" | ||
export socket_path="/run/mcm/mcm_rx_memif.sock" | ||
|
||
info "Connection type: MEMIF libmemif_rx" | ||
|
||
info "Starting Tx side media_proxy" | ||
local tx_media_proxy_cmd="media_proxy -d $tx_vf_bdf -i 192.168.96.1 -t 8002" | ||
run_in_background "$bin_dir/$tx_media_proxy_cmd" "$tx_media_proxy_out" | ||
tx_media_proxy_pid=$! | ||
|
||
sleep 1 | ||
|
||
info "Starting Rx side media_proxy" | ||
local rx_media_proxy_cmd="media_proxy -d $rx_vf_bdf -i 192.168.96.2 -t 8003" | ||
run_in_background "$bin_dir/$rx_media_proxy_cmd" "$rx_media_proxy_out" | ||
rx_media_proxy_pid=$! | ||
|
||
sleep 1 | ||
|
||
info "Starting sender_app" | ||
export MCM_MEDIA_PROXY_PORT=8002 | ||
local sender_app_cmd="sender_app -s 192.168.96.2 -t st20 -w $width -h $height -f $fps -x $pixel_format -b $input_file -n $frames_number -o memif --socketpath=${socket_path}" | ||
run_in_background "$bin_dir/$sender_app_cmd" "$sender_app_out" | ||
sender_app_pid=$! | ||
|
||
sleep 1 | ||
|
||
info "Starting memif_test_rx" | ||
local recver_app_cmd="memif_test_rx -w $width -h $height -f $output_file -s $socket_path" | ||
run_in_background "$bin_dir/$recver_app_cmd" "$recver_app_out" | ||
recver_app_pid=$! | ||
|
||
wait_completion "$wait_interval" | ||
local timeout=$? | ||
|
||
sleep 1 | ||
|
||
shutdown_apps | ||
|
||
sleep 1 | ||
|
||
check_results | ||
local error=$? | ||
|
||
info "Cleanup" | ||
cleanup | ||
|
||
return $(($error || $timeout)) | ||
} | ||
|
||
function run_test_memif_tx() { | ||
# Notice: media_proxy does not take part in the direct memif communication. | ||
# However, we start Tx and Rx media_proxy to check if they print expected | ||
# messages and do not produce any errors. | ||
|
||
# Notice: sender_app should be started before recver_app. Currently, this is | ||
# the only successful scenario. | ||
mkdir -p "$out_dir" | ||
export socket_path="/run/mcm/mcm_rx_memif.sock" | ||
|
||
info "Connection type: MEMIF libmemif_tx" | ||
|
||
info "Starting Tx side media_proxy" | ||
local tx_media_proxy_cmd="media_proxy -d $tx_vf_bdf -i 192.168.96.1 -t 8002" | ||
run_in_background "$bin_dir/$tx_media_proxy_cmd" "$tx_media_proxy_out" | ||
tx_media_proxy_pid=$! | ||
|
||
sleep 1 | ||
|
||
info "Starting Rx side media_proxy" | ||
local rx_media_proxy_cmd="media_proxy -d $rx_vf_bdf -i 192.168.96.2 -t 8003" | ||
run_in_background "$bin_dir/$rx_media_proxy_cmd" "$rx_media_proxy_out" | ||
rx_media_proxy_pid=$! | ||
|
||
sleep 1 | ||
|
||
info "Starting memif_test_tx" | ||
local sender_app_cmd="memif_test_tx -m -w $width -h $height -f $input_file -s $socket_path" | ||
run_in_background "$bin_dir/$sender_app_cmd" "$sender_app_out" | ||
sender_app_pid=$! | ||
|
||
sleep 1 | ||
|
||
info "Starting recver_app" | ||
export MCM_MEDIA_PROXY_PORT=8003 | ||
local recver_app_cmd="recver_app -r 192.168.96.1 -t st20 -w $width -h $height -f $fps -x $pixel_format -b $output_file -o memif --socketpath=$socket_path" | ||
run_in_background "$bin_dir/$recver_app_cmd" "$recver_app_out" | ||
recver_app_pid=$! | ||
|
||
wait_completion "$wait_interval" | ||
local timeout=$? | ||
|
||
sleep 1 | ||
|
||
shutdown_apps | ||
|
||
sleep 1 | ||
|
||
check_results | ||
local error=$? | ||
|
||
info "Cleanup" | ||
cleanup | ||
|
||
return $(($error || $timeout)) | ||
} |