Commit 3319ac91 authored by Omar Kallel's avatar Omar Kallel

Add uspd config files to the test

parent bb1c4903
Pipeline #11816 failed with stages
in 2 minutes and 21 seconds
......@@ -42,4 +42,9 @@ cd /opt/dev/uspd
exec_cmd git checkout devel
exec_cmd make
cp uspd /usr/sbin/uspd
mkdir -p /etc/config
mkdir -p /etc/init.d
cp test/uspd/uspd.config /etc/config/uspd
cp test/uspd/uspd.init /etc/init.d/uspd
/etc/init.d/uspd start
ldconfig
\ No newline at end of file
config uspd 'usp'
option granularitylevel '0'
option debug '0'
option loglevel '1'
#!/bin/sh /etc/rc.common
START=98
STOP=10
USE_PROCD=1
PROG=/usr/sbin/uspd
validate_uspd_usp_section()
{
uci_validate_section uspd uspd "usp" \
'enabled:bool:true' \
'granularitylevel:uinteger' \
'debug:bool:false' \
'loglevel:uinteger' \
'sock:string' \
'transaction_timeout:string'
}
configure_uspd()
{
local enabled debug sock transaction_timeout
config_load uspd
validate_uspd_usp_section || {
log "Validation of usp section failed"
return 1;
}
[ ${enabled} -eq 0 ] && exit 0
if [ ${debug} -eq 1 ]; then
procd_set_param stdout 1
procd_set_param stderr 1
fi
if [ -n "${sock}" ]; then
procd_append_param command -s ${sock}
fi
if [ -n "${transaction_timeout}" ]; then
procd_append_param command -t ${transaction_timeout}
fi
}
start_service() {
procd_open_instance usp
procd_set_param command ${PROG}
configure_uspd
procd_set_param respawn
procd_close_instance
}
reload_service() {
stop
start
}
service_triggers()
{
procd_add_config_trigger "config.change" "uspd" /etc/init.d/uspd restart
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment