Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 27 additions & 11 deletions .github/workflows/ri-consumer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,53 @@ name: Run ri consumer against sdc11073 provider

on:
push:
workflow_dispatch:

jobs:
test:
strategy:
matrix:
branch: [master]
sdcri_version: ["5.1.1", "6.0.0-SNAPSHOT"]
sdc11073_repo: [draegerwerk/sdc11073]
sdcpi_branch: [feature/pat_20]
tls_enable: [true, false]
include:
- sdc11073_repo: draegerwerk/sdc11073
sdc11073_branch: master
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/checkout@v6

- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: '3.10'
python-version: '3.13'

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6

- name: Checkout sdc11073
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
repository: draegerwerk/sdc11073
ref: ${{ matrix.branch }}
repository: ${{ matrix.sdc11073_repo }}
ref: ${{ matrix.sdc11073_branch }}
path: sdc11073_git

- name: Install sdc11073
run: |
python -m pip install -e ./sdc11073_git

- name: Checkout sdpi
run: |
git clone --branch=${{ matrix.sdcpi_branch }} https://gitlab.com/sdc-suite/sdc-ri-adjuncts/sdpi.git sdpi_git

- name: Run test
run: |
./ri_consumer.sh ${{ matrix.sdcri_version }} ${{ matrix.tls_enable }}
./ri_consumer.sh ${{ matrix.tls_enable }}
38 changes: 27 additions & 11 deletions .github/workflows/sdc11073-consumer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,53 @@ name: Run sdc11073 consumer against ri provider

on:
push:
workflow_dispatch:

jobs:
test:
strategy:
matrix:
branch: [master]
sdcri_version: ["5.1.1", "6.0.0-SNAPSHOT"]
sdc11073_repo: [draegerwerk/sdc11073]
sdcpi_branch: [feature/pat_20]
tls_enable: [true, false]
include:
- sdc11073_repo: draegerwerk/sdc11073
sdc11073_branch: master
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/checkout@v6

- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: '3.10'
python-version: '3.13'

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6

- name: Checkout sdc11073
uses: actions/checkout@v3
uses: actions/checkout@v6
with:
repository: draegerwerk/sdc11073
ref: ${{ matrix.branch }}
repository: ${{ matrix.sdc11073_repo }}
ref: ${{ matrix.sdc11073_branch }}
path: sdc11073_git

- name: Install sdc11073
run: |
python -m pip install -e ./sdc11073_git

- name: Checkout sdpi
run: |
git clone --branch=${{ matrix.sdcpi_branch }} https://gitlab.com/sdc-suite/sdc-ri-adjuncts/sdpi.git sdpi_git

- name: Run test
run: |
./sdc11073_consumer.sh ${{ matrix.sdcri_version }} ${{ matrix.tls_enable }}
./sdc11073_consumer.sh ${{ matrix.tls_enable }}
23 changes: 23 additions & 0 deletions app-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[provider]
epr = "urn:uuid:12345678-6f55-11ea-9697-123456789abc"
address = "127.0.0.1"
writeCommlog = false
[provider.tls]
disableTls = true
publicKeyFile = "**\\participant_public.pem"
privateKeyFile = "**\\participant_private.pem"
caCertFile = "**\\ca_certificate.pem"
privateKeyPassword = "dummypass"
[provider.updateTimes]
descriptionUpdateIntervalInMillis = 10000

[consumer]
epr = "urn:uuid:12345678-6f55-11ea-9697-123456789abc"
address = "127.0.0.1"
writeCommlog = true
[consumer.tls]
disableTls = true
publicKeyFile = "**\\user_certificate_root_signed.pem"
privateKeyFile = "**\\user_private_key_encrypted.pem"
caCertFile = "**\\root_certificate.pem"
privateKeyPassword = "dummypass"
154 changes: 0 additions & 154 deletions ri/pom.xml

This file was deleted.

55 changes: 35 additions & 20 deletions ri_consumer.sh
Original file line number Diff line number Diff line change
@@ -1,34 +1,49 @@
#!/bin/bash

args=("$@")
echo sdcri-version is "${args[0]}"
echo flag indicating to use TLS is "${args[1]}"
echo flag indicating to use TLS is "${args[0]}"

ip addr
echo ref_ip is "${ref_ip}"

export ref_fac="theFacility"
export ref_bed="comfyBed"
export ref_poc="noPoint"
if [ "${args[1]}" == "true" ]; then
export ref_ca=$(pwd)/certs
export ref_ssl_passwd=dummypass
epr="urn:uuid:12345678-6f55-11ea-9697-123456789abc"
ip_addr="127.0.0.1"
cert_path="$(pwd)/certs"
cert_passwd="dummypass"

sdc11073_path="$(pwd)/sdc11073_git"
if [ "${args[0]}" == "true" ]; then
echo "Starting sdc11073 provider with TLS"
PYTHONPATH=$sdc11073_path python3 -m pat.provider --epr $epr --ip $ip_addr --certificate-folder $cert_path --ssl-password $cert_passwd &
else
echo "Starting sdc11073 provider without TLS"
PYTHONPATH=$sdc11073_path python3 -m pat.provider --epr $epr --ip $ip_addr &
fi

echo "Starting sdc11073 provider"

python3 sdc11073_git/examples/ReferenceTest/reference_provider.py &

if [ "${args[1]}" == "true" ]; then
echo "Starting SDCri consumer with TLS"
cd ri && mvn -Dsdcri-version=${args[0]} -Pconsumer-tls -Pallow-snapshots exec:java; ((test_exit_code = $?))
if [ "${args[0]}" == "true" ]; then
echo "Starting sdpi consumer with TLS"
disableTls_value="false"
else
echo "Starting SDCri consumer without TLS"
cd ri && mvn -Dsdcri-version=${args[0]} -Pconsumer -Pallow-snapshots exec:java; ((test_exit_code = $?))
echo "Starting sdpi consumer without TLS"
disableTls_value="true"
fi

config="$(mktemp --suffix=.toml)"
cat > "$config" << EOF
[consumer]
epr = "$epr"
address = "$ip_addr"
writeCommlog = true
[consumer.tls]
disableTls = $disableTls_value
publicKeyFile = "$cert_path/user_certificate_root_signed.pem"
privateKeyFile = "$cert_path/user_private_key_encrypted.pem"
caCertFile = "$cert_path/root_certificate.pem"
privateKeyPassword = "$cert_passwd"
EOF

(cd sdpi_git && ./gradlew run -PchooseMain=org.somda.sdpi.test.v2.consumer.MainKt --args="--config ${config}"); test_exit_code=$?

echo "Terminating sdc11073 provider"
jobs && kill %1
pkill -f sdc11073
pkill -f pat.provider

exit "$test_exit_code"
Loading