Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functional tests - Add esSupertest support for SSL #90425

Merged
merged 6 commits into from
Feb 9, 2021

Conversation

pheyos
Copy link
Member

@pheyos pheyos commented Feb 5, 2021

Summary

This PR allows the functional test service esSupertest to work correctly in environments that have ES SSL enabled in the Kibana server configuration.

Observed issue

  • In [ML] Anomaly Detection alert type #89286, a new suite is planned to be added to functional_with_es_ssl
  • We want to prepare some ML jobs via the ES API and use the esSupertest service
  • This results in the following error:
    fail: Some test app should request the ES API successfully
         Error: self signed certificate in certificate chain
    

Investigated solutions

  • ❌ Some investigation showed that others solved this issue by adding process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';. But this is not working (process is terminated with a node warning about insecure HTTPS requests) and IMO also not the right way to fix it => we should rather tell supertest about the CA
  • ❌ We could add the CA to every esSupertest request, like await esSupertest.get(/).ca(readFileSync(CA_CERT_PATH)).expect(200); (with some some additional checking if SSL is enabled). While this is working, we would need to adjust all existing and future requests like this, which makes it unattractive => we should rather have it centrally in the esSupertest service
  • ✔️ The supertest agent allows to set the CA via additional options, which seems to be the right thing to do:
    interface AgentOptions {
      ca?: any;
    }
    function agent(app?: any, options?: AgentOptions): SuperTest<Test>;
    
    The only downside that I see is that our supertestAsPromised.agent doesn't seem to support it:
    function agent(app?: any): SuperTest<Test>;
    
    But I gave it a go and it seems it's passing the additional options correctly to supertest. So this is the solution I would prefer, but I'm also open to other suggestions.

Notes for reviewers

  • The changes in b525eed will be reverted before this PR is merged. They are only made to have an example usage of esSupertest in a deployment with ES SSL enabled.
  • This way, we can see how CI likes it and it can be used during the review process:
    • Start the functional test server via
      node scripts/functional_tests_server.js --config test/functional_with_es_ssl/config.ts
      
    • Start the functional test runner via
      node scripts/functional_test_runner.js --config test/functional_with_es_ssl/config.ts --include-tag test-app
      

@pheyos pheyos added test_infra v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.12.0 labels Feb 5, 2021
@pheyos pheyos self-assigned this Feb 5, 2021
@pheyos
Copy link
Member Author

pheyos commented Feb 8, 2021

@elasticmachine merge upstream

@pheyos pheyos requested review from dmlemeshko and spalger February 8, 2021 06:26
Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/transform/feature_controls/transform_security·ts.transform feature controls security global all privileges (aka kibana_admin) should not render the "Stack" section

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has failed 5 times on tracked branches: https://github.com/elastic/kibana/issues/90576

