testsuite: Special char file and dir transfer return and cleanup.

This commit is contained in:
Ole Tange 2015-01-19 00:08:07 +01:00
parent 649e2ec7c3
commit 92e65305df
3 changed files with 24 additions and 1 deletions

View file

@ -7418,7 +7418,6 @@ sub replaced {
my $regexp = join('|', map { my $s = $_; $s =~ s/(\W)/\\$1/g; $s } my $regexp = join('|', map { my $s = $_; $s =~ s/(\W)/\\$1/g; $s }
sort { length $b <=> length $a } keys %replace); sort { length $b <=> length $a } keys %replace);
for(@target) { for(@target) {
# ::debug("replace","Replace in ",::my_dump($_));
s/($regexp)/join(" ",@{$replace{$1}})/ge; s/($regexp)/join(" ",@{$replace{$1}})/ge;
} }
} }

View file

@ -35,4 +35,23 @@ echo '### --hostgroup -S @group1+grp2'
echo '### trailing space in sshlogin' echo '### trailing space in sshlogin'
echo 'sshlogin trailing space' | parallel --sshlogin "ssh -l parallel localhost " echo echo 'sshlogin trailing space' | parallel --sshlogin "ssh -l parallel localhost " echo
echo '### Special char file and dir transfer return and cleanup'
cd /tmp;
mkdir -p d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`";
echo local > d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"/f"`perl -e 'print pack("c*",1..9,11..46,48..255)'`";
ssh parallel@lo rm -rf d'*'/;
mytouch() {
cat d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"/f"`perl -e 'print pack("c*",1..9,11..46,48..255)'`" > d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"/g"`perl -e 'print pack("c*",1..9,11..46,48..255)'`";
echo remote OK >> d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"/g"`perl -e 'print pack("c*",1..9,11..46,48..255)'`";
};
export -f mytouch;
parallel --env mytouch -Sparallel@lo --transfer
--return d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"/g"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"
mytouch
::: d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"/f"`perl -e 'print pack("c*",1..9,11..46,48..255)'`";
cat d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"/g"`perl -e 'print pack("c*",1..9,11..46,48..255)'`";
# Should be changed to --return '{=s:/f:/g:=}' and tested with csh
EOF EOF

View file

@ -91,3 +91,8 @@ echo '### trailing space in sshlogin'
### trailing space in sshlogin ### trailing space in sshlogin
echo 'sshlogin trailing space' | parallel --sshlogin "ssh -l parallel localhost " echo echo 'sshlogin trailing space' | parallel --sshlogin "ssh -l parallel localhost " echo
sshlogin trailing space sshlogin trailing space
echo '### Special char file and dir transfer return and cleanup'
### Special char file and dir transfer return and cleanup
cd /tmp; mkdir -p d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"; echo local > d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"/f"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"; ssh parallel@lo rm -rf d'*'/; mytouch() { cat d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"/f"`perl -e 'print pack("c*",1..9,11..46,48..255)'`" > d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"/g"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"; echo remote OK >> d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"/g"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"; }; export -f mytouch; parallel --env mytouch -Sparallel@lo --transfer --return d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"/g"`perl -e 'print pack("c*",1..9,11..46,48..255)'`" mytouch ::: d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"/f"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"; cat d"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"/g"`perl -e 'print pack("c*",1..9,11..46,48..255)'`"; # Should be changed to --return '{=s:/f:/g:=}'
local
remote OK