mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-25 15:37:56 +00:00
sql: Use credentials file for MySQL to avoid warning.
This commit is contained in:
parent
c55493944c
commit
7032e5dec2
12
src/sql
12
src/sql
|
@ -666,9 +666,19 @@ sub mysql_commands {
|
|||
if ($database_driver eq "mysqlssl") {
|
||||
$ssl="--ssl";
|
||||
}
|
||||
my($credential_fh,$tmp) = tempfile(SUFFIX => ".sql");
|
||||
chmod (0600,$tmp);
|
||||
print $credential_fh ("[client]\n",
|
||||
$user && "user=$opt{'user'}\n",
|
||||
$password && "password=$opt{'password'}\n",
|
||||
$host && "host=$opt{'host'}\n");
|
||||
close $credential_fh;
|
||||
|
||||
# Prepend with a remover of the tempfile
|
||||
# -C: Compression if both ends support it
|
||||
$batch_command =
|
||||
"mysql -C $pass_through_options $no_headers $html $ssl $host $user $port $password $database";
|
||||
"(sleep 1; rm $tmp) &".
|
||||
"mysql --defaults-extra-file=$tmp -C $pass_through_options $no_headers $html $ssl $host $user $port $database";
|
||||
$interactive_command = $batch_command;
|
||||
return($batch_command,$interactive_command);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ prereqlocal: installparallel
|
|||
timeout 5 ssh csh@lo true || (echo ssh csh@lo is required for testsuite; /bin/false)
|
||||
|
||||
prereqremote: installparallel startvm
|
||||
parallel -j0 --timeout 10 --tag ssh parallel@parallel-server{} parallel --minversion 20121021 ::: 1 2 3 || (echo parallel on remote required for testsuite; /bin/true)
|
||||
parallel -j0 --timeout 10 --tag ssh parallel@parallel-server{} parallel --minversion 20121021 ::: 1 2 || (echo parallel on remote required for testsuite; /bin/true)
|
||||
|
||||
startvm:
|
||||
# Make sure we can reach the virtual machines
|
||||
|
|
|
@ -58,8 +58,10 @@ create_shell_user() {
|
|||
echo Do ssh $shell@lo 'cat .ssh/id_rsa.pub >> .ssh/authorized_keys' &&
|
||||
ssh $shell@lo 'cat .ssh/id_rsa.pub >> .ssh/authorized_keys' &&
|
||||
ssh $shell@lo cat .ssh/id_rsa.pub | ssh parallel@lo 'cat >> .ssh/authorized_keys' &&
|
||||
ssh $shell@lo 'echo ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxg+dh+BL1myqo6A+pHcQCKVV5v7cewdkN8xGtMDqm7xGgh+e5A44W7qKViIx641d6yoWb012XzDz2MKetG4Kosoma8Z/qkS27p6901RmI3ap2JFffzBESlpQtW1FyxQPlMyBfrd4ONy8xW6R/gEkjC3yOcXCQO2494/c46ouXs5gtE84Cusr3RsopR4bI7oloH1GQZ4vsHSFSakq8IwcujaSh1mmribMONLb2TjDpmE7tAY+yfOVWHPQ2J+EU1//Go60EZfSRKOu81oxW7SJ2uGgWfWcs2T1lRtT8Yh+TwVTz8UFV75kVtpZ10x5baN+ncsSpaBK+8sFLfoMvA9yQQ== tange@freebsd71.tange.dk >> .ssh/authorized_keys' &&
|
||||
echo Do env_parallel --install &&
|
||||
ssh $shell@lo env_parallel --install &&
|
||||
ssh $shell@lo 'mkdir .parallel; touch .parallel/will-cite' &&
|
||||
echo OK Created $shell &&
|
||||
echo
|
||||
}
|
||||
|
|
|
@ -9,10 +9,10 @@ echo '### --hostgroup two group arg'
|
|||
parallel -k --sshdelay 0.1 --hgrp -S @g1/1/parallel@lo -S @g2/3/lo whoami\;sleep 0.3{} ::: {1..8}@g1+g2 | sort
|
||||
|
||||
echo '### --hostgroup one group arg'
|
||||
parallel --delay 0.1 --hgrp -S @g1/1/parallel@lo -S @g2/3/lo whoami\;sleep 0.2{} ::: {1..8}@g2
|
||||
parallel --delay 0.2 --hgrp -S @g1/1/parallel@lo -S @g2/3/lo whoami\;sleep 0.4{} ::: {1..8}@g2
|
||||
|
||||
echo '### --hostgroup multiple group arg + unused group'
|
||||
parallel --delay 0.1 --hgrp -S @g1/1/parallel@lo -S @g1/3/lo -S @g3/100/tcsh@lo whoami\;sleep 0.4{} ::: {1..8}@g1+g2 | sort
|
||||
parallel --delay 0.2 --hgrp -S @g1/1/parallel@lo -S @g1/3/lo -S @g3/100/tcsh@lo whoami\;sleep 0.8{} ::: {1..8}@g1+g2 | sort
|
||||
|
||||
echo '### --hostgroup two groups @'
|
||||
parallel -k --hgrp -S @g1/parallel@lo -S @g2/lo --tag whoami\;echo ::: parallel@g1 tange@g2
|
||||
|
|
|
@ -76,7 +76,7 @@ perl -ne '$/="\n\n"; /^Output/../^[^O]\S/ and next; /^ / and print;' ../../src/
|
|||
s/^(\d\d)$/99/;
|
||||
# Fails often due to race
|
||||
s/cat: input_file: No such file or directory\n//;
|
||||
s{rsync: link_stat "/home/parallel/input_file.out" .*\n}{};
|
||||
s{rsync: link_stat ".*/home/parallel/input_file.out" .*\n}{};
|
||||
s{rsync error: some files/attrs were not transferred .*\n}{};
|
||||
'
|
||||
# 3+3 .par files (from --files), 1 .tms-file from tmux attach
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
mysqlrootpass=${mysqlrootpass:-b+Ydjq4ejT4E}
|
||||
mysqlrootpass=${mysqlrootpass:-M-b+Ydjq4ejT4E}
|
||||
MYSQL_ADMIN_DBURL=mysql://root:$mysqlrootpass@/mysql
|
||||
|
||||
exec 2>&1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
mysqlrootpass=${mysqlrootpass:-b+Ydjq4ejT4E}
|
||||
mysqlrootpass=${mysqlrootpass:-M-b+Ydjq4ejT4E}
|
||||
MYSQL_ADMIN_DBURL=mysql://root:$mysqlrootpass@/mysql
|
||||
|
||||
exec 2>&1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
SERVER1=parallel-server3
|
||||
SERVER1=parallel-server1
|
||||
SERVER2=parallel-server2
|
||||
|
||||
echo '### Test -M (--retries to avoid false errors)'
|
||||
|
|
|
@ -22,7 +22,7 @@ tange
|
|||
tange
|
||||
echo '### --hostgroup one group arg'
|
||||
### --hostgroup one group arg
|
||||
parallel --delay 0.1 --hgrp -S @g1/1/parallel@lo -S @g2/3/lo whoami\;sleep 0.2{} ::: {1..8}@g2
|
||||
parallel --delay 0.2 --hgrp -S @g1/1/parallel@lo -S @g2/3/lo whoami\;sleep 0.4{} ::: {1..8}@g2
|
||||
tange
|
||||
tange
|
||||
tange
|
||||
|
@ -33,7 +33,7 @@ tange
|
|||
tange
|
||||
echo '### --hostgroup multiple group arg + unused group'
|
||||
### --hostgroup multiple group arg + unused group
|
||||
parallel --delay 0.1 --hgrp -S @g1/1/parallel@lo -S @g1/3/lo -S @g3/100/tcsh@lo whoami\;sleep 0.4{} ::: {1..8}@g1+g2 | sort
|
||||
parallel --delay 0.2 --hgrp -S @g1/1/parallel@lo -S @g1/3/lo -S @g3/100/tcsh@lo whoami\;sleep 0.8{} ::: {1..8}@g1+g2 | sort
|
||||
parallel
|
||||
parallel
|
||||
tange
|
||||
|
|
|
@ -852,6 +852,8 @@ MFLAGS
|
|||
MOZ_NO_REMOTE
|
||||
ORACLE_HOME
|
||||
ORACLE_SID
|
||||
PAM_KWALLET5_LOGIN
|
||||
PAM_KWALLET_LOGIN
|
||||
PARALLEL
|
||||
PARALLEL_PID
|
||||
PARALLEL_SEQ
|
||||
|
@ -1371,4 +1373,4 @@ C
|
|||
echo A
|
||||
echo B
|
||||
echo C
|
||||
7
|
||||
8
|
||||
|
|
Loading…
Reference in a new issue