diff --git a/etc/examples/formats/csv.conf b/etc/examples/formats/csv.conf new file mode 100644 index 000000000..14b49e433 --- /dev/null +++ b/etc/examples/formats/csv.conf @@ -0,0 +1,15 @@ +nodes = { + node = { + type = "file" + uri = "/dev/null" + + format = { + type = "csv" + + separator = "," + delimiter = "\n" + skip_first_line = false + header = true + } + } +} diff --git a/etc/examples/formats/gtnet.conf b/etc/examples/formats/gtnet.conf new file mode 100644 index 000000000..c2e9199cc --- /dev/null +++ b/etc/examples/formats/gtnet.conf @@ -0,0 +1,14 @@ +nodes = { + node = { + type = "file" + uri = "/dev/null" + + format = { + type = "gtnet" + + bits = 32 + endianess = "little" + fake = false + } + } +} diff --git a/etc/examples/formats/iotagent_ul.conf b/etc/examples/formats/iotagent_ul.conf new file mode 100644 index 000000000..29a6769e2 --- /dev/null +++ b/etc/examples/formats/iotagent_ul.conf @@ -0,0 +1,8 @@ +nodes = { + node = { + type = "file" + uri = "/dev/null" + + format = "iotagent_ul" + } +} diff --git a/etc/examples/formats/json-edgeflex.conf b/etc/examples/formats/json-edgeflex.conf new file mode 100644 index 000000000..ebf71ba84 --- /dev/null +++ b/etc/examples/formats/json-edgeflex.conf @@ -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 + } + } +} diff --git a/etc/examples/formats/json-kafka.conf b/etc/examples/formats/json-kafka.conf new file mode 100644 index 000000000..207c95488 --- /dev/null +++ b/etc/examples/formats/json-kafka.conf @@ -0,0 +1,16 @@ +nodes = { + node = { + type = "file" + uri = "/dev/null" + + format = { + type = "json.kafka" + + indent = 2 + schema = { + type = "struct" + name = "villas-node.Value" + } + } + } +} diff --git a/etc/examples/formats/json-reserve.conf b/etc/examples/formats/json-reserve.conf new file mode 100644 index 000000000..d20441ba6 --- /dev/null +++ b/etc/examples/formats/json-reserve.conf @@ -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 + } + } +} diff --git a/etc/examples/formats/json.conf b/etc/examples/formats/json.conf new file mode 100644 index 000000000..00d5d47bc --- /dev/null +++ b/etc/examples/formats/json.conf @@ -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 + } + } +} diff --git a/etc/examples/formats/protobuf.conf b/etc/examples/formats/protobuf.conf new file mode 100644 index 000000000..46f688165 --- /dev/null +++ b/etc/examples/formats/protobuf.conf @@ -0,0 +1,8 @@ +nodes = { + node = { + type = "file" + uri = "/dev/null" + + format = "protobuf" + } +} diff --git a/etc/examples/formats/raw.conf b/etc/examples/formats/raw.conf new file mode 100644 index 000000000..1da00032e --- /dev/null +++ b/etc/examples/formats/raw.conf @@ -0,0 +1,14 @@ +nodes = { + node = { + type = "file" + uri = "/dev/null" + + format = { + type = "raw" + + bits = 32 + endianess = "little" + fake = false + } + } +} diff --git a/etc/examples/formats/tsv.conf b/etc/examples/formats/tsv.conf new file mode 100644 index 000000000..ed1bb1b88 --- /dev/null +++ b/etc/examples/formats/tsv.conf @@ -0,0 +1,15 @@ +nodes = { + node = { + type = "file" + uri = "/dev/null" + + format = { + type = "tsv" + + separator = "\t" + delimiter = "\n" + skip_first_line = false + header = true + } + } +} diff --git a/etc/examples/formats/value.conf b/etc/examples/formats/value.conf new file mode 100644 index 000000000..df5dbfe00 --- /dev/null +++ b/etc/examples/formats/value.conf @@ -0,0 +1,8 @@ +nodes = { + node = { + type = "file" + uri = "/dev/null" + + format = "value" + } +} diff --git a/etc/examples/formats/villas-binary.conf b/etc/examples/formats/villas-binary.conf new file mode 100644 index 000000000..055357e24 --- /dev/null +++ b/etc/examples/formats/villas-binary.conf @@ -0,0 +1,12 @@ +nodes = { + node = { + type = "file" + uri = "/dev/null" + + format = { + type = "villas.binary" + + source_index = 99 + } + } +} diff --git a/etc/examples/formats/villas-human.conf b/etc/examples/formats/villas-human.conf new file mode 100644 index 000000000..c1ba6ce17 --- /dev/null +++ b/etc/examples/formats/villas-human.conf @@ -0,0 +1,8 @@ +nodes = { + node = { + type = "file" + uri = "/dev/null" + + format = "villas.human" + } +} diff --git a/etc/examples/formats/villas-web.conf b/etc/examples/formats/villas-web.conf new file mode 100644 index 000000000..ee3ef865d --- /dev/null +++ b/etc/examples/formats/villas-web.conf @@ -0,0 +1,8 @@ +nodes = { + node = { + type = "file" + uri = "/dev/null" + + format = "villas.web" + } +} diff --git a/etc/examples/hooks/pps_ts.conf b/etc/examples/hooks/pps_ts.conf new file mode 100644 index 000000000..f001a8931 --- /dev/null +++ b/etc/examples/hooks/pps_ts.conf @@ -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 + } + ) + } +) diff --git a/tests/integration/missing-example-configs.sh b/tests/integration/missing-example-configs.sh index a3140038d..68a5cf76f 100755 --- a/tests/integration/missing-example-configs.sh +++ b/tests/integration/missing-example-configs.sh @@ -23,10 +23,9 @@ # along with this program. If not, see . ################################################################################## -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 ))