[ARVADOS] updated: 943b3e807126ba5dc936ceeeddbee9801dab7308
Git user
git at public.curoverse.com
Tue Jul 18 11:21:42 EDT 2017
Summary of changes:
.../arvados/v1/healthcheck_controller_test.rb | 30 ++++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 services/api/test/functional/arvados/v1/healthcheck_controller_test.rb
via 943b3e807126ba5dc936ceeeddbee9801dab7308 (commit)
from 3bbe6cfeb45325554c97c674770ca64f2d367b83 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 943b3e807126ba5dc936ceeeddbee9801dab7308
Author: radhika <radhika at curoverse.com>
Date: Tue Jul 18 11:21:16 2017 -0400
11906: added api ping tests
Arvados-DCO-1.1-Signed-off-by: Radhika Chippada <radhika at curoverse.com>
diff --git a/services/api/test/functional/arvados/v1/healthcheck_controller_test.rb b/services/api/test/functional/arvados/v1/healthcheck_controller_test.rb
new file mode 100644
index 0000000..10d493b
--- /dev/null
+++ b/services/api/test/functional/arvados/v1/healthcheck_controller_test.rb
@@ -0,0 +1,30 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+require 'test_helper'
+
+class Arvados::V1::HealthcheckControllerTest < ActionController::TestCase
+ [
+ [false, nil, 404, 'disabled'],
+ [true, nil, 401, 'authorization required'],
+ [true, 'badformatwithnoBearer', 403, 'authorization error'],
+ [true, 'Bearer wrongtoken', 403, 'authorization error'],
+ [true, 'Bearer configuredmanagementtoken', 200, '{"health":"OK"}'],
+ ].each do |enabled, header, error_code, error_msg|
+ test "ping when #{if enabled then 'enabled' else 'disabled' end} with header '#{header}'" do
+ Rails.configuration.management_token = 'configuredmanagementtoken' if enabled
+
+ @request.headers['Authorization'] = header
+ get :ping
+ assert_response error_code
+
+ resp = JSON.parse(@response.body)
+ if error_code == 200
+ assert_equal(JSON.load('{"health":"OK"}'), resp)
+ else
+ assert_includes(resp['errors'], error_msg)
+ end
+ end
+ end
+end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list