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