1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
7 class KeepProxyTest < ActionDispatch::IntegrationTest
8 test "request keep disks" do
9 get "/arvados/v1/keep_services/accessible",
10 params: {:format => :json},
11 headers: auth(:active)
12 assert_response :success
13 services = json_response['items']
15 assert_operator 2, :<=, services.length
16 services.each do |service|
17 assert_equal 'disk', service['service_type']
21 test "request keep proxy" do
22 get "/arvados/v1/keep_services/accessible",
23 params: {:format => :json},
24 headers: auth(:active).merge({'HTTP_X_EXTERNAL_CLIENT' => '1'})
25 assert_response :success
26 services = json_response['items']
28 assert_equal 1, services.length
30 assert_equal keep_services(:proxy).uuid, services[0]['uuid']
31 assert_equal keep_services(:proxy).service_host, services[0]['service_host']
32 assert_equal keep_services(:proxy).service_port, services[0]['service_port']
33 assert_equal keep_services(:proxy).service_ssl_flag, services[0]['service_ssl_flag']
34 assert_equal 'proxy', services[0]['service_type']