Skip to content

Commit

Permalink
Added to resolve unit test failure in github workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
vasuki01 committed Nov 6, 2024
1 parent aa980b2 commit 9d5f463
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ jobs:
mkdir _install
mkdir _install/lib
cp ${RBUS_INSTALL_DIR}/usr/lib/librbus* _install/lib
build-wrapper-linux-x86-64 --out-dir bw-output make all test
build-wrapper-linux-x86-64 --out-dir bw-output make all
cd tests
./test_rbus_fr
cd ..
- name: Stop rtrouted
run: |
Expand Down
19 changes: 10 additions & 9 deletions tests/test_rbus_fr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1513,8 +1513,9 @@ rbusError_t webcfgInterfaceSubscribeHandler(rbusHandle_t handle, rbusEventSubAct
{
(void)handle;
(void)filter;
(void)autoPublish;
(void)interval;

*autoPublish = false;

WebcfgInfo(
"webcfgInterfaceSubscribeHandler called:\n" \
Expand Down Expand Up @@ -1562,11 +1563,11 @@ void test_subscribeTo_CurrentActiveInterface_Event()

rc = subscribeTo_CurrentActiveInterface_Event();
CU_ASSERT_EQUAL(rc, RBUS_ERROR_SUCCESS);

rbusError_t result = rbus_unregDataElements(handle, 1, webcfgInterfaceElement);
CU_ASSERT_EQUAL(result, RBUS_ERROR_SUCCESS);
rbus_close(handle);
sleep(1);
rbusEvent_Unsubscribe(rbus_handle,WEBCFG_INTERFACE_PARAM);
webpaRbus_Uninit();
rbus_unregDataElements(handle, 1, webcfgInterfaceElement);
rbus_close(handle);
}

//WanMgr_Rbus_String_EventPublish_OnValueChange(): publish rbus events on value change
Expand Down Expand Up @@ -1667,10 +1668,10 @@ void test_eventReceiveHandler()
sleep(2);
printf("get_global_interface(): %s\n",get_global_interface());
CU_ASSERT_STRING_EQUAL(get_global_interface(),"eth2");
rbus_unregDataElements(handle, 1, wanMgrRbusDataElements);
rbus_close(handle);
rbusEvent_Unsubscribe(rbus_handle,WEBCFG_INTERFACE_PARAM);
webpaRbus_Uninit();
webpaRbus_Uninit();
rbus_unregDataElements(handle, 1, wanMgrRbusDataElements);
rbus_close(handle);
}
#endif

Expand Down Expand Up @@ -1749,7 +1750,7 @@ void test_sendNotification_rbus()
}

sendNotification_rbus(payload, source, destination);

rbusEvent_Unsubscribe(handle,WEBCFG_UPSTREAM_EVENT);
rbus_close(handle);
webpaRbus_Uninit();
}
Expand Down

0 comments on commit 9d5f463

Please sign in to comment.