Lines Matching full:test
1 # Test class and utilities for functional tests
33 # @test: functional test to fail if @failure is seen
36 # @failure: a string to look for that triggers test failure, or None
48 # If @failure is seen, then mark @test as failed
49 def _console_read_line_until_match(test, vm, success, failure): argument
56 test.fail(
67 test.fail(
81 def _console_interaction(test, success_message, failure_message, argument
87 vm = test.vm
89 test.log.debug(
116 if _console_read_line_until_match(test, vm,
121 def interrupt_interactive_console_until_pattern(test, success_message, argument
136 :param test: a test containing a VM that will have its console
138 :type test: :class:`qemu_test.QemuSystemTest`
139 :param success_message: if this message appears, test succeeds
140 :param failure_message: if this message appears, test fails
145 _console_interaction(test, success_message, failure_message,
148 def wait_for_console_pattern(test, success_message, failure_message=None, argument
153 :param test: a test containing a VM that will have its console
155 :type test: :class:`qemu_test.QemuSystemTest`
156 :param success_message: if this message appears, test succeeds
157 :param failure_message: if this message appears, test fails
160 _console_interaction(test, success_message, failure_message, None, vm=vm)
162 def exec_command(test, command): argument
167 :param test: a test containing a VM.
168 :type test: :class:`qemu_test.QemuSystemTest`
172 _console_interaction(test, None, None, command + '\r')
174 def exec_command_and_wait_for_pattern(test, command, argument
179 content. Mark the test as failed if failure_message is found instead.
181 :param test: a test containing a VM that will have its console
183 :type test: :class:`qemu_test.QemuSystemTest`
185 :param success_message: if this message appears, test succeeds
186 :param failure_message: if this message appears, test fails
189 _console_interaction(test, success_message, failure_message, command + '\r')
191 def get_qemu_img(test): argument
192 test.log.debug('Looking for and selecting a qemu-img binary')
196 qemu_img = test.build_file('qemu-img')
202 test.skipTest(f"qemu-img not found in build dir or '$PATH'")