RDKEMW-18410: Update to strict NP wait if system time manager initializes#373
Open
shibu-kv wants to merge 11 commits into
Open
RDKEMW-18410: Update to strict NP wait if system time manager initializes#373shibu-kv wants to merge 11 commits into
shibu-kv wants to merge 11 commits into
Conversation
#161) Description: Introduced marker type DataModelTable for dynamic tables in telemetry. Enhanced T2 agent to resolve and collect data from all instances of multi-instance object tables when dynamic markers are configured. Added logic to parse DataModelTable, filter markers based on telemetry profile configuration, and encode them in telemetry reports after collection, ensuring telemetry reports include per-instance data for configured dynamic markers. Added support for an "index" parameter in configuration to restrict data collection to specific indexes if required. Reason for change: Enable telemetry to capture dynamic, per-instance data from tables (e.g., Host table, Wi-Fi associated devices) where indexes are not fixed, ensuring richer and more flexible telemetry collection. Signed-off-by: onkar.panchare1 <onkar.panchare@telekom-digital.com> Co-authored-by: Shibu Kakkoth Vayalambron <shibu.kakkoth@gmail.com>
* Update build_inside_container.sh * Update t2common.c
* Fix memory safety issues blocking PR-161 L1 tests Fix double-free crash, NULL dereference, memory leaks, and buffer overflow risks identified in telemetry PR-161 code review. Key fixes: - Expose freeProfile() and call on error in processConfiguration() - Add NULL checks before Vector_Create() and Vector_Size() - Free allocated strings before error returns in reportgen.c - Add bounds checking for strcat/strcpy operations - Move debug logging before free() calls - Update test mocks for new function signature Fixes L1 test crash (exit code 134) and resolves all critical memory safety issues in PR-161. * Correct merge conflict errors * Fix astyle formatting compliance errors * Potential fix for pull request finding 'CodeQL / Potentially unsafe use of strcat' --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…ork connectivity (#367) * Xconf thread shpuld wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> * Xconf thread should wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> * Update telemetry2_0.service to start after systimemgr.service * RDKEMW-18410: Xconf thread should wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> * RDKEMW-18410: Xconf thread should wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> * RDKEMW-18410: Xconf thread should wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> * RDKEMW-18410: Xconf thread should wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> * RDKEMW-18410: Xconf thread should wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> * RDKEMW-18410: Xconf thread should wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> * RDKEMW-18410: Xconf thread should wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> * RDKEMW-18410: Xconf thread should wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> * RDKEMW-18410: Xconf thread should wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> * RDKEMW-18410: Xconf thread should wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> * RDKEMW-18410: Xconf thread should wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> * RDKEMW-18410: Xconf thread should wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> * Disable NTP sync indicator compile flag in L2 container build path (#368) * Initial plan * Disable NTP sync indication flag in container build path Agent-Logs-Url: https://github.com/rdkcentral/telemetry/sessions/fe1b0563-e051-4df8-a022-0ae17a31725d Co-authored-by: shibu-kv <89052442+shibu-kv@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: shibu-kv <89052442+shibu-kv@users.noreply.github.com> * RDKEMW-18410: Xconf thread should wait for the NTP indicator for network connectivity Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> --------- Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com> Co-authored-by: Yogeswaran K <yogeswaran_k@comcast.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: shibu-kv <89052442+shibu-kv@users.noreply.github.com>
…ator Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com>
…ator Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com>
…ator Signed-off-by: Yogeswaran K <yogeswaran_k@comcast.com>
…ator Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
…ator Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
…ator Signed-off-by: Yogeswaran K <yogeswaransky@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Telemetry 2.0 startup/runtime behavior around time synchronization (to avoid early TLS/xconf fetch before NTP sync) and expands Dynamic Table (“dataModelTable”) support across parsing, report generation, schema validation, and test automation.
Changes:
- Add optional boot-time NTP sync gating to xconf fetch (inotify-based) and order the service behind
systimemgr.service. - Introduce/extend
dataModelTableparsing + reporting plumbing (newDataModelTable/DataModelParamtypes, schema updates, and reportgen encoding changes). - Add multiple new gtest binaries + docs and enhance unit test runner output/report aggregation.
Reviewed changes
Copilot reviewed 36 out of 40 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| test/run_ut.sh | Runs additional test binaries, filters noisy logs, and prints aggregated JSON reports. |
| test/README.md | Documents how to run L1/L2 tests in the container workflow. |
| telemetry2_0.service | Ensures telemetry starts after/wants systimemgr.service. |
| source/xconf-client/xconfclient.c | Adds optional NTP-sync indicator gating before xconf fetch using inotify/select. |
| source/utils/t2common.h | Introduces DataModelTable / DataModelParam types and related free helpers + matcher prototype. |
| source/utils/t2common.c | Implements freeDataModelParam, freeDataModelTable, and matchesParameter. |
| source/test/t2parser/t2parser_dynamictable_Test.cpp | Adds parser-focused tests for dynamic table and memory-safety scenarios. |
| source/test/t2parser/Makefile.am | Adds t2parser_dynamictable_gtest.bin and adjusts include/source deps. |
| source/test/t2parser/gtest_main.cpp | Makes gtest JSON output filename unique per binary. |
| source/test/scheduler/gtest_main.cpp | Ensures gtest output flag set before init. |
| source/test/reportgen/reportgenTest.cpp | Updates callsites for new encodeParamResultInJSON(..., dataModelTableList) signature. |
| source/test/reportgen/reportgen_dynamictable_Test.cpp | Adds reportgen-focused dynamic-table/bounds/cleanup tests. |
| source/test/reportgen/Makefile.am | Adds reportgen_dynamictable_gtest.bin. |
| source/test/reportgen/gtest_main.cpp | Makes gtest JSON output filename unique per binary. |
| source/test/mocks/profileStub.c | Adds a stub freeProfile for tests to avoid full dependency tree. |
| source/test/mocks/FileioMock.h | Guards PATH_MAX definition for test environments lacking it. |
| source/test/DYNAMICTABLE_TESTS_README.md | Documents PR-161/PR-363 dynamic table + memory safety test coverage. |
| source/test/dcautils/Makefile.am | Adjusts include paths/sources; adds profileStub.c to test build. |
| source/test/dcautils/gtest_main.cpp | Ensures gtest output flag set before init. |
| source/test/dcautils/dcautilTest.cpp | Fixes a missing free in a test. |
| source/test/ccspinterface/gtest_main.cpp | Adds JSON gtest report output file configuration. |
| source/test/bulkdata/profilexconfTest.cpp | Updates mock expectations for new encodeParamResultInJSON signature. |
| source/test/bulkdata/profile_dynamictable_Test.cpp | Adds bulkdata/profile NULL-safety + cleanup tests around table list handling. |
| source/test/bulkdata/Makefile.am | Adds profile_dynamictable_gtest.bin target. |
| source/test/bulkdata/gtest_main.cpp | Makes gtest JSON output filename unique per binary. |
| source/t2parser/t2parser.h | Adds MAX_PATH_LENGTH constant for path building. |
| source/t2parser/t2parser.c | Adds table path-building/parsing helpers, allocation tracking fixes, and cleanup on parse failure. |
| source/t2dm/cosa_apis.h | Formatting tweak to typedef closing braces. |
| source/reportgen/reportgen.h | Adds isDataModelTable and updates encodeParamResultInJSON signature. |
| source/reportgen/reportgen.c | Adds dynamic-table JSON encoding logic and helper functions. |
| source/protocol/http/multicurlinterface.c | Minor whitespace/cast formatting adjustments. |
| source/ccspinterface/rbusInterface.c | Minor whitespace/cast formatting adjustments. |
| source/ccspinterface/ccspinterface.c | Minor whitespace/cast formatting adjustments. |
| source/bulkdata/t2eventreceiver.c | Minor whitespace/cast formatting adjustments. |
| source/bulkdata/profilexconf.c | Updates encodeParamResultInJSON call to pass NULL table list. |
| source/bulkdata/profile.h | Adds dataModelTableList to Profile and exposes freeProfile. |
| source/bulkdata/profile.c | Makes freeProfile public, frees table list entries, and routes table list into report encoding. |
| schemas/t2_reportProfileSchema.schema.json | Adds schema for dataModelTable and nested parameter constraints. |
| .github/skills/quality-checker/SKILL.md | Expands skill docs to include L1/L2 test runs and result collection. |
| .astylerc | Changes AStyle option from --add-brackets to --add-braces. |
Comment on lines
+89
to
+93
| for report in `ls /tmp/Gtest_Report/*.json`; do | ||
| if [ -f "$report" ]; then | ||
| echo "Contents of $report:" | ||
| cat "$report" | ||
| echo "----------------------------------------" |
| { | ||
| free(parameterWild); | ||
| } | ||
| cJSON_Delete(currentObject); |
| rc = regcomp(®pattern, param->regexParam, REG_EXTENDED); | ||
| if(rc != 0) | ||
| char *parameterName = strdup(paramValues[valIndex]->parameterName); | ||
| char *parameterWild = strdup(paramValues[valIndex]->parameterName); |
Comment on lines
+935
to
+939
| char currentPath[MAX_PATH_LENGTH]; | ||
| if (buildFullPath(currentPath, parentPath, jpReference->valuestring) != 0) | ||
| { | ||
| T2Error("Failed to build current path\n"); | ||
| return T2ERROR_FAILURE; |
Comment on lines
+703
to
+707
| "type": "dataModelTable", | ||
| "reference": "Device.WiFi.AccessPoint.", | ||
| "index": "1", | ||
| "parameters": [ | ||
| { |
Comment on lines
+111
to
+114
| if(profile->dataModelTableList) | ||
| { | ||
| Vector_Destroy(profile->dataModelTableList, NULL); | ||
| } |
Comment on lines
+219
to
+223
| cJSON* findOrCreateArrayItem(cJSON *array, int targetIndex) | ||
| { | ||
| int currentSize = cJSON_GetArraySize(array); | ||
| // Check if item already exists at any position | ||
| for (int i = 0; i < currentSize; i++) |
Comment on lines
+508
to
+512
| DataModelTable *table = findTableByReference(dataModelTableList, param->name); | ||
| if (table != NULL) | ||
| { | ||
|
|
||
| for (; valIndex < paramValCount; valIndex++) |
Comment on lines
+21
to
+22
| After=local-fs.target nvram.service previous-log-backup.service network-online.target systemd-timesyncd.service tr69hostif.service rbus.service systimemgr.service | ||
| Wants=systimemgr.service |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.