Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.2176 06/04/24 10:21:09 msvensson@neptunus.(none) +5 -0
Bug#17002 mysql-test-run as root user
- Add test to see if tests are running with root permissions
- Disables tests that uses chmod if that is the case
mysql-test/r/not_as_root.require
1.1 06/04/24 10:21:05 msvensson@neptunus.(none) +2 -0
New BitKeeper file ``mysql-test/r/not_as_root.require''
mysql-test/r/not_as_root.require
1.0 06/04/24 10:21:05 msvensson@neptunus.(none) +0 -0
BitKeeper file /home/msvensson/mysql/mysql-5.0-maint/mysql-test/r/not_as_root.require
mysql-test/include/not_as_root.inc
1.1 06/04/24 10:21:04 msvensson@neptunus.(none) +4 -0
New BitKeeper file ``mysql-test/include/not_as_root.inc''
mysql-test/t/rpl_rotate_logs.test
1.65 06/04/24 10:21:04 msvensson@neptunus.(none) +3 -0
Disable test if running as root.
mysql-test/t/information_schema.test
1.73 06/04/24 10:21:04 msvensson@neptunus.(none) +3 -0
Disable test if running as root
mysql-test/mysql-test-run.pl
1.88 06/04/24 10:21:04 msvensson@neptunus.(none) +29 -0
Add test to check if mysql-test-run is run with root permission.
Set environment variable MYSQL_TEST_ROOT to 'YES' or 'NO'.
mysql-test/include/not_as_root.inc
1.0 06/04/24 10:21:04 msvensson@neptunus.(none) +0 -0
BitKeeper file
/home/msvensson/mysql/mysql-5.0-maint/mysql-test/include/not_as_root.inc
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: msvensson
# Host: neptunus.(none)
# Root: /home/msvensson/mysql/mysql-5.0-maint
--- 1.72/mysql-test/t/information_schema.test 2006-04-07 09:32:18 +02:00
+++ 1.73/mysql-test/t/information_schema.test 2006-04-24 10:21:04 +02:00
@@ -1,6 +1,9 @@
# This test uses grants, which can't get tested for embedded server
-- source include/not_embedded.inc
+# This test uses chmod, can't be run with root permissions
+-- source include/not_as_root.inc
+
# Test for information_schema.schemata &
# show databases
--- 1.87/mysql-test/mysql-test-run.pl 2006-04-11 09:09:15 +02:00
+++ 1.88/mysql-test/mysql-test-run.pl 2006-04-24 10:21:04 +02:00
@@ -338,6 +338,7 @@
sub kill_running_server ();
sub kill_and_cleanup ();
sub check_ssl_support ();
+sub check_running_as_root();
sub check_ndbcluster_support ();
sub ndbcluster_install ();
sub ndbcluster_start ($);
@@ -376,6 +377,7 @@
check_ndbcluster_support();
check_ssl_support();
+ check_running_as_root();
environment_setup();
signal_setup();
@@ -1333,6 +1335,33 @@
copy("$glob_mysql_test_dir/std_data/$_", "$opt_vardir/std_data_ln/$_");
}
closedir(DIR);
+ }
+}
+
+
+sub check_running_as_root () {
+ # Check if running as root
+ # i.e a file can be read regardless what mode we set it to
+ my $test_file= "test_running_as_root.txt";
+ mtr_tofile($test_file, "MySQL");
+ chmod(oct("0000"), $test_file);
+
+ my $result="";
+ if (open(FILE,"<",$test_file))
+ {
+ $result= join('', <FILE>);
+ close FILE;
+ }
+
+ chmod(oct("0755"), $test_file);
+ unlink($test_file);
+
+ $ENV{'MYSQL_TEST_ROOT'}= "NO";
+ if ($result eq "MySQL")
+ {
+ mtr_warning("running this script as _root_ will cause some " .
+ "tests to be skipped");
+ $ENV{'MYSQL_TEST_ROOT'}= "YES";
}
}
--- New file ---
+++ mysql-test/include/not_as_root.inc 06/04/24 10:21:04
-- require r/not_as_root.require
disable_query_log;
select $MYSQL_TEST_ROOT as running_as_root;
enable_query_log;
--- New file ---
+++ mysql-test/r/not_as_root.require 06/04/24 10:21:05
running_as_root
NO
--- 1.64/mysql-test/t/rpl_rotate_logs.test 2006-01-24 08:30:49 +01:00
+++ 1.65/mysql-test/t/rpl_rotate_logs.test 2006-04-24 10:21:04 +02:00
@@ -1,3 +1,6 @@
+# This test uses chmod, can't be run with root permissions
+-- source include/not_as_root.inc
+
#
# Test is run with max_binlog_size=2048 to force automatic rotation of the
# binary log
| Thread |
|---|
| • bk commit into 5.0 tree (msvensson:1.2176) BUG#17002 | msvensson | 24 Apr |