1import os 2 3import infra.basetest 4 5 6class TestLuvi(infra.basetest.BRTest): 7 config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \ 8 """ 9 BR2_TARGET_ROOTFS_CPIO=y 10 # BR2_TARGET_ROOTFS_TAR is not set 11 BR2_PACKAGE_LUAJIT=y 12 BR2_PACKAGE_LUVI=y 13 BR2_PACKAGE_OPENSSL=y 14 BR2_PACKAGE_PCRE=y 15 BR2_PACKAGE_ZLIB=y 16 """ 17 18 def login(self): 19 cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio") 20 self.emulator.boot(arch="armv5", 21 kernel="builtin", 22 options=["-initrd", cpio_file]) 23 self.emulator.login() 24 25 def version_test(self): 26 cmd = "luvi -v" 27 output, exit_code = self.emulator.run(cmd) 28 output = sorted(output) 29 self.assertIn('libuv', output[0]) 30 self.assertIn('luvi', output[1]) 31 self.assertIn('rex', output[2]) 32 self.assertIn('ssl', output[3]) 33 self.assertIn('zlib', output[4]) 34 35 def test_run(self): 36 self.login() 37 self.version_test() 38