[Buildroot] [git commit] support/testing: TestApache: use read-only rootfs image

Thomas Petazzoni via buildroot <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <[email protected]>
commit: https://gitlab.com/buildroot.org/buildroot/-/commit/0c349a881332d76ef6f0526a3224facc0c8a7a48
branch: https://gitlab.com/buildroot.org/buildroot/-/tree/master

With this the test verifies not only that Apache can work in
principle, but also that it works with a read-only rootfs. Because of
the read-only rootfs the test itself cannot write to /root, so store
the test download in /tmp.

Signed-off-by: Fiona Klute <[email protected]>
Signed-off-by: Thomas Petazzoni <[email protected]>
---
 support/testing/tests/package/test_apache.py | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/support/testing/tests/package/test_apache.py b/support/testing/tests/package/test_apache.py
index f29f4e2524..d44e7927bd 100644
--- a/support/testing/tests/package/test_apache.py
+++ b/support/testing/tests/package/test_apache.py
@@ -1,5 +1,6 @@
 import os
 
+import infra
 import infra.basetest
 
 
@@ -7,17 +8,22 @@ class TestApache(infra.basetest.BRTest):
     config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
         """
         BR2_PACKAGE_APACHE=y
-        BR2_TARGET_ROOTFS_CPIO=y
+        BR2_TARGET_ROOTFS_SQUASHFS=y
+        BR2_TARGET_ROOTFS_SQUASHFS4_LZO=y
         # BR2_TARGET_ROOTFS_TAR is not set
         """
 
     def test_run(self):
-        cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
-        self.emulator.boot(arch="armv5",
+        rootfs = os.path.join(self.builddir, "images", "rootfs.squashfs")
+        infra.img_round_power2(rootfs)
+        self.emulator.boot(arch="armv7",
                            kernel="builtin",
-                           options=["-initrd", cpio_file])
+                           kernel_cmdline=["root=/dev/mmcblk0",
+                                           "rootfstype=squashfs"],
+                           options=["-drive",
+                                    "file={},if=sd,format=raw".format(rootfs)])
         self.emulator.login()
 
         self.assertRunOk("httpd -V")
-        self.assertRunOk("wget http://localhost/index.html")
-        self.assertRunOk("grep -F 'It works!' index.html")
+        self.assertRunOk("wget -O /tmp/index.html http://localhost/index.html")
+        self.assertRunOk("grep -F 'It works!' /tmp/index.html")
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.