Skip to content

Test OpenWrt hostinfo#7094

Open
hectorespert wants to merge 4 commits into
BOINC:masterfrom
hectorespert:openwrt_hostinfo
Open

Test OpenWrt hostinfo#7094
hectorespert wants to merge 4 commits into
BOINC:masterfrom
hectorespert:openwrt_hostinfo

Conversation

@hectorespert

@hectorespert hectorespert commented May 23, 2026

Copy link
Copy Markdown
Contributor

Description of the Change

Add support to run unit tests for client code and test hostinfo processing with OpenWrt data

Alternate Designs

Release Notes


Summary by cubic

Add unit tests for Linux host info parsing, covering os-release for Ubuntu 26.04 and OpenWrt 25.12.4, and lsb-release for Ubuntu. Adds a Linux-only client unit-test target and updates the test runner to build and run it on non-macOS, ensuring OS name and version are parsed correctly.

Written for commit ef53cd0. Summary will update on new commits. Review in cubic

Copilot AI review requested due to automatic review settings May 23, 2026 15:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new Linux-focused unit-test module to validate parsing of /etc/os-release content for Ubuntu and OpenWrt.

Changes:

  • Introduces new os-release fixtures for Ubuntu and OpenWrt.
  • Adds test_hostinfo_linux.cpp with gtest coverage for HOST_INFO::parse_linux_os_info.
  • Wires a new client unit-test subdirectory into the unit-test build and execution script.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/unit-tests/testdata/os-release.ubuntu Adds Ubuntu /etc/os-release fixture for parser tests.
tests/unit-tests/testdata/os-release.openwrt Adds OpenWrt /etc/os-release fixture for parser tests.
tests/unit-tests/client/test_hostinfo_linux.cpp Adds gtest cases that parse the fixtures and assert expected name/version.
tests/unit-tests/client/CMakeLists.txt Defines test_client test executable and links required libs.
tests/unit-tests/CMakeLists.txt Adds client unit-test subdirectory to the test build.
tests/executeUnitTests.sh Includes the new client module in the unit-test execution list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/unit-tests/client/CMakeLists.txt
Comment thread tests/unit-tests/CMakeLists.txt Outdated
Comment thread tests/executeUnitTests.sh Outdated
Comment thread tests/unit-tests/client/test_hostinfo_linux.cpp
Comment thread tests/unit-tests/client/test_hostinfo_linux.cpp
@hectorespert hectorespert requested a review from Copilot May 23, 2026 18:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Comment thread tests/unit-tests/CMakeLists.txt Outdated
Comment thread tests/executeUnitTests.sh Outdated
Comment thread tests/unit-tests/client/CMakeLists.txt
Comment thread tests/unit-tests/client/test_hostinfo_linux.cpp
Comment thread tests/unit-tests/client/test_hostinfo_linux.cpp
@hectorespert hectorespert marked this pull request as ready for review May 24, 2026 09:43
Copilot AI review requested due to automatic review settings May 24, 2026 09:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

@@ -0,0 +1,9 @@
file(GLOB SRCS *.cpp)

LIST(APPEND SRCS "${PROJECT_SOURCE_DIR}/../../client/hostinfo_linux.cpp")
@@ -0,0 +1,9 @@
file(GLOB SRCS *.cpp)
Comment on lines +7 to +8
TARGET_LINK_LIBRARIES(test_client "${SCHED_LIB}" "${BOINC_CRYPT_LIB}" "${BOINC_LIB}" pthread GTest::gtest GTest::gtest_main)


TARGET_LINK_LIBRARIES(test_client "${SCHED_LIB}" "${BOINC_CRYPT_LIB}" "${BOINC_LIB}" pthread GTest::gtest GTest::gtest_main)

add_test(NAME test_client COMMAND test_client)
Comment on lines +28 to +29
std::string fixture_path(__FILE__);
fixture_path = fixture_path.substr(0, fixture_path.find_last_of('/')) + "/../testdata/lsb-release.ubuntu";
#include <string>

namespace test_hostinfo_linux {
class test_hostinfo_linux : public ::testing::Test {};

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

Re-trigger cubic

@AenBleidd AenBleidd self-assigned this May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants