mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2026-01-27 17:17:17 +01:00
Fix ci pipeline
This commit is contained in:
parent
ffba17fe09
commit
29ec93d024
5 changed files with 27 additions and 35 deletions
|
|
@ -51,3 +51,5 @@ run_functional_test:
|
|||
- memory-report.xml
|
||||
- memory-report-download.xml
|
||||
- icwmpd_debug.txt
|
||||
- bbf*.log
|
||||
- core*.log
|
||||
|
|
|
|||
|
|
@ -8,11 +8,6 @@ pwd
|
|||
trap cleanup EXIT
|
||||
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
|
||||
|
||||
echo "Compiling icmwp"
|
||||
|
|
@ -63,11 +58,12 @@ for test in $(cat test/script/run_sequence.txt); do
|
|||
remove_icwmp_log
|
||||
echo "#### $test Ended with error ####" >> "$icwmp_master_log"
|
||||
echo "#### $test Ended with error ####"
|
||||
exit 1
|
||||
fi
|
||||
sleep 1
|
||||
sleep 5
|
||||
done
|
||||
|
||||
echo "Stop all services"
|
||||
echo "Stop icwmpd service only"
|
||||
sleep 10
|
||||
supervisorctl stop icwmpd
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ function log()
|
|||
function cleanup()
|
||||
{
|
||||
echo ""
|
||||
supervisorctl stop all
|
||||
cp /var/log/supervisor/*.log .
|
||||
}
|
||||
|
||||
function check_ret()
|
||||
|
|
@ -126,8 +128,8 @@ function build_icwmp()
|
|||
exec_cmd cp bbf_plugin/libcwmpdm.so ../bbf_plugin/
|
||||
exec_cmd make install
|
||||
[ -f "/usr/sbin/icwmpd" ] && rm /usr/sbin/icwmpd
|
||||
exec_cmd ln -s ${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}/src/icwmpd /usr/sbin/icwmpd
|
||||
exec_cmd ln -sf ${BINP}/bbf_plugin/libcwmpdm.so /usr/share/bbfdm/micro_services/icwmp.so
|
||||
cd ..
|
||||
}
|
||||
|
||||
|
|
@ -150,19 +152,6 @@ function check_valgrind_xml() {
|
|||
echo "Checking memory leaks..."
|
||||
cp /tmp/memory-report.xml memory-report.xml
|
||||
|
||||
echo "checking UninitCondition"
|
||||
grep -q "<kind>UninitCondition</kind>" /tmp/memory-report.xml
|
||||
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 $?
|
||||
valgrind-ci memory-report.xml --summary
|
||||
exec_cmd valgrind-ci memory-report.xml --abort-on-errors
|
||||
}
|
||||
|
|
|
|||
|
|
@ -755,11 +755,15 @@ int cwmp_set_parameter_value(const char *parameter_name, const char *parameter_v
|
|||
.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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
CWMP_MEMSET(&b, 0, sizeof(struct blob_buf));
|
||||
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) {
|
||||
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);
|
||||
return FAULT_CPE_INVALID_ARGUMENTS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,22 +4,23 @@ source ./test/script/common.sh
|
|||
source ./gitlab-ci/shared.sh
|
||||
|
||||
TEST_NAME="SET RPC Method"
|
||||
PARAM="Device.Schedules.Schedule.1.Enable"
|
||||
|
||||
echo "Running: $TEST_NAME"
|
||||
|
||||
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 $?
|
||||
wait_for_session_end
|
||||
check_session "GetParameterValues"
|
||||
param_value_before=$(print_tag_value "cwmp:GetParameterValuesResponse" "Value xsi:type=\"xsd:boolean\"")
|
||||
if [ "$param_value_before" != "1" ]; 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
|
||||
if [ "$param_value_before" != "0" ]; then
|
||||
echo "Error: Default value of [${PARAM}] is wrong, current_value($param_value_before) expected_value(1)" >> ./funl-test-debug.log
|
||||
exit 1
|
||||
fi
|
||||
|
||||
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 $?
|
||||
wait_for_session_end
|
||||
check_session "SetParameterValues"
|
||||
|
|
@ -30,17 +31,17 @@ if [ "$get_status" != "0" ]; then
|
|||
fi
|
||||
|
||||
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 $?
|
||||
wait_for_session_end
|
||||
check_session "GetParameterValues"
|
||||
param_value_after=$(print_tag_value "cwmp:GetParameterValuesResponse" "Value xsi:type=\"xsd:boolean\"")
|
||||
if [ "$param_value_after" != "0" ]; 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
|
||||
if [ "$param_value_after" != "1" ]; then
|
||||
echo "Error: the value of [${PARAM}] is wrong, current_value($param_value_after) expected_value(0)" >> ./funl-test-debug.log
|
||||
exit 1
|
||||
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
|
||||
|
||||
echo "PASS: $TEST_NAME"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue