Refactor test infrastructure for metadata stress
[ctf-testsuite.git] / tests / 1.8 / stress / metadata / pass / large-metadata / test.py
CommitLineData
9491ba33 1#!/usr/bin/env python3
9926ec7f 2from ctftestsuite.stress import MetadataTest
9491ba33 3
9491ba33 4
9926ec7f
PP
5class Test(MetadataTest):
6 what = 'large metadata with {size} extra chars'
9491ba33 7
9926ec7f
PP
8 def write_metadata(self, f):
9 p1 = '''/* CTF 1.8 */
9491ba33 10
9926ec7f
PP
11typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
12typealias integer { size = 32; align = 8; signed = false; base = hex; } := uint32_t;
9491ba33 13
9926ec7f
PP
14trace {
15 major = 0;
16 minor = 0;
17 uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
18 byte_order = le;
19 packet.header := struct {
20 uint32_t magic;
21 uint8_t uuid[16];
22 };
23};
9491ba33 24
9926ec7f
PP
25event {
26 name = myevent;
27 fields := struct {
28 uint8_t f;
29 };
30'''
31 p2 = '\n};\n'
9491ba33 32
9926ec7f 33 f.write(p1)
9491ba33 34
9926ec7f
PP
35 for i in range(self.size):
36 f.write(' ')
9491ba33 37
9926ec7f 38 f.write(p2)
9491ba33 39
9491ba33 40
9926ec7f
PP
41if __name__ == '__main__':
42 test = Test()
43 test.main()
This page took 0.023976 seconds and 4 git commands to generate.