Skip to content

Commit

Permalink
Test scripting improvements and af_xdp fixes (#198)
Browse files Browse the repository at this point in the history
* Test scripting improvements and af_xdp fixes

Test scripting improvements and af_xdp fixes
- added basic path resolution
- added copy logs on error functionality
- many fixes to the af_xdp workflow
- .gitignore updated

* Shellcheck warnings and errors fixed.

- Shellcheck warnings and errors fixed:
(SC1087): Use braces when expanding arrays, e.g. ${array[idx]} (or ${var}[.. to quiet).
(SC2086): Double quote to prevent globbing and word splitting.
(SC2004): $/${} is unnecessary on arithmetic variables.

- Added .shellcheckrc with `external-sources=true`
- Moved and renamed build_dep.sh to scripts/setup_build_env.sh

* Update docs/README.md

---------

Signed-off-by: Miłosz Linkiewicz <milosz.linkiewicz@intel.com>
Co-authored-by: Konstantin Ilichev <konstantin.ilichev@intel.com>
  • Loading branch information
Mionsz and ko80 authored Sep 27, 2024
1 parent 213ce27 commit 4d87a2d
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 130 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ media-proxy/protos/controller.pb.cc
media-proxy/protos/controller.pb.h

# for VS Code settings
.vscode/c_cpp_properties.json
.vscode/settings.json
.vscode/*

# For FFmpeg plugin
ffmpeg-plugin/FFmpeg/
Expand All @@ -30,3 +29,5 @@ docs/_build
media-proxy/tests/test.yuv
media-proxy/tests/memif_test_rx
media-proxy/tests/memif_test_tx
tests/single-node-sample-apps/error_*
tests/single-node-sample-apps/out
1 change: 1 addition & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
external-sources=true
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ Detailed information about MCM SDK can be found in [sdk](sdk) directory.

1. **Install Dependencies**, choose between options `a)` or `b)`.

a) The `build_dep.sh` script can be used for all-in-one environment preparation. The script is designed for Debian and was tested under `Ubuntu 20.04`, `Ubuntu 22.04` and `Ubuntu 24.04` environments.
To use this option just run the script after cloning the repository by typing `build_dep.sh`
a) The `setup_build_env.sh` script located in the `scripts` folder can be used for all-in-one environment preparation. The script is designed for Debian and was tested under `Ubuntu 20.04`, `Ubuntu 22.04` and `Ubuntu 24.04` environments.
To use this option just run the script after cloning the repository by typing `./scripts/setup_build_env.sh`

b) The following method is universal and should work for most Linux OS distributions.

Expand Down
9 changes: 5 additions & 4 deletions build_dep.sh → scripts/setup_build_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
set -eo pipefail

SCRIPT_DIR="$(readlink -f "$(dirname -- "${BASH_SOURCE[0]}")")"
REPO_DIR="${SCRIPT_DIR:-$(pwd)}"
REPO_DIR="$(readlink -f "../${SCRIPT_DIR}")"

. "${REPO_DIR}/common.sh"

NPROC="$(nproc)"
export MCM_DIR="${REPO_DIR}/build/mcm"
export MTL_VER="d2515b90cc0ef651f6d0a6661d5a644490bfc3f3"
export MTL_DIR="${REPO_DIR}/build/mtl"
Expand Down Expand Up @@ -120,7 +121,7 @@ popd
pushd "${LIBFABRIC_DIR}"
./autogen.sh && \
./configure && \
make -j$(nproc) && \
make -j "${NPROC}" && \
make install && \
popd

Expand All @@ -143,10 +144,10 @@ popd
mkdir -p "${GRPC_DIR}/cmake/build"
pushd "${GRPC_DIR}/cmake/build"
cmake -DgRPC_BUILD_TESTS=OFF -DgRPC_INSTALL=ON ../.. && \
make -j $(nproc) && \
make -j "${NPROC}" && \
make install && \
cmake -DgRPC_BUILD_TESTS=ON -DgRPC_INSTALL=ON ../.. && \
make -j $(nproc) grpc_cli && \
make -j "${NPROC}" grpc_cli && \
cp grpc_cli "/usr/local/bin/"
popd

Expand Down
16 changes: 8 additions & 8 deletions tests/single-node-sample-apps/test-rdma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,49 +146,49 @@ function run_test_rdma() {
info "Starting Tx side media_proxy"
local tx_media_proxy_cmd="media_proxy -t 8002"
run_in_background "$bin_dir/$tx_media_proxy_cmd" "$tx_media_proxy_out"
tx_media_proxy_pid=$!
tx_media_proxy_pid="$!"

sleep 1

info "Starting Rx side media_proxy"
local rx_media_proxy_cmd="media_proxy -t 8003"
run_in_background "$bin_dir/$rx_media_proxy_cmd" "$rx_media_proxy_out"
rx_media_proxy_pid=$!
rx_media_proxy_pid="$!"

sleep 1

info "Starting recver_app"
export MCM_MEDIA_PROXY_PORT=8003
local recver_app_cmd="recver_app -r $rdma_iface_ip -t rdma -w $width -h $height -f $fps -x $pixel_format -b $output_file -o auto"
run_in_background "$bin_dir/$recver_app_cmd" "$recver_app_out"
recver_app_pid=$!
recver_app_pid="$!"


info "Starting sender_app"
export MCM_MEDIA_PROXY_PORT=8002
local sender_app_cmd="sender_app -s $rdma_iface_ip -t rdma -w $width -h $height -f $fps -x $pixel_format -b $input_file -n $frames_number -o auto"
run_in_background "$bin_dir/$sender_app_cmd" "$sender_app_out"
sender_app_pid=$!
sender_app_pid="$!"

info "Waiting for recver_app to connect to Rx media_proxy"
wait_text 10 $recver_app_out "Success connect to MCM media-proxy"
local recver_app_timeout=$?
local recver_app_timeout="$?"
[ $recver_app_timeout -eq 0 ] && info "Connection established"

info "Waiting for sender_app to connect to Tx media_proxy"
wait_text 10 $sender_app_out "Success connect to MCM media-proxy"
local sender_app_timeout=$?
local sender_app_timeout="$?"
[ $sender_app_timeout -eq 0 ] && info "Connection established"

wait_completion "$wait_interval"
local timeout=$?
local timeout="$?"

sleep 1

shutdown_apps

check_results
local error=$?
local error="$?"

info "Tx media_proxy stats"
local regex="throughput ([0-9]*\.[0-9]*) Mb/s: [0-9]*\.[0-9]* Mb/s, cpu busy ([0-9]*\.[0-9]*)"
Expand Down
Loading

0 comments on commit 4d87a2d

Please sign in to comment.