Debian Codegraph @

mysql-test/suite/ndb/include/have_ndb_rqg.inc

raw
1 --perl
2 use strict;
3
4 use File::Basename;
5 use IO::File;
6 use lib "lib/";
7 use My::Find;
8
9 #
10 # Look for
11 # - RQG_HOME
12 # - binaries needed to run ndb rqg scripts
13 #
14
15 #
16 # Set up paths
17 #
18 my $vardir = $ENV{MYSQLTEST_VARDIR} or die "Need MYSQLTEST_VARDIR";
19 my $mysql_test_dir = $ENV{MYSQL_TEST_DIR} or die "Need MYSQL_TEST_DIR";
20 my $basedir = dirname($mysql_test_dir);
21 my $bindir = $ENV{MTR_BINDIR} || $basedir; # Out of source set MTR_BINDIR
22
23 #
24 # Check if the needed jars and libs are available
25 #
26
27 my $runall = my_find_file($basedir,
28 ["storage/ndb/test/rqg" ],
29 "load_and_run.sh", NOT_REQUIRED);
30
31 my $loadrqg = my_find_file($basedir,
32 ["storage/ndb/test/rqg" ],
33 "load_rqg.sh", NOT_REQUIRED);
34
35 my $runrqg = my_find_file($basedir,
36 ["storage/ndb/test/rqg" ],
37 "run_rqg.sh", NOT_REQUIRED);
38
39 my $exe_mysqltest = my_find_bin($bindir,
40 ["client", "bin"],
41 "mysqltest", NOT_REQUIRED);
42
43 my $F = IO::File->new("$vardir/tmp/have_ndb_rqg.inc", 'w') or die;
44 if ($ENV{RQG_HOME}) {
45 print $F "--echo RQG_HOME: $ENV{RQG_HOME}\n"
46 } else {
47 print $F "skip Could not find RQG, set environment variable RQG_HOME\n";
48 }
49
50 my $env_mysqltest="";
51 if ($exe_mysqltest) {
52 $env_mysqltest="EXE_MYSQLTEST=$exe_mysqltest"
53 }
54 else {
55 print $F "skip Could find mysqltest binary\n";
56 }
57
58
59 if ($runall) {
60 print $F "--let \$RUN_ALL= $env_mysqltest bash $runall -p \$MASTER_MYPORT\n"
61 } else {
62 print $F "skip Could not find load_and_run.sh\n";
63 }
64
65 if ($loadrqg) {
66 print $F "--let \$LOAD_RQG= $env_mysqltest bash $loadrqg -p \$MASTER_MYPORT\n"
67 } else {
68 print $F "skip Could not find load_rqg.sh\n";
69 }
70
71 if ($runrqg) {
72 print $F "--let \$RUN_RQG= $env_mysqltest bash $runrqg -p \$MASTER_MYPORT\n"
73 } else {
74 print $F "skip Could not find run_rqg.sh\n";
75 }
76
77 $F->close();
78
79 EOF
80
81 --source $MYSQLTEST_VARDIR/tmp/have_ndb_rqg.inc