summaryrefslogtreecommitdiffstats
path: root/support/testing/tests/package/test_prosody.py
blob: 8ef8ff95ff9a009ae0d0ae2f89c49e5f2dc0ffa3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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()
OpenPOWER on IntegriCloud