aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--erlang.mk12
-rw-r--r--rebar.config2
-rw-r--r--test/http_SUITE.erl14
-rw-r--r--test/http_SUITE_data/ssl/cert.pem14
-rw-r--r--test/http_SUITE_data/ssl/key.pem18
6 files changed, 17 insertions, 47 deletions
diff --git a/Makefile b/Makefile
index dfdd851..a743a2d 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,9 @@ PLT_APPS = crypto public_key ssl
# Dependencies.
DEPS = ranch
-dep_ranch = https://github.com/extend/ranch.git 0.8.1
+TEST_DEPS = ct_helper
+dep_ranch = https://github.com/extend/ranch.git 0.8.2
+dep_ct_helper = https://github.com/extend/ct_helper.git master
# Standard targets.
diff --git a/erlang.mk b/erlang.mk
index 50e2530..9e4c698 100644
--- a/erlang.mk
+++ b/erlang.mk
@@ -34,6 +34,7 @@ DEPS_DIR ?= $(CURDIR)/deps
export DEPS_DIR
ALL_DEPS_DIRS = $(addprefix $(DEPS_DIR)/,$(DEPS))
+ALL_TEST_DEPS_DIRS = $(addprefix $(DEPS_DIR)/,$(TEST_DEPS))
# Application.
@@ -56,7 +57,7 @@ app: ebin/$(PROJECT).app
ebin/$(PROJECT).app: src/*.erl
@mkdir -p ebin/
- $(erlc_verbose) erlc -v $(ERLC_OPTS) -o ebin/ -pa ebin/ \
+ $(erlc_verbose) ERL_LIBS=deps erlc -v $(ERLC_OPTS) -o ebin/ -pa ebin/ \
$(COMPILE_FIRST_PATHS) $?
clean:
@@ -94,7 +95,12 @@ clean-docs:
# Tests.
-build-tests:
+$(foreach dep,$(TEST_DEPS),$(eval $(call dep_target,$(dep))))
+
+build-test-deps: $(ALL_TEST_DEPS_DIRS)
+ @for dep in $(ALL_TEST_DEPS_DIRS) ; do $(MAKE) -C $$dep; done
+
+build-tests: build-test-deps
$(gen_verbose) erlc -v $(ERLC_OPTS) -o test/ \
$(wildcard test/*.erl test/*/*.erl) -pa ebin/
@@ -123,7 +129,7 @@ DIALYZER_OPTS ?= -Werror_handling -Wrace_conditions \
build-plt: deps app
@dialyzer --build_plt --output_plt .$(PROJECT).plt \
- --apps erts kernel stdlib $(PLT_APPS) $(ALL_DEPS_DIR)
+ --apps erts kernel stdlib $(PLT_APPS) $(ALL_DEPS_DIRS)
dialyze:
@dialyzer --src src --plt .$(PROJECT).plt --no_native $(DIALYZER_OPTS)
diff --git a/rebar.config b/rebar.config
index 7367e6d..123b3ee 100644
--- a/rebar.config
+++ b/rebar.config
@@ -1,3 +1,3 @@
{deps, [
- {ranch, ".*", {git, "git://github.com/extend/ranch.git", "0.8.1"}}
+ {ranch, ".*", {git, "git://github.com/extend/ranch.git", "0.8.2"}}
]}.
diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl
index 98d4376..21cdd4b 100644
--- a/test/http_SUITE.erl
+++ b/test/http_SUITE.erl
@@ -209,11 +209,8 @@ init_per_group(http, Config) ->
{transport, Transport}, {client, Client}|Config1];
init_per_group(https, Config) ->
Transport = ranch_ssl,
- Opts = [
- {certfile, ?config(data_dir, Config) ++ "ssl/cert.pem"},
- {keyfile, ?config(data_dir, Config) ++ "ssl/key.pem"},
- {password, "cowboy"}
- ],
+ {_, Cert, Key} = ct_helper:make_certs(),
+ Opts = [{cert, Cert}, {key, Key}],
Config1 = init_static_dir(Config),
application:start(public_key),
application:start(ssl),
@@ -241,11 +238,8 @@ init_per_group(http_compress, Config) ->
{transport, Transport}, {client, Client}|Config1];
init_per_group(https_compress, Config) ->
Transport = ranch_ssl,
- Opts = [
- {certfile, ?config(data_dir, Config) ++ "ssl/cert.pem"},
- {keyfile, ?config(data_dir, Config) ++ "ssl/key.pem"},
- {password, "cowboy"}
- ],
+ {_, Cert, Key} = ct_helper:make_certs(),
+ Opts = [{cert, Cert}, {key, Key}],
Config1 = init_static_dir(Config),
application:start(public_key),
application:start(ssl),
diff --git a/test/http_SUITE_data/ssl/cert.pem b/test/http_SUITE_data/ssl/cert.pem
deleted file mode 100644
index a772007..0000000
--- a/test/http_SUITE_data/ssl/cert.pem
+++ /dev/null
@@ -1,14 +0,0 @@
------BEGIN CERTIFICATE-----
-MIICKTCCAZICCQCl9gdHk5NqUjANBgkqhkiG9w0BAQUFADBZMQswCQYDVQQGEwJB
-VTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
-cyBQdHkgTHRkMRIwEAYDVQQDDAlsb2NhbGhvc3QwHhcNMTEwNDA4MTMxNTE3WhcN
-MTEwNTA4MTMxNTE3WjBZMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0
-ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMRIwEAYDVQQDDAls
-b2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOjgFPS0dP4d8F1e
-bNJPB+kAjM2FyTZGmkFCLUYONTPrdGOUIHL/UOGtU22BQzlskE+a6/j2Kg72tm8x
-4X7yf+6s7CdRe086idNx9+GymZ64ZTnly33rD3AJffbBeWHwT2e9fuBeFk9WGC8v
-kqECFZyqf7+znS0o48oBNcx3ePB5AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEASTkv
-oHuZyO8DgT8bIE6W3yM2fvlNshkhh7Thgpf32qQoVOxRU9EF0KpuJCCAHQHQNQlI
-nf9Zc4UzOrLhxZBGocNhkkn4WLw2ysto/7+/+9xHah0M0l4auHLQagVLCoOsHUn2
-JX+A2NrbvuX5wnUrZGOdgY70tvMBeU/xLtp3af8=
------END CERTIFICATE-----
diff --git a/test/http_SUITE_data/ssl/key.pem b/test/http_SUITE_data/ssl/key.pem
deleted file mode 100644
index 0b699cc..0000000
--- a/test/http_SUITE_data/ssl/key.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN RSA PRIVATE KEY-----
-Proc-Type: 4,ENCRYPTED
-DEK-Info: DES-EDE3-CBC,F11262DB77BB804C
-
-jOJ+ft/dihIxz7CTuuK47fCTGdX7xMLANmA7mRg8y9OYhNZQiCz5GjcWLqe0NNl5
-qXPW0uvT/9B5O9o21Y2i/CKU1BqRLuXHXDsjHg7RGaSH6wIavWt+lR+I1sjieFbX
-VByK1KHXjEU704DEILKJIA9gVzoYAgMzo+FTw2e/2jusXntxk8HXyF5zKTzjHBtI
-NQGweJqTmfZjX3SgPP4Co/ShrA6fUG0uTp1HwbByJnwtAeT3xWJrAD4QSn7+qrlv
-3qmEIqVXsvLrfZRY1WZ4uIsbLK8wkvxboSIoIK55VV9R2zRbwQULon6QJwKYujAr
-J2WUYkHHQOMpaAzUmalaT+8GUt8/A1oSK4BdiSZywsMMm46/hDadXBzFg+dPL5g2
-Td+7/L0S6tUVWq4+YBp5EalZH6VQ4cqPYDJZUZ9xt6+yY7V5748lSdA7cHCROnbG
-bKbSW9WbF7MPDHCjvCAfq+s1dafHJgyIOlMg2bm7V8eHWAA0xKQ/o7i5EyEyaKYR
-UXGeAf+KfXcclEZ77v2RCXZvd6ceWkifm59qWv/3TCYaHiS2Aa3lVToMKTwYzzXQ
-p5X5os6wv3IAi2nGyAIOoSDisdHmFteZNXNQsw0n3XCAYfsNMk+r5/r5YqDffURH
-c8SMOCP4BIPoZ/abi/gnEntGqsx1YALg0aosHwHGDJ/l+QJC6u6PZk310YzRw4GL
-K9+wscFgEub2OO+R83Vkfesj4tYzgOjab7+92a/soHdW0zhGejlvehODOgNZ6NUG
-MPQlT+qpF9Jh5IThYXupXXFzJzQe3O/qVXy89m69JGa+AWRvbu+M/A==
------END RSA PRIVATE KEY-----