Skip to content

RDKCOM-5487: RDKBWIFI-206: add mocks, build, and limited platform ind… - #1296

Closed
tinaelizabeth84 wants to merge 1 commit into
rdkcentral:mainfrom
tinaelizabeth84:RDKCOM-5487
Closed

RDKCOM-5487: RDKBWIFI-206: add mocks, build, and limited platform ind…#1296
tinaelizabeth84 wants to merge 1 commit into
rdkcentral:mainfrom
tinaelizabeth84:RDKCOM-5487

Conversation

@tinaelizabeth84

Copy link
Copy Markdown

…ependent L1 tests (#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

…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
Copilot AI review requested due to automatic review settings July 24, 2026 14:11

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 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 mockplatform Makefile 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.c apply 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.

Comment on lines +31 to +36
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
Comment on lines +105 to +116
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;
}
Comment on lines +37 to +45
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;
}
Comment on lines +534 to +536
$(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

Comment on lines +79 to +85
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
Comment on lines +71 to +76
golang \
pkg-config \
libperl-dev \
libjson-c-dev \
libgtest-dev \
libgmock-dev

@mateuszCieslak-GL mateuszCieslak-GL 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.

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.

@github-actions github-actions Bot locked and limited conversation to collaborators Jul 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants