support/testing: add lua-http test
authorFrancois Perrad <fperrad@gmail.com>
Thu, 28 Mar 2019 17:20:47 +0000 (18:20 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 28 Mar 2019 18:01:00 +0000 (19:01 +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_lua_http.py [new file with mode: 0644]

index b89df337555c99684caaf6a9b030c28dec30173e..68f542f679aa04020dc775bf0f67295686aaf0c8 100644 (file)
@@ -334,6 +334,8 @@ tests.package.test_lua.TestLua: { extends: .runtime_test }
 tests.package.test_lua.TestLuajit: { extends: .runtime_test }
 tests.package.test_lua_curl.TestLuaLuacURL: { extends: .runtime_test }
 tests.package.test_lua_curl.TestLuajitLuacURL: { extends: .runtime_test }
+tests.package.test_lua_http.TestLuaHttp: { extends: .runtime_test }
+tests.package.test_lua_http.TestLuajitHttp: { extends: .runtime_test }
 tests.package.test_lua_utf8.TestLuaUtf8: { extends: .runtime_test }
 tests.package.test_lua_utf8.TestLuajitUtf8: { extends: .runtime_test }
 tests.package.test_luaexpat.TestLuaLuaExpat: { extends: .runtime_test }
diff --git a/support/testing/tests/package/test_lua_http.py b/support/testing/tests/package/test_lua_http.py
new file mode 100644 (file)
index 0000000..ba6096a
--- /dev/null
@@ -0,0 +1,37 @@
+from tests.package.test_lua import TestLuaBase
+
+
+class TestLuaHttp(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_LUA_HTTP=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("http.version", script="local ver=require[[http.version]]; print(ver.name, ver.version)")
+        self.module_test("http.client")
+        self.module_test("http.cookie")
+        self.module_test("http.proxies")
+        self.module_test("http.server")
+        self.module_test("http.socks")
+        self.module_test("http.websocket")
+
+
+class TestLuajitHttp(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUAJIT=y
+        BR2_PACKAGE_LUA_HTTP=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("http.version", script="local ver=require[[http.version]]; print(ver.name, ver.version)")
+        self.module_test("http.client")
+        self.module_test("http.cookie")
+        self.module_test("http.proxies")
+        self.module_test("http.server")
+        self.module_test("http.socks")
+        self.module_test("http.websocket")