-
Notifications
You must be signed in to change notification settings - Fork 22
add simple itf test for scrample application #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
56ba5ec
add simple itf test for scrample application
antonkri 3a873c8
add ci/cd workflows for itf test execution
antonkri bce4cb5
add ci/cd workflows for itf test execution
antonkri 3c52047
add further scrample test
antonkri 99e2f65
switch to official qnx toolchain version
antonkri 16ef99a
Fix release verification workflow for qemu
nradakovic 7ddb503
give write permessions to the build workflow
antonkri e51aeec
downgrade the ubuntu version
antonkri 228b17c
extend workflows with qemu installation
antonkri 334203a
update dhcp script
antonkri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,81 @@ | ||
| #!/usr/bin/env python3 | ||
|
|
||
| # ******************************************************************************* | ||
| # Copyright (c) 2025 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| import http.cookiejar | ||
| import json | ||
| import netrc | ||
| import os | ||
| import sys | ||
| import urllib.parse | ||
| import urllib.request | ||
|
|
||
|
|
||
| def eprint(*args, **kwargs): | ||
| print(*args, file=sys.stderr, **kwargs) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| data = json.load(sys.stdin) | ||
|
|
||
| if "qnx.com" not in data["uri"]: | ||
| eprint("Unsupported domain") | ||
| sys.exit(1) | ||
|
|
||
| if "SCORE_QNX_USER" in os.environ and "SCORE_QNX_PASSWORD" in os.environ: | ||
| login = os.environ["SCORE_QNX_USER"] | ||
| password = os.environ["SCORE_QNX_PASSWORD"] | ||
| else: | ||
| try: | ||
| nrc = netrc.netrc() | ||
| auth = nrc.authenticators("qnx.com") | ||
| if auth: | ||
| login, _, password = auth | ||
| else: | ||
| raise Exception("No credential found for QNX") | ||
| except Exception as excp: | ||
| eprint(excp) | ||
| eprint("Failed getting credentials from .netrc") | ||
| sys.exit(1) | ||
|
|
||
| data = urllib.parse.urlencode( | ||
| {"userlogin": login, "password": password, "UseCookie": "1"} | ||
| ) | ||
| data = data.encode("ascii") | ||
|
|
||
| cookie_jar = http.cookiejar.CookieJar() | ||
| cookie_processor = urllib.request.HTTPCookieProcessor(cookie_jar) | ||
| opener = urllib.request.build_opener(cookie_processor) | ||
| urllib.request.install_opener(opener) | ||
|
|
||
| r = urllib.request.urlopen("https://www.qnx.com/account/login.html", data) | ||
| if r.status != 200: | ||
| eprint("Failed to login to QNX") | ||
| sys.exit(1) | ||
|
|
||
| cookies = {c.name: c.value for c in list(cookie_jar)} | ||
| if not "myQNX" in cookies: | ||
| eprint("Failed to get myQNX cookie from login page") | ||
| sys.exit(1) | ||
|
|
||
| myQNX = cookies["myQNX"] | ||
| print( | ||
| json.dumps( | ||
| { | ||
| "headers": { | ||
| "Cookie": [f"myQNX={myQNX}"], | ||
| } | ||
| } | ||
| ) | ||
| ) |
This file contains hidden or 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,56 @@ | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2025 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| name: Test reference integration | ||
| on: | ||
| pull_request: | ||
| types: [opened, reopened, synchronize] | ||
| merge_group: | ||
| types: [checks_requested] | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| test_reference_integration: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4.2.2 | ||
| - name: Setup Bazel | ||
| uses: bazel-contrib/setup-bazel@0.9.1 | ||
| - name: Setup QNX License | ||
| env: | ||
| SCORE_QNX_LICENSE: ${{ secrets.SCORE_QNX_LICENSE }} | ||
| run: | | ||
| mkdir -p /opt/score_qnx/license | ||
| echo "${SCORE_QNX_LICENSE}" | base64 --decode > /opt/score_qnx/license/licenses | ||
| - name: Install qemu | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y qemu-system | ||
| - name: Enable KVM group perms | ||
| run: | | ||
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
| sudo udevadm control --reload-rules | ||
| sudo udevadm trigger --name-match=kvm | ||
| - name: Bazel execute itf qnx_qemu tests | ||
| env: | ||
| SCORE_QNX_USER: ${{ secrets.SCORE_QNX_USER }} | ||
| SCORE_QNX_PASSWORD: ${{ secrets.SCORE_QNX_PASSWORD }} | ||
| run: | | ||
| cd qnx_qemu | ||
| bazel test --config=qemu-integration --test_output=streamed --credential_helper=*.qnx.com=${{ github.workspace }}/.github/tools/qnx_credential_helper.py -- \ | ||
| //:test_ssh_qemu \ | ||
| //:test_scrample_qemu \ | ||
|
|
||
This file contains hidden or 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,68 @@ | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2025 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| # Workflow configuration for S-CORE CI - Release Check | ||
| # This workflow runs Bazel build and test when triggered by tag creation. | ||
|
|
||
| name: Test reference integration | ||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' # Triggers on version tags like v1.0.0 | ||
| - 'release-*' # Triggers on release tags like release-1.0.0 | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| test_target: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4.2.2 | ||
| - name: Setup Bazel | ||
| uses: bazel-contrib/setup-bazel@0.9.1 | ||
| - name: Setup QNX License | ||
| env: | ||
| SCORE_QNX_LICENSE: ${{ secrets.SCORE_QNX_LICENSE }} | ||
| run: | | ||
| mkdir -p /opt/score_qnx/license | ||
| echo "${SCORE_QNX_LICENSE}" | base64 --decode > /opt/score_qnx/license/licenses | ||
| - name: Install qemu | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y qemu-system | ||
| - name: Enable KVM group perms | ||
| run: | | ||
| echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules | ||
| sudo udevadm control --reload-rules | ||
| sudo udevadm trigger --name-match=kvm | ||
| - name: Bazel execute itf qnx_qemu tests | ||
| env: | ||
| SCORE_QNX_USER: ${{ secrets.SCORE_QNX_USER }} | ||
| SCORE_QNX_PASSWORD: ${{ secrets.SCORE_QNX_PASSWORD }} | ||
| run: | | ||
| cd qnx_qemu | ||
| bazel test --config=qemu-integration --test_output=streamed --credential_helper=*.qnx.com=${{ github.workspace }}/.github/tools/qnx_credential_helper.py -- \ | ||
| //:test_ssh_qemu \ | ||
| //:test_scrample_qemu \ | ||
| release_verification: | ||
| runs-on: ubuntu-latest | ||
| needs: [test_target] | ||
| if: always() && (needs.test_target.result == 'failure') | ||
| steps: | ||
| - name: Remove release and tag (if exists) | ||
| uses: nikhilbadyal/ghaction-rm-releases@v0.7.0 | ||
| with: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| RELEASE_PATTERN: ${{ github.ref_name }} |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -11,32 +11,11 @@ | |
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
| module( | ||
| name = "score_toolchains_qnx_tests", | ||
| name = "score_ri_qnx_qemu", | ||
| version = "0.0.1", | ||
| compatibility_level = 0, | ||
| ) | ||
|
|
||
| bazel_dep(name = "score_toolchains_qnx", version = "0.0.2") | ||
| git_override( | ||
| module_name = "score_toolchains_qnx", | ||
| commit = "faa88ee7b26c82b23127b4493f140c15df4c7b8d", | ||
| remote = "https://github.com/eclipse-score/toolchains_qnx.git", | ||
| ) | ||
|
|
||
|
|
||
| toolchains_qnx = use_extension("@score_toolchains_qnx//:extensions.bzl", "toolchains_qnx") | ||
| toolchains_qnx.sdp( | ||
| sha256 = "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63", | ||
| strip_prefix = "installation", | ||
| url = "https://www.qnx.com/download/download/79858/installation.tgz", | ||
| ) | ||
| use_repo(toolchains_qnx, "toolchains_qnx_sdp") | ||
| use_repo(toolchains_qnx, "toolchains_qnx_qcc") | ||
| use_repo(toolchains_qnx, "toolchains_qnx_ifs") | ||
|
|
||
| register_toolchains("@toolchains_qnx_qcc//:qcc_x86_64") | ||
| register_toolchains("@toolchains_qnx_ifs//:ifs_x86_64") | ||
|
|
||
| ############################################################################### | ||
| # | ||
| # Shell dependency | ||
|
|
@@ -63,35 +42,53 @@ use_repo(python) | |
|
|
||
| ############################################################################### | ||
| # | ||
| # LLVM Toolchains | ||
| # GCC Toolchains | ||
| # | ||
| ############################################################################### | ||
| bazel_dep(name = "toolchains_llvm", version = "1.2.0") | ||
| # Configure the host toolchain. | ||
| bazel_dep(name = "score_toolchains_gcc", version = "0.5", dev_dependency=True) | ||
| gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc", dev_dependency=True) | ||
| gcc.toolchain( | ||
| url = "https://github.com/eclipse-score/toolchains_gcc_packages/releases/download/0.0.1/x86_64-unknown-linux-gnu_gcc12.tar.gz", | ||
| sha256 = "457f5f20f57528033cb840d708b507050d711ae93e009388847e113b11bf3600", | ||
| strip_prefix = "x86_64-unknown-linux-gnu", | ||
| ) | ||
| gcc.extra_features( | ||
| features = [ | ||
| "minimal_warnings", | ||
| "treat_warnings_as_errors", | ||
| ], | ||
| ) | ||
| gcc.warning_flags( | ||
| minimal_warnings = ["-Wall", "-Wno-error=deprecated-declarations", "-Wno-error=narrowing"], | ||
| strict_warnings = ["-Wextra", "-Wpedantic"], | ||
| ) | ||
| use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc") | ||
|
|
||
| llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm") | ||
| llvm.toolchain( | ||
| cxx_standard = {"": "c++17"}, | ||
| llvm_version = "19.1.0", | ||
| register_toolchains("@gcc_toolchain//:all") | ||
|
|
||
| # Configure target toolchain for QNX build. | ||
| bazel_dep(name = "score_toolchains_qnx", version = "0.0.3") | ||
| toolchains_qnx = use_extension("@score_toolchains_qnx//:extensions.bzl", "toolchains_qnx") | ||
| toolchains_qnx.sdp( | ||
| sha256 = "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63", | ||
| strip_prefix = "installation", | ||
| url = "https://www.qnx.com/download/download/79858/installation.tgz", | ||
| ) | ||
| use_repo(llvm, "llvm_toolchain") | ||
| use_repo(llvm, "llvm_toolchain_llvm") | ||
| use_repo(toolchains_qnx, "toolchains_qnx_sdp") | ||
| use_repo(toolchains_qnx, "toolchains_qnx_qcc") | ||
| use_repo(toolchains_qnx, "toolchains_qnx_ifs") | ||
|
|
||
| register_toolchains("@llvm_toolchain//:all") | ||
| register_toolchains("@toolchains_qnx_qcc//:qcc_x86_64") | ||
| register_toolchains("@toolchains_qnx_ifs//:ifs_x86_64") | ||
|
|
||
| ############################################################################### | ||
| # | ||
| # C++ rules | ||
| # Other dependencies | ||
| # | ||
| ############################################################################### | ||
| bazel_dep(name = "rules_cc", version = "0.1.1") | ||
|
|
||
| ############################################################################### | ||
| # | ||
| # ITF dependency | ||
| # | ||
| ############################################################################### | ||
| bazel_dep(name = "score_itf", version = "0.1.0") | ||
|
|
||
| bazel_dep(name = "score_baselibs", version = "0.1.3") | ||
|
|
||
| bazel_dep(name = "score_communication", version = "0.0.1") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. registry? |
||
|
|
@@ -100,16 +97,13 @@ git_override( | |
| commit = "2d0d067b064a6e27d115f382bc938a30d44f08e7", | ||
| remote = "https://github.com/eclipse-score/communication.git", | ||
| ) | ||
|
|
||
| bazel_dep(name = "scrample", version = "0.0.1") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we please use the registry here |
||
| git_override( | ||
| module_name = "scrample", | ||
| commit = "a56570127abc583ad6127f27bae31ae3643b2eb9", | ||
| remote = "https://github.com/eclipse-score/scrample.git", | ||
| ) | ||
|
|
||
|
|
||
|
|
||
| bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost") | ||
| archive_override( | ||
| module_name = "rules_boost", | ||
|
|
||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to cicd-workflows?