Release/1.0.4 - #210
Closed
apatel859 wants to merge 41 commits into
Closed
Conversation
RDKECMF-213 Add CODEOWNERS file
Signed-off-by: apatel859 <amit_patel5@comcast.com>
RDKEMW-254: libsoup3 support
DELIA-67407: Code syncup main to develop
Rebase with Develop Branch
…p_set_friendlyname Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
RDKTV-35185: Add sync between ssdp_http_server_callback and gdial_ssdp_set_friendlyname
Reason for change: Fix issues identified within xcast Test Procedure: Risks: low Priority: P1 Signed-off-by:Hayden Gfeller <Hayden_Gfeller@comcast.com>
…ialserver into feature/RDKEMW-2033
Reason for change: Implemented setManufacturerName and setModelName APIs for DIAL Server name configuration maintained the additional data url to specific app Test Procedure: DIAL should work Risks: None Priority: P1 Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
…4_Dial_Args_1 RDK-55044: Implement DIAL requirement to use on EU product
RDKEMW-2033 : Coverity
Reason for change: Added DISABLE_SECURITY_TOKEN Flag to disable the WPEFrameworkSecurity Token generation changes Test Procedure: please referred from the ticket Risks: Medium Signed-off-by: Thamim Razith <ThamimRazith_AbbasAli@comcast.com>
RDKEMW-2278: Removal of WPEFrameworkSecurity Agent Utility
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
…129_Coverity RDKEMW-4129: Prepare native build environment
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
…129_CoverityTest RDKEMW-4129: Test
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
…alserver into topic/RDKEMW-4129_CoverityTest Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
…129_CoverityTest RDKEMW-4129: Prepare native build environment for Coverity
Signed-off-by: apatel859 <amit_patel5@comcast.com>
RDKEMW-4129: Prepare native build environment for Coverity
RDKEMW-2854 : Fix the double free issue on call to onApplicationStateChanged api
Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
* RDKEMW-6891: Coverity errors fix for xdial * Update gdial.cpp Fixed review comments
* RDKEMW-9964: Removing onStopped GDial notification handling Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com> * RDKEMW-9964: Fixed coverity issues Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com> * RDKEMW-9964: Fixed coverity issues Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com> * RDKEMW-9964: Fixed coverity issues Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com> --------- Signed-off-by: yuvaramachandran_gurusamy <yuvaramachandran_gurusamy@comcast.com>
…s issues in xdial (#182) * RDKEMW-11024 - Using copilot identify and fix the static code analysis issues in xdial Reason for Change: Resolving the static code issues scanned by copilot Test Procedure: Compiled and Verified Risks: Low Priority: P1 version: minor Signed-off-by: smohap466 <srinibas_mohapatra@comcast.com> --------- Signed-off-by: smohap466 <srinibas_mohapatra@comcast.com> Co-authored-by: smohap466 <srinibas_mohapatra@comcast.com> Co-authored-by: dkumar798 <dinesh_kumar2@comcast.com>
* RDKEMW-12059: Fix Coverity identified issues
* RDKEMW-12555 : Fix coveirty workflow scan in xdialserver repo Reason for Change: Fix coveirty scan workflow failure in xdialserver repo Test Procedure: Verify coveirty workflow Risks: Low Priority: P1 version: minor Signed-off-by:AkshayKumar_Gampa AkshayKumar_Gampa@comcast.com * RDKEMW-12555 : Fix coveirty workflow scan in xdialserver repo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* RDKEMW-12059: Fix Coverity identified issues * Update gdial-plat-util.c * Update gdial-rest.c * Update gdial-plat-util.c * Update gdial-plat-util.c
* RDKEMW-16911 - L1 unit tests for xdialserver
…M_SLEEP_REQUEST_KEY not configured (#206) * RDKEMW-19912: Update gdial.cpp * RDKEMW-19912: Fix for L1 test failure Signed-off-by: Yuvaramachandran Gurusamy <yuvaramachandran_gurusamy@comcast.com>
* RDKEMW-6898: gdialserver not compatible with Libsoup3 library Reason for change: gdialserver not compatible with Libsoup3 library Updating gssdp to 1.6.3 provides libsoup3 compatibility . Test Procedure: Compiled and Verified Risks: Low Priority: P1 version: minor Signed-off-by: balaji velmurugan <balaji_velmurugan@comcast.com> * Update Makefile.am * Update configure.ac * Update configure.ac * Update Makefile.am * Update configure.ac * Update configure.ac --------- Signed-off-by: balaji velmurugan <balaji_velmurugan@comcast.com> Co-authored-by: balaji velmurugan <balaji_velmurugan@comcast.com>
|
|
||
| steps: | ||
| - name: Set up CMake | ||
| uses: jwlawson/actions-setup-cmake@v1.13 |
| echo "Trigger Source: ${{ inputs.caller_source }}" | ||
|
|
||
| - name: Set up CMake | ||
| uses: jwlawson/actions-setup-cmake@v1.13 |
Comment on lines
+11
to
+25
| name: Build xdialserver component in github rdkcentral | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ubuntu:22.04 | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: native build | ||
| run: | | ||
| sh -x build_dependencies.sh | ||
| sh -x cov_build.sh | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }} No newline at end of file |
Comment on lines
+41
to
+42
| g_print_with_timestamp("server_request_remove_callback tid=[%lx] msg=%p timeout source %d removed", | ||
| pthread_self(), msg, conn_context->read_timeout_source); |
| SoupMessage *msg = (SoupMessage*)user_data; | ||
| GDIAL_LOGTRACE("Entering ..."); | ||
| DialShieldConnectionContext * conn_context = (DialShieldConnectionContext *)g_hash_table_lookup(active_conns_, msg); | ||
| g_print_with_timestamp("soup_message_read_timeout_callback tid=[%lx] msg=%p", pthread_self(), msg); |
| static void server_request_read_callback (SoupServer *server, SoupServerMessage *msg, | ||
| gpointer data) { | ||
| GDIAL_LOGTRACE("Entering ..."); | ||
| g_print_with_timestamp("server_request_read_callback tid=[%lx] msg=%p", pthread_self(), msg); |
| static void server_request_aborted_callback (SoupServer *server, SoupServerMessage *msg, | ||
| gpointer data) { | ||
| GDIAL_LOGTRACE("Entering ..."); | ||
| g_print_with_timestamp("server_request_aborted_callback tid=[%lx] msg=%p", pthread_self(), msg); |
| SoupMessage *msg=(SoupMessage*)user_data; | ||
| GDIAL_LOGTRACE("Entering ..."); | ||
| assert(msg0==msg); | ||
| g_print_with_timestamp("soup_message_weak_ref_callback tid=[%lx] msg=%p", pthread_self(), msg); |
Comment on lines
+109
to
+110
| g_print_with_timestamp("server_request_started_callback tid=[%lx] msg=%p timeout source %d added with socket fd = %d", | ||
| pthread_self(), msg, read_timeout_source, g_socket_get_fd(conn_context->read_gsocket)); |
| uuid_unparse(random_uuid, uuid_data); | ||
| GDIAL_LOGINFO("generated uuid:[%s]", uuid_data); | ||
|
|
||
| fuuid = fopen(app_uuid_file_path, "w"); |
There was a problem hiding this comment.
Pull request overview
This PR prepares the Release/1.0.4 cut by introducing a full L1 (unit-level) test harness, expanding platform/service APIs (manufacturer/model propagation), and updating the build system to support both libsoup 2.4 and libsoup 3.0 paths (plus CI workflows).
Changes:
- Add an autotools-based L1 test harness (gtest/gmock) with extensive server/plat/util coverage and CI workflow execution (including valgrind + coverage artifacts).
- Add libsoup 2.4 vs 3.0 source splits and detection in CMake/autotools, plus new stub/mocks and build scripts for native CI.
- Introduce manufacturer/model update plumbing across service → plat → ssdp, and add UUID-based app URIs used by the local REST additional-data endpoint.
Reviewed changes
Copilot reviewed 60 out of 61 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/README.md | Documents the new L1 test harness layout, workflow, and pitfalls. |
| tests/Makefile.am | Adds autotools test subdir build gating via ENABLE_L1TESTS. |
| tests/L1Tests/Makefile.am | Defines the run_L1Tests binary sources, flags, and soup/gssdp conditionals. |
| tests/L1Tests/test_main.cpp | Adds unified gtest/gmock main for the L1 runner. |
| tests/L1Tests/utils/test_gdialUtil.cpp | Adds unit tests for gdial-util hashtable helpers and ASCII checks. |
| tests/L1Tests/tests/gdialserver_ut.cpp | Adds a placeholder test file under tests/ (currently not built). |
| tests/L1Tests/stubs/gdial_cpp_test_stubs.hpp | Provides lightweight C++ stubs for WPEFramework/security token APIs in tests. |
| tests/L1Tests/mocks/gssdp_mock.c | Adds minimal GSSDP mocks to decouple tests from network/GSSDP runtime behavior. |
| tests/L1Tests/server/test_gdialSsdp.cpp | Adds SSDP tests (dd.xml callback + setter coverage). |
| tests/L1Tests/server/test_gdialShield.cpp | Adds shield tests around SoupServer request throttling/timeout paths. |
| tests/L1Tests/server/test_gdialService.cpp | Adds service-layer tests (impl singleton, request routing, conditional startup). |
| tests/L1Tests/server/test_gdialServer.cpp | Adds tests for GDialApp lifecycle and helper coverage. |
| tests/L1Tests/server/test_gdialserver_ut.cpp | Adds tests for the interactive gdialserver UT main loop using a fake service. |
| tests/L1Tests/server/test_gdialRest.cpp | Adds REST server tests (register/unregister, origin checks, launch flows, additional data). |
| tests/L1Tests/plat/test_gdialPlat.cpp | Adds tests for GDialAppRegistry construction and origin allow-list behavior. |
| tests/L1Tests/plat/test_gdialAppCache.cpp | Adds tests for GDialAppStatusCache set/get behavior and isolation. |
| tests/L1Tests/plat/test_gdialPlatApp.cpp | Adds platform app API guard/lifecycle/async tests. |
| tests/L1Tests/plat/test_gdialPlatDev.cpp | Adds tests for plat-dev power/network standby callbacks. |
| tests/L1Tests/plat/test_gdialPlatUtil.cpp | Adds tests for iface IP/MAC helpers and logging behavior. |
| tests/L1Tests/plat/gdial_os_stubs.cpp | Adds OS-layer stubs and controllable behavior for plat-app tests. |
| stubs/securityagent/SecurityTokenUtil.h | Adds a stub header for SecurityAgent token access. |
| stubs/securityagent/SecurityTokenUtil.cpp | Adds a stub implementation for GetSecurityToken. |
| stubs/iarm_stubs.cpp | Adds IARM stub implementations for native CI builds. |
| server/plat/gdialappcache.hpp | Initializes observer pointer to null to avoid uninitialized usage. |
| server/plat/gdialappcache.cpp | Improves safety/logging and moves strings to avoid copies. |
| server/plat/gdial.hpp | Adds manufacturer/model callback typedefs + registration APIs. |
| server/plat/gdial-plat-util.c | Fixes thread-id formatting in logging and annotates coverity intent. |
| server/plat/gdial-plat-dev.c | Removes env-based manufacturer/model getters. |
| server/plat/gdial-plat-app.c | Adds manufacturer/model update APIs + callback registration glue. |
| server/plat/gdial-os-app.h | Adds OS hooks for manufacturer/model updates. |
| server/plat/gdial_app_registry.c | Adds UUID generation/persistence and app_uri initialization. |
| server/plat/CMakeLists.txt | Adds DISABLE_SECURITY_TOKEN option and links uuid. |
| server/libsoup/2.4/gdial-rest.c | Updates additionalDataUrl construction + UUID routing; various fixes/annotations. |
| server/libsoup/2.4/gdial-ssdp.c | Adds mutex sync + manufacturer/model override support. |
| server/libsoup/2.4/gdial-shield.c | Adds/ports shield module implementation for libsoup 2.4 tree. |
| server/libsoup/3.0/gdial-rest.c | libsoup 3.0-compatible REST implementation (UUID routing + fixes/annotations). |
| server/libsoup/3.0/gdial-ssdp.c | libsoup 3.0-compatible SSDP implementation (mutex + manufacturer/model). |
| server/libsoup/3.0/gdial-shield.c | libsoup 3.0-compatible shield implementation. |
| server/include/gdialserviceimpl.h | Adds new request events/payload fields; initializes observer pointer. |
| server/include/gdialservicecommon.h | Removes onStopped() from notifier interface. |
| server/include/gdialservice.h | Adds manufacturer/model setter APIs; minor header cleanup. |
| server/include/gdial-plat-dev.h | Removes manufacturer/model getter declarations. |
| server/include/gdial-plat-app.h | Adds manufacturer/model callback typedefs + update APIs. |
| server/include/gdial-config.h | Renames include guard and removes unused enum. |
| server/include/gdial_app_registry.h | Adds app_uri field and uuid size macro to registry struct. |
| server/gdialservice.cpp | Wires manufacturer/model callbacks to SSDP, adds libsoup3 handling, refactors payload init/moves. |
| server/gdialserver_ut.cpp | Adjusts test utility to match notifier interface changes and fixes moves. |
| server/gdial-ssdp.h | Exposes manufacturer/model setters. |
| server/gdial-rest.h | Updates additionalDataUrl signature and adds find-by-uuid API. |
| server/CMakeLists.txt | Adds libsoup3 detection, selects correct source set (2.4 vs 3.0). |
| Makefile.am | Adds autotools to build tests subdir. |
| Makefile | Passes DISABLE_SECURITY_TOKEN cmake option through build. |
| configure.ac | Adds autotools project definition + optional L1 test enablement and soup/gssdp probing. |
| cov_build.sh | Adds a small build script for coverage/native CI. |
| CHANGELOG.md | Adds/updates changelog entries for releases up to 1.0.4. |
| build_dependencies.sh | Adds native CI dependency install + building required third-party components/stubs. |
| .github/workflows/native_full_build.yml | Adds native container build workflow. |
| .github/workflows/L1-tests.yml | Adds CI workflow for L1 tests, valgrind, and coverage artifacts. |
| .github/CODEOWNERS | Adds repo ownership rules. |
Comments suppressed due to low confidence (6)
server/libsoup/2.4/gdial-ssdp.c:264
- Same issue as libsoup/3.0: handler is added at "/<random_uuid>/dd.xml" but destroy removes only "/dd.xml" (leaving the handler installed).
server/libsoup/2.4/gdial-rest.c:24 - gdial-rest logs pthread_self() but doesn't include <pthread.h>, which can fail compilation with -Werror due to implicit declaration of pthread_self().
server/libsoup/2.4/gdial-ssdp.c:320 - gdial_ssdp_destroy() doesn't free the process-global strings app_friendly_name/app_manufacturer_name/app_model_name, so values can persist across init/destroy and leak memory (valgrind will flag this).
server/libsoup/2.4/gdial-rest.c:548 - Avoid tool-specific comments like "FIX(Copilot)" in source; the intent here is just to avoid accidental use-after-free if this block is edited later.
server/libsoup/2.4/gdial-rest.c:663 - Avoid tool-specific comments like "FIX(Copilot)" in source; the intent here is just to destroy the duplicated query table after merging.
server/include/gdial_app_registry.h:45 - GDialAppRegistry is defined as a public struct in an installed header; adding app_uri changes the struct layout and can break ABI for any external consumers. Consider making GDialAppRegistry opaque and exposing accessors, or keep UUID/URI internal to the server side.
typedef struct _GDialAppRegistry {
gchar app_uri[APP_MAX_UUID_SIZE+1]; // for storing uri
gchar *name;
gboolean use_additional_data;
gboolean is_singleton;
GList *allowed_origins;
GList *app_prefixes;
GHashTable *properties;
} GDialAppRegistry;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+45
to
+55
| int GetSecurityToken(unsigned short maxLength, unsigned char buffer[]) | ||
| { | ||
| // get a localhost token | ||
| string payload = "http://localhost"; | ||
|
|
||
| size_t len = payload.length(); | ||
|
|
||
| if(!memcpy(buffer,payload.c_str(),len)) | ||
| return -1; | ||
| return 0; | ||
| } |
Comment on lines
+118
to
+125
| else | ||
| { | ||
| fgets(uuid_data, sizeof(uuid_data), fuuid); | ||
| fclose(fuuid); | ||
| } | ||
|
|
||
| snprintf( app_registry->app_uri, sizeof(app_registry->app_uri), "/%s" , uuid_data); | ||
| GDIAL_LOGINFO("App:[%s] uuid:[%s] per Bootup", app_name, uuid_data); |
Comment on lines
+248
to
+264
| g_object_ref(ssdp_http_server); | ||
| ssdp_http_server_ = ssdp_http_server; | ||
| app_random_uuid = g_strdup(random_uuid); | ||
| gchar *dail_ssdp_handler = g_strdup_printf("/%s/%s", random_uuid,"dd.xml"); | ||
| soup_server_add_handler(ssdp_http_server_, dail_ssdp_handler, ssdp_http_server_callback, NULL, NULL); | ||
| ssdp_client_ = ssdp_client; | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| int gdial_ssdp_destroy() { | ||
| GDIAL_LOGTRACE("Entering ..."); | ||
| pthread_mutex_lock(&ssdpServerEventSync); | ||
| if (ssdp_http_server_) | ||
| { | ||
| soup_server_remove_handler(ssdp_http_server_, "/dd.xml"); | ||
| } |
Comment on lines
+296
to
+299
| if (app_random_uuid != NULL) { | ||
| g_free(app_random_uuid); | ||
| app_random_uuid = NULL; | ||
| } |
Comment on lines
+20
to
+23
| #include <stdio.h> | ||
| #include <glib.h> | ||
| #include <assert.h> | ||
| #include <libsoup/soup.h> |
Comment on lines
+66
to
+72
| GSList *uris = soup_server_get_uris(server); | ||
| ASSERT_NE(uris, nullptr); | ||
| SoupURI *uri = (SoupURI *)uris->data; | ||
| guint port = soup_uri_get_port(uri); | ||
| base_url = std::string("http://127.0.0.1:") + std::to_string(port); | ||
| g_slist_free_full(uris, (GDestroyNotify)soup_uri_free); | ||
|
|
Comment on lines
+51
to
+53
| TEST_F(GDialServerTest, ExampleTest) { | ||
| EXPECT_TRUE(true); | ||
| } |
Comment on lines
95
to
+100
| AppInfo* appEntry = ObjectCache->findObject(id); | ||
|
|
||
| state = appEntry->appState; | ||
| GDIAL_LOGINFO("APPCache: App Name[%s] AppID[%s] Error[%s]", | ||
| appEntry->appName.c_str(), | ||
| appEntry->appId.c_str(), | ||
| appEntry->appError.c_str()); | ||
| // FIX(Copilot): Add NULL check for appEntry | ||
| if (appEntry) { | ||
| state = appEntry->appState; | ||
| GDIAL_LOGINFO("APPCache: App Name[%s] AppID[%s] Error[%s]", | ||
| appEntry->appName.c_str(), |
Comment on lines
+545
to
+549
| else { | ||
| g_object_unref(app); | ||
| // FIX(Copilot): Set app to NULL after unref to prevent use-after-free | ||
| app = NULL; | ||
| gdial_rest_server_http_return_if(start_error == GDIAL_APP_ERROR_FORBIDDEN, msg, SOUP_STATUS_FORBIDDEN); |
Comment on lines
+661
to
+665
| GHashTable *dupQuery = gdial_util_str_str_hashtable_dup(query); | ||
| body_query = query ? gdial_util_str_str_hashtable_merge(body_query, dupQuery) : body_query; | ||
| // FIX(Copilot): Correct typo g_hash_table_destory -> g_hash_table_destroy | ||
| g_hash_table_destroy(dupQuery); | ||
| } |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.