[00:00:00]       │
[00:19:45]         └-: transform
[00:19:45]           └-> "before all" hook in "transform"
[00:19:45]           └-> "before all" hook in "transform"
[00:19:45]             │ debg creating role transform_source
[00:19:45]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] added role [transform_source]
[00:19:45]             │ debg creating role transform_dest
[00:19:45]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] added role [transform_dest]
[00:19:45]             │ debg creating role transform_dest_readonly
[00:19:45]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] added role [transform_dest_readonly]
[00:19:45]             │ debg creating role transform_ui_extras
[00:19:45]             │ info [o.e.x.s.a.r.TransportPutRoleAction] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] added role [transform_ui_extras]
[00:19:45]             │ debg creating user transform_poweruser
[00:19:45]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] added user [transform_poweruser]
[00:19:45]             │ debg created user transform_poweruser
[00:19:45]             │ debg creating user transform_viewer
[00:19:46]             │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] added user [transform_viewer]
[00:19:46]             │ debg created user transform_viewer
[00:24:59]           └-: feature controls
[00:24:59]             └-> "before all" hook in "feature controls"
[00:24:59]             └-: security
[00:24:59]               └-> "before all" hook in "security"
[00:24:59]               └-> "before all" hook in "security"
[00:24:59]                 │ info [empty_kibana] Loading "mappings.json"
[00:24:59]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] [.kibana_8.0.0_001/7U0H2gZaRfWaBl56FQ-E6g] deleting index
[00:24:59]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] [.kibana_pre6.5.0_001/8QE_D256S9anr0La5oZ8sg] deleting index
[00:24:59]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] [.kibana_task_manager_8.0.0_001/wEECr8xiQcOl0BqrQgbYCA] deleting index
[00:24:59]                 │ info [empty_kibana] Deleted existing index ".kibana_8.0.0_001"
[00:24:59]                 │ info [empty_kibana] Deleted existing index ".kibana_task_manager_8.0.0_001"
[00:24:59]                 │ info [empty_kibana] Deleted existing index ".kibana_pre6.5.0_001"
[00:24:59]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] [.kibana] creating index, cause [api], templates [], shards [1]/[1]
[00:24:59]                 │ info [empty_kibana] Created index ".kibana"
[00:24:59]                 │ debg [empty_kibana] ".kibana" settings {"index":{"number_of_replicas":"1","number_of_shards":"1"}}
[00:24:59]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] [.kibana/9qXwzOc4Rc2VRmZr-5CzmA] update_mapping [_doc]
[00:24:59]                 │ debg Migrating saved objects
[00:24:59]                 │ proc [kibana]   log   [10:40:52.332] [info][savedobjects-service] [.kibana_task_manager] INIT -> CREATE_NEW_TARGET
[00:24:59]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] [.kibana_task_manager_8.0.0_001] creating index, cause [api], templates [], shards [1]/[1]
[00:24:59]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] updating number_of_replicas to [0] for indices [.kibana_task_manager_8.0.0_001]
[00:24:59]                 │ proc [kibana]   log   [10:40:52.342] [info][savedobjects-service] [.kibana] INIT -> LEGACY_SET_WRITE_BLOCK
[00:24:59]                 │ info [o.e.c.m.MetadataIndexStateService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] adding block write to indices [[.kibana/9qXwzOc4Rc2VRmZr-5CzmA]]
[00:24:59]                 │ info [o.e.c.m.MetadataIndexStateService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] completed adding block write to indices [.kibana]
[00:24:59]                 │ proc [kibana]   log   [10:40:52.406] [info][savedobjects-service] [.kibana_task_manager] CREATE_NEW_TARGET -> MARK_VERSION_INDEX_READY
[00:24:59]                 │ proc [kibana]   log   [10:40:52.427] [info][savedobjects-service] [.kibana] LEGACY_SET_WRITE_BLOCK -> LEGACY_CREATE_REINDEX_TARGET
[00:24:59]                 │ proc [kibana]   log   [10:40:52.438] [info][savedobjects-service] [.kibana_task_manager] MARK_VERSION_INDEX_READY -> DONE
[00:24:59]                 │ proc [kibana]   log   [10:40:52.438] [info][savedobjects-service] [.kibana_task_manager] Migration completed after 113ms
[00:24:59]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] [.kibana_pre6.5.0_001] creating index, cause [api], templates [], shards [1]/[1]
[00:24:59]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] updating number_of_replicas to [0] for indices [.kibana_pre6.5.0_001]
[00:24:59]                 │ proc [kibana]   log   [10:40:52.494] [info][savedobjects-service] [.kibana] LEGACY_CREATE_REINDEX_TARGET -> LEGACY_REINDEX
[00:24:59]                 │ info [o.e.t.LoggingTaskListener] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] 32071 finished with response BulkByScrollResponse[took=1.9ms,timed_out=false,sliceId=null,updated=0,created=0,deleted=0,batches=0,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:24:59]                 │ proc [kibana]   log   [10:40:52.503] [info][savedobjects-service] [.kibana] LEGACY_REINDEX -> LEGACY_REINDEX_WAIT_FOR_TASK
[00:24:59]                 │ proc [kibana]   log   [10:40:52.513] [info][savedobjects-service] [.kibana] LEGACY_REINDEX_WAIT_FOR_TASK -> LEGACY_DELETE
[00:24:59]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] [.kibana/9qXwzOc4Rc2VRmZr-5CzmA] deleting index
[00:24:59]                 │ proc [kibana]   log   [10:40:52.551] [info][savedobjects-service] [.kibana] LEGACY_DELETE -> SET_SOURCE_WRITE_BLOCK
[00:24:59]                 │ info [o.e.c.m.MetadataIndexStateService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] adding block write to indices [[.kibana_pre6.5.0_001/sjE3covgTaaq9lfX9EukLw]]
[00:24:59]                 │ info [o.e.c.m.MetadataIndexStateService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] completed adding block write to indices [.kibana_pre6.5.0_001]
[00:24:59]                 │ proc [kibana]   log   [10:40:52.591] [info][savedobjects-service] [.kibana] SET_SOURCE_WRITE_BLOCK -> CREATE_REINDEX_TEMP
[00:24:59]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] [.kibana_8.0.0_reindex_temp] creating index, cause [api], templates [], shards [1]/[1]
[00:24:59]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] updating number_of_replicas to [0] for indices [.kibana_8.0.0_reindex_temp]
[00:24:59]                 │ proc [kibana]   log   [10:40:52.651] [info][savedobjects-service] [.kibana] CREATE_REINDEX_TEMP -> REINDEX_SOURCE_TO_TEMP
[00:24:59]                 │ info [o.e.t.LoggingTaskListener] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] 32100 finished with response BulkByScrollResponse[took=1.8ms,timed_out=false,sliceId=null,updated=0,created=0,deleted=0,batches=0,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:24:59]                 │ proc [kibana]   log   [10:40:52.658] [info][savedobjects-service] [.kibana] REINDEX_SOURCE_TO_TEMP -> REINDEX_SOURCE_TO_TEMP_WAIT_FOR_TASK
[00:24:59]                 │ proc [kibana]   log   [10:40:52.666] [info][savedobjects-service] [.kibana] REINDEX_SOURCE_TO_TEMP_WAIT_FOR_TASK -> SET_TEMP_WRITE_BLOCK
[00:24:59]                 │ info [o.e.c.m.MetadataIndexStateService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] adding block write to indices [[.kibana_8.0.0_reindex_temp/epPAa0g7QkuXErpj8pATMA]]
[00:24:59]                 │ info [o.e.c.m.MetadataIndexStateService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] completed adding block write to indices [.kibana_8.0.0_reindex_temp]
[00:24:59]                 │ proc [kibana]   log   [10:40:52.707] [info][savedobjects-service] [.kibana] SET_TEMP_WRITE_BLOCK -> CLONE_TEMP_TO_TARGET
[00:24:59]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] applying create index request using existing index [.kibana_8.0.0_reindex_temp] metadata
[00:24:59]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] [.kibana_8.0.0_001] creating index, cause [clone_index], templates [], shards [1]/[1]
[00:24:59]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] updating number_of_replicas to [0] for indices [.kibana_8.0.0_001]
[00:24:59]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] [.kibana_8.0.0_001/olsXxQFSQ_2z-Sdf3PzQWg] create_mapping
[00:24:59]                 │ proc [kibana]   log   [10:40:52.804] [info][savedobjects-service] [.kibana] CLONE_TEMP_TO_TARGET -> OUTDATED_DOCUMENTS_SEARCH
[00:24:59]                 │ proc [kibana]   log   [10:40:52.813] [info][savedobjects-service] [.kibana] OUTDATED_DOCUMENTS_SEARCH -> UPDATE_TARGET_MAPPINGS
[00:24:59]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] [.kibana_8.0.0_001/olsXxQFSQ_2z-Sdf3PzQWg] update_mapping [_doc]
[00:24:59]                 │ info [o.e.t.LoggingTaskListener] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] 32136 finished with response BulkByScrollResponse[took=1.5ms,timed_out=false,sliceId=null,updated=0,created=0,deleted=0,batches=0,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:24:59]                 │ proc [kibana]   log   [10:40:52.877] [info][savedobjects-service] [.kibana] UPDATE_TARGET_MAPPINGS -> UPDATE_TARGET_MAPPINGS_WAIT_FOR_TASK
[00:24:59]                 │ proc [kibana]   log   [10:40:52.884] [info][savedobjects-service] [.kibana] UPDATE_TARGET_MAPPINGS_WAIT_FOR_TASK -> MARK_VERSION_INDEX_READY
[00:24:59]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] [.kibana_8.0.0_reindex_temp/epPAa0g7QkuXErpj8pATMA] deleting index
[00:24:59]                 │ proc [kibana]   log   [10:40:52.925] [info][savedobjects-service] [.kibana] MARK_VERSION_INDEX_READY -> DONE
[00:24:59]                 │ proc [kibana]   log   [10:40:52.926] [info][savedobjects-service] [.kibana] Migration completed after 602ms
[00:24:59]                 │ debg [empty_kibana] Migrated Kibana index after loading Kibana data
[00:25:00]                 │ debg [empty_kibana] Ensured that default space exists in .kibana
[00:25:00]                 │ debg applying update to kibana config: {"accessibility:disableAnimations":true,"dateFormat:tz":"UTC","visualization:visualize:legacyChartsLibrary":true}
[00:25:00]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] [.kibana_8.0.0_001/olsXxQFSQ_2z-Sdf3PzQWg] update_mapping [_doc]
[00:25:01]                 │ debg SecurityPage.forceLogout
[00:25:01]                 │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=100
[00:25:01]                 │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:02]                 │ debg Redirecting to /logout to force the logout
[00:25:02]                 │ debg Waiting on the login form to appear
[00:25:02]                 │ debg Waiting for Login Page to appear.
[00:25:02]                 │ debg Waiting up to 100000ms for login page...
[00:25:02]                 │ debg browser[INFO] http://localhost:61231/logout?_t=1612867255394 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:25:02]                 │
[00:25:02]                 │ debg browser[INFO] http://localhost:61231/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:25:02]                 │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:05]                 │ERROR browser[SEVERE] http://localhost:61231/internal/security/me - Failed to load resource: the server responded with a status of 401 (Unauthorized)
[00:25:05]                 │ debg browser[INFO] http://localhost:61231/login?msg=LOGGED_OUT 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:25:05]                 │
[00:25:05]                 │ debg browser[INFO] http://localhost:61231/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:25:05]                 │ debg --- retry.tryForTime error: .login-form is not displayed
[00:25:05]                 │ERROR browser[SEVERE] http://localhost:61231/internal/spaces/_active_space - Failed to load resource: the server responded with a status of 401 (Unauthorized)
[00:25:05]                 │ERROR browser[SEVERE] http://localhost:61231/internal/security/me - Failed to load resource: the server responded with a status of 401 (Unauthorized)
[00:25:05]                 │ debg browser[INFO] http://localhost:61231/40260/bundles/core/core.entry.js 12:159412 "Detected an unhandled Promise rejection.
[00:25:05]                 │      Error: Unauthorized"
[00:25:05]                 │ERROR browser[SEVERE] http://localhost:61231/40260/bundles/core/core.entry.js 5:3002 
[00:25:05]                 │ERROR browser[SEVERE] http://localhost:61231/api/licensing/info - Failed to load resource: the server responded with a status of 401 (Unauthorized)
[00:25:06]                 │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:25:06]                 │ debg navigating to home url: http://localhost:61231/app/home#/
[00:25:06]                 │ debg navigate to: http://localhost:61231/app/home#/
[00:25:06]                 │ debg browser[INFO] http://localhost:61231/login?next=%2Fapp%2Fhome%3F_t%3D1612867259262#/ 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:25:06]                 │
[00:25:06]                 │ debg browser[INFO] http://localhost:61231/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:25:06]                 │ debg ... sleep(700) start
[00:25:07]                 │ debg ... sleep(700) end
[00:25:07]                 │ debg returned from get, calling refresh
[00:25:07]                 │ERROR browser[SEVERE] http://localhost:61231/internal/spaces/_active_space - Failed to load resource: the server responded with a status of 401 (Unauthorized)
[00:25:07]                 │ debg browser[INFO] http://localhost:61231/40260/bundles/core/core.entry.js 12:159412 "Detected an unhandled Promise rejection.
[00:25:07]                 │      Error: Unauthorized"
[00:25:07]                 │ERROR browser[SEVERE] http://localhost:61231/40260/bundles/core/core.entry.js 5:3002 
[00:25:07]                 │ debg browser[INFO] http://localhost:61231/login?next=%2Fapp%2Fhome%3F_t%3D1612867259262#/ 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:25:07]                 │
[00:25:07]                 │ debg browser[INFO] http://localhost:61231/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:25:08]                 │ debg currentUrl = http://localhost:61231/login?next=%2Fapp%2Fhome%3F_t%3D1612867259262#/
[00:25:08]                 │          appUrl = http://localhost:61231/app/home#/
[00:25:08]                 │ debg TestSubjects.find(kibanaChrome)
[00:25:08]                 │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:25:08]                 │ debg Found login page
[00:25:08]                 │ debg TestSubjects.setValue(loginUsername, test_user)
[00:25:08]                 │ debg TestSubjects.click(loginUsername)
[00:25:08]                 │ debg Find.clickByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:25:08]                 │ debg Find.findByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:25:08]                 │ERROR browser[SEVERE] http://localhost:61231/internal/spaces/_active_space - Failed to load resource: the server responded with a status of 401 (Unauthorized)
[00:25:08]                 │ debg browser[INFO] http://localhost:61231/40260/bundles/core/core.entry.js 12:159412 "Detected an unhandled Promise rejection.
[00:25:08]                 │      Error: Unauthorized"
[00:25:08]                 │ERROR browser[SEVERE] http://localhost:61231/40260/bundles/core/core.entry.js 5:3002 
[00:25:08]                 │ERROR browser[SEVERE] http://localhost:61231/api/licensing/info - Failed to load resource: the server responded with a status of 401 (Unauthorized)
[00:25:08]                 │ debg TestSubjects.setValue(loginPassword, changeme)
[00:25:08]                 │ debg TestSubjects.click(loginPassword)
[00:25:08]                 │ debg Find.clickByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:25:08]                 │ debg Find.findByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:25:08]                 │ERROR browser[SEVERE] http://localhost:61231/internal/security/me - Failed to load resource: the server responded with a status of 401 (Unauthorized)
[00:25:08]                 │ debg TestSubjects.click(loginSubmit)
[00:25:08]                 │ debg Find.clickByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:25:08]                 │ debg Find.findByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:25:08]                 │ debg Find.waitForDeletedByCssSelector('.kibanaWelcomeLogo') with timeout=10000
[00:25:08]                 │ proc [kibana]   log   [10:41:01.713] [info][plugins][routes][security] Logging in with provider "basic" (basic)
[00:25:09]                 │ debg browser[INFO] http://localhost:61231/app/home?_t=1612867259262#/ 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:25:09]                 │
[00:25:09]                 │ debg browser[INFO] http://localhost:61231/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:25:09]                 │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:25:10]                 │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"] nav:not(.ng-hide)') with timeout=60000
[00:25:11]                 │ debg browser[INFO] http://localhost:61231/app/home?_t=1612867263620#/ 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:25:11]                 │
[00:25:11]                 │ debg browser[INFO] http://localhost:61231/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:25:11]                 │ debg Finished login process currentUrl = http://localhost:61231/app/home#/
[00:25:11]                 │ debg ... sleep(501) start
[00:25:11]                 │ debg ... sleep(501) end
[00:25:11]                 │ debg in navigateTo url = http://localhost:61231/app/home#/
[00:25:11]                 │ debg TestSubjects.exists(statusPageContainer)
[00:25:11]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:25:14]                 │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:25:15]               └-: global all privileges (aka kibana_admin)
[00:25:15]                 └-> "before all" hook for "should show the Stack Management nav link"
[00:25:15]                 └-> "before all" hook for "should show the Stack Management nav link"
[00:25:15]                   │ debg set roles = kibana_admin
[00:25:15]                   │ debg creating user test_user
[00:25:15]                   │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-centos-tests-xxl-1612863369765627967] updated user [test_user]
[00:25:15]                   │ debg created user test_user
[00:25:15]                   │ debg TestSubjects.exists(kibanaChrome)
[00:25:15]                   │ debg Find.existsByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=2500
[00:25:15]                   │ debg TestSubjects.find(kibanaChrome)
[00:25:15]                   │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=100000
[00:25:15]                   │ debg browser[INFO] http://localhost:61231/app/home?_t=1612867263620#/ 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:25:15]                   │
[00:25:15]                   │ debg browser[INFO] http://localhost:61231/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:25:16]                 └-> should show the Stack Management nav link
[00:25:16]                   └-> "before each" hook: global before each for "should show the Stack Management nav link"
[00:25:16]                   │ debg isGlobalLoadingIndicatorVisible
[00:25:16]                   │ debg TestSubjects.exists(globalLoadingIndicator)
[00:25:16]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:25:17]                   │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:25:18]                   │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:25:18]                   │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:25:18]                   │ debg TestSubjects.exists(collapsibleNav)
[00:25:18]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="collapsibleNav"]') with timeout=2500
[00:25:20]                   │ debg --- retry.tryForTime error: [data-test-subj="collapsibleNav"] is not displayed
[00:25:21]                   │ debg TestSubjects.click(toggleNavButton)
[00:25:21]                   │ debg Find.clickByCssSelector('[data-test-subj="toggleNavButton"]') with timeout=10000
[00:25:21]                   │ debg Find.findByCssSelector('[data-test-subj="toggleNavButton"]') with timeout=10000
[00:25:21]                   │ debg TestSubjects.find(collapsibleNav)
[00:25:21]                   │ debg Find.findByCssSelector('[data-test-subj="collapsibleNav"]') with timeout=10000
[00:25:21]                   │ debg Find.existsByCssSelector('[data-test-subj=collapsibleNav] > button') with timeout=2500
[00:25:21]                   │ debg Find.findByCssSelector('[data-test-subj=collapsibleNav] > button') with timeout=10000
[00:25:21]                   │ debg Find.clickByCssSelector('[data-test-subj=collapsibleNav] > button') with timeout=10000
[00:25:21]                   │ debg Find.findByCssSelector('[data-test-subj=collapsibleNav] > button') with timeout=10000
[00:25:21]                   └- ✓ pass  (5.6s) "transform feature controls security global all privileges (aka kibana_admin) should show the Stack Management nav link"
[00:25:21]                 └-> should not render the "Stack" section
[00:25:21]                   └-> "before each" hook: global before each for "should not render the "Stack" section"
[00:25:21]                   │ debg navigating to management url: http://localhost:61231/app/management
[00:25:21]                   │ debg navigate to: http://localhost:61231/app/management
[00:25:22]                   │ debg browser[INFO] http://localhost:61231/app/management?_t=1612867274925 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:25:22]                   │
[00:25:22]                   │ debg browser[INFO] http://localhost:61231/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:25:22]                   │ debg ... sleep(700) start
[00:25:22]                   │ debg ... sleep(700) end
[00:25:22]                   │ debg returned from get, calling refresh
[00:25:23]                   │ debg browser[INFO] http://localhost:61231/app/management?_t=1612867274925 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:25:23]                   │
[00:25:23]                   │ debg browser[INFO] http://localhost:61231/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:25:23]                   │ debg currentUrl = http://localhost:61231/app/management
[00:25:23]                   │          appUrl = http://localhost:61231/app/management
[00:25:23]                   │ debg TestSubjects.find(kibanaChrome)
[00:25:23]                   │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:25:23]                   │ debg ... sleep(501) start
[00:25:24]                   │ debg ... sleep(501) end
[00:25:24]                   │ debg in navigateTo url = http://localhost:61231/app/management
[00:25:24]                   │ debg TestSubjects.exists(statusPageContainer)
[00:25:24]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:25:26]                   │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:25:27]                   │ debg Find.allByCssSelector('.mgtSideBarNav > .euiSideNav__content > .euiSideNavItem') with timeout=10000
[00:25:27]                   │ info Taking screenshot "/dev/shm/workspace/parallel/23/kibana/x-pack/test/functional/screenshots/failure/transform feature controls security global all privileges _aka kibana_admin_ should not render the _Stack_ section.png"
[00:25:27]                   │ info Current URL is: http://localhost:61231/app/management
[00:25:27]                   │ info Saving page source to: /dev/shm/workspace/parallel/23/kibana/x-pack/test/functional/failure_debug/html/transform feature controls security global all privileges _aka kibana_admin_ should not render the _Stack_ section.html
[00:25:27]                   └- ✖ fail: transform feature controls security global all privileges (aka kibana_admin) should not render the "Stack" section
[00:25:27]                   │       Error: expected [ 'ingest', 'insightsAndAlerting', 'kibana' ] to sort of equal [ 'insightsAndAlerting', 'kibana' ]
[00:25:27]                   │       + expected - actual
[00:25:27]                   │ 
[00:25:27]                   │        [
[00:25:27]                   │       -  "ingest"
[00:25:27]                   │          "insightsAndAlerting"
[00:25:27]                   │          "kibana"
[00:25:27]                   │        ]
[00:25:27]                   │       
[00:25:27]                   │       at Assertion.assert (/dev/shm/workspace/parallel/23/kibana/packages/kbn-expect/expect.js:100:11)
[00:25:27]                   │       at Assertion.eql (/dev/shm/workspace/parallel/23/kibana/packages/kbn-expect/expect.js:244:8)
[00:25:27]                   │       at Context.<anonymous> (test/functional/apps/transform/feature_controls/transform_security.ts:45:29)
[00:25:27]                   │       at runMicrotasks (<anonymous>)
[00:25:27]                   │       at processTicksAndRejections (internal/process/task_queues.js:93:5)
[00:25:27]                   │       at Object.apply (/dev/shm/workspace/parallel/23/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:73:16)
[00:25:27]                   │ 
[00:25:27]                   │ 

