Skip to content

Commit 89f5f4f

Browse files
committed
test: add check on unsupported ssl
1 parent 377163b commit 89f5f4f

File tree

5 files changed

+41
-1
lines changed

5 files changed

+41
-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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,14 @@ helpers.tcp_connection_exists = function(host, port)
148148
return ok
149149
end
150150

151+
local has_ssl, _ = pcall(require('ffi').load, 'ssl')
152+
153+
helpers.skip_if_ssl_not_enabled = function()
154+
luatest.skip_if(not has_ssl, 'tarantool does not supports ssl')
155+
end
156+
157+
helpers.skip_if_ssl_enabled = function()
158+
luatest.skip_if(has_ssl, 'tarantool supports ssl')
159+
end
160+
151161
return helpers

test/integration/http_tls_enabled_test.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ local g = t.group('ssl')
99

1010
local ssl_data_dir = fio.pathjoin(helpers.get_testdir_path(), "ssl_data")
1111

12+
g.before_all(function()
13+
helpers.skip_if_ssl_not_enabled()
14+
end)
15+
1216
local server_test_cases = {
1317
test_key_password_missing = {
1418
ssl_opts = {

test/integration/http_tls_enabled_validate_test.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,22 @@ local test_cases = {
111111
},
112112
expected_err_msg = '"unknown" option not exists. Available options: "on", "off", "optional"'
113113
},
114+
ssl_socket_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+
helpers.skip_if_ssl_not_enabled()
127+
if case.check_ssl == true then
128+
helpers.skip_if_ssl_enabled()
129+
end
118130
t.assert_error_msg_contains(case.expected_err_msg, function()
119131
http_server.new('host', 8080, case.opts)
120132
end)

test/integration/httpd_role_test.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ tls_config.groups['group-001'].replicasets['replicaset-001'].roles_cfg['roles.ht
8888
tls_config.groups['group-001'].replicasets['replicaset-001'].roles_cfg['roles.httpd'].default
8989
.ssl_password_file = fio.pathjoin(ssl_data_dir, 'passwords')
9090

91+
g.before_all(function()
92+
helpers.skip_if_ssl_not_enabled()
93+
end)
94+
9195
g.before_each(function(cg)
9296
helpers.skip_if_not_tarantool3()
9397

0 commit comments

Comments
 (0)