<div dir="ltr"><div>May someone look over this patch?<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Thx!!<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 13, 2013 at 6:00 PM, Yicheng Qin <span dir="ltr"><<a href="mailto:yichengq@google.com" target="_blank">yichengq@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Currently, env.sh only contains the location of criu executable.<br>
<br>
Signed-off-by: Yicheng Qin <<a href="mailto:yichengq@google.com">yichengq@google.com</a>><br>
---<br>
test/app-emu/java/HelloWorld/run.sh | 3 +--<br>
test/app-emu/job/job.exp | 6 ++++--<br>
test/app-emu/lxc/run.sh | 4 ++--<br>
test/app-emu/make/run.sh | 3 +--<br>
test/app-emu/screen/run.sh | 3 +--<br>
test/app-emu/tarbz/run.sh | 2 +-<br>
test/app-emu/vnc/run.sh | 3 +--<br>
test/env.sh | 4 ++++<br>
test/mem-snap/run-predump-2.sh | 3 ++-<br>
test/mem-snap/run-predump.sh | 3 ++-<br>
test/mem-snap/run-snap.sh | 3 ++-<br>
test/tcp/run.sh | 3 ++-<br>
test/zdtm.sh | 3 ++-<br>
13 files changed, 25 insertions(+), 18 deletions(-)<br>
create mode 100755 test/env.sh<br>
<br>
diff --git a/test/app-emu/java/HelloWorld/run.sh b/test/app-emu/java/HelloWorld/run.sh<br>
index 7f94d3a..0ed6afd 100644<br>
--- a/test/app-emu/java/HelloWorld/run.sh<br>
+++ b/test/app-emu/java/HelloWorld/run.sh<br>
@@ -1,8 +1,7 @@<br>
#!/bin/bash<br>
<br>
source ../../../functions.sh || exit 1<br>
-<br>
-criu="../../../../criu"<br>
+source ../../../env.sh || exit 1<br>
<br>
cleanup_class() {<br>
rm -f ./*.class<br>
diff --git a/test/app-emu/job/job.exp b/test/app-emu/job/job.exp<br>
index 1b9b7fb..1409103 100755<br>
--- a/test/app-emu/job/job.exp<br>
+++ b/test/app-emu/job/job.exp<br>
@@ -1,5 +1,7 @@<br>
#!/usr/bin/expect<br>
<br>
+source ../../env.sh || exit 1<br>
+<br>
exec rm -rf ./dump<br>
exec mkdir ./dump<br>
<br>
@@ -21,7 +23,7 @@ switch $current {<br>
puts "FAIL: Timed out on ready"<br>
exit -1<br>
}<br>
- system ../../../criu dump -v4 -D ./dump -o dump.log -j -t $pid<br>
+ system $criu dump -v4 -D ./dump -o dump.log -j -t $pid<br>
system echo "$pid" > ./dump/pid.pid<br>
exit 0<br>
}<br>
@@ -37,7 +39,7 @@ switch $current {<br>
exit -1<br>
}<br>
<br>
- spawn ../../../criu restore -v4 -D ./dump -o restore.log -j<br>
+ spawn $criu restore -v4 -D ./dump -o restore.log -j<br>
#<br>
# spawn doesn't wait for restore to complete, so<br>
# add some sleep here. Still better would be to<br>
diff --git a/test/app-emu/lxc/run.sh b/test/app-emu/lxc/run.sh<br>
index 3b86f00..3664f5f 100755<br>
--- a/test/app-emu/lxc/run.sh<br>
+++ b/test/app-emu/lxc/run.sh<br>
@@ -1,11 +1,11 @@<br>
#!/bin/bash<br>
<br>
+source ../../env.sh || exit 1<br>
+<br>
[ -z "$CR_IP_TOOL" ] && CR_IP_TOOL=ip<br>
<br>
cd `dirname $0`<br>
<br>
-criu="../../../criu"<br>
-<br>
name=$1<br>
[ -z "$name" ] && { cat <<EOF<br>
Usage: $0 NAME [PID]"<br>
diff --git a/test/app-emu/make/run.sh b/test/app-emu/make/run.sh<br>
index 582d4d7..7cb44c7 100644<br>
--- a/test/app-emu/make/run.sh<br>
+++ b/test/app-emu/make/run.sh<br>
@@ -1,8 +1,7 @@<br>
#!/bin/bash<br>
<br>
source ../../functions.sh || exit 1<br>
-<br>
-criu="../../../criu"<br>
+source ../../env.sh || exit 1<br>
<br>
cleanup_wd() {<br>
rm -f "ref-*"<br>
diff --git a/test/app-emu/screen/run.sh b/test/app-emu/screen/run.sh<br>
index 67c9913..3227491 100644<br>
--- a/test/app-emu/screen/run.sh<br>
+++ b/test/app-emu/screen/run.sh<br>
@@ -1,8 +1,7 @@<br>
#!/bin/bash<br>
<br>
source ../../functions.sh || exit 1<br>
-<br>
-criu="../../../criu"<br>
+source ../../env.sh || exit 1<br>
<br>
set -x<br>
<br>
diff --git a/test/app-emu/tarbz/run.sh b/test/app-emu/tarbz/run.sh<br>
index 0a48900..677c6de 100644<br>
--- a/test/app-emu/tarbz/run.sh<br>
+++ b/test/app-emu/tarbz/run.sh<br>
@@ -1,8 +1,8 @@<br>
#!/bin/bash<br>
<br>
source ../../functions.sh || exit 1<br>
+source ../../env.sh || exit 1<br>
<br>
-criu="../../../criu"<br>
DEPTH=3<br>
SPAN=5<br>
archref="arch-ref.tar.bz2"<br>
diff --git a/test/app-emu/vnc/run.sh b/test/app-emu/vnc/run.sh<br>
index 7445d63..b3a9822 100755<br>
--- a/test/app-emu/vnc/run.sh<br>
+++ b/test/app-emu/vnc/run.sh<br>
@@ -1,8 +1,7 @@<br>
set -m<br>
<br>
source ../../functions.sh || exit 1<br>
-<br>
-criu="../../../criu"<br>
+source ../../env.sh || exit 1<br>
<br>
mkdir data<br>
<br>
diff --git a/test/env.sh b/test/env.sh<br>
new file mode 100755<br>
index 0000000..ab015e0<br>
--- /dev/null<br>
+++ b/test/env.sh<br>
@@ -0,0 +1,4 @@<br>
+#!/bin/sh<br>
+<br>
+CRIU=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../criu)<br>
+criu=$CRIU<br>
diff --git a/test/mem-snap/run-predump-2.sh b/test/mem-snap/run-predump-2.sh<br>
index bb336e8..3fc2f74 100755<br>
--- a/test/mem-snap/run-predump-2.sh<br>
+++ b/test/mem-snap/run-predump-2.sh<br>
@@ -1,12 +1,13 @@<br>
#!/bin/bash<br>
<br>
+source ../env.sh || exit 1<br>
+<br>
function fail {<br>
echo "$@"<br>
exit 1<br>
}<br>
set -x<br>
<br>
-CRIU="../../criu"<br>
IMGDIR="dump/"<br>
<br>
rm -rf "$IMGDIR"<br>
diff --git a/test/mem-snap/run-predump.sh b/test/mem-snap/run-predump.sh<br>
index edfd26f..741d8eb 100755<br>
--- a/test/mem-snap/run-predump.sh<br>
+++ b/test/mem-snap/run-predump.sh<br>
@@ -1,5 +1,7 @@<br>
#!/bin/bash<br>
<br>
+source ../env.sh || exit 1<br>
+<br>
USEPS=0<br>
<br>
if [ "$1" = "-s" ]; then<br>
@@ -18,7 +20,6 @@ function fail {<br>
}<br>
set -x<br>
<br>
-CRIU="../../criu"<br>
IMGDIR="dump/"<br>
<br>
rm -rf "$IMGDIR"<br>
diff --git a/test/mem-snap/run-snap.sh b/test/mem-snap/run-snap.sh<br>
index 08f7669..d2a6207 100755<br>
--- a/test/mem-snap/run-snap.sh<br>
+++ b/test/mem-snap/run-snap.sh<br>
@@ -1,5 +1,7 @@<br>
#!/bin/bash<br>
<br>
+source ../env.sh || exit 1<br>
+<br>
USEPS=0<br>
<br>
if [ "$1" = "-s" ]; then<br>
@@ -18,7 +20,6 @@ function fail {<br>
}<br>
set -x<br>
<br>
-CRIU="../../criu"<br>
IMGDIR="dump/"<br>
<br>
rm -rf "$IMGDIR"<br>
diff --git a/test/tcp/run.sh b/test/tcp/run.sh<br>
index 43a0674..702879d 100755<br>
--- a/test/tcp/run.sh<br>
+++ b/test/tcp/run.sh<br>
@@ -1,5 +1,7 @@<br>
#!/bin/bash<br>
<br>
+source ../env.sh || exit 1<br>
+<br>
set -x<br>
<br>
PORT=12345<br>
@@ -7,7 +9,6 @@ CLN_PIPE="./clnt_pipe"<br>
SRV_LOG="./srv.log"<br>
CLN_LOG="./cln.log"<br>
DDIR="dump"<br>
-CRIU="../../criu"<br>
<br>
TEXT=$(hexdump -C /dev/urandom | head -n 1)<br>
<br>
diff --git a/test/zdtm.sh b/test/zdtm.sh<br>
index 61aae6c..71fc8e3 100755<br>
--- a/test/zdtm.sh<br>
+++ b/test/zdtm.sh<br>
@@ -150,7 +150,8 @@ fanotify00<br>
sk-netlink<br>
"<br>
<br>
-CRIU=$(readlink -f `dirname $0`/../criu)<br>
+source $(readlink -f `dirname $0`/env.sh) || exit 1<br>
+<br>
CRIU_CPT=$CRIU<br>
TMP_TREE=""<br>
SCRIPTDIR=`dirname $CRIU`/test<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3<br>
<br>
</font></span></blockquote></div><br></div>