support/testing: add prosody test
authorFrancois Perrad <fperrad@gmail.com>
Sat, 24 Nov 2018 09:07:53 +0000 (10:07 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 6 Dec 2018 22:08:59 +0000 (23:08 +0100)
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
.gitlab-ci.yml
support/testing/tests/package/test_prosody.py [new file with mode: 0644]

index a7edaddf3dd14786d242063dbcf653dda5fe27d4..051439cc9302726d27f714b24cbb894e0a1ee477 100644 (file)
@@ -328,6 +328,8 @@ tests.package.test_perl_libwww_perl.TestPerllibwwwperl: *runtime_test
 tests.package.test_perl_mail_dkim.TestPerlMailDKIM: *runtime_test
 tests.package.test_perl_x10.TestPerlX10: *runtime_test
 tests.package.test_perl_xml_libxml.TestPerlXMLLibXML: *runtime_test
+tests.package.test_prosody.TestLua51Prosody: *runtime_test
+tests.package.test_prosody.TestLuajitProsody: *runtime_test
 tests.package.test_python.TestPython2: *runtime_test
 tests.package.test_python.TestPython3: *runtime_test
 tests.package.test_python_argh.TestPythonPy2Argh: *runtime_test
diff --git a/support/testing/tests/package/test_prosody.py b/support/testing/tests/package/test_prosody.py
new file mode 100644 (file)
index 0000000..8ef8ff9
--- /dev/null
@@ -0,0 +1,48 @@
+from tests.package.test_lua import TestLuaBase
+
+
+class TestProsody(TestLuaBase):
+    def lua_dependencies_test(self):
+        self.module_test('bit')     # luabitop
+        self.module_test('lfs')     # luafilesystem
+        self.module_test('lxp')     # luaexpat
+        self.module_test('socket')  # luasocket
+        self.module_test('ssl')     # luasec
+
+    def prosody_test(self):
+        # prosody was launched as service
+        cmd = "prosodyctl status"
+        output, exit_code = self.emulator.run(cmd)
+        self.assertEqual(exit_code, 0)
+        self.assertIn("Prosody is running", output[0])
+
+
+class TestProsodyLua51(TestProsody):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_LUA_5_1=y
+        BR2_PACKAGE_PROSODY=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.version_test('Lua 5.1')
+        self.g_version_test('Lua 5.1')
+        self.lua_dependencies_test()
+        self.prosody_test()
+
+
+class TestProsodyLuajit(TestProsody):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUAJIT=y
+        BR2_PACKAGE_PROSODY=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.version_test('LuaJIT 2')
+        self.g_version_test('Lua 5.1')
+        self.lua_dependencies_test()
+        self.prosody_test()