import os
-class MetadataTest:
+class MetadataTestAssistant:
+ BASIC_PROLOGUE = \
+'''/* CTF 1.8 */
+
+typealias integer { size = 8; align = 8; signed = false; base = 10; } := uint8_t;
+typealias integer { size = 32; align = 8; signed = false; base = hex; } := uint32_t;
+
+trace {
+ major = 0;
+ minor = 0;
+ uuid = "2a6422d0-6cee-11e0-8c08-cb07d7b3a564";
+ byte_order = le;
+ packet.header := struct {
+ uint32_t magic;
+ uint8_t uuid[16];
+ };
+};
+
+'''
+
def __init__(self):
self._actions = {
'prepare': self._prepare,
# validate size
if args.size < 1:
- MetadataTest._perror('wrong size: {}'.format(args.size))
+ MetadataTestAssistant._perror('wrong size: {}'.format(args.size))
return args
def _do_action(self):
if self._action not in self._actions:
- MetadataTest._perror('invalid action: "{}"'.format(self._action))
+ msg = 'invalid action: "{}"'.format(self._action)
+ MetadataTestAssistant._perror(msg)
self._actions[self._action]()