Skip to content

Commit b0b0a4e

Browse files
committed
ngci: Add QemuTestConfig
1 parent 0fa9122 commit b0b0a4e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

lib/ngci.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,25 @@ def setup(self, state, boot, test_dir):
291291
boot.args.append('--net-tests')
292292

293293

294+
class QemuTestConfig(TestConfig):
295+
def __init__(self, name, callbacks=[]):
296+
super().__init__(f'qemu-test-{name}')
297+
self.callbacks = callbacks
298+
299+
def setup(self, state, boot, test_dir):
300+
start_marker = f'starting-{self.name}'
301+
end_marker = f'end-{self.name}'
302+
303+
# Script doesn't run the tests, just greps the qemu console.log
304+
gen_script(f'{test_dir}/run.sh',
305+
f"awk '/{start_marker}/, /{end_marker}/' ../console.log | tee extracted.log")
306+
307+
boot.callbacks.append(f'sh(# {start_marker})')
308+
for callback in self.callbacks:
309+
boot.callbacks.append(callback)
310+
boot.callbacks.append(f'sh(# {end_marker})')
311+
312+
294313
class QemuSelftestsConfig(TestConfig):
295314
def __init__(self, selftest_build, collection=None, exclude=[], extra_callbacks=[]):
296315
name = 'qemu-selftests'

0 commit comments

Comments
 (0)