Просмотр исходного кода

Skip SNI tests on OTP<18 in CI

Loïc Hoguin 8 лет назад
Родитель
Сommit
9a8e5b5733
2 измененных файлов с 17 добавлено и 2 удалено
  1. 9 2
      Makefile
  2. 8 0
      test/acceptor_SUITE.erl

+ 9 - 2
Makefile

@@ -8,12 +8,19 @@ COMPILE_FIRST = ranch_transport
 CT_OPTS += -pa test -ct_hooks ranch_ct_hook []
 PLT_APPS = crypto public_key ssl
 
-CI_OTP ?= \
+CI_OTP_NO_SNI = \
 	OTP_R16B OTP_R16B01 OTP_R16B02 OTP_R16B03-1 \
-	OTP-17.1.2 OTP-17.2.2 OTP-17.3.4 OTP-17.4.1 OTP-17.5.6.6 \
+	OTP-17.1.2 OTP-17.2.2 OTP-17.3.4 OTP-17.4.1 OTP-17.5.6.6
+CI_OTP ?= $(CI_OTP_NO_SNI) \
 	OTP-18.0.3 OTP-18.1.5 OTP-18.2.4.1 OTP-18.3.4.4 \
 	OTP-19.0.7 OTP-19.1.5
 
+ifdef CI_OTP_RELEASE
+ifneq ($(filter $(CI_OTP_RELEASE),$(CI_OTP_NO_SNI)),)
+TEST_ERLC_OPTS += -DTEST_NO_SNI=1
+endif
+endif
+
 # Dependencies.
 
 TEST_DEPS = ct_helper

+ 8 - 0
test/acceptor_SUITE.erl

@@ -134,6 +134,13 @@ ssl_echo(_) ->
 	{'EXIT', _} = begin catch ranch:get_port(Name) end,
 	ok.
 
+-ifdef(TEST_NO_SNI).
+ssl_sni_echo(_) ->
+	{skip, "No SNI support."}.
+
+ssl_sni_fail(_) ->
+	{skip, "No SNI support."}.
+-else.
 ssl_sni_echo(_) ->
 	doc("Ensure that SNI works with SSL transport."),
 	Name = name(),
@@ -160,6 +167,7 @@ ssl_sni_fail(_) ->
 	%% Make sure the listener stopped.
 	{'EXIT', _} = begin catch ranch:get_port(Name) end,
 	ok.
+-endif.
 
 %% tcp.