Fix ci pipeline

This commit is contained in:
Vivek Kumar Dutta 2026-01-05 14:56:27 +05:30
parent ffba17fe09
commit 29ec93d024
No known key found for this signature in database
GPG key ID: 4E09F5AD8265FD4C
5 changed files with 27 additions and 35 deletions

View file

@ -51,3 +51,5 @@ run_functional_test:
- memory-report.xml - memory-report.xml
- memory-report-download.xml - memory-report-download.xml
- icwmpd_debug.txt - icwmpd_debug.txt
- bbf*.log
- core*.log

View file

@ -8,11 +8,6 @@ pwd
trap cleanup EXIT trap cleanup EXIT
trap cleanup SIGINT trap cleanup SIGINT
echo "Add X_IOWRT_EU_Dropbear Object that is needed for functional test"
DROPBEAR_OBJECT='{"parent_dm": "Device.", "object": "X_IOWRT_EU_Dropbear"}'
jq --argjson newObj "$DROPBEAR_OBJECT" '.daemon.services += [$newObj]' "/etc/bbfdm/services/core.json" > /tmp/updated_core.json
mv /tmp/updated_core.json /etc/bbfdm/services/core.json
supervisorctl restart bbfdmd supervisorctl restart bbfdmd
echo "Compiling icmwp" echo "Compiling icmwp"
@ -63,11 +58,12 @@ for test in $(cat test/script/run_sequence.txt); do
remove_icwmp_log remove_icwmp_log
echo "#### $test Ended with error ####" >> "$icwmp_master_log" echo "#### $test Ended with error ####" >> "$icwmp_master_log"
echo "#### $test Ended with error ####" echo "#### $test Ended with error ####"
exit 1
fi fi
sleep 1 sleep 5
done done
echo "Stop all services" echo "Stop icwmpd service only"
sleep 10 sleep 10
supervisorctl stop icwmpd supervisorctl stop icwmpd

View file

