diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2021-01-08 17:13:02 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2021-01-08 17:13:02 +0100 |
commit | 9d89d0f4e45a504a552f63842d24273a397bd34d (patch) | |
tree | 1c8f1483de938b62e26fc46b36679fa54c1741e3 | |
parent | 7c771b0d2d01b26a919c629c2cd9af142991ef4a (diff) | |
download | drminfo-9d89d0f4e45a504a552f63842d24273a397bd34d.tar.gz |
fix init for fedora 33 dracut
-rw-r--r-- | tests/drminfo/__init__.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/drminfo/__init__.py b/tests/drminfo/__init__.py index 492d751..2362747 100644 --- a/tests/drminfo/__init__.py +++ b/tests/drminfo/__init__.py @@ -174,7 +174,10 @@ class TestDRM(avocado.Test): self.lcommand = logging.getLogger('command') self.console_wait('Entering emergency mode') - self.console_run('PS1=---\\\\u---\\\\n') + self.console_wait_char('continue): ') + self.console_send() + self.console_wait_char('# ') + self.console_send('PS1=---\\\\u---\\\\n') self.console_wait('---root---') def console_send(self, line = ""): @@ -195,6 +198,23 @@ class TestDRM(avocado.Test): if '--[ end trace' in msg: break + def console_wait_char(self, good): + msg = "" + counter = 1 + while True: + char = self.rconsole.read(1) + if char == '\n': + if len(msg) != 0: + self.lconsole.debug("%3d: %s [line]" % (counter, msg)) + counter += 1 + msg = "" + else: + msg += char + if good in msg: + break + if len(msg) != 0: + self.lconsole.debug("%3d: %s [match]" % (counter, msg)) + def console_wait(self, good, bad = None, errmsg = None): output = "" counter = 1 |