diff --git a/docker/ci/dockerfiles/current/test.rockylinux8.systemd-base.x64.arm64.dockerfile b/docker/ci/dockerfiles/current/test.rockylinux8.systemd-base.x64.arm64.dockerfile index a4a36e2e38..50b23a26e6 100644 --- a/docker/ci/dockerfiles/current/test.rockylinux8.systemd-base.x64.arm64.dockerfile +++ b/docker/ci/dockerfiles/current/test.rockylinux8.systemd-base.x64.arm64.dockerfile @@ -111,7 +111,7 @@ RUN dnf install -y sudo && \ usermod -a -G opensearch $CONTAINER_USER && \ usermod -a -G opensearch-dashboards $CONTAINER_USER && \ id && \ - echo "$CONTAINER_USER ALL=(root) NOPASSWD:`which systemctl`, `which dnf`, `which yum`, `which rpm`, `which chmod`, `which kill`, `which curl`, /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin" >> /etc/sudoers.d/$CONTAINER_USER + echo "$CONTAINER_USER ALL=(root) NOPASSWD:`which systemctl`, `which env`, `which dnf`, `which yum`, `which rpm`, `which chmod`, `which kill`, `which curl`, /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin" >> /etc/sudoers.d/$CONTAINER_USER # Copy from Stage0 COPY --from=linux_stage_0 --chown=$CONTAINER_USER:$CONTAINER_USER $CONTAINER_USER_HOME $CONTAINER_USER_HOME diff --git a/docker/ci/dockerfiles/current/test.ubuntu2004.systemd-base.x64.arm64.dockerfile b/docker/ci/dockerfiles/current/test.ubuntu2004.systemd-base.x64.arm64.dockerfile index d5884e38a0..7b8d6928a5 100644 --- a/docker/ci/dockerfiles/current/test.ubuntu2004.systemd-base.x64.arm64.dockerfile +++ b/docker/ci/dockerfiles/current/test.ubuntu2004.systemd-base.x64.arm64.dockerfile @@ -130,7 +130,7 @@ RUN apt-get install -y sudo && \ usermod -a -G opensearch $CONTAINER_USER && \ usermod -a -G opensearch-dashboards $CONTAINER_USER && \ id && \ - echo "$CONTAINER_USER ALL=(root) NOPASSWD:`which systemctl`, `which apt`, `which apt-get`, `which apt-key`, `which dpkg`, `which chmod`, `which kill`, `which curl`, `which tee`, /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin" >> /etc/sudoers.d/$CONTAINER_USER + echo "$CONTAINER_USER ALL=(root) NOPASSWD:`which systemctl`, `which env`, `which apt`, `which apt-get`, `which apt-key`, `which dpkg`, `which chmod`, `which kill`, `which curl`, `which tee`, /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin" >> /etc/sudoers.d/$CONTAINER_USER # Copy from Stage0 COPY --from=linux_stage_0 --chown=$CONTAINER_USER:$CONTAINER_USER $CONTAINER_USER_HOME $CONTAINER_USER_HOME diff --git a/src/test_workflow/integ_test/distribution_deb.py b/src/test_workflow/integ_test/distribution_deb.py index d49866a807..125219d5ec 100644 --- a/src/test_workflow/integ_test/distribution_deb.py +++ b/src/test_workflow/integ_test/distribution_deb.py @@ -30,16 +30,14 @@ def install(self, bundle_name: str) -> None: logging.info("deb installation requires sudo, script will exit if current user does not have sudo access") deb_install_cmd = " ".join( [ - 'sudo', - 'env', - 'OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123!', - '&&', 'sudo', 'dpkg', '--purge', self.filename, '&&', 'sudo', + 'env', + 'OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123!', 'dpkg', '--install', bundle_name, diff --git a/src/test_workflow/integ_test/distribution_rpm.py b/src/test_workflow/integ_test/distribution_rpm.py index 17c3325480..8cd5c84572 100644 --- a/src/test_workflow/integ_test/distribution_rpm.py +++ b/src/test_workflow/integ_test/distribution_rpm.py @@ -30,10 +30,6 @@ def install(self, bundle_name: str) -> None: logging.info("rpm installation requires sudo, script will exit if current user does not have sudo access") rpm_install_cmd = " ".join( [ - 'sudo', - 'env', - 'OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123!', - '&&', 'sudo', 'yum', 'remove', @@ -41,6 +37,8 @@ def install(self, bundle_name: str) -> None: self.filename, '&&', 'sudo', + 'env', + 'OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123!', 'yum', 'install', '-y', diff --git a/tests/tests_test_workflow/test_integ_workflow/integ_test/test_distribution_deb.py b/tests/tests_test_workflow/test_integ_workflow/integ_test/test_distribution_deb.py index 8a299bf72b..67e31311f4 100644 --- a/tests/tests_test_workflow/test_integ_workflow/integ_test/test_distribution_deb.py +++ b/tests/tests_test_workflow/test_integ_workflow/integ_test/test_distribution_deb.py @@ -40,9 +40,9 @@ def test_install(self, check_call_mock: Mock) -> None: self.assertEqual(check_call_mock.call_count, 1) self.assertEqual( ( - "sudo env OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123! && " "sudo dpkg --purge opensearch && " - "sudo dpkg --install opensearch.deb && " + "sudo env OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123! " + "dpkg --install opensearch.deb && " f"sudo chmod 0666 {self.distribution_deb.config_path}" ), args_list[0][0][0], diff --git a/tests/tests_test_workflow/test_integ_workflow/integ_test/test_distribution_rpm.py b/tests/tests_test_workflow/test_integ_workflow/integ_test/test_distribution_rpm.py index 508d954c4f..79c90d64c6 100644 --- a/tests/tests_test_workflow/test_integ_workflow/integ_test/test_distribution_rpm.py +++ b/tests/tests_test_workflow/test_integ_workflow/integ_test/test_distribution_rpm.py @@ -40,9 +40,9 @@ def test_install(self, check_call_mock: Mock) -> None: self.assertEqual(check_call_mock.call_count, 1) self.assertEqual( ( - "sudo env OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123! && " "sudo yum remove -y opensearch && " - "sudo yum install -y opensearch.rpm && " + "sudo env OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123! " + "yum install -y opensearch.rpm && " f"sudo chmod 0666 {self.distribution_rpm.config_path}" ), args_list[0][0][0],