Skip to content

Commit 452ffc3

Browse files
committed
test: add check on unsupported ssl
1 parent 377163b commit 452ffc3

File tree

5 files changed

+30
-1
lines changed

5 files changed

+30
-1
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@ jobs:
1212
matrix:
1313
tarantool: ['1.10', '2.10', '2.11', '3.1', '3.2']
1414
coveralls: [false]
15+
static-build: [false]
1516
include:
1617
- tarantool: '2.11'
1718
coveralls: true
19+
static-build: false
20+
- tarantool: '3.5'
21+
coveralls: false
22+
static-build: true
1823
runs-on: [ubuntu-22.04]
1924
steps:
2025
- uses: actions/checkout@master
@@ -32,9 +37,14 @@ jobs:
3237
env:
3338
DEBIAN_FRONTEND: noninteractive
3439

35-
- name: Install Tarantool
40+
- name: Install dynamic Tarantool
41+
if: matrix.static-build == false
3642
run: tt install tarantool ${{ matrix.tarantool }} --dynamic
3743

44+
- name: Install static Tarantool
45+
if: matrix.static-build == true
46+
run: tt install tarantool ${{ matrix.tarantool }}
47+
3848
- name: Cache rocks
3949
uses: actions/cache@v3
4050
id: cache-rocks

test/helpers.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,9 @@ helpers.tcp_connection_exists = function(host, port)
148148
return ok
149149
end
150150

151+
helpers.skip_if_ssl_not_enabled = function()
152+
local has_ssl, _ = pcall(require('ffi').load, 'ssl')
153+
luatest.skip_if(not has_ssl, 'tarantool supports ssl')
154+
end
155+
151156
return helpers

test/integration/http_tls_enabled_test.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ for name, tc in pairs(server_test_cases) do
5656
end)
5757

5858
g[name] = function()
59+
helpers.skip_if_ssl_not_enabled()
5960
t.assert_error_msg_contains(tc.expected_err_msg, function()
6061
g.httpd:start()
6162
end)
@@ -225,6 +226,7 @@ for name, tc in pairs(client_test_cases) do
225226
end)
226227

227228
g[name] = function()
229+
helpers.skip_if_ssl_not_enabled()
228230
local req_opts = http_server.internal.extend({
229231
-- We need to provide ca_file by default because curl uses the
230232
-- system native CA store for verification.

test/integration/http_tls_enabled_validate_test.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,21 @@ local test_cases = {
111111
},
112112
expected_err_msg = '"unknown" option not exists. Available options: "on", "off", "optional"'
113113
},
114+
ssl_not_supported = {
115+
check_ssl = true,
116+
opts = {
117+
ssl_cert_file = fio.pathjoin(ssl_data_dir, 'server.crt'),
118+
ssl_key_file = fio.pathjoin(ssl_data_dir, 'server.key'),
119+
},
120+
expected_err_msg = 'ssl socket is not supported',
121+
}
114122
}
115123

116124
for name, case in pairs(test_cases) do
117125
g['test_ssl_option_' .. name] = function()
126+
if case.checks_ssl == nil then
127+
helpers.skip_if_ssl_not_enabled()
128+
end
118129
t.assert_error_msg_contains(case.expected_err_msg, function()
119130
http_server.new('host', 8080, case.opts)
120131
end)

test/integration/httpd_role_test.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ g.before_each(function(cg)
9595

9696
local cfg = config
9797
if cg.params.use_tls then
98+
helpers.skip_if_ssl_not_enabled()
9899
cfg = tls_config
99100
end
100101

0 commit comments

Comments
 (0)