2019-09-29 14:55:20 +02:00
|
|
|
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")
|
2021-11-12 20:06:46 +01:00
|
|
|
self.emulator.boot(arch="armv5",
|
2019-09-29 14:55:20 +02:00
|
|
|
kernel="builtin",
|
|
|
|
options=["-initrd", cpio_file])
|
|
|
|
self.emulator.login()
|
|
|
|
|
|
|
|
def version_test(self):
|
|
|
|
cmd = "luvi -v"
|
|
|
|
output, exit_code = self.emulator.run(cmd)
|
2021-11-12 20:06:50 +01:00
|
|
|
output = sorted(output)
|
|
|
|
self.assertIn('libuv', output[0])
|
|
|
|
self.assertIn('luvi', output[1])
|
2019-09-29 14:55:20 +02:00
|
|
|
self.assertIn('rex', output[2])
|
2021-11-12 20:06:50 +01:00
|
|
|
self.assertIn('ssl', output[3])
|
|
|
|
self.assertIn('zlib', output[4])
|
2019-09-29 14:55:20 +02:00
|
|
|
|
|
|
|
def test_run(self):
|
|
|
|
self.login()
|
|
|
|
self.version_test()
|