From: Philippe Proulx Date: Thu, 30 Jul 2020 14:43:43 +0000 (-0400) Subject: Fix: add missing `tests/config/2/fail/metadata` directory X-Git-Tag: v3.0.0~161 X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=c7daae61222a4bf29de6b744a4418c1b93646f39;p=barectf.git Fix: add missing `tests/config/2/fail/metadata` directory Was ignored because `tests/config/.gitignore` ignores `metadata` files (and directories). Unignore `tests/config/2/fail/metadata` in `tests/config/.gitignore`. Signed-off-by: Philippe Proulx --- diff --git a/tests/config/.gitignore b/tests/config/.gitignore index d0a59d3..556fc71 100644 --- a/tests/config/.gitignore +++ b/tests/config/.gitignore @@ -1,4 +1,5 @@ barectf*.* metadata +!2/fail/metadata *.c *.h diff --git a/tests/config/2/fail/metadata/clocks-invalid-type.yaml b/tests/config/2/fail/metadata/clocks-invalid-type.yaml new file mode 100644 index 0000000..ef897e1 --- /dev/null +++ b/tests/config/2/fail/metadata/clocks-invalid-type.yaml @@ -0,0 +1,46 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + type-aliases: + uint16: + class: int + size: 16 + trace: + byte-order: le + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 + clocks: 23 diff --git a/tests/config/2/fail/metadata/clocks-key-invalid-identifier.yaml b/tests/config/2/fail/metadata/clocks-key-invalid-identifier.yaml new file mode 100644 index 0000000..1a33087 --- /dev/null +++ b/tests/config/2/fail/metadata/clocks-key-invalid-identifier.yaml @@ -0,0 +1,48 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + type-aliases: + uint16: + class: int + size: 16 + trace: + byte-order: le + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 + clocks: + 'some clock': + freq: 1000 diff --git a/tests/config/2/fail/metadata/default-stream-invalid-type.yaml b/tests/config/2/fail/metadata/default-stream-invalid-type.yaml new file mode 100644 index 0000000..d009ab9 --- /dev/null +++ b/tests/config/2/fail/metadata/default-stream-invalid-type.yaml @@ -0,0 +1,46 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.2' +metadata: + $default-stream: 23 + type-aliases: + uint16: + class: int + size: 16 + trace: + byte-order: le + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 diff --git a/tests/config/2/fail/metadata/default-stream-stream-default-duplicate.yaml b/tests/config/2/fail/metadata/default-stream-stream-default-duplicate.yaml new file mode 100644 index 0000000..c992213 --- /dev/null +++ b/tests/config/2/fail/metadata/default-stream-stream-default-duplicate.yaml @@ -0,0 +1,61 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.2' +metadata: + $default-stream: my_stream + type-aliases: + uint16: + class: int + size: 16 + trace: + byte-order: le + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 + other_stream: + $default: true + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 diff --git a/tests/config/2/fail/metadata/default-stream-unknown-stream.yaml b/tests/config/2/fail/metadata/default-stream-unknown-stream.yaml new file mode 100644 index 0000000..2ccec89 --- /dev/null +++ b/tests/config/2/fail/metadata/default-stream-unknown-stream.yaml @@ -0,0 +1,46 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.2' +metadata: + $default-stream: some_stream + type-aliases: + uint16: + class: int + size: 16 + trace: + byte-order: le + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 diff --git a/tests/config/2/fail/metadata/env-invalid-type.yaml b/tests/config/2/fail/metadata/env-invalid-type.yaml new file mode 100644 index 0000000..1886d02 --- /dev/null +++ b/tests/config/2/fail/metadata/env-invalid-type.yaml @@ -0,0 +1,46 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + type-aliases: + uint16: + class: int + size: 16 + trace: + byte-order: le + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 + env: 17 diff --git a/tests/config/2/fail/metadata/env-key-invalid-identifier.yaml b/tests/config/2/fail/metadata/env-key-invalid-identifier.yaml new file mode 100644 index 0000000..24027df --- /dev/null +++ b/tests/config/2/fail/metadata/env-key-invalid-identifier.yaml @@ -0,0 +1,47 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + type-aliases: + uint16: + class: int + size: 16 + trace: + byte-order: le + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 + env: + 'yes sir miller': bug diff --git a/tests/config/2/fail/metadata/env-value-invalid-type.yaml b/tests/config/2/fail/metadata/env-value-invalid-type.yaml new file mode 100644 index 0000000..1daeade --- /dev/null +++ b/tests/config/2/fail/metadata/env-value-invalid-type.yaml @@ -0,0 +1,49 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + type-aliases: + uint16: + class: int + size: 16 + trace: + byte-order: le + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 + env: + yes-sir-miller: + - a + - b diff --git a/tests/config/2/fail/metadata/fail.bats b/tests/config/2/fail/metadata/fail.bats new file mode 100644 index 0000000..e19a159 --- /dev/null +++ b/tests/config/2/fail/metadata/fail.bats @@ -0,0 +1,105 @@ +#!/usr/bin/env bats + +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +load ../../../common + +@test 'unknown property in metadata object makes barectf fail' { + barectf_config_check_fail unknown-prop.yaml +} + +@test 'wrong "env" property type in metadata object makes barectf fail' { + barectf_config_check_fail env-invalid-type.yaml +} + +@test 'invalid "env" key (invalid C identifier) in metadata object makes barectf fail' { + barectf_config_check_fail env-key-invalid-identifier.yaml +} + +@test 'invalid "env" value (not an int/string) in metadata object makes barectf fail' { + barectf_config_check_fail env-value-invalid-type.yaml +} + +@test 'wrong "clocks" property type in metadata object makes barectf fail' { + barectf_config_check_fail clocks-invalid-type.yaml +} + +@test 'invalid "clocks" key (invalid C identifier) in metadata object makes barectf fail' { + barectf_config_check_fail clocks-key-invalid-identifier.yaml +} + +@test 'wrong "$log-levels" property type in metadata object makes barectf fail' { + barectf_config_check_fail ll-invalid-type.yaml +} + +@test 'wrong "$log-levels" property value type in metadata object makes barectf fail' { + barectf_config_check_fail ll-value-invalid-type.yaml +} + +@test 'wrong "type-aliases" property type in metadata object makes barectf fail' { + barectf_config_check_fail ta-invalid-type.yaml +} + +@test 'no "trace" property in metadata object makes barectf fail' { + barectf_config_check_fail trace-no.yaml +} + +@test 'wrong "trace" property type in metadata object makes barectf fail' { + barectf_config_check_fail trace-invalid-type.yaml +} + +@test 'empty "trace" property in metadata object makes barectf fail' { + barectf_config_check_fail trace-empty.yaml +} + +@test 'no "streams" property in metadata object makes barectf fail' { + barectf_config_check_fail streams-no.yaml +} + +@test 'wrong "streams" property type in metadata object makes barectf fail' { + barectf_config_check_fail streams-invalid-type.yaml +} + +@test 'empty "streams" property in metadata object makes barectf fail' { + barectf_config_check_fail streams-empty.yaml +} + +@test 'invalid "streams" key (invalid C identifier) in metadata object makes barectf fail' { + barectf_config_check_fail streams-key-invalid-identifier.yaml +} + +@test 'multiple streams in metadata object with missing "stream_id" packet header type field makes barectf fail' { + barectf_config_check_fail multiple-streams-trace-ph-no-stream-id.yaml +} + +@test 'wrong "$default-stream" property type in metadata object makes barectf fail' { + barectf_config_check_fail default-stream-invalid-type.yaml +} + +@test 'non-existing stream name in "$default-stream" property makes barectf fail' { + barectf_config_check_fail default-stream-unknown-stream.yaml +} + +@test 'coexisting "$default-stream" property (metadata) and "$default: true" property (stream) with different names make barectf fail' { + barectf_config_check_fail default-stream-stream-default-duplicate.yaml +} diff --git a/tests/config/2/fail/metadata/ll-invalid-type.yaml b/tests/config/2/fail/metadata/ll-invalid-type.yaml new file mode 100644 index 0000000..cda3e9f --- /dev/null +++ b/tests/config/2/fail/metadata/ll-invalid-type.yaml @@ -0,0 +1,46 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + type-aliases: + uint16: + class: int + size: 16 + trace: + byte-order: le + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 + $log-levels: hello diff --git a/tests/config/2/fail/metadata/ll-value-invalid-type.yaml b/tests/config/2/fail/metadata/ll-value-invalid-type.yaml new file mode 100644 index 0000000..d9dce3c --- /dev/null +++ b/tests/config/2/fail/metadata/ll-value-invalid-type.yaml @@ -0,0 +1,47 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + type-aliases: + uint16: + class: int + size: 16 + trace: + byte-order: le + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 + $log-levels: + 'yes sir miller': meow diff --git a/tests/config/2/fail/metadata/multiple-streams-trace-ph-no-stream-id.yaml b/tests/config/2/fail/metadata/multiple-streams-trace-ph-no-stream-id.yaml new file mode 100644 index 0000000..71d7469 --- /dev/null +++ b/tests/config/2/fail/metadata/multiple-streams-trace-ph-no-stream-id.yaml @@ -0,0 +1,54 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + $include: + - stdint.yaml + - stdmisc.yaml + type-aliases: + pct: + class: struct + fields: + packet_size: uint32 + content_size: uint32 + pt: + class: struct + fields: + a: uint32 + trace: + byte-order: le + packet-header-type: + class: struct + fields: + magic: ctf-magic + streams: + s1: + packet-context-type: pct + events: + ev1: + payload-type: pt + s2: + packet-context-type: pct + events: + ev2: + payload-type: pt diff --git a/tests/config/2/fail/metadata/streams-empty.yaml b/tests/config/2/fail/metadata/streams-empty.yaml new file mode 100644 index 0000000..a911f0e --- /dev/null +++ b/tests/config/2/fail/metadata/streams-empty.yaml @@ -0,0 +1,27 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + trace: + byte-order: le + streams: {} diff --git a/tests/config/2/fail/metadata/streams-invalid-type.yaml b/tests/config/2/fail/metadata/streams-invalid-type.yaml new file mode 100644 index 0000000..76391ab --- /dev/null +++ b/tests/config/2/fail/metadata/streams-invalid-type.yaml @@ -0,0 +1,31 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + type-aliases: + uint16: + class: int + size: 16 + trace: + byte-order: le + streams: -17 diff --git a/tests/config/2/fail/metadata/streams-key-invalid-identifier.yaml b/tests/config/2/fail/metadata/streams-key-invalid-identifier.yaml new file mode 100644 index 0000000..4ca8111 --- /dev/null +++ b/tests/config/2/fail/metadata/streams-key-invalid-identifier.yaml @@ -0,0 +1,45 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + type-aliases: + uint16: + class: int + size: 16 + trace: + byte-order: le + streams: + 'some stream': + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 diff --git a/tests/config/2/fail/metadata/streams-no.yaml b/tests/config/2/fail/metadata/streams-no.yaml new file mode 100644 index 0000000..32894b4 --- /dev/null +++ b/tests/config/2/fail/metadata/streams-no.yaml @@ -0,0 +1,26 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + trace: + byte-order: le diff --git a/tests/config/2/fail/metadata/ta-invalid-type.yaml b/tests/config/2/fail/metadata/ta-invalid-type.yaml new file mode 100644 index 0000000..888210d --- /dev/null +++ b/tests/config/2/fail/metadata/ta-invalid-type.yaml @@ -0,0 +1,45 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + type-aliases: + - uint16: + class: int + size: 16 + trace: + byte-order: le + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 diff --git a/tests/config/2/fail/metadata/trace-empty.yaml b/tests/config/2/fail/metadata/trace-empty.yaml new file mode 100644 index 0000000..359c74f --- /dev/null +++ b/tests/config/2/fail/metadata/trace-empty.yaml @@ -0,0 +1,44 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + type-aliases: + uint16: + class: int + size: 16 + trace: {} + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 diff --git a/tests/config/2/fail/metadata/trace-invalid-type.yaml b/tests/config/2/fail/metadata/trace-invalid-type.yaml new file mode 100644 index 0000000..3f39bc5 --- /dev/null +++ b/tests/config/2/fail/metadata/trace-invalid-type.yaml @@ -0,0 +1,44 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + type-aliases: + uint16: + class: int + size: 16 + trace: switch + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 diff --git a/tests/config/2/fail/metadata/trace-no.yaml b/tests/config/2/fail/metadata/trace-no.yaml new file mode 100644 index 0000000..060b39b --- /dev/null +++ b/tests/config/2/fail/metadata/trace-no.yaml @@ -0,0 +1,39 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 diff --git a/tests/config/2/fail/metadata/unknown-prop.yaml b/tests/config/2/fail/metadata/unknown-prop.yaml new file mode 100644 index 0000000..5ad61d3 --- /dev/null +++ b/tests/config/2/fail/metadata/unknown-prop.yaml @@ -0,0 +1,46 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016 Philippe Proulx +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +version: '2.1' +metadata: + type-aliases: + uint16: + class: int + size: 16 + trace: + byte-order: le + streams: + my_stream: + packet-context-type: + class: struct + fields: + packet_size: uint16 + content_size: uint16 + events: + my_event: + payload-type: + class: struct + fields: + my_field: + class: int + size: 8 + unknown: false