bbfdm/gitlab-ci/tools-test.sh
2023-11-20 13:36:36 +00:00

68 lines
2.2 KiB
Bash
Executable file

#!/bin/bash
echo "Verification of BBF Tools"
pwd
source ./gitlab-ci/shared.sh
cp ./gitlab-ci/core_service.conf /etc/supervisor/conf.d/
# starting base services
supervisorctl reread
supervisorctl update
sleep 5
# install required packages
exec_cmd apt update
exec_cmd apt install -y python3-pip libxml2-utils
exec_cmd pip3 install jsonschema xlwt ubus pylint
echo "Validating PEP8 syntax on tools"
exec_cmd_verbose pylint -d R,C,W0603 tools/*.py
echo "********* Validate JSON Plugin *********"
echo "Validate BBF TR-181 JSON Plugin"
./tools/validate_json_plugin.py libbbfdm/dmtree/json/tr181.json
check_ret $?
echo "Validate BBF TR-104 JSON Plugin"
./tools/validate_json_plugin.py libbbfdm/dmtree/json/tr104.json
check_ret $?
echo "Validate X_IOPSYS_EU_Dropbear JSON Plugin"
./tools/validate_json_plugin.py test/files/etc/bbfdm/plugins/X_IOPSYS_EU_Dropbear.json
check_ret $?
echo "Validate X_IOPSYS_EU_TEST JSON Plugin"
./tools/validate_json_plugin.py test/files/etc/bbfdm/plugins/X_IOPSYS_EU_TEST.json
check_ret $?
echo "Validate X_IOPSYS_EU_WiFi JSON Plugin"
./tools/validate_json_plugin.py test/files/etc/bbfdm/plugins/X_IOPSYS_EU_WiFi.json
check_ret $?
echo "Validate X_IOPSYS_EU_URLFilter JSON Plugin"
./tools/validate_json_plugin.py test/files/etc/bbfdm/plugins/urlfilter.json
check_ret $?
echo "Validate CWMPManagementServer JSON Plugin"
./tools/validate_json_plugin.py test/files/etc/bbfdm/plugins/CWMPManagementServer.json
check_ret $?
echo "Validate TR-181 JSON Plugin after generating from XML"
json_path=$(./tools/convert_dm_xml_to_json.py test/tools/tr-181-2-*-cwmp-full.xml test/tools/tr-181-2-*-usp-full.xml Device.)
./tools/validate_json_plugin.py $json_path
check_ret $?
echo "Validate TR-104 JSON Plugin after generating from XML"
json_path=$(./tools/convert_dm_xml_to_json.py test/tools/tr-104-2-0-2-cwmp-full.xml test/tools/tr-104-2-0-2-usp-full.xml Device.Services.VoiceService.)
./tools/validate_json_plugin.py $json_path
check_ret $?
echo "Validate TR-135 JSON Plugin after generating from XML"
json_path=$(./tools/convert_dm_xml_to_json.py test/tools/tr-135-1-4-1-cwmp-full.xml test/tools/tr-135-1-4-1-usp-full.xml Device.Services.STBService.)
./tools/validate_json_plugin.py $json_path
check_ret $?
date +%s > timestamp.log
echo "Tools Test :: PASS"