ctf-testsuite
=============
-The Common Trace Format (CTF) testsuite is intended to validate the conformance of CTF readers.
+The Common Trace Format (CTF) testsuite is intended to validate the
+conformance of CTF readers.
To run the testsuite simply export CTF_READER_BIN="$YOUR_CTF_READER" and
-use the run.sh script found in the tests/1.8/ or tests/1.9/ folder,
-depending on the CTF specification version you want to check.
+use the run.sh script found in the tests/x.y/ folder, x.y being the CTF
+specification version you want to check.
+++ /dev/null
-/* CTF 1.8 */
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+typealias integer { size = 8; align = 8; signed = false; base = hex; } := TYPE;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+/* Value 1024 is above the max value of TYPE. */
+event {
+ name = string;
+ fields := struct {
+ enum : TYPE {
+ VAL1,
+ VAL2,
+ VAL3 = 1024
+ } field;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: implicit type int, but undefined. */
+enum dummy {
+ x = 1024
+};
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
+
+
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: out of range */
+enum dummy : uint32_t {
+ x = -1
+};
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
+
+
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
+
+/* FAIL: out of range */
+enum dummy : uint8_t {
+ x = 1024
+};
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
+
+
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
-typealias integer { size = 8; align = 8; signed = false; base = hex; } := TYPE;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-/* Value 1024 is above the max value of TYPE. */
-event {
- name = string;
- fields := struct {
- enum : TYPE {
- VAL1,
- VAL2,
- VAL3 = 1024
- } field;
- };
-};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: align as string. */
+typealias integer { size = 8; align = "8"; signed = false; } := uint8_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: negative align. */
+typealias integer { size = 8; align = -8; signed = false; } := uint8_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: Alignment values must be power of two. */
+typealias integer { size = 8; align = 17; signed = false; } := uint0_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: base as a string. */
+typealias integer { size = 8; align = 8; signed = false; base = "decimal"; } := uint8_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: invalid base. */
+typealias integer { size = 8; align = 8; signed = false; base = orthogonal; } := uint8_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: invalid byte ordering. */
+typealias integer { size = 8; align = 8; signed = false; byte_order = iroquois; } := uint8_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: encoding as a string. */
+typealias integer { size = 8; align = 8; signed = false; encoding = "ascii"; } := uint8_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: invalid encoding. */
+typealias integer { size = 8; align = 8; signed = false; encoding = true; } := uint8_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+
+/* FAIL: signed as string. */
+typealias integer { size = 8; align = 8; signed = "false"; } := uint8_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: invalid signed. */
+typealias integer { size = 8; align = 8; signed = svp; } := uint8_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+
+/* FAIL: size as string. */
+typealias integer { size = "8"; align = 8; signed = false; } := uint8_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: missing size. */
+typealias integer { align = 8; signed = "false"; } := uint8_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: negative size. */
+typealias integer { size = -8; align = 8; signed = false; } := uint8_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: duplicate name */
+struct dummy {
+ uint32_t xxx;
+ uint32_t xxx;
+};
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
+
+
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: duplicate name. */
+struct a {
+ uint32_t xxx;
+};
+
+struct a {
+ uint32_t xxx;
+};
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
+
+
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: keyword as a field. */
+struct a {
+ uint32_t trace;
+};
+
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
+
+
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: type int, but undefined. */
+struct dummy {
+ int xxx;
+};
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
+
+
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: duplicate name. */
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
+
+
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: invalid kind. */
+typealias entier { size = 8; align = 8; signed = false; } := uint8_t;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
--- /dev/null
+/* CTF 1.8 */
+
+typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
+
+/* FAIL: name is a keyword. */
+typealias integer { size = 8; align = 8; signed = false; } := trace;
+
+trace {
+ major = 2;
+ minor = 1;
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ };
+};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: size = 0 */
-typealias integer { size = 0; align = 8; signed = false; } := uint0_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: Alignment values must be power of two. */
-typealias integer { size = 8; align = 17; signed = false; } := uint0_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: invalid byte ordering. */
-typealias integer { size = 8; align = 8; signed = false; byte_order = iroquois; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: invalid signed. */
-typealias integer { size = 8; align = 8; signed = svp; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: negative size. */
-typealias integer { size = -8; align = 8; signed = false; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: negative align. */
-typealias integer { size = 8; align = -8; signed = false; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-
-/* FAIL: size as string. */
-typealias integer { size = "8"; align = 8; signed = false; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: align as string. */
-typealias integer { size = 8; align = "8"; signed = false; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-
-/* FAIL: signed as string. */
-typealias integer { size = 8; align = 8; signed = "false"; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: name is a keyword. */
-typealias integer { size = 8; align = 8; signed = "false"; } := trace;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: missing size. */
-typealias integer { align = 8; signed = "false"; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: invalid kind. */
-typealias entier { size = 8; align = 8; signed = false; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: base as a string. */
-typealias integer { size = 8; align = 8; signed = false; base = "decimal"; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: invalid base. */
-typealias integer { size = 8; align = 8; signed = false; base = orthogonal; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: invalid encoding. */
-typealias integer { size = 8; align = 8; signed = false; encoding = true; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: encoding as a string. */
-typealias integer { size = 8; align = 8; signed = false; encoding = "ascii"; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
-
-/* FAIL: out of range */
-enum dummy : uint8_t {
- x = 1024
-};
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: out of range */
-enum dummy : uint32_t {
- x = -1
-};
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: implicite type int, but undefined. */
-enum dummy {
- x = 1024
-};
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: type int, but undefined. */
-struct dummy {
- int xxx;
-};
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: duplicate name */
-struct dummy {
- uint32_t xxx;
- uint32_t xxx;
-};
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: duplicate name. */
-struct a {
- uint32_t xxx;
-};
-
-struct a {
- uint32_t xxx;
-};
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: duplicate name. */
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: keyword as a field. */
-struct a {
- uint32_t trace;
-};
-
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: keyword as a field. */
-struct a {
- uint32_t x;
-} align(-1);
-
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: negative array. */
-typedef uint32_t name[-1];
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; } := uint32_t;
+
+trace {
+ major = 0;
+ minor = 1;
+ test = 0xABC234; /* hexadecimal */
+ test1 = 06534; /* octal */
+ test2 = 1234; /* decimal */
+ test3 = +1234; /* decimal with + unary op */
+ test4 = -1234; /* decimal (negated) */
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+stream {
+ packet.context := struct {
+ uint32_t content_size;
+ uint32_t packet_size;
+ };
+};
+
+event {
+ name = string;
+ fields := struct { string str; };
+};
--- /dev/null
+/* CTF 1.8 */
+
+trace {
+ major = 1;
+ minor = 8;
+ byte_order = le;
+};
+++ /dev/null
-/* CTF 1.8 */
-
-trace {
- major = 1;
- minor = 8;
- byte_order = le;
-};
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- test = 0xABC234; /* hexadecimal */
- test1 = 06534; /* octal */
- test2 = 1234; /* decimal */
- test3 = +1234; /* decimal with + unary op */
- test4 = -1234; /* decimal (negated) */
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-stream {
- packet.context := struct {
- uint32_t content_size;
- uint32_t packet_size;
- };
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; aa = bb; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; zz = aa; } := uint32_t;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+ blah = "aaa";
+};
+
+stream {
+ packet.context := struct {
+ uint32_t content_size;
+ uint32_t packet_size;
+ };
+ askdjfhaskdjfh = 1;
+};
+
+event {
+ name = string;
+ fields := struct { string str; };
+ asdjfhah := struct { uint8_t ffff; };
+};
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; aa = bb; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; zz = aa; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
- blah = "aaa";
-};
-
-stream {
- packet.context := struct {
- uint32_t content_size;
- uint32_t packet_size;
- };
- askdjfhaskdjfh = 1;
-};
-
-event {
- name = string;
- fields := struct { string str; };
- asdjfhah := struct { uint8_t ffff; };
-};
+++ /dev/null
-Á\1füÁ*d"Ðlî\11à\8c\bË\a׳¥dB
\ No newline at end of file
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
-typealias integer { size = 32; align = 512; signed = false; base = hex; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-event {
- name = evname;
- fields := struct { struct {} s; };
-};
--- /dev/null
+Á\1füÁ*d"Ðlî\11à\8c\bË\a׳¥dB
\ No newline at end of file
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 512; signed = false; base = hex; } := uint32_t;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+event {
+ name = evname;
+ fields := struct { struct {} s; };
+};
+++ /dev/null
-/* CTF 1.8
- *
- * Architecture with 32-bit pointers, 32-bit integers, 32-bit longs.
- */
-
-typealias integer { size = 1; align = 1; signed = false; } := uint1_t;
-typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
-typealias integer { size = 63; align = 1; signed = false; } := timestamp_t;
-
-typealias integer { size = 32; align = 32; signed = false; base = 10; } := uint32_t;
-typealias integer { size = 32; align = 32; signed = false; } := void *;
-
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- uint32_t stream_id;
- };
-};
-
-stream {
- event.header := struct {
- uint1_t id;
- timestamp_t timestamp;
- };
- event.context := struct {
- uint32_t thread_id;
- uint32_t event_count;
- };
-};
-
-event {
- name = func_enter;
- id = 0;
- fields := struct {
- void *func_called;
- void *called_from;
- };
-};
-
-event {
- name = func_exit;
- id = 1;
-};
--- /dev/null
+Á\1füÁ*d"Ðlî\11à\8c\bË\a׳¥dBBBB
\ No newline at end of file
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+event {
+ name = evname;
+ fields := struct { uint32_t len; uint32_t blah[len]; };
+};
--- /dev/null
+Á\1füÁ*d
\ No newline at end of file
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+event {
+ name = string;
+ fields := struct { string str; };
+};
+++ /dev/null
-Á\1füÁ*d
\ No newline at end of file
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; } := uint32_t;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+stream {
+ packet.context := struct {
+ uint32_t content_size;
+ uint32_t packet_size;
+ };
+};
+
+event {
+ name = string;
+ fields := struct { string str; };
+};
--- /dev/null
+/* CTF 1.8 */
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
+
+trace {
+ major = 0;
+ minor = 1;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+event {
+ name = string;
+ fields := struct { string str; };
+};
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-stream {
- packet.context := struct {
- uint32_t content_size;
- uint32_t packet_size;
- };
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-stream {
- packet.context := struct {
- uint32_t content_size;
- uint32_t packet_size;
- };
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
+++ /dev/null
-Á\1füÁ*d"Ðlî\11à\8c\bË\a׳¥dBBBB
\ No newline at end of file
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-event {
- name = evname;
- fields := struct { uint32_t len; uint32_t blah[len]; };
-};
--- /dev/null
+524288
+1048576
+2097152
+4194304
+8388608
+16777216
+33554432
+67108864
--- /dev/null
+#!/usr/bin/env python3
+
+# Expects either "prepare" or "clean" argument
+
+import sys
+import os
+
+def arg_err():
+ print('Please specify "prepare <SIZE>" or "clean <SIZE>" as first argument.')
+ sys.exit(-1)
+
+if (len(sys.argv) <= 1):
+ arg_err()
+mode = sys.argv[1]
+if (len(sys.argv) <= 2):
+ arg_err()
+array_len = int(sys.argv[2])
+
+tracedir_name = './trace-' + str(array_len) + '/'
+output_metadata = tracedir_name + 'metadata'
+output_stream = tracedir_name + 'stream'
+
+
+def write_binary(f, arr):
+ f.write(bytes(arr))
+
+def generate_metadata(array_len):
+ # Generate metadata
+ metadata_str = \
+ ( '/* CTF 1.8 */\n'
+ '\n'
+ 'typealias integer {{ size = 8; align = 8; signed = false; base = 10; }} := uint8_t;\n'
+ 'typealias integer {{ size = 32; align = 32; signed = false; base = hex; }} := uint32_t;\n'
+ '\n'
+ 'trace {{\n'
+ ' major = 0;\n'
+ ' minor = 0;\n'
+ ' uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";\n'
+ ' byte_order = le;\n'
+ ' packet.header := struct {{\n'
+ ' uint32_t magic;\n'
+ ' uint8_t uuid[16];\n'
+ ' }};\n'
+ '}};\n'
+ '\n'
+ 'event {{\n'
+ ' name = seq;\n'
+ ' fields := struct {{\n'
+ ' uint8_t field[{}]; \n'
+ ' }};\n'
+ '}};\n').format(array_len)
+ metadata_f = open(output_metadata, 'w')
+ metadata_f.write(metadata_str)
+ metadata_f.close()
+
+def generate_stream(array_len):
+ # Generate stream
+ stream_packet_header = [
+ 0xC1, 0x1F, 0xFC, 0xC1, # magic
+ 0x2A, 0x64, 0x22, 0xD0, 0x6C, 0xEE, 0x11, 0xE0,
+ 0x8C, 0x08, 0xCB, 0x07, 0xD7, 0xB3, 0xA5, 0x64, # uuid
+ ]
+ stream_f = open(output_stream, 'wb')
+ write_binary(stream_f, stream_packet_header)
+ # generate array as event content
+ os.ftruncate(stream_f.fileno(), len(stream_packet_header) + array_len)
+ stream_f.close()
+
+def test_prepare():
+ print('Preparing test for array length ' + str(array_len) + ' bytes')
+ os.mkdir(tracedir_name)
+ generate_metadata(array_len)
+ generate_stream(array_len)
+
+def test_clean():
+ print('Cleaning up test for array length ' + str(array_len) + ' bytes')
+ try:
+ os.remove(output_metadata)
+ except:
+ pass
+ try:
+ os.remove(output_stream)
+ except:
+ pass
+ try:
+ os.rmdir(tracedir_name)
+ except:
+ pass
+
+if (mode == "prepare"):
+ test_clean()
+ test_prepare()
+elif (mode == "clean"):
+ test_clean()
+else:
+ arg_err()
--- /dev/null
+524288
+1048576
+2097152
+4194304
+8388608
+16777216
+33554432
+67108864
--- /dev/null
+#!/usr/bin/env python3
+
+# Expects either "prepare" or "clean" argument
+
+import sys
+import os
+
+def arg_err():
+ print('Please specify "prepare <SIZE>" or "clean <SIZE>" as first argument.')
+ sys.exit(-1)
+
+if (len(sys.argv) <= 1):
+ arg_err()
+mode = sys.argv[1]
+if (len(sys.argv) <= 2):
+ arg_err()
+array_len = int(sys.argv[2])
+
+tracedir_name = './trace-' + str(array_len) + '/'
+output_metadata = tracedir_name + 'metadata'
+output_stream = tracedir_name + 'stream'
+
+
+def write_binary(f, arr):
+ f.write(bytes(arr))
+
+def generate_metadata(array_len):
+ # Generate metadata
+ metadata_str = \
+ ( '/* CTF 1.8 */\n'
+ '\n'
+ 'typealias integer {{ size = 8; align = 8; signed = false; base = 10; }} := uint8_t;\n'
+ 'typealias integer {{ size = 32; align = 32; signed = false; base = hex; }} := uint32_t;\n'
+ '\n'
+ 'trace {{\n'
+ ' major = 0;\n'
+ ' minor = 0;\n'
+ ' uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";\n'
+ ' byte_order = le;\n'
+ '}};\n'
+ '\n'
+ 'stream {{\n'
+ ' packet.context := struct {{\n'
+ ' uint8_t packet_size; \n'
+ ' }};\n'
+ '}};\n').format(array_len)
+ metadata_f = open(output_metadata, 'w')
+ metadata_f.write(metadata_str)
+ metadata_f.close()
+
+def generate_stream(array_len):
+ # Generate stream
+ stream_packet_header = [
+ 0x8, # packet_size, in bits
+ ]
+ stream_f = open(output_stream, 'wb')
+ # generate trace content filled with 1-byte packets
+ for i in range(array_len):
+ write_binary(stream_f, stream_packet_header)
+ stream_f.close()
+
+def test_prepare():
+ print('Preparing test for many packets length ' + str(array_len) + ' bytes')
+ os.mkdir(tracedir_name)
+ generate_metadata(array_len)
+ generate_stream(array_len)
+
+def test_clean():
+ print('Cleaning up test for many packets length ' + str(array_len) + ' bytes')
+ try:
+ os.remove(output_metadata)
+ except:
+ pass
+ try:
+ os.remove(output_stream)
+ except:
+ pass
+ try:
+ os.rmdir(tracedir_name)
+ except:
+ pass
+
+if (mode == "prepare"):
+ test_clean()
+ test_prepare()
+elif (mode == "clean"):
+ test_clean()
+else:
+ arg_err()
--- /dev/null
+524288
+1048576
+2097152
+4194304
+8388608
+16777216
+33554432
+67108864
+134217728
+268435456
+536870912
+1073741824
+2147483648
+4294967296
+8589934592
--- /dev/null
+#!/usr/bin/env python3
+
+# Expects either "prepare" or "clean" argument
+
+import sys
+import os
+
+def arg_err():
+ print('Please specify "prepare <SIZE>" or "clean <SIZE>" as first argument.')
+ sys.exit(-1)
+
+if (len(sys.argv) <= 1):
+ arg_err()
+mode = sys.argv[1]
+if (len(sys.argv) <= 2):
+ arg_err()
+array_len = int(sys.argv[2])
+
+tracedir_name = './trace-' + str(array_len) + '/'
+output_metadata = tracedir_name + 'metadata'
+output_stream = tracedir_name + 'stream'
+
+
+def write_binary(f, arr):
+ f.write(bytes(arr))
+
+def generate_metadata(array_len):
+ # Generate metadata
+ metadata_str = \
+ ( '/* CTF 1.8 */\n'
+ '\n'
+ 'typealias integer {{ size = 8; align = 8; signed = false; base = 10; }} := uint8_t;\n'
+ 'typealias integer {{ size = 32; align = 32; signed = false; base = hex; }} := uint32_t;\n'
+ '\n'
+ 'trace {{\n'
+ ' major = 0;\n'
+ ' minor = 0;\n'
+ ' uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";\n'
+ ' byte_order = le;\n'
+ ' packet.header := struct {{\n'
+ ' uint32_t magic;\n'
+ ' uint8_t uuid[16];\n'
+ ' }};\n'
+ '}};\n'
+ '\n'
+ 'event {{\n'
+ ' name = myevent;\n'
+ ' fields := struct {{\n'
+ ' uint8_t field; \n'
+ ' }};\n'
+ '}};\n').format()
+ metadata_f = open(output_metadata, 'w')
+ metadata_f.write(metadata_str)
+ metadata_f.close()
+
+def generate_stream(array_len):
+ # Generate stream
+ stream_packet_header = [
+ 0xC1, 0x1F, 0xFC, 0xC1, # magic
+ 0x2A, 0x64, 0x22, 0xD0, 0x6C, 0xEE, 0x11, 0xE0,
+ 0x8C, 0x08, 0xCB, 0x07, 0xD7, 0xB3, 0xA5, 0x64, # uuid
+ ]
+ stream_f = open(output_stream, 'wb')
+ write_binary(stream_f, stream_packet_header)
+ # generate array as event content
+ os.ftruncate(stream_f.fileno(), len(stream_packet_header) + array_len)
+ stream_f.close()
+
+def test_prepare():
+ print('Preparing test for packet length ' + str(array_len) + ' bytes')
+ os.mkdir(tracedir_name)
+ generate_metadata(array_len)
+ generate_stream(array_len)
+
+def test_clean():
+ print('Cleaning up test for packet length ' + str(array_len) + ' bytes')
+ try:
+ os.remove(output_metadata)
+ except:
+ pass
+ try:
+ os.remove(output_stream)
+ except:
+ pass
+ try:
+ os.rmdir(tracedir_name)
+ except:
+ pass
+
+if (mode == "prepare"):
+ test_clean()
+ test_prepare()
+elif (mode == "clean"):
+ test_clean()
+else:
+ arg_err()
--- /dev/null
+#!/bin/sh
+
+. ../../../../../utils/run.sh
--- /dev/null
+524288
+1048576
+2097152
+4194304
+8388608
+16777216
+33554432
+67108864
--- /dev/null
+#!/usr/bin/env python3
+
+# Expects either "prepare" or "clean" argument
+
+import sys
+import os
+import struct
+
+def arg_err():
+ print('Please specify "prepare <SIZE>" or "clean <SIZE>" as first argument.')
+ sys.exit(-1)
+
+if (len(sys.argv) <= 1):
+ arg_err()
+mode = sys.argv[1]
+if (len(sys.argv) <= 2):
+ arg_err()
+array_len = int(sys.argv[2])
+
+tracedir_name = './trace-' + str(array_len) + '/'
+output_metadata = tracedir_name + 'metadata'
+output_stream = tracedir_name + 'stream'
+
+
+def write_binary(f, arr):
+ f.write(bytes(arr))
+
+def generate_metadata(array_len):
+ # Generate metadata
+ metadata_str = \
+ ( '/* CTF 1.8 */\n'
+ '\n'
+ 'typealias integer {{ size = 8; align = 8; signed = false; base = 10; }} := uint8_t;\n'
+ 'typealias integer {{ size = 32; align = 8; signed = false; base = hex; }} := uint32_t;\n'
+ 'typealias integer {{ size = 64; align = 8; signed = false; base = hex; }} := uint64_t;\n'
+ '\n'
+ 'trace {{\n'
+ ' major = 0;\n'
+ ' minor = 0;\n'
+ ' uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";\n'
+ ' byte_order = le;\n'
+ ' packet.header := struct {{\n'
+ ' uint32_t magic;\n'
+ ' uint8_t uuid[16];\n'
+ ' }};\n'
+ '}};\n'
+ '\n'
+ 'event {{\n'
+ ' name = seq;\n'
+ ' fields := struct {{\n'
+ ' uint64_t len; \n'
+ ' uint8_t field[len]; \n'
+ ' }};\n'
+ '}};\n').format()
+ metadata_f = open(output_metadata, 'w')
+ metadata_f.write(metadata_str)
+ metadata_f.close()
+
+def generate_stream(array_len):
+ # Generate stream
+ stream_packet_header = [
+ 0xC1, 0x1F, 0xFC, 0xC1, # magic
+ 0x2A, 0x64, 0x22, 0xD0, 0x6C, 0xEE, 0x11, 0xE0,
+ 0x8C, 0x08, 0xCB, 0x07, 0xD7, 0xB3, 0xA5, 0x64, # uuid
+ ]
+ stream_f = open(output_stream, 'wb')
+ write_binary(stream_f, stream_packet_header)
+ # write sequence length (64-bit little endian)
+ write_binary(stream_f, struct.pack('<Q', array_len))
+ # generate array as event content
+ os.ftruncate(stream_f.fileno(), len(stream_packet_header) + 8 + array_len)
+ stream_f.close()
+
+def test_prepare():
+ print('Preparing test for sequence length ' + str(array_len) + ' bytes')
+ os.mkdir(tracedir_name)
+ generate_metadata(array_len)
+ generate_stream(array_len)
+
+def test_clean():
+ print('Cleaning up test for sequence length ' + str(array_len) + ' bytes')
+ try:
+ os.remove(output_metadata)
+ except:
+ pass
+ try:
+ os.remove(output_stream)
+ except:
+ pass
+ try:
+ os.rmdir(tracedir_name)
+ except:
+ pass
+
+if (mode == "prepare"):
+ test_clean()
+ test_prepare()
+elif (mode == "clean"):
+ test_clean()
+else:
+ arg_err()
--- /dev/null
+524288
+1048576
+2097152
+4194304
+8388608
+16777216
+33554432
+67108864
--- /dev/null
+#!/usr/bin/env python3
+
+# Expects either "prepare" or "clean" argument
+
+import sys
+import os
+
+def arg_err():
+ print('Please specify "prepare <SIZE>" or "clean <SIZE>" as first argument.')
+ sys.exit(-1)
+
+if (len(sys.argv) <= 1):
+ arg_err()
+mode = sys.argv[1]
+if (len(sys.argv) <= 2):
+ arg_err()
+array_len = int(sys.argv[2])
+
+tracedir_name = './trace-' + str(array_len) + '/'
+output_metadata = tracedir_name + 'metadata'
+output_stream = tracedir_name + 'stream'
+
+
+def write_binary(f, arr):
+ f.write(bytes(arr))
+
+def generate_metadata(array_len):
+ # Generate metadata
+ metadata_str1 = \
+ ( '/* CTF 1.8 */\n'
+ '\n'
+ 'typealias integer {{ size = 8; align = 8; signed = false; base = 10; }} := uint8_t;\n'
+ 'typealias integer {{ size = 32; align = 32; signed = false; base = hex; }} := uint32_t;\n'
+ '\n'
+ 'trace {{\n'
+ ' major = 0;\n'
+ ' minor = 0;\n'
+ ' uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";\n'
+ ' byte_order = le;\n'
+ ' packet.header := struct {{\n'
+ ' uint32_t magic;\n'
+ ' uint8_t uuid[16];\n'
+ ' }};\n'
+ '}};\n'
+ '\n'
+ 'event {{\n'
+ ' name = myevent;\n'
+ ' fields := struct {{\n').format()
+
+ metadata_str2 = \
+ ' uint8_t f{}; \n'
+
+ metadata_str3 = \
+ ( ' }};\n'
+ '}};\n').format()
+ metadata_f = open(output_metadata, 'w')
+ metadata_f.write(metadata_str1)
+ for i in range(array_len):
+ metadata_f.write(metadata_str2.format(i))
+ metadata_f.write(metadata_str3)
+ metadata_f.close()
+
+def generate_stream(array_len):
+ # Generate stream
+ stream_packet_header = [
+ 0xC1, 0x1F, 0xFC, 0xC1, # magic
+ 0x2A, 0x64, 0x22, 0xD0, 0x6C, 0xEE, 0x11, 0xE0,
+ 0x8C, 0x08, 0xCB, 0x07, 0xD7, 0xB3, 0xA5, 0x64, # uuid
+ ]
+ stream_f = open(output_stream, 'wb')
+ write_binary(stream_f, stream_packet_header)
+ # generate array as event content
+ os.ftruncate(stream_f.fileno(), len(stream_packet_header) + array_len)
+ stream_f.close()
+
+def test_prepare():
+ print('Preparing test for many field structure length ' + str(array_len) + ' fields')
+ os.mkdir(tracedir_name)
+ generate_metadata(array_len)
+ generate_stream(array_len)
+
+def test_clean():
+ print('Cleaning up test for many field structure length ' + str(array_len) + ' fields')
+ try:
+ os.remove(output_metadata)
+ except:
+ pass
+ try:
+ os.remove(output_stream)
+ except:
+ pass
+ try:
+ os.rmdir(tracedir_name)
+ except:
+ pass
+
+if (mode == "prepare"):
+ test_clean()
+ test_prepare()
+elif (mode == "clean"):
+ test_clean()
+else:
+ arg_err()
--- /dev/null
+256
+512
+1024
+2048
+4096
+8192
+16384
+32768
+65536
+131072
+262144
+524288
+1048576
+2097152
+4194304
+8388608
+16777216
+33554432
+67108864
--- /dev/null
+#!/usr/bin/env python3
+
+# Expects either "prepare" or "clean" argument
+
+import sys
+import os
+
+def arg_err():
+ print('Please specify "prepare <SIZE>" or "clean <SIZE>" as first argument.')
+ sys.exit(-1)
+
+if (len(sys.argv) <= 1):
+ arg_err()
+mode = sys.argv[1]
+if (len(sys.argv) <= 2):
+ arg_err()
+array_len = int(sys.argv[2])
+
+tracedir_name = './trace-' + str(array_len) + '/'
+output_metadata = tracedir_name + 'metadata'
+output_stream = tracedir_name + 'stream'
+
+
+def write_binary(f, arr):
+ f.write(bytes(arr))
+
+def generate_metadata(array_len):
+ # Generate metadata
+ metadata_str1 = \
+ ( '/* CTF 1.8 */\n'
+ '\n'
+ 'typealias integer {{ size = 8; align = 8; signed = false; base = 10; }} := uint8_t;\n'
+ 'typealias integer {{ size = 32; align = 32; signed = false; base = hex; }} := uint32_t;\n'
+ '\n'
+ 'trace {{\n'
+ ' major = 0;\n'
+ ' minor = 0;\n'
+ ' uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";\n'
+ ' byte_order = le;\n'
+ ' packet.header := struct {{\n'
+ ' uint32_t magic;\n'
+ ' uint8_t uuid[16];\n'
+ ' }};\n'
+ '}};\n'
+ '\n'
+ 'event {{\n'
+ ' name = myevent;\n'
+ ' fields := struct {{\n').format()
+
+ metadata_nest_push = \
+ ' struct {{\n'
+
+ metadata_str2 = \
+ ( ' uint8_t field; \n').format()
+
+ metadata_nest_pop = \
+ ' }} s_depth_{};\n'
+
+ metadata_str3 = \
+ ( ' }};\n'
+ '}};\n').format()
+ metadata_f = open(output_metadata, 'w')
+ metadata_f.write(metadata_str1)
+ for i in range(array_len):
+ metadata_f.write(metadata_nest_push.format())
+ metadata_f.write(metadata_str2)
+ for i in range(array_len):
+ metadata_f.write(metadata_nest_pop.format(i))
+ metadata_f.write(metadata_str3)
+ metadata_f.close()
+
+def generate_stream(array_len):
+ # Generate stream
+ stream_packet_header = [
+ 0xC1, 0x1F, 0xFC, 0xC1, # magic
+ 0x2A, 0x64, 0x22, 0xD0, 0x6C, 0xEE, 0x11, 0xE0,
+ 0x8C, 0x08, 0xCB, 0x07, 0xD7, 0xB3, 0xA5, 0x64, # uuid
+ ]
+ stream_f = open(output_stream, 'wb')
+ write_binary(stream_f, stream_packet_header)
+ # generate single byte event as event content
+ os.ftruncate(stream_f.fileno(), len(stream_packet_header) + 1)
+ stream_f.close()
+
+def test_prepare():
+ print('Preparing test for deeply nested structure ' + str(array_len) + ' levels')
+ os.mkdir(tracedir_name)
+ generate_metadata(array_len)
+ generate_stream(array_len)
+
+def test_clean():
+ print('Cleaning up test for deeply nested structure ' + str(array_len) + ' levels')
+ try:
+ os.remove(output_metadata)
+ except:
+ pass
+ try:
+ os.remove(output_stream)
+ except:
+ pass
+ try:
+ os.rmdir(tracedir_name)
+ except:
+ pass
+
+if (mode == "prepare"):
+ test_clean()
+ test_prepare()
+elif (mode == "clean"):
+ test_clean()
+else:
+ arg_err()
--- /dev/null
+#!/bin/bash
+#
+# Copyright (C) - 2013 Christian Babeux <christian.babeux@efficios.com>
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License, version 2 only, as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 51
+# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+CURDIR=$(dirname $0)
+UTILS_DIR=$CURDIR/../../../../../utils/
+
+source $UTILS_DIR/tap/tap.sh
+
+NUM_TESTS=0
+
+for param in $(cat $1/param-list.txt); do
+ NUM_TESTS=$((${NUM_TESTS} + 3))
+done
+
+plan_tests $NUM_TESTS
+
+if [ "x${CTF_READER_BIN}" == "x" ]; then
+ echo "Bail out! No CTF_READER_BIN specified"
+ exit 1
+fi
+
+for param in $(cat $1/param-list.txt); do
+ cd $1 && ./test.py prepare ${param}
+ result=$?
+ is $result 0 $1
+ cd ..
+
+ $CTF_READER_BIN $CTF_READER_OPTS $1/trace-${param} >/dev/null 2>&1
+ result=$?
+ is $result 0 $1 # expect pass
+
+ cd $1 && ./test.py clean ${param}
+ result=$?
+ is $result 0 $1
+ cd ..
+done
--- /dev/null
+524288
+1048576
+2097152
+4194304
+8388608
+16777216
+33554432
+67108864
--- /dev/null
+#!/usr/bin/env python3
+
+# Expects either "prepare" or "clean" argument
+
+import sys
+import os
+
+def arg_err():
+ print('Please specify "prepare <SIZE>" or "clean <SIZE>" as first argument.')
+ sys.exit(-1)
+
+if (len(sys.argv) <= 1):
+ arg_err()
+mode = sys.argv[1]
+if (len(sys.argv) <= 2):
+ arg_err()
+array_len = int(sys.argv[2])
+
+tracedir_name = './trace-' + str(array_len) + '/'
+output_metadata = tracedir_name + 'metadata'
+output_stream = tracedir_name + 'stream'
+
+
+def write_binary(f, arr):
+ f.write(bytes(arr))
+
+def generate_metadata(array_len):
+ # Generate metadata
+ metadata_str1 = \
+ ( '/* CTF 1.8 */\n'
+ '\n'
+ 'typealias integer {{ size = 8; align = 8; signed = false; base = 10; }} := uint8_t;\n'
+ 'typealias integer {{ size = 32; align = 8; signed = false; base = hex; }} := uint32_t;\n'
+ 'typealias integer {{ size = 64; align = 8; signed = false; base = hex; }} := uint64_t;\n'
+ '\n'
+ 'trace {{\n'
+ ' major = 0;\n'
+ ' minor = 0;\n'
+ ' uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";\n'
+ ' byte_order = le;\n'
+ ' packet.header := struct {{\n'
+ ' uint32_t magic;\n'
+ ' uint8_t uuid[16];\n'
+ ' }};\n'
+ '}};\n'
+ '\n'
+ 'event {{\n'
+ ' name = myevent;\n'
+ ' fields := struct {{\n'
+ ' enum : uint64_t {{\n').format()
+
+ metadata_enum = \
+ ' t{},\n'
+
+ metadata_str2 = \
+ ( ' }} select;\n'
+ ' variant <select> {{\n').format()
+
+ metadata_variant = \
+ ' uint8_t t{};\n'
+
+ metadata_str3 = \
+ ( ' }} myvar;\n'
+ ' }};\n'
+ '}};\n').format()
+ metadata_f = open(output_metadata, 'w')
+ metadata_f.write(metadata_str1)
+ for i in range(array_len):
+ metadata_f.write(metadata_enum.format(i))
+ metadata_f.write(metadata_str2)
+ for i in range(array_len):
+ metadata_f.write(metadata_variant.format(i))
+ metadata_f.write(metadata_str3)
+ metadata_f.close()
+
+def generate_stream(array_len):
+ # Generate stream
+ stream_packet_header = [
+ 0xC1, 0x1F, 0xFC, 0xC1, # magic
+ 0x2A, 0x64, 0x22, 0xD0, 0x6C, 0xEE, 0x11, 0xE0,
+ 0x8C, 0x08, 0xCB, 0x07, 0xD7, 0xB3, 0xA5, 0x64, # uuid
+ ]
+ stream_f = open(output_stream, 'wb')
+ write_binary(stream_f, stream_packet_header)
+ # generate 8 bytes (enum) + 1 byte (variant) as content
+ os.ftruncate(stream_f.fileno(), len(stream_packet_header) + 8 + 1)
+ stream_f.close()
+
+def test_prepare():
+ print('Preparing test for many tags variant length ' + str(array_len) + ' tags')
+ os.mkdir(tracedir_name)
+ generate_metadata(array_len)
+ generate_stream(array_len)
+
+def test_clean():
+ print('Cleaning up test for many tags variant length ' + str(array_len) + ' tags')
+ try:
+ os.remove(output_metadata)
+ except:
+ pass
+ try:
+ os.remove(output_stream)
+ except:
+ pass
+ try:
+ os.rmdir(tracedir_name)
+ except:
+ pass
+
+if (mode == "prepare"):
+ test_clean()
+ test_prepare()
+elif (mode == "clean"):
+ test_clean()
+else:
+ arg_err()
--- /dev/null
+#!/bin/sh
+
+for dir in */; do
+ echo "Running ${dir} tests"
+ cd ${dir}
+ ./run.sh
+ cd ..
+done
+++ /dev/null
-/* CTF 1.8 */
+++ /dev/null
-/* CTF 1.8
- *
- * Architecture with 32-bit pointers, 32-bit integers, 32-bit longs.
- */
-
-typealias integer { size = 1; align = 1; signed = false; } := uint1_t;
-typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
-typealias integer { size = 63; align = 1; signed = false; } := timestamp_t;
-
-typealias integer { size = 32; align = 32; signed = false; base = 10; } := uint32_t;
-typealias integer { size = 32; align = 32; signed = false; } := void *;
-
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- uint32_t stream_id;
- };
-};
-
-stream {
- event.header := struct {
- uint1_t id;
- timestamp_t timestamp;
- };
- event.context := struct {
- uint32_t thread_id;
- uint32_t event_count;
- };
-};
-
-event {
- name = func_enter;
- id = 0;
- fields := struct {
- void *func_called;
- void *called_from;
- };
-};
-
-event {
- name = func_exit;
- id = 1;
-};
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; } := uint32_t;
-
-trace {
- /* Integer out of range */
- major = 23452397856348975623897562893746589237465289374658923764598237645897234658723648579236;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-stream {
- packet.context := struct {
- uint32_t content_size;
- uint32_t packet_size;
- };
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
+++ /dev/null
-#!/bin/sh
-
-. ../../../utils/run.sh
+++ /dev/null
-Á\1füÁ*d
\ No newline at end of file
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
+++ /dev/null
-#!/bin/bash
-#
-# Copyright (C) - 2013 Christian Babeux <christian.babeux@efficios.com>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License, version 2 only, as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 51
-# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-CURDIR=$(dirname $0)
-UTILS_DIR=$CURDIR/../../../utils/
-
-source $UTILS_DIR/tap/tap.sh
-
-NUM_TESTS=1
-
-plan_tests $NUM_TESTS
-
-$CTF_READER_BIN $CTF_READER_OPTS $1 >/dev/null 2>&1
-
-result=$?
-
-is $result 1 $1
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: size = 0 */
-typealias integer { size = 0; align = 8; signed = false; } := uint0_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: Alignment values must be power of two. */
-typealias integer { size = 8; align = 17; signed = false; } := uint0_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: invalid byte ordering. */
-typealias integer { size = 8; align = 8; signed = false; byte_order = iroquois; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: invalid signed. */
-typealias integer { size = 8; align = 8; signed = svp; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: negative size. */
-typealias integer { size = -8; align = 8; signed = false; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: negative align. */
-typealias integer { size = 8; align = -8; signed = false; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-
-/* FAIL: size as string. */
-typealias integer { size = "8"; align = 8; signed = false; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: align as string. */
-typealias integer { size = 8; align = "8"; signed = false; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-
-/* FAIL: signed as string. */
-typealias integer { size = 8; align = 8; signed = "false"; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: name is a keyword. */
-typealias integer { size = 8; align = 8; signed = "false"; } := trace;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: missing size. */
-typealias integer { align = 8; signed = "false"; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: invalid kind. */
-typealias entier { size = 8; align = 8; signed = false; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: base as a string. */
-typealias integer { size = 8; align = 8; signed = false; base = "decimal"; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: invalid base. */
-typealias integer { size = 8; align = 8; signed = false; base = orthogonal; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: invalid encoding. */
-typealias integer { size = 8; align = 8; signed = false; encoding = true; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: encoding as a string. */
-typealias integer { size = 8; align = 8; signed = false; encoding = "ascii"; } := uint8_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
-
-/* FAIL: out of range */
-enum dummy : uint8_t {
- x = 1024
-};
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: out of range */
-enum dummy : uint32_t {
- x = -1
-};
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: implicite type int, but undefined. */
-enum dummy {
- x = 1024
-};
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: type int, but undefined. */
-struct dummy {
- int xxx;
-};
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: duplicate name */
-struct dummy {
- uint32_t xxx;
- uint32_t xxx;
-};
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: duplicate name. */
-struct a {
- uint32_t xxx;
-};
-
-struct a {
- uint32_t xxx;
-};
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: duplicate name. */
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: keyword as a field. */
-struct a {
- uint32_t trace;
-};
-
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: keyword as a field. */
-struct a {
- uint32_t x;
-} align(-1);
-
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-
-typealias integer { size = 32; align = 8; signed = false; } := uint32_t;
-
-/* FAIL: negative array. */
-typedef uint32_t name[-1];
-
-trace {
- major = 2;
- minor = 1;
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- };
-};
-
-
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
+++ /dev/null
-Á\1füÁ*d"Ðlî\11à\8c\bË\a׳¥d
\ No newline at end of file
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-env {
- dummy = "blah";
-};
-
-stream {
- packet.context := struct {
- uint32_t content_size;
- uint32_t packet_size;
- };
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
+++ /dev/null
-/* CTF 1.8 */
+++ /dev/null
-#!/bin/sh
-
-. ../../../utils/run.sh
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
+++ /dev/null
-/* CTF 1.8 */
-
-trace {
- test = "abc" "def";
-};
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- test2 = "?\x20\040\123\0?";
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-/* use babeltrace -f trace:hostname to print. */
-
-/*
- * Expected:
-
-abc " hex: A, #, #, #1,
-oct: A, #, #, #1,
-
- */
-
-env {
- hostname = "\nabc \" hex: \x41, \x23, \x023, \x0231,\noct: \101, \043, \43, \0431, \0NOT SEEN";
-};
-
-stream {
- packet.context := struct {
- uint32_t content_size;
- uint32_t packet_size;
- };
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-stream {
- packet.context := struct {
- uint32_t content_size;
- uint32_t packet_size;
- };
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; base = hex; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-stream {
- packet.context := struct {
- uint32_t content_size;
- uint32_t packet_size;
- };
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- test = 0xABC234; /* hexadecimal */
- test1 = 06534; /* octal */
- test2 = 1234; /* decimal */
- test3 = +1234; /* decimal with + unary op */
- test4 = -1234; /* decimal (negated) */
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
-};
-
-stream {
- packet.context := struct {
- uint32_t content_size;
- uint32_t packet_size;
- };
-};
-
-event {
- name = string;
- fields := struct { string str; };
-};
+++ /dev/null
-#!/bin/bash
-#
-# Copyright (C) - 2013 Christian Babeux <christian.babeux@efficios.com>
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License, version 2 only, as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-# more details.
-#
-# You should have received a copy of the GNU General Public License along with
-# this program; if not, write to the Free Software Foundation, Inc., 51
-# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-CURDIR=$(dirname $0)
-UTILS_DIR=$CURDIR/../../../utils/
-
-source $UTILS_DIR/tap/tap.sh
-
-NUM_TESTS=1
-
-plan_tests $NUM_TESTS
-
-$CTF_READER_BIN $CTF_READER_OPTS $1 >/dev/null 2>&1
-
-result=$?
-
-is $result 0 $1
+++ /dev/null
-/* CTF 1.8 */
-typealias integer { size = 8; align = 8; signed = false; aa = bb; } := uint8_t;
-typealias integer { size = 32; align = 32; signed = false; zz = aa; } := uint32_t;
-
-trace {
- major = 0;
- minor = 1;
- uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
- byte_order = le;
- packet.header := struct {
- uint32_t magic;
- uint8_t uuid[16];
- };
- blah = "aaa";
-};
-
-stream {
- packet.context := struct {
- uint32_t content_size;
- uint32_t packet_size;
- };
- askdjfhaskdjfh = 1;
-};
-
-event {
- name = string;
- fields := struct { string str; };
- asdjfhah := struct { uint8_t ffff; };
-};
+++ /dev/null
-#!/bin/sh
-
-echo "Running expected pass tests"
-cd pass
-./run.sh
-cd ..
-
-echo "Running expected failure tests"
-cd fail
-./run.sh
-cd ..