@ -9,6 +9,8 @@ function log()
function cleanup() function cleanup()
{ {
echo "" echo ""
supervisorctl stop all
cp /var/log/supervisor/*.log .
} }
function check_ret() function check_ret()
@ -126,8 +128,8 @@ function build_icwmp()
exec_cmd cp bbf_plugin/libcwmpdm.so ../bbf_plugin/ exec_cmd cp bbf_plugin/libcwmpdm.so ../bbf_plugin/
exec_cmd make install exec_cmd make install
[ -f "/usr/sbin/icwmpd" ] && rm /usr/sbin/icwmpd [ -f "/usr/sbin/icwmpd" ] && rm /usr/sbin/icwmpd
exec_cmd ln -s ${BINP}/src/icwmpd /usr/sbin/icwmpd exec_cmd ln -sf ${BINP}/src/icwmpd /usr/sbin/icwmpd
exec_cmd ln -s ${BINP}/bbf_plugin/libcwmpdm.so /usr/share/bbfdm/micro_services/icwmp.so exec_cmd ln -sf ${BINP}/bbf_plugin/libcwmpdm.so /usr/share/bbfdm/micro_services/icwmp.so
cd .. cd ..
} }
@ -150,19 +152,6 @@ function check_valgrind_xml() {
echo "Checking memory leaks..." echo "Checking memory leaks..."
cp /tmp/memory-report.xml memory-report.xml cp /tmp/memory-report.xml memory-report.xml
echo "checking UninitCondition" valgrind-ci memory-report.xml --summary
grep -q "<kind>UninitCondition</kind>" /tmp/memory-report.xml exec_cmd valgrind-ci memory-report.xml --abort-on-errors
error_on_zero $?
echo "checking Leak_PossiblyLost"
grep -q "<kind>Leak_PossiblyLost</kind>" /tmp/memory-report.xml
error_on_zero $?
echo "checking Leak_DefinitelyLost"
grep -q "<kind>Leak_DefinitelyLost</kind>" /tmp/memory-report.xml
error_on_zero $?
echo "checking Leak_StillReachable"
grep -q "<kind>Leak_StillReachable</kind>" /tmp/memory-report.xml
error_on_zero $?
} }

View file

@ -755,11 +755,15 @@ int cwmp_set_parameter_value(const char *parameter_name, const char *parameter_v
.status = true .status = true
}; };
if (param_len == 0 || parameter_name[param_len - 1] == '.' || parameter_value == NULL) if (param_len == 0 || parameter_name[param_len - 1] == '.' || parameter_value == NULL) {
CWMP_LOG(ERROR, "Invalid inputs");
return FAULT_CPE_INVALID_ARGUMENTS; return FAULT_CPE_INVALID_ARGUMENTS;
}
if (CWMP_OK != instantiate_param_name(parameter_name, &inst_path)) if (CWMP_OK != instantiate_param_name(parameter_name, &inst_path)) {
CWMP_LOG(ERROR, "Invalid instance entry");
return FAULT_CPE_INVALID_ARGUMENTS; return FAULT_CPE_INVALID_ARGUMENTS;
}
CWMP_MEMSET(&b, 0, sizeof(struct blob_buf)); CWMP_MEMSET(&b, 0, sizeof(struct blob_buf));
blob_buf_init(&b, 0); blob_buf_init(&b, 0);
@ -782,7 +786,7 @@ int cwmp_set_parameter_value(const char *parameter_name, const char *parameter_v
} }
if (set_result.status == false) { if (set_result.status == false) {
CWMP_LOG(INFO, "Set parameter value of %s with %s value is failed", parameter_name, parameter_value); CWMP_LOG(ERROR, "Set parameter value of %s with %s value is failed", parameter_name, parameter_value);
FREE(inst_path); FREE(inst_path);
return FAULT_CPE_INVALID_ARGUMENTS; return FAULT_CPE_INVALID_ARGUMENTS;
} }

View file

@ -4,22 +4,23 @@ source ./test/script/common.sh
source ./gitlab-ci/shared.sh source ./gitlab-ci/shared.sh
TEST_NAME="SET RPC Method" TEST_NAME="SET RPC Method"
PARAM="Device.Schedules.Schedule.1.Enable"
echo "Running: $TEST_NAME" echo "Running: $TEST_NAME"
remove_icwmp_log remove_icwmp_log
curl $connection_request_path -X POST --data '{"name": "getParameterValues", "parameterNames": ["Device.X_IOWRT_EU_Dropbear.1.PasswordAuth"] }' >/dev/null 2>&1 curl $connection_request_path -X POST --data '{"name": "getParameterValues", "parameterNames": ["'${PARAM}'"] }' >/dev/null 2>&1
check_ret $? check_ret $?
wait_for_session_end wait_for_session_end
check_session "GetParameterValues" check_session "GetParameterValues"
param_value_before=$(print_tag_value "cwmp:GetParameterValuesResponse" "Value xsi:type=\"xsd:boolean\"") param_value_before=$(print_tag_value "cwmp:GetParameterValuesResponse" "Value xsi:type=\"xsd:boolean\"")
if [ "$param_value_before" != "1" ]; then if [ "$param_value_before" != "0" ]; then
echo "Error: Default value of 'Device.X_IOWRT_EU_Dropbear.1.PasswordAuth' is wrong, current_value($param_value_before) expected_value(1)" >> ./funl-test-debug.log echo "Error: Default value of [${PARAM}] is wrong, current_value($param_value_before) expected_value(1)" >> ./funl-test-debug.log
exit 1 exit 1
fi fi
remove_icwmp_log remove_icwmp_log
curl $connection_request_path -X POST --data '{"name": "setParameterValues", "parameterValues": [["Device.X_IOWRT_EU_Dropbear.1.PasswordAuth",false]]}' >/dev/null 2>&1 curl $connection_request_path -X POST --data '{"name": "setParameterValues", "parameterValues": [["'${PARAM}'",true]]}' >/dev/null 2>&1
check_ret $? check_ret $?
wait_for_session_end wait_for_session_end
check_session "SetParameterValues" check_session "SetParameterValues"
@ -30,17 +31,17 @@ if [ "$get_status" != "0" ]; then
fi fi
remove_icwmp_log remove_icwmp_log
curl $connection_request_path -X POST --data '{"name": "getParameterValues", "parameterNames": ["Device.X_IOWRT_EU_Dropbear.1.PasswordAuth"] }' >/dev/null 2>&1 curl $connection_request_path -X POST --data '{"name": "getParameterValues", "parameterNames": ["'${PARAM}'"] }' >/dev/null 2>&1
check_ret $? check_ret $?
wait_for_session_end wait_for_session_end
check_session "GetParameterValues" check_session "GetParameterValues"
param_value_after=$(print_tag_value "cwmp:GetParameterValuesResponse" "Value xsi:type=\"xsd:boolean\"") param_value_after=$(print_tag_value "cwmp:GetParameterValuesResponse" "Value xsi:type=\"xsd:boolean\"")
if [ "$param_value_after" != "0" ]; then if [ "$param_value_after" != "1" ]; then
echo "Error: the value of 'Device.X_IOWRT_EU_Dropbear.1.PasswordAuth' is wrong, current_value($param_value_after) expected_value(0)" >> ./funl-test-debug.log echo "Error: the value of [${PARAM}] is wrong, current_value($param_value_after) expected_value(0)" >> ./funl-test-debug.log
exit 1 exit 1
fi fi
curl $connection_request_path -X POST --data '{"name": "setParameterValues", "parameterValues": [["Device.X_IOWRT_EU_Dropbear.1.PasswordAuth",true]]}' >/dev/null 2>&1 curl $connection_request_path -X POST --data '{"name": "setParameterValues", "parameterValues": [["'${PARAM}'",false]]}' >/dev/null 2>&1
wait_for_session_end wait_for_session_end
echo "PASS: $TEST_NAME" echo "PASS: $TEST_NAME"