diff mbox series

[styhead,4/5] arm-systemready/oeqa: Add unattended installation testcase

Message ID 20250115142246.3825897-4-musa.antike@arm.com
State New
Headers show
Series [styhead,1/5] arm-systemready/linux-distros: Move Fedora unattended conf to SRC_URI | expand

Commit Message

Musa Antike Jan. 15, 2025, 2:22 p.m. UTC
Add test for Debian unattended installation verification

Signed-off-by: Musa Antike <musa.antike@arm.com>
---
 .../arm_systemready_debian_unattended.py      | 66 +++++++++++++++++++
 .../arm-systemready-linux-distros-debian.bb   |  2 +
 2 files changed, 68 insertions(+)
 create mode 100644 meta-arm-systemready/lib/oeqa/runtime/cases/arm_systemready_debian_unattended.py
diff mbox series

Patch

diff --git a/meta-arm-systemready/lib/oeqa/runtime/cases/arm_systemready_debian_unattended.py b/meta-arm-systemready/lib/oeqa/runtime/cases/arm_systemready_debian_unattended.py
new file mode 100644
index 00000000..3c3a2a48
--- /dev/null
+++ b/meta-arm-systemready/lib/oeqa/runtime/cases/arm_systemready_debian_unattended.py
@@ -0,0 +1,66 @@ 
+from oeqa.runtime.case import OERuntimeTestCase
+
+
+class SystemReadyDebianUnattendedTest(OERuntimeTestCase):
+    def setUp(self):
+        super().setUp()
+        self.console = self.target.DEFAULT_CONSOLE
+
+    def test_debian_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,
+                           r'.*Scanning installation',
+                           timeout=(20 * 60))
+        bb.plain('Installation status: Scanning installation media...')
+
+        self.target.expect(self.console,
+                           r'.*Detecting network hardware',
+                           timeout=(35 * 60))
+        bb.plain('Installation status: Detecting network hardware...')
+
+        self.target.expect(self.console,
+                           r'.*Installing the base system',
+                           timeout=(35 * 60))
+        bb.plain('Installation status: Installing the base system...')
+
+        self.target.expect(self.console,
+                           r'.*Installing GRUB',
+                           timeout=(7 * 60 * 60))
+        bb.plain('Installation status: Installing GRUB...')
+
+        # Waiting to respond to the boot loader prompt error message.
+        self.target.expect(self.console,
+                           r'.*Press enter to continue',
+                           timeout=(15 * 60))
+        self.target.sendline(self.console, '')
+
+        self.target.expect(self.console,
+                           r'.*Press enter to continue',
+                           timeout=(60))
+        self.target.sendline(self.console, '')
+
+        # Waiting to respond continue without bootloader to install
+        # bootloader with the late script in preseed.cfg at the end.
+        self.target.expect(self.console,
+                           r'.*Continue without boot loader',
+                           timeout=(2 * 60))
+        self.target.sendline(self.console, '14')
+
+        self.target.expect(self.console,
+                           r'.*Press enter to continue',
+                           timeout=(60))
+        self.target.sendline(self.console, '')
+
+        self.target.expect(self.console,
+                           r'.*Finishing the installation',
+                           timeout=(2 * 60))
+        bb.plain('Installation status: Finishing the installation...')
+
+        # Waiting till the installation is finished.
+        self.target.expect(self.console, r'.*login:', timeout=(40 * 60))
+        bb.plain('Installation status: Debian installation finished successfully.')
diff --git a/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-debian.bb b/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-debian.bb
index 5e5ebc31..daeec6cb 100644
--- a/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-debian.bb
+++ b/meta-arm-systemready/recipes-test/arm-systemready-linux-distros/arm-systemready-linux-distros-debian.bb
@@ -105,6 +105,8 @@  SRC_URI = "\
     "
 SRC_URI[debian_iso_image.sha256sum] = "8891fe48bb5a58ae54176eaa6440059bf852044d6b9ae77219e78f9ef8d65149"
 
+TEST_SUITES = "${@oe.utils.vartrue("DISTRO_UNATTENDED_INST_TESTS", "arm_systemready_debian_unattended", "", d)}"
+
 ISO_LABEL = "${@oe.utils.vartrue("DISTRO_UNATTENDED_INST_TESTS", "debian-12.8.0-arm64-1", "", d)}"
 BOOT_CATALOG = "${@oe.utils.vartrue("DISTRO_UNATTENDED_INST_TESTS", "boot.catalog", "", d)}"
 BOOT_IMAGE = "${@oe.utils.vartrue("DISTRO_UNATTENDED_INST_TESTS", "EFI/boot/bootaa64.efi", "", d)}"