Browse Source

Disable eacces tests on Windows

Windows apparently does not have privileged ports, anyone
can open sockets on ports < 1024.
Loïc Hoguin 7 years ago
parent
commit
729a23f925
1 changed files with 21 additions and 12 deletions
  1. 21 12
      test/acceptor_SUITE.erl

+ 21 - 12
test/acceptor_SUITE.erl

@@ -282,12 +282,17 @@ ssl_error_no_cert(_) ->
 	ok.
 
 ssl_error_eacces(_) ->
-	doc("Ensure that failure due to an eacces returns a compact readable error."),
-	Name = name(),
-	Opts = ct_helper:get_certs_from_ets(),
-	{error, eacces} = ranch:start_listener(Name,
-		ranch_ssl, [{port, 283}|Opts], active_echo_protocol, []),
-	ok.
+	case os:type() of
+		{win32, nt} ->
+			doc("There are no privileged ports on Windows.");
+		_ ->
+			doc("Ensure that failure due to an eacces returns a compact readable error."),
+			Name = name(),
+			Opts = ct_helper:get_certs_from_ets(),
+			{error, eacces} = ranch:start_listener(Name,
+				ranch_ssl, [{port, 283}|Opts], active_echo_protocol, []),
+			ok
+	end.
 
 %% tcp.
 
@@ -493,12 +498,16 @@ tcp_error_eaddrinuse(_) ->
 	ok.
 
 tcp_error_eacces(_) ->
-	doc("Ensure that failure due to an eacces returns a compact readable error."),
-	Name = name(),
-	{error, eacces} = ranch:start_listener(Name,
-		ranch_tcp, [{port, 283}], active_echo_protocol, []),
-	ok.
-
+	case os:type() of
+		{win32, nt} ->
+			doc("There are no privileged ports on Windows.");
+		_ ->
+			doc("Ensure that failure due to an eacces returns a compact readable error."),
+			Name = name(),
+			{error, eacces} = ranch:start_listener(Name,
+				ranch_tcp, [{port, 283}], active_echo_protocol, []),
+			ok
+	end.
 
 %% Supervisor tests