List:Commits« Previous MessageNext Message »
From:Joerg Bruehe Date:November 1 2006 8:17pm
Subject:bk commit into 4.1 tree (joerg:1.2557) BUG#17194
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of joerg. When joerg 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@stripped, 2006-11-01 20:17:10+01:00, joerg@trift2. +2 -0
  mysql-test/mysql-test-run.pl  +  mysql-test/mysql-test-run.sh
  
  Necessary changes if one of the test scripts is to be used with a RPM installation
(bug#17194).
  
  This change handles finding the server and the other programs,
  but it does not solve the problem to get a writable "var" directory.
  If we want to avoid world-writable directories below "/usr/share/mysql-test" (and we
do!), 
  any automatic solution would require fixed decisions which may not match the local
installation.
  
  For the Perl script, use "--vardir"; for the shell script, create "mysql-test/var"
manually.

  mysql-test/mysql-test-run.pl@stripped, 2006-11-01 20:17:08+01:00, joerg@trift2. +21 -2
    Modifications to use this script in a RPM installation (bug#17194):
    - The tests are one level further down, "/usr/share/mysqltest" (vs. "/usr/bin").
    - A "mysql-bench" might not exist.
    - "mysql-test" is owned by root and not world-writable, so "var" must be put somewhere
else.
    - The server, "mysqld", is in a different location, "/usr/sbin".
    
    Note that the "--vardir" option must be used in a RPM installation,
    unless "mysql-test" is made writable for the user who runs the tests (not done
automatically).

  mysql-test/mysql-test-run.sh@stripped, 2006-11-01 20:17:08+01:00, joerg@trift2. +28 -10
    Necessary changes if this script is to be used with a RPM installation (bug#17194):
    - The tests are one level further down, "/usr/share/mysqltest" (vs. "/usr/bin").
    - The server, "mysqld", is in a different location, "/usr/sbin".
    
    Note that these changes are not sufficient, as the user needs a writable
"mysql-test/var" subdirectory.
    Either this is created manually, or the script can not be used.
    An alternative is the corresponding Perl script which supports a "--vardir" option.

# 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:	joerg
# Host:	trift2.
# Root:	/MySQL/M41/bug17194-4.1

--- 1.268/mysql-test/mysql-test-run.sh	2006-11-01 20:17:14 +01:00
+++ 1.269/mysql-test/mysql-test-run.sh	2006-11-01 20:17:14 +01:00
@@ -158,18 +158,29 @@
 # Misc. Definitions
 #--
 
-if [ -d ../sql ] ; then
+# BASEDIR is always above mysql-test directory ...
+MYSQL_TEST_DIR=`pwd`
+cd ..
+
+if [ -d ./sql ] ; then
    SOURCE_DIST=1
 else
    BINARY_DIST=1
 fi
 
-#BASEDIR is always one above mysql-test directory
-CWD=`pwd`
-cd ..
-BASEDIR=`pwd`
-cd $CWD
-MYSQL_TEST_DIR=$BASEDIR/mysql-test
+# ... one level for tar.gz, two levels for a RPM installation
+if [ -d ./bin ] ; then
+   # this is not perfect: we have 
+   #   /usr/share/mysql/   # mysql-test-run  is here, so this is "$MYSQL_TEST_DIR"
+   #   /usr/bin/           # with MySQL client programs
+   # so the existence of "/usr/share/bin/" would make this test fail.
+   BASEDIR=`pwd`
+else
+   cd ..
+   BASEDIR=`pwd`
+fi
+
+cd $MYSQL_TEST_DIR
 MYSQL_TEST_WINDIR=$MYSQL_TEST_DIR
 MYSQLTEST_VARDIR=$MYSQL_TEST_DIR/var
 export MYSQL_TEST_DIR MYSQL_TEST_WINDIR MYSQLTEST_VARDIR
@@ -648,8 +659,15 @@
  if test -x "$BASEDIR/libexec/mysqld"
  then
    MYSQLD="$VALGRIND $BASEDIR/libexec/mysqld"
- else
+ elif test -x "$BASEDIR/bin/mysqld"
+ then
    MYSQLD="$VALGRIND $BASEDIR/bin/mysqld"
+ elif test -x "$BASEDIR/sbin/mysqld"
+ then
+   MYSQLD="$VALGRIND $BASEDIR/sbin/mysqld"
+ else
+   $ECHO "Fatal error: Cannot find program mysqld in $BASEDIR/{libexec,bin,sbin}"
1>&2
+   exit 1
  fi
  CLIENT_BINDIR="$BASEDIR/bin"
  if test -d "$BASEDIR/tests"
@@ -1261,7 +1279,7 @@
     then
       $ECHO "set args $master_args" > $GDB_MASTER_INIT$1
       $ECHO "To start gdb for the master , type in another window:"
-      $ECHO "cd $CWD ; gdb -x $GDB_MASTER_INIT$1 $MASTER_MYSQLD"
+      $ECHO "cd $MYSQL_TEST_DIR ; gdb -x $GDB_MASTER_INIT$1 $MASTER_MYSQLD"
       wait_for_master=1500
     else
       ( $ECHO set args $master_args;
@@ -1377,7 +1395,7 @@
     then
       $ECHO "set args $slave_args" > $GDB_SLAVE_INIT
       echo "To start gdb for the slave, type in another window:"
-      echo "cd $CWD ; gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD"
+      echo "cd $MYSQL_TEST_DIR ; gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD"
       wait_for_slave=1500
     else
       ( $ECHO set args $slave_args;

--- 1.70/mysql-test/mysql-test-run.pl	2006-11-01 20:17:14 +01:00
+++ 1.71/mysql-test/mysql-test-run.pl	2006-11-01 20:17:14 +01:00
@@ -431,7 +431,7 @@
 
   $glob_hostname=  mtr_short_hostname();
 
-  # 'basedir' is always parent of "mysql-test" directory
+  # 'basedir' is always above "mysql-test" directory ...
   $glob_mysql_test_dir=  cwd();
   if ( $glob_cygwin_perl )
   {
@@ -442,8 +442,19 @@
     chomp($glob_mysql_test_dir);
     chomp($glob_cygwin_shell);
   }
+  # ... direct parent for "tar.gz" installations, ...
   $glob_basedir=         dirname($glob_mysql_test_dir);
+  # ... or one more level up, for RPM installations.
+  if ( ! -d "$glob_basedir/bin" )
+  {
+    $glob_basedir=       dirname($glob_basedir);
+  }
+  # "mysql-bench" might be installed, but need not be.
   $glob_mysql_bench_dir= "$glob_basedir/mysql-bench"; # FIXME make configurable
+  if ( ! -d "$glob_mysql_bench_dir" )
+  {
+    $glob_mysql_bench_dir= undef;
+  }
 
   # needs to be same length to test logging (FIXME what???)
   $path_slave_load_tmpdir=  "../../var/tmp";
@@ -646,6 +657,13 @@
     $opt_vardir= "$glob_mysql_test_dir/$opt_vardir";
   }
 
+  # Ensure a proper error message 
+  mkpath("$opt_vardir");
+  unless ( -d $opt_vardir and -w $opt_vardir )
+  {
+    mtr_error("Writable 'var' directory is needed, use the '--vardir' option");
+  }
+
   # --------------------------------------------------------------------------
   # If not set, set these to defaults
   # --------------------------------------------------------------------------
@@ -984,7 +1002,8 @@
     else
     {
       $exe_mysqld=         mtr_exe_exists ("$glob_basedir/libexec/mysqld",
-                                           "$glob_basedir/bin/mysqld");
+                                           "$glob_basedir/bin/mysqld",
+                                           "$glob_basedir/sbin/mysqld");
     }
 
     if ( $glob_use_embedded_server )
Thread
bk commit into 4.1 tree (joerg:1.2557) BUG#17194Joerg Bruehe1 Nov