Bug #31983 Running mysql-test from RPM fails for NDB
Submitted: 31 Oct 2007 10:54 Modified: 5 Jan 2009 1:39
Reporter: MC Brown Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.0.45 OS:Linux (CentOS 4)
Assigned to: Bjørn Munch CPU Architecture:Any

[31 Oct 2007 10:54] MC Brown
Description:
I downloaded and installed the 5.0.45 RPMs and Cluster RPMs so that I could run mysql-test-run. 

However, the test run fails to find the NDB binaries: 

Logging: ./mysql-test-run ndb_restore_print
MySQL Version 5.0.45
Using ndbcluster when necessary, mysqld supports it
Setting mysqld to support SSL connections
mysql-test-run: WARNING: Could not find all required ndb binaries, all ndb tests will fail, use --skip-ndbcluster to skip testing it.
Using MTR_BUILD_THREAD      = 0

Checking the actual mysql-test-run script, and the installed locations of the files it's looking for, either the install is putting the files in the wrong place, or the test script is looking in the wrong place. 

In particular, the ndbd and ndb_mgmd are installed from the RPM into /usr/sbin, but mysql-test-run only looks in /usr/bin for the binaries. 

How to repeat:
Install MySQL+Cluster from RPM: 

MySQL-client-community-5.0.45-0.rhel4
MySQL-clusterextra-community-5.0.45-0.rhel4
MySQL-clustermanagement-community-5.0.45-0.rhel4
MySQL-clusterstorage-community-5.0.45-0.rhel4
MySQL-clustertools-community-5.0.45-0.rhel4
MySQL-devel-community-5.0.45-0.rhel4
MySQL-server-community-5.0.45-0.rhel4
MySQL-test-community-5.0.45-0.rhel4

Execute mysql-test-run:

cd /usr/share/mysql-test
./mysql-test-run

Suggested fix:
Update the mysql-test-run to look in /usr/sbin, or install the NDB daemons into /usr/bin
[31 Oct 2007 10:55] MC Brown
If you create symbolic links to the ndbd and ndb_mgmd files, the test run script and the tests themselves run fine: 

ln -s /usr/sbin/ndbd /usr/bin/ndbd
ln -s /usr/sbin/ndb_mgmd /usr/bin/ndb_mgmd
[17 Feb 2008 16:14] Valeriy Kravchuk
Thank you for a problem report and workaround. Please, try to repeat with a newer version, 5.0.51a/5.0.56, and inform about the results.
[18 Mar 2008 0:02] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[20 Mar 2008 9:34] Susanne Ebrecht
We still need to know if this occurs in newer version.
[20 Apr 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[9 Dec 2008 17:22] Joerg Bruehe
Just ran into the same issue with RPMs of cluster-6.3.20, but this should be independent of the version.

The original analysis is correct, the problem is that "mysql-test-run.pl" doesn't check in "/usr/sbin" for the daemons.

I got it to work with this patch:
--- mysql-test-run.pl   2008-12-03 02:54:07.000000000 +0100
+++ mysql-test-run      2008-12-09 17:58:02.000000000 +0100
@@ -1584,16 +1584,21 @@
                                "$glob_basedir/storage/ndb",
                                "$glob_basedir/bin");