Stack Trace

Error: expected [ 'ingest', 'insightsAndAlerting', 'kibana' ] to sort of equal [ 'insightsAndAlerting', 'kibana' ]
    at Assertion.assert (/dev/shm/workspace/parallel/23/kibana/packages/kbn-expect/expect.js:100:11)
    at Assertion.eql (/dev/shm/workspace/parallel/23/kibana/packages/kbn-expect/expect.js:244:8)
    at Context.<anonymous> (test/functional/apps/transform/feature_controls/transform_security.ts:45:29)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at Object.apply (/dev/shm/workspace/parallel/23/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:73:16) {
  actual: '[\n  "ingest"\n  "insightsAndAlerting"\n  "kibana"\n]',
  expected: '[\n  "insightsAndAlerting"\n  "kibana"\n]',
  showDiff: true
}

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@pheyos pheyos merged commit 523110d into elastic:master Feb 9, 2021
@pheyos pheyos deleted the es_supertest_ssl branch February 9, 2021 11:45
pheyos added a commit to pheyos/kibana that referenced this pull request Feb 9, 2021
This PR allows the functional test service esSupertest to work correctly in environments that have ES SSL enabled in the Kibana server configuration.
pheyos added a commit that referenced this pull request Feb 9, 2021
This PR allows the functional test service esSupertest to work correctly in environments that have ES SSL enabled in the Kibana server configuration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes test_infra v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants