Bug #17002 mysql-test-run as root user
Submitted: 1 Feb 2006 12:20 Modified: 11 May 2006 17:27
Reporter: Lars Thalmann Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:5.0.18 (but also 4.1) OS:Any (All)
Assigned to: Magnus Blåudd CPU Architecture:Any

[1 Feb 2006 12:20] Lars Thalmann
Description:
It is not possible to run mysql-test-run as root.  Either this should be made 
possible, or the user should be notified directly when trying to start mysql-test-run.

rpl_rotate_logs.test has the following test code:

  system cat /dev/null > var/slave-data/master.info;
  system chmod 000 var/slave-data/master.info;
  connection slave;
  ...
  # START SLAVE will fail because it can't read the file (mode 000)
  # (system error 13)
  ...
  --error 1105,1105,29
  start slave;

Since root can read a file even if it is chmod:ed to 000, this test fails 
when running as root.

How to repeat:
Run mysql-test-run as root

Suggested fix:
Add a test in mysql-test-run that will stop the test and print an error message 
if the user tries to run the suite as user root.  (Alternatively change the test case.)
[24 Apr 2006 8:17] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/5375
[24 Apr 2006 8:21] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/5376
[27 Apr 2006 19:53] Magnus Blåudd
Pushed to 5.0.21 a patch that makes mysql-test-run.pl check if it's running as root. Disable test cases that are depending on "chmod"  and prints a warning.
[11 May 2006 17:27] Paul DuBois
Noted in 5.0.21 changelog.