diff --git a/src/test_workflow/integ_test/service_opensearch_dashboards.py b/src/test_workflow/integ_test/service_opensearch_dashboards.py index 8304cd71e7..f9aecc866a 100644 --- a/src/test_workflow/integ_test/service_opensearch_dashboards.py +++ b/src/test_workflow/integ_test/service_opensearch_dashboards.py @@ -68,7 +68,7 @@ def url(self, path=""): def get_service_response(self): url = self.url("/api/status") logging.info(f"Pinging {url}") - return requests.get(url, verify=False, auth=("kibanaserver", "kibanaserver") if self.security_enabled else None) + return requests.get(url, verify=False, auth=("admin", "admin")) def __add_plugin_specific_config(self, additional_config): with open(self.opensearch_dashboards_yml_dir, "a") as yamlfile: diff --git a/tests/jenkins/TestRpmDashboardsDistValidation.groovy b/tests/jenkins/TestRpmDashboardsDistValidation.groovy index 300530f8eb..379a415e77 100644 --- a/tests/jenkins/TestRpmDashboardsDistValidation.groovy +++ b/tests/jenkins/TestRpmDashboardsDistValidation.groovy @@ -82,7 +82,7 @@ class TestRpmDashboardsDistValidation extends BuildPipelineTest { ] ] ] - helper.addShMock("curl -s \"http://localhost:5601/api/status\"") { script -> + helper.addShMock("curl -s \"http://localhost:5601/api/status\" -u admin:admin") { script -> return [stdout: cluster_status.inspect(), exitValue: 0] } helper.registerAllowedMethod("readJSON", [Map.class], {c -> cluster_status}) diff --git a/tests/jenkins/jobs/RpmDashboardsDistValidation_Jenkinsfile.txt b/tests/jenkins/jobs/RpmDashboardsDistValidation_Jenkinsfile.txt index c52dde3b39..dafff37124 100644 --- a/tests/jenkins/jobs/RpmDashboardsDistValidation_Jenkinsfile.txt +++ b/tests/jenkins/jobs/RpmDashboardsDistValidation_Jenkinsfile.txt @@ -31,8 +31,8 @@ For more information, see: https://opensearch.org/}}) systemdCommands.sh(systemctl start opensearch-dashboards) rpmDashboardsDistValidation.systemdCommands({command=status, product=opensearch-dashboards}) systemdCommands.sh({script=systemctl status opensearch-dashboards, returnStdout=true}) - rpmDashboardsDistValidation.sh({script=curl -s "http://localhost:5601/api/status", returnStatus=true}) - rpmDashboardsDistValidation.sh({script=curl -s "http://localhost:5601/api/status", returnStdout=true}) + rpmDashboardsDistValidation.sh({script=curl -s "http://localhost:5601/api/status" -u admin:admin, returnStatus=true}) + rpmDashboardsDistValidation.sh({script=curl -s "http://localhost:5601/api/status" -u admin:admin, returnStdout=true}) rpmDashboardsDistValidation.readJSON({text=['name':'dummy_desktop', 'uuid':'c4677c7a-d76f-45eb-a124-7e30d2b10e4b', 'version':['number':'1.3.0', 'build_hash':'00e06934211e9819f99aabbf139885682f33e95e', 'build_number':1, 'build_snapshot':false], 'status':['overall':['since':'2022-04-07T21:54:39.960Z', 'state':'green', 'title':'Green', 'nickname':'Looking good', 'icon':'success', 'uiColor':'secondary']]]}) rpmDashboardsDistValidation.sh({script=/usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin list --allow-root, returnStdout=true}) BundleManifest.getLocation(ganttChartDashboards) diff --git a/tests/tests_test_workflow/test_integ_workflow/integ_test/test_service_opensearch_dashboards.py b/tests/tests_test_workflow/test_integ_workflow/integ_test/test_service_opensearch_dashboards.py index e8ce017ff1..997720e4a6 100644 --- a/tests/tests_test_workflow/test_integ_workflow/integ_test/test_service_opensearch_dashboards.py +++ b/tests/tests_test_workflow/test_integ_workflow/integ_test/test_service_opensearch_dashboards.py @@ -208,7 +208,7 @@ def test_get_service_response_with_security(self, mock_url, mock_requests_get): service.get_service_response() mock_url.assert_called_once_with("/api/status") - mock_requests_get.assert_called_once_with(mock_url_result, verify=False, auth=("kibanaserver", "kibanaserver")) + mock_requests_get.assert_called_once_with(mock_url_result, verify=False, auth=("admin", "admin")) @patch("requests.get") @patch.object(ServiceOpenSearchDashboards, "url") @@ -228,7 +228,7 @@ def test_get_service_response_without_security(self, mock_url, mock_requests_get service.get_service_response() mock_url.assert_called_once_with("/api/status") - mock_requests_get.assert_called_once_with(mock_url_result, auth=None, verify=False) + mock_requests_get.assert_called_once_with(mock_url_result, verify=False, auth=("admin", "admin")) @patch.object(ServiceOpenSearchDashboards, "get_service_response") def test_service_alive_green_available(self, mock_get_service_response): diff --git a/vars/rpmDashboardsDistValidation.groovy b/vars/rpmDashboardsDistValidation.groovy index 2569b23363..657d328fe1 100644 --- a/vars/rpmDashboardsDistValidation.groovy +++ b/vars/rpmDashboardsDistValidation.groovy @@ -76,12 +76,12 @@ def call(Map args = [:]) { if (osd_status_json != 0) { sleep 10 osd_status_json = sh ( - script: "curl -s \"http://localhost:5601/api/status\"", + script: "curl -s \"http://localhost:5601/api/status\" -u admin:admin", returnStatus: true ) } else { osd_status_json = sh ( - script: "curl -s \"http://localhost:5601/api/status\"", + script: "curl -s \"http://localhost:5601/api/status\" -u admin:admin", returnStdout: true ).trim() break