+  my $daemon_path= mtr_file_exists("$glob_basedir/ndb",
+                               "$glob_basedir/storage/ndb",
+                               "$glob_basedir/sbin",
+                               "$glob_basedir/bin");
+
   $exe_ndbd=
     mtr_exe_maybe_exists("$ndb_path/src/kernel/ndbd",
-                        "$ndb_path/ndbd",
+                        "$daemon_path/ndbd",
                         "$glob_basedir/libexec/ndbd");
   $exe_ndb_mgm=
     mtr_exe_maybe_exists("$ndb_path/src/mgmclient/ndb_mgm",
                         "$ndb_path/ndb_mgm");
   $exe_ndb_mgmd=
     mtr_exe_maybe_exists("$ndb_path/src/mgmsrv/ndb_mgmd",
-                        "$ndb_path/ndb_mgmd",
+                        "$daemon_path/ndb_mgmd",
                         "$glob_basedir/libexec/ndb_mgmd");
   $exe_ndb_waiter=
     mtr_exe_maybe_exists("$ndb_path/tools/ndb_waiter",

For diagnostic purposes, this addition proved helpful:
@@ -1610,6 +1615,11 @@
   $exe_ndb_example=
     mtr_file_exists("$path_ndb_examples_dir/ndbapi_simple/ndbapi_simple");

+  mtr_warning("Used settings 'glob_basedir' '$glob_basedir', 'ndb_path' '$ndb_path', " .
+              "'daemon_path' '$daemon_path'.");
+  mtr_warning("Found programs '$exe_ndbd', '$exe_ndb_mgm', '$exe_ndb_mgmd', '$exe_ndb_waiter'.");
+  mtr_warning("Found directories '$path_ndb_tools_dir', '$path_ndb_examples_dir', '$exe_ndb_example'.");
+
   return ( $exe_ndbd eq "" or
           $exe_ndb_mgm eq "" or
           $exe_ndb_mgmd eq "" or

I know 5.0 is GA and "stable", but it is a shame that you cannot run the tests including cluster if installed from RPM, this embarrassment should be stopped.
[12 Dec 2008 14:12] 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/61498

2664 Bjorn Munch	2008-12-12
      Bug #31983 Running mysql-test from RPM fails for NDB
      Added $glob_basedir/sbin to search path for relevant binaries
[15 Dec 2008 14: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/61674

2702 Bjorn Munch	2008-12-15 [merge]
      Bug #31983 Running mysql-test from RPM fails for NDB
      Adds $glob_basedir/sbin to search path when needed
[28 Dec 2008 14:16] Bugs System
Pushed into 5.0.76 (revid:joerg@mysql.com-20081228133458-u9fpk3ad0cxwbfoy) (version source revid:bjorn.munch@sun.com-20081212141056-gnuq2q5uo7ri0uij) (merge vers: 5.0.76) (pib:6)
[28 Dec 2008 21:46] Bugs System
Pushed into 5.1.31 (revid:joerg@mysql.com-20081228151808-aou2s7esrmastj3e) (version source revid:bjorn.munch@sun.com-20081215141456-cckdri6lwvmw1r1l) (merge vers: 5.1.31) (pib:6)
[31 Dec 2008 17:15] Bugs System
Pushed into 6.0.10-alpha (revid:joerg@mysql.com-20081231141015-zruy7wn1un1yn8n2) (version source revid:timothy.smith@sun.com-20081217194623-9vumqc3f2giav4qm) (merge vers: 6.0.9-alpha) (pib:6)
[5 Jan 2009 1:39] Paul DuBois
Test suite change. No changelog entry needed.
[19 Jan 2009 11:27] Bugs System
Pushed into 5.1.31-ndb-6.2.17 (revid:tomas.ulin@sun.com-20090119095303-uwwvxiibtr38djii) (version source revid:tomas.ulin@sun.com-20090108105244-8opp3i85jw0uj5ib) (merge vers: 5.1.31-ndb-6.2.17) (pib:6)
[19 Jan 2009 13:05] Bugs System
Pushed into 5.1.31-ndb-6.3.21 (revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (version source revid:tomas.ulin@sun.com-20090119104956-guxz190n2kh31fxl) (merge vers: 5.1.31-ndb-6.3.21) (pib:6)
[19 Jan 2009 16:11] Bugs System
Pushed into 5.1.31-ndb-6.4.1 (revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (version source revid:tomas.ulin@sun.com-20090119144033-4aylstx5czzz88i5) (merge vers: 5.1.31-ndb-6.4.1) (pib:6)