diff mbox series

[3/4] arm-systemready/oeqa: Add new test for Fedora unattended installation

Message ID 20240726095604.1805688-3-amr.mohamed@arm.com
State New
Headers show
Series [1/4] arm-systemready/linux-distros: new inc file for unattended installation | expand

Commit Message

amr.mohamed@arm.com July 26, 2024, 9:56 a.m. UTC
From: Amr Mohamed <amr.mohamed@arm.com>

The oeqa test responds to the boot loader prompt error message and
waits till the distro installation is finished.

Signed-off-by: Amr Mohamed <amr.mohamed@arm.com>
---
 .../arm_systemready_fedora_unattended.py      | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 meta-arm-systemready/lib/oeqa/runtime/cases/arm_systemready_fedora_unattended.py
diff mbox series

Patch

diff --git a/meta-arm-systemready/lib/oeqa/runtime/cases/arm_systemready_fedora_unattended.py b/meta-arm-systemready/lib/oeqa/runtime/cases/arm_systemready_fedora_unattended.py
new file mode 100644
index 00000000..f607fb12
--- /dev/null
+++ b/meta-arm-systemready/lib/oeqa/runtime/cases/arm_systemready_fedora_unattended.py
@@ -0,0 +1,39 @@ 
+from oeqa.runtime.case import OERuntimeTestCase
+
+
+class SystemReadyFedoraUnattendedTest(OERuntimeTestCase):
+    def setUp(self):
+        super().setUp()
+        self.console = self.target.DEFAULT_CONSOLE
+
+    def test_fedora_unattended(self):
+        # Turn on the FVP.
+        self.target.transition('on')
+
+        # Timeout value = elapsed time * 2; where elapsed time was collected
+        # from the elapsed time in the log.do_testimage for each function after
+        # the build is finished on the development machine.
+        self.target.expect(self.console,
+                           '  Booting `Install Fedora 39\'',
+                           timeout=(2 * 60))
+        bb.plain('Installation status: Loading the installer, kernel and initrd...')
+
+        self.target.expect(self.console,
+                           'Setting up the installation environment',
+                           timeout=(2 * 60 * 60))
+        bb.plain('Installation status: Setting up the installation environment...')
+
+        self.target.expect(self.console,
+                           'Installing the software',
+                           timeout=(30 * 60))
+        bb.plain('Installation status: Installing the software packages...')
+
+        # Waiting to respond to the boot loader prompt error message.
+        self.target.expect(self.console,
+                           'Please respond \'yes\' or \'no\': ',
+                           timeout=(16 * 60 * 60))
+        self.target.sendline(self.console, 'yes')
+
+        # Waiting till the installation is finished.
+        self.target.expect(self.console, r'.*login: ', timeout=(5 * 60 * 60))
+        bb.plain('Installation status: Fedora installation finished successfully.')