From 41a378b99c8c4411a66c19e878b7535c67de2ba3 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Wed, 13 Jul 2022 17:21:28 -0300 Subject: [PATCH] 19206: Adds test exposing the bug. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- services/api/test/integration/users_test.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/services/api/test/integration/users_test.rb b/services/api/test/integration/users_test.rb index f3e787e3df..3660d35bad 100644 --- a/services/api/test/integration/users_test.rb +++ b/services/api/test/integration/users_test.rb @@ -480,4 +480,17 @@ class UsersTest < ActionDispatch::IntegrationTest assert_response 403 end + test "disabling system root user not permitted" do + put("/arvados/v1/users/#{users(:system_user).uuid}", + params: { + user: {is_admin: false} + }, + headers: auth(:admin)) + assert_response 422 + + post("/arvados/v1/users/#{users(:system_user).uuid}/unsetup", + params: {}, + headers: auth(:admin)) + assert_response 422 + end end -- 2.30.2