mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
tests: add and test format example configs
This commit is contained in:
parent
548bf75d23
commit
9c05ceb976
16 changed files with 210 additions and 5 deletions
15
etc/examples/formats/csv.conf
Normal file
15
etc/examples/formats/csv.conf
Normal file
|
@ -0,0 +1,15 @@
|
|||
nodes = {
|
||||
node = {
|
||||
type = "file"
|
||||
uri = "/dev/null"
|
||||
|
||||
format = {
|
||||
type = "csv"
|
||||
|
||||
separator = ","
|
||||
delimiter = "\n"
|
||||
skip_first_line = false
|
||||
header = true
|
||||
}
|
||||
}
|
||||
}
|
14
etc/examples/formats/gtnet.conf
Normal file
14
etc/examples/formats/gtnet.conf
Normal file
|
@ -0,0 +1,14 @@
|
|||
nodes = {
|
||||
node = {
|
||||
type = "file"
|
||||
uri = "/dev/null"
|
||||
|
||||
format = {
|
||||
type = "gtnet"
|
||||
|
||||
bits = 32
|
||||
endianess = "little"
|
||||
fake = false
|
||||
}
|
||||
}
|
||||
}
|
8
etc/examples/formats/iotagent_ul.conf
Normal file
8
etc/examples/formats/iotagent_ul.conf
Normal file
|
@ -0,0 +1,8 @@
|
|||
nodes = {
|
||||
node = {
|
||||
type = "file"
|
||||
uri = "/dev/null"
|
||||
|
||||
format = "iotagent_ul"
|
||||
}
|
||||
}
|
16
etc/examples/formats/json-edgeflex.conf
Normal file
16
etc/examples/formats/json-edgeflex.conf
Normal file
|
@ -0,0 +1,16 @@
|
|||
nodes = {
|
||||
node = {
|
||||
type = "file"
|
||||
uri = "/dev/null"
|
||||
|
||||
format = {
|
||||
type = "json.edgeflex"
|
||||
|
||||
indent = 4
|
||||
compact = true
|
||||
ensure_ascii = true
|
||||
escape_slash = false
|
||||
sort_keys = true
|
||||
}
|
||||
}
|
||||
}
|
16
etc/examples/formats/json-kafka.conf
Normal file
16
etc/examples/formats/json-kafka.conf
Normal file
|
@ -0,0 +1,16 @@
|
|||
nodes = {
|
||||
node = {
|
||||
type = "file"
|
||||
uri = "/dev/null"
|
||||
|
||||
format = {
|
||||
type = "json.kafka"
|
||||
|
||||
indent = 2
|
||||
schema = {
|
||||
type = "struct"
|
||||
name = "villas-node.Value"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
16
etc/examples/formats/json-reserve.conf
Normal file
16
etc/examples/formats/json-reserve.conf
Normal file
|
@ -0,0 +1,16 @@
|
|||
nodes = {
|
||||
node = {
|
||||
type = "file"
|
||||
uri = "/dev/null"
|
||||
|
||||
format = {
|
||||
type = "json.reserve"
|
||||
|
||||
indent = 4
|
||||
compact = true
|
||||
ensure_ascii = true
|
||||
escape_slash = false
|
||||
sort_keys = true
|
||||
}
|
||||
}
|
||||
}
|
16
etc/examples/formats/json.conf
Normal file
16
etc/examples/formats/json.conf
Normal file
|
@ -0,0 +1,16 @@
|
|||
nodes = {
|
||||
node = {
|
||||
type = "file"
|
||||
uri = "/dev/null"
|
||||
|
||||
format = {
|
||||
type = "json"
|
||||
|
||||
indent = 4
|
||||
compact = true
|
||||
ensure_ascii = true
|
||||
escape_slash = false
|
||||
sort_keys = true
|
||||
}
|
||||
}
|
||||
}
|
8
etc/examples/formats/protobuf.conf
Normal file
8
etc/examples/formats/protobuf.conf
Normal file
|
@ -0,0 +1,8 @@
|
|||
nodes = {
|
||||
node = {
|
||||
type = "file"
|
||||
uri = "/dev/null"
|
||||
|
||||
format = "protobuf"
|
||||
}
|
||||
}
|
14
etc/examples/formats/raw.conf
Normal file
14
etc/examples/formats/raw.conf
Normal file
|
@ -0,0 +1,14 @@
|
|||
nodes = {
|
||||
node = {
|
||||
type = "file"
|
||||
uri = "/dev/null"
|
||||
|
||||
format = {
|
||||
type = "raw"
|
||||
|
||||
bits = 32
|
||||
endianess = "little"
|
||||
fake = false
|
||||
}
|
||||
}
|
||||
}
|
15
etc/examples/formats/tsv.conf
Normal file
15
etc/examples/formats/tsv.conf
Normal file
|
@ -0,0 +1,15 @@
|
|||
nodes = {
|
||||
node = {
|
||||
type = "file"
|
||||
uri = "/dev/null"
|
||||
|
||||
format = {
|
||||
type = "tsv"
|
||||
|
||||
separator = "\t"
|
||||
delimiter = "\n"
|
||||
skip_first_line = false
|
||||
header = true
|
||||
}
|
||||
}
|
||||
}
|
8
etc/examples/formats/value.conf
Normal file
8
etc/examples/formats/value.conf
Normal file
|
@ -0,0 +1,8 @@
|
|||
nodes = {
|
||||
node = {
|
||||
type = "file"
|
||||
uri = "/dev/null"
|
||||
|
||||
format = "value"
|
||||
}
|
||||
}
|
12
etc/examples/formats/villas-binary.conf
Normal file
12
etc/examples/formats/villas-binary.conf
Normal file
|
@ -0,0 +1,12 @@
|
|||
nodes = {
|
||||
node = {
|
||||
type = "file"
|
||||
uri = "/dev/null"
|
||||
|
||||
format = {
|
||||
type = "villas.binary"
|
||||
|
||||
source_index = 99
|
||||
}
|
||||
}
|
||||
}
|
8
etc/examples/formats/villas-human.conf
Normal file
8
etc/examples/formats/villas-human.conf
Normal file
|
@ -0,0 +1,8 @@
|
|||
nodes = {
|
||||
node = {
|
||||
type = "file"
|
||||
uri = "/dev/null"
|
||||
|
||||
format = "villas.human"
|
||||
}
|
||||
}
|
8
etc/examples/formats/villas-web.conf
Normal file
8
etc/examples/formats/villas-web.conf
Normal file
|
@ -0,0 +1,8 @@
|
|||
nodes = {
|
||||
node = {
|
||||
type = "file"
|
||||
uri = "/dev/null"
|
||||
|
||||
format = "villas.web"
|
||||
}
|
||||
}
|
22
etc/examples/hooks/pps_ts.conf
Normal file
22
etc/examples/hooks/pps_ts.conf
Normal file
|
@ -0,0 +1,22 @@
|
|||
@include "hook-nodes.conf"
|
||||
|
||||
paths = (
|
||||
{
|
||||
in = "signal_node"
|
||||
out = "file_node"
|
||||
|
||||
hooks = (
|
||||
{
|
||||
type = "pps_ts"
|
||||
|
||||
signal = "pps"
|
||||
|
||||
mode = "simple" # Oneof: simple, horizon
|
||||
threshold = 0.5
|
||||
expected_smp_rate = 5e3
|
||||
horizon_estimation = 10
|
||||
horizon_compensation = 10
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
|
@ -23,10 +23,9 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
##################################################################################
|
||||
|
||||
NODE_TYPES=$(villas node -C | jq -r '.nodes | join(" ")')
|
||||
HOOKS_TYPES=$(villas node -C | jq -r '.["hooks"] | join(" ")')
|
||||
|
||||
CONFIGS=$(find -name '*.conf' -o -name '*.json')
|
||||
NODE_TYPES=$(villas node -C 2>/dev/null | jq -r '.nodes | join(" ")')
|
||||
HOOK_TYPES=$(villas node -C 2>/dev/null | jq -r '.hooks | join(" ")')
|
||||
FORMAT_TYPES=$(villas node -C 2>/dev/null | jq -r '.formats | join(" ")')
|
||||
|
||||
MISSING=0
|
||||
|
||||
|
@ -40,7 +39,9 @@ for NODE in ${NODE_TYPES}; do
|
|||
done
|
||||
|
||||
for HOOK in ${HOOK_TYPES}; do
|
||||
[ ${NODE} == "loopback_internal" ] && continue
|
||||
[ ${HOOK} == "restart" ] || \
|
||||
[ ${HOOK} == "drop" ] || \
|
||||
[ ${HOOK} == "fix" ] && continue
|
||||
|
||||
if [ ! -f "${SRCDIR}/etc/examples/hooks/${HOOK}.conf" ]; then
|
||||
echo "Missing example config for hook-type: ${HOOK}"
|
||||
|
@ -48,4 +49,12 @@ for HOOK in ${HOOK_TYPES}; do
|
|||
fi
|
||||
done
|
||||
|
||||
for FORMAT in ${FORMAT_TYPES}; do
|
||||
FORMAT=${FORMAT/./-}
|
||||
if [ ! -f "${SRCDIR}/etc/examples/formats/${FORMAT}.conf" ]; then
|
||||
echo "Missing example config for format-type: ${FORMAT}"
|
||||
((MISSING++))
|
||||
fi
|
||||
done
|
||||
|
||||
(( ${MISSING} == 0 ))
|
||||
|
|
Loading…
Add table
Reference in a new issue