JDK-8215544 : SA: Modify ClhsdbLauncher to add sudo privileges to enable MacOS tests on Mach5
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc-agent
  • Affected Version: 11,12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2018-12-18
  • Updated: 2022-11-15
  • Resolved: 2019-01-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13
11.0.16Fixed 13 b04Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
This issue is related to JDK-8199700. As per the review comment, the proposed changes of 8199700 are being broken down into multiple patches for ease of review. This one deals with enabling ClhsdbLauncher to check if sudo privileges can be added to the tests for enabling their execution on OSX and if so, adding these privileges.
Comments
A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk11u-dev/pull/912 Date: 2022-03-18 07:06:37 +0000
18-03-2022

Fix request [11u] I backport this to improve mac testing and to fix the failure of ClhsdbRegionDetailsScanOopsForG1.java No risk, only a test change. Clean backport. SAP nighlty testing passed.
18-03-2022

Git URL: https://github.com/openjdk/jdk/commit/86fcd475b1227cff0fc9f9557f542ca6bd3abfe0
14-03-2022

URL: http://hg.openjdk.java.net/jdk/jdk/rev/0b6d6db878b6 User: jgeorge Date: 2019-01-14 05:05:39 +0000
14-01-2019

This proposed change enables 22 tests (the ones using ClhsdbLauncher) on MacOS on Mach5. Some more tests will get enabled with the changes of JDK-8215568.
03-01-2019

Making modifications to: Create SATestUtils to check if we can add sudo privileges, if we are on OSX and if we are not 'root'. 'sudo' might throw errors like the following: sudo: no tty present and no askpass program specified or sudo: a password is required if we don't have a no-password entry for the user in the /etc/sudoers list and if ssh is used. If ssh is not used and if we don't have a no-password entry for the user in the /etc/sudoers list, it would typically wait for the password to be entered. The check to see if we can add sudo privileges is done by trying a simple echo command with sudo, and checking if we encounter any of the error messages mentioned above or if sudo is timing out waiting for the password to be entered. If we cannot add sudo privileges, we continue to skip the test as before. If we have the capability to add 'sudo' privileges, then we add sudo to the test command using SATestUtils.addPrivileges () and proceed to execute the test. The timeouts of 2 test cases are also been increased (these timed out during testing) -- to ensure that the jtreg timeout does not get hit before the echoProcess.waitFor() times out. Else it would result in a test error, instead of a pass. Goetz Lindenmaier was kind enough to help me with multiple rounds of testing of this in the SAP test farms. The earlier review mail chain for the JDK-8199700 is at: http://mail.openjdk.java.net/pipermail/serviceability-dev/2018-July/024373.html
03-01-2019