From 424f3c6336d9862d780b3431ec57c4107527c7d4 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Fri, 7 Jul 2023 12:50:23 +0200 Subject: [PATCH] remove the security_users from project suites since it is already in common --- .../test_suites/observability/index.ts | 1 - .../observability/security_users.ts | 31 ------------------- .../test_suites/search/index.ts | 1 - .../test_suites/search/security_users.ts | 31 ------------------- .../test_suites/security/index.ts | 1 - .../test_suites/security/security_users.ts | 31 ------------------- 6 files changed, 96 deletions(-) delete mode 100644 x-pack/test_serverless/api_integration/test_suites/observability/security_users.ts delete mode 100644 x-pack/test_serverless/api_integration/test_suites/search/security_users.ts delete mode 100644 x-pack/test_serverless/api_integration/test_suites/security/security_users.ts diff --git a/x-pack/test_serverless/api_integration/test_suites/observability/index.ts b/x-pack/test_serverless/api_integration/test_suites/observability/index.ts index 1b571e6e0f7a5..1020ebc74d551 100644 --- a/x-pack/test_serverless/api_integration/test_suites/observability/index.ts +++ b/x-pack/test_serverless/api_integration/test_suites/observability/index.ts @@ -9,7 +9,6 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ loadTestFile }: FtrProviderContext) { describe('serverless observability API', function () { - loadTestFile(require.resolve('./security_users')); loadTestFile(require.resolve('./snapshot_telemetry')); }); } diff --git a/x-pack/test_serverless/api_integration/test_suites/observability/security_users.ts b/x-pack/test_serverless/api_integration/test_suites/observability/security_users.ts deleted file mode 100644 index b3ccb00830b26..0000000000000 --- a/x-pack/test_serverless/api_integration/test_suites/observability/security_users.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FtrProviderContext } from '../../ftr_provider_context'; - -export default function ({ getService }: FtrProviderContext) { - const svlCommonApi = getService('svlCommonApi'); - const supertest = getService('supertest'); - - /* - * This is a placeholder test to demonstrate usage. - * This test case is actually already covered in the `serverless` plugin tests - * and should be replaced with something specific to the observability project - * once it modifies / adds / disables Kibana APIs. - */ - describe('security/users', function () { - it('rejects request to create user', async () => { - const { body, status } = await supertest - .post(`/internal/security/users/some_testuser`) - .set(svlCommonApi.getCommonRequestHeader()) - .send({ username: 'some_testuser', password: 'testpassword', roles: [] }); - - // in a non-serverless environment this would succeed with a 200 - svlCommonApi.assertResponseStatusCode(400, status, body); - }); - }); -} diff --git a/x-pack/test_serverless/api_integration/test_suites/search/index.ts b/x-pack/test_serverless/api_integration/test_suites/search/index.ts index 21fea435a53a2..20c04f741b1ac 100644 --- a/x-pack/test_serverless/api_integration/test_suites/search/index.ts +++ b/x-pack/test_serverless/api_integration/test_suites/search/index.ts @@ -9,7 +9,6 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ loadTestFile }: FtrProviderContext) { describe('serverless search API', function () { - loadTestFile(require.resolve('./security_users')); loadTestFile(require.resolve('./snapshot_telemetry')); }); } diff --git a/x-pack/test_serverless/api_integration/test_suites/search/security_users.ts b/x-pack/test_serverless/api_integration/test_suites/search/security_users.ts deleted file mode 100644 index bb6391f167cc2..0000000000000 --- a/x-pack/test_serverless/api_integration/test_suites/search/security_users.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FtrProviderContext } from '../../ftr_provider_context'; - -export default function ({ getService }: FtrProviderContext) { - const svlCommonApi = getService('svlCommonApi'); - const supertest = getService('supertest'); - - /* - * This is a placeholder test to demonstrate usage. - * This test case is actually already covered in the `serverless` plugin tests - * and should be replaced with something specific to the search project - * once it modifies / adds / disables Kibana APIs. - */ - describe('security/users', function () { - it('rejects request to create user', async () => { - const { body, status } = await supertest - .post(`/internal/security/users/some_testuser`) - .set(svlCommonApi.getCommonRequestHeader()) - .send({ username: 'some_testuser', password: 'testpassword', roles: [] }); - - // in a non-serverless environment this would succeed with a 200 - svlCommonApi.assertResponseStatusCode(400, status, body); - }); - }); -} diff --git a/x-pack/test_serverless/api_integration/test_suites/security/index.ts b/x-pack/test_serverless/api_integration/test_suites/security/index.ts index 22b9e23010b6a..9dc97ea8a9b57 100644 --- a/x-pack/test_serverless/api_integration/test_suites/security/index.ts +++ b/x-pack/test_serverless/api_integration/test_suites/security/index.ts @@ -9,7 +9,6 @@ import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ loadTestFile }: FtrProviderContext) { describe('serverless security API', function () { - loadTestFile(require.resolve('./security_users')); loadTestFile(require.resolve('./snapshot_telemetry')); }); } diff --git a/x-pack/test_serverless/api_integration/test_suites/security/security_users.ts b/x-pack/test_serverless/api_integration/test_suites/security/security_users.ts deleted file mode 100644 index 3b389f1aff527..0000000000000 --- a/x-pack/test_serverless/api_integration/test_suites/security/security_users.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FtrProviderContext } from '../../ftr_provider_context'; - -export default function ({ getService }: FtrProviderContext) { - const svlCommonApi = getService('svlCommonApi'); - const supertest = getService('supertest'); - - /* - * This is a placeholder test to demonstrate usage. - * This test case is actually already covered in the `serverless` plugin tests - * and should be replaced with something specific to the security project - * once it modifies / adds / disables Kibana APIs. - */ - describe('security/users', function () { - it('rejects request to create user', async () => { - const { body, status } = await supertest - .post(`/internal/security/users/some_testuser`) - .set(svlCommonApi.getCommonRequestHeader()) - .send({ username: 'some_testuser', password: 'testpassword', roles: [] }); - - // in a non-serverless environment this would succeed with a 200 - svlCommonApi.assertResponseStatusCode(400, status, body); - }); - }); -}