Skip to content

add support for QNX 7.1/8.0#548

Open
pkleymonov-qnx wants to merge 1 commit intoCorvusoft:masterfrom
qnx-ports:qnx-4.8
Open

add support for QNX 7.1/8.0#548
pkleymonov-qnx wants to merge 1 commit intoCorvusoft:masterfrom
qnx-ports:qnx-4.8

Conversation

@pkleymonov-qnx
Copy link

@pkleymonov-qnx pkleymonov-qnx commented Mar 21, 2025

These changes facilitate porting of Restbed for QNX7.1/8.0. #549
Build files are available at https://github.com/qnx-ports/build-files/tree/main/ports/restbed

NOTE: QNX ports are only supported from a Linux host operating system

Create a workspace

mkdir -p ~/qnx_workspace && cd ~/qnx_workspace
git clone https://github.com/qnx-ports/build-files.git

Clone Restbed repository from tested release version

git clone https://github.com/qnx-ports/restbed.git

Or clone it from original repository

git clone https://github.com/Corvusoft/restbed.git

Update 3rdParty dependencies

cd restbed
git submodule update --init --recursive
cd -

Pre-requisite:

Setup a Docker container

# Build the Docker image and create a container
cd build-files/docker
./docker-build-qnx-image.sh
./docker-create-container.sh

# Now you are in the Docker container

Or setup Ubuntu host

# source qnxsdp-env.sh
source ~/qnx800/qnxsdp-env.sh

Compile the port for QNX

cd ~/qnx_workspace
# Build Restbed and install it in sysroot (QNX SDP)
make -C build-files/ports/restbed install JLEVEL=$(nproc)
# Or build Restbed and install it in a staging area
make -C build-files/ports/restbed install JLEVEL=$(nproc) INSTALL_ROOT_nto=<PATH_TO_YOUR_STAGING_AREA> USE_INSTALL_ROOT=true

How to run tests

Copy (scp) Restbed tests in to the QNX target.

cd ~/qnx_workspace
# Build restbed and all tests
make -C build-files/ports/restbed check JLEVEL=$(nproc)

# define target IP address
TARGET_HOST=<target-ip-address-or-hostname>

# remove old test dir on target
ssh qnxuser@$TARGET_HOST "rm -rf restbed_tests"

# create new test dir on target
ssh qnxuser@$TARGET_HOST "mkdir restbed_tests"

# copy restbed build tree to your QNX target
scp -r build-files/ports/restbed/nto-aarch64-le/build/* qnxuser@$TARGET_HOST:/data/home/qnxuser/restbed_tests/
# or
scp -r build-files/ports/restbed/nto-x86_64-o/build/* qnxuser@$TARGET_HOST:/data/home/qnxuser/restbed_tests/

Run tests on the target.

# ssh into the target
ssh qnxuser@$TARGET_HOST
## Run tests
cd /data/home/qnxuser/restbed_tests/
python ./base_testsuite.py

Tips and triks.

With your spd you can create and run virtual x86_64 TARGET of QNX.

# source qnxsdp-env.sh
source ~/qnx800/qnxsdp-env.sh

# Install on linux host virtual machine like qemu/vxbox/vmware
# Create and run virtual target of QNX
# qemu
mkqnximage --type=qemu --arch=x86_64 --clean --run --force --python=yes --data-size=500 --data-inodes=20000
# or vmware
mkqnximage --type=vmware --arch=x86_64 --clean --run --force --python=yes --data-size=500 --data-inodes=20000
# or virtual box
mkqnximage --type=vbox --arch=x86_64 --clean --run --force --python=yes --data-size=500 --data-inodes=20000

Note: All tests have to return no error.

...
======================================================
Tests suites summary for Restbed 4.8
======================================================
# test/unit        - ALL:10 PASS:10 FAIL:0 SKIP:0 [0:00:00.115737]
# test/feature     - ALL:65 PASS:65 FAIL:0 SKIP:0 [0:00:14.513149]
# test/regression  - ALL:31 PASS:31 FAIL:0 SKIP:0 [0:00:08.603444]
# test/integration - ALL:10 PASS:10 FAIL:0 SKIP:0 [0:00:00.114280]
# TOTAL: 116 [0:00:23.346610]
# PASS: 116
# FAIL: 0
# SKIP: 0
======================================================

@pkleymonov-qnx pkleymonov-qnx marked this pull request as ready for review April 3, 2025 11:23
@ben-crowhurst
Copy link
Member

If you'd like this included in the 5.0.0 release, please provide a resolution to the conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants