RDKCOM-5487: RDKBWIFI-206: add mocks, build, and limited platform ind… - #1296
RDKCOM-5487: RDKBWIFI-206: add mocks, build, and limited platform ind…#1296tinaelizabeth84 wants to merge 1 commit into
Conversation
…ependent L1 tests (rdkcentral#702) * RDKBWIFI-206: add mocks and build for platform independent L1 tests on-behalf-of: @permanence-ai <github-ai@permanence.ai> * RDKBWIFI-206: add unittests for wifi_ctrl_webconfig.c on-behalf-of: @permanence-ai <github-ai@permanence.ai> * remove symbols that are no longer necessary to mock on-behalf-of: @permanence-ai <github-ai@permanence.ai> * update mockplatform/makefile to match recent updates * remove wifi_sensing from the Makefile again to work with latest changes * more explicitly use the rpi setup.sh script as the intent is to be identical * minor naming conventions and typo updates * update mockplatform makefile for multi_ap includes
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds a mock-platform build target and initial GoogleTest-based unit tests to enable limited platform-independent L1 testing in CI.
Changes:
- Introduce
mockplatformMakefile target that builds OneWifi plus a gtest binary and runs tests. - Add platform mock implementations to satisfy HAL/driver symbols during unit test builds.
- Add initial unit tests for
wifi_ctrl_webconfig.capply paths and update CI workflow to build mockplatform (and BPI) variants.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| source/test/wifi_ctrl_webconfig_test.cpp | Adds gtests covering several webconfig_*_apply NULL and basic map-handling scenarios. |
| source/test/platform_mocks.c | Adds stub/mock implementations for platform/HAL symbols needed to link unit tests. |
| source/test/gtest_main.cpp | Whitespace cleanup in file header comment. |
| build/linux/mockplatform/makefile | New mockplatform build that produces OneWifi and a gtest binary (with mocks) and runs tests. |
| .github/workflows/makefile.yml | CI matrix expanded (BPI + mockplatform), installs extra deps, builds ucode from source. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| TEST(WifiCtrlWebconfig, VifNeighborsApplyNullArguments) | ||
| { | ||
| ASSERT_EXIT((webconfig_vif_neighbors_apply(NULL, NULL), exit(0)), ::testing::ExitedWithCode(0), ".*"); | ||
| // expected that RETURN_ERR is -1, but use the macro if possible | ||
| ASSERT_EQ(webconfig_vif_neighbors_apply(NULL, NULL), RETURN_ERR); | ||
| } |
| TEST(WifiCtrlWebconfig, SteeringConfigApplyNullArguments) | ||
| { | ||
| ASSERT_EXIT((webconfig_steering_config_apply(NULL, NULL), exit(0)), ::testing::ExitedWithCode(0), ".*"); | ||
| // expected that RETURN_ERR is -1, butuse the macro if possible |
| TEST(WifiCtrlWebconfig, SteeringConfigApplySameSteeringConfigMap) | ||
| { | ||
| wifi_mgr_t *mgr = get_wifimgr_obj(); | ||
|
|
||
| webconfig_subdoc_decoded_data_t data = {0}; | ||
| data.steering_config_map = hash_map_create(); | ||
| mgr->steering_config_map = data.steering_config_map; | ||
|
|
||
| ASSERT_EQ(webconfig_steering_config_apply(NULL, &data), RETURN_OK); | ||
|
|
||
| mgr->steering_config_map = NULL; | ||
| } |
| int wifi_rrm_send_beacon_req(struct wifi_interface_info_t *interface, const u8 *addr, | ||
| u16 num_of_repetitions, u8 measurement_request_mode, u8 oper_class, u8 channel, | ||
| u16 random_interval, u16 measurement_duration, u8 mode, const u8 *bssid, | ||
| struct wpa_ssid_value *ssid, u8 *rep_cond, u8 *rep_cond_threshold, u8 *rep_detail, | ||
| const u8 *ap_ch_rep, unsigned int ap_ch_rep_len, const u8 *req_elem, unsigned int req_elem_len, | ||
| u8 *ch_width, u8 *ch_center_freq0, u8 *ch_center_freq1, u8 last_indication) | ||
| { | ||
| return 0; | ||
| } |
| $(GTEST_BINARY): $(GTEST_ALLOBJECTS) $(PLATFORM_MOCK_OBJECTS) $(GTEST_OBJECTS) $(CMN_LIBRARY) $(HAL_LIBRARY) $(WEBCONFIG_LIBRARY) $(HE_BUS_LIBRARY) | ||
| $(CXX) -o $@ $(GTEST_ALLOBJECTS) $(GTEST_OBJECTS) $(PLATFORM_MOCK_OBJECTS) $(LDFLAGS) --coverage -lgtest -lgmock | ||
|
|
| git clone https://github.com/jow-/ucode.git ucode | ||
| cd ucode | ||
| mkdir build && cd build | ||
| cmake -DUBUS_SUPPORT=OFF -DUCI_SUPPORT=OFF -DULOOP_SUPPORT=OFF .. | ||
| make -j$(nproc) | ||
| sudo make install | ||
| sudo ldconfig |
| golang \ | ||
| pkg-config \ | ||
| libperl-dev \ | ||
| libjson-c-dev \ | ||
| libgtest-dev \ | ||
| libgmock-dev |
mateuszCieslak-GL
left a comment
There was a problem hiding this comment.
Marking as blocked for wider review,
Permanence AI (on which agentic's tool behalf this was created) ceased to exist last month.
I dont think we can proceed with this, without legal review (i.e. CLA agreement) and/or manager who can vouch for the process used.
…ependent L1 tests (#702)
on-behalf-of: @permanence-ai github-ai@permanence.ai
on-behalf-of: @permanence-ai github-ai@permanence.ai
on-behalf-of: @permanence-ai github-ai@permanence.ai
update mockplatform/makefile to match recent updates
remove wifi_sensing from the Makefile again to work with latest changes
more explicitly use the rpi setup.sh script as the intent is to be identical
minor naming conventions and typo updates
update mockplatform makefile for multi_ap includes