403Webshell
Server IP : 104.21.38.3  /  Your IP : 172.68.242.118
Web Server : Apache
System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /www/server/mysql/src/libmysqld/examples/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/libmysqld/examples/test-run
#! /bin/sh

# Copyright (c) 2001, 2023, Oracle and/or its affiliates.
# Use is subject to license terms
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation.  The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA

# This is slapped together as a quick way to run the tests and
# is not meant for prime time.  Please hack at it and submit
# changes, though, so we can gradually turn it into something
# that will run on all platforms (or incorporate it into the
# standard mysql-test-run).

# All paths below must be relative to $test_data_dir
top_builddir=../..
mysql_test_dir=$top_builddir/mysql-test
examples=$top_builddir/libmysqld/examples
mysqltest=$examples/mysqltest_embedded
datadir=$mysql_test_dir/var/master-data
test_data_dir=test
gdb=0
list=0
run=
tests=
start=
clean=1

cr="
"
er="\b\b\b\b\b\b\b\b"

usage () {
    cat <<EOF
usage: $0 [-g|-h|-r] [test-name ...]

    -C | --noclean	Do not remove old innodb and bdb files at start.
    -g | --gdb          run $mysqltest in gdb
    -h | --help         show this help
    -l | --list )       list all available tests
    -r | --run          automatically 'run' program in gdb
    -s t | --start=t    start with test t (skip all tests before t)
EOF
}

init_args="--server-arg=--language=$top_builddir/sql/share/english"
while test $# -gt 0
do
    arg=
    argset=0
    case "$1" in
        --?*=* ) arg=`echo "$1" | sed -e 's,^[^=][^=]*=,,'`; argset=1 ;;
    esac

    case "$1" in
        -g | --gdb )  gdb=1; shift;;
        -h | --help | -\? ) usage; exit 0;;
        -l | --list ) list=1 ; shift ;;
        -r | --run ) run="${cr}run"; shift;;
        --debug)     init_args="$init_args --debug" ; shift ;;
        -C | --noclean) clean=0 ; shift ;;
        -s | --start=* )
            test $argset -eq 0 && { shift; arg="$1"; }
            start="$arg"
            shift
            ;;
        -* ) usage; exit 1;;
        * ) tests="$tests $1"; shift;;
    esac
done

if test ! -d "$datadir/$test_data_dir"
then
    echo "bad setup (is '$datadir/$test_data_dir'', missing ?)" >&2
    exit 1
fi

test -n "$tests" ||
    tests=`/bin/ls -1 "$mysql_test_dir"/t/*.test | grep -v '^.*/rpl[^/]*$' | \
        sed -e 's,^.*/,,' -e 's,.test$,,'`

echo "cleaning data directory '$datadir/$test_data_dir'"
if test $clean = 1
then
  rm -f $datadir/ib_* $datadir/ibdata*
  rm -f $datadir/log.00*
  rm -f $datadir/test/*.db
fi
rm -f $datadir/../tmp/*
rm -f test-gdbinit

TZ=GMT-3; export TZ

# At least one of the tests needs the following environment variable
MYSQL_TEST_DIR=`( cd $mysql_test_dir ; pwd )` ; export MYSQL_TEST_DIR

skip=1
test -z "$start" && skip=0

for b in $tests
do
    test $list -eq 1 && { echo "  $b"; continue; }
    test $skip -eq 1 && test -n "$start" && test "$start" = "$b" && skip=0
    test $skip -eq 1 && { echo "skipping '$b'"; continue; }

    t="t/$b.test"
    r="r/$b.result"

    # Only test if $t exists; there is no $r for some tests
    test -f $mysql_test_dir/$t || {
        echo "test '$mysql_test_dir/$t' doesn't exist" >&2
        continue
    }
    args="$init_args -v --basedir=$mysql_test_dir/ -R $r -x $t --server-arg=--datadir=$datadir"
    if test -f "$mysql_test_dir/t/$b-master.opt" ; then
       args="$args --server-file=t/$b-master.opt"
    fi

    args="$args $test_data_dir"		# Add database last
    echo "set args $args$run" > test-gdbinit
    #if false && test -n "$run"
    if test -n "$run" -o $gdb -eq 1
    then
        echo -e "$er>>> $b"
    else
        echo -e "$er>>> $b> \c"
        read junk
    fi
    if test $gdb -eq 1
    then
	if [ -x "$top_builddir/libtool" ]; then
	  $top_builddir/libtool gdb -x test-gdbinit -q $mysqltest
	else
	  gdb -x test-gdbinit -q $mysqltest
	fi
        res=$?
        rm -f test-gdbinit
    else
        $mysqltest $args
        res=$?
    fi

    test $res -eq 0 -o $res -eq 2 || echo "!!! error: $res"
done

Youez - 2016 - github.com/yon3zu
LinuXploit