[Buildroot] [git commit] support/testing: add luvi test

Thomas Petazzoni thomas.petazzoni at bootlin.com
Sat Oct 26 14:33:12 UTC 2019


commit: https://git.buildroot.net/buildroot/commit/?id=76b4fcb5dc0eb9f19060a8d7ca9dde087138d62c
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Signed-off-by: Francois Perrad <francois.perrad at gadz.org>
Reviewed-by: Ricardo Martincoski <ricardo.martincoski at gmail.com>
Tested-by: Ricardo Martincoski <ricardo.martincoski at gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
---
 .gitlab-ci.yml                             |  1 +
 support/testing/tests/package/test_luvi.py | 36 ++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c689039007..e4aa0bea4d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -408,6 +408,7 @@ tests.package.test_luasocket.TestLuaLuaSocket: { extends: .runtime_test }
 tests.package.test_luasocket.TestLuajitLuaSocket: { extends: .runtime_test }
 tests.package.test_luasyslog.TestLuaLuasyslog: { extends: .runtime_test }
 tests.package.test_luasyslog.TestLuajitLuasyslog: { extends: .runtime_test }
+tests.package.test_luvi.TestLuvi: { extends: .runtime_test }
 tests.package.test_lzlib.TestLuaLzlib: { extends: .runtime_test }
 tests.package.test_openjdk.TestOpenJdk: { extends: .runtime_test }
 tests.package.test_perl.TestPerl: { extends: .runtime_test }
diff --git a/support/testing/tests/package/test_luvi.py b/support/testing/tests/package/test_luvi.py
new file mode 100644
index 0000000000..a85a6f4d27
--- /dev/null
+++ b/support/testing/tests/package/test_luvi.py
@@ -0,0 +1,36 @@
+import os
+
+import infra.basetest
+
+
+class TestLuvi(infra.basetest.BRTest):
+    config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+        """
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        BR2_PACKAGE_LUAJIT=y
+        BR2_PACKAGE_LUVI=y
+        BR2_PACKAGE_OPENSSL=y
+        BR2_PACKAGE_PCRE=y
+        BR2_PACKAGE_ZLIB=y
+        """
+
+    def login(self):
+        cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+        self.emulator.boot(arch="armv7",
+                           kernel="builtin",
+                           options=["-initrd", cpio_file])
+        self.emulator.login()
+
+    def version_test(self):
+        cmd = "luvi -v"
+        output, exit_code = self.emulator.run(cmd)
+        self.assertIn('luvi', output[0])
+        self.assertIn('zlib', output[1])
+        self.assertIn('rex', output[2])
+        self.assertIn('libuv', output[3])
+        self.assertIn('ssl', output[4])
+
+    def test_run(self):
+        self.login()
+        self.version_test()


More information about the buildroot mailing list