Commit 156b1b81 authored by Yicheng Qin's avatar Yicheng Qin Committed by Pavel Emelyanov

test: create env.sh for environment setting

Currently, env.sh only contains the location of criu executable.
Signed-off-by: 's avatarYicheng Qin <yichengq@google.com>
Acked-by: 's avatarAndrew Vagin <avagin@parallels.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f1684be8
#!/bin/bash #!/bin/bash
source ../../../functions.sh || exit 1 source ../../../functions.sh || exit 1
source ../../../env.sh || exit 1
criu="../../../../criu"
cleanup_class() { cleanup_class() {
rm -f ./*.class rm -f ./*.class
......
#!/usr/bin/expect #!/usr/bin/expect
source ../../env.sh || exit 1
exec rm -rf ./dump exec rm -rf ./dump
exec mkdir ./dump exec mkdir ./dump
...@@ -21,7 +23,7 @@ switch $current { ...@@ -21,7 +23,7 @@ switch $current {
puts "FAIL: Timed out on ready" puts "FAIL: Timed out on ready"
exit -1 exit -1
} }
system ../../../criu dump -v4 -D ./dump -o dump.log -j -t $pid system $criu dump -v4 -D ./dump -o dump.log -j -t $pid
system echo "$pid" > ./dump/pid.pid system echo "$pid" > ./dump/pid.pid
exit 0 exit 0
} }
...@@ -37,7 +39,7 @@ switch $current { ...@@ -37,7 +39,7 @@ switch $current {
exit -1 exit -1
} }
spawn ../../../criu restore -v4 -D ./dump -o restore.log -j spawn $criu restore -v4 -D ./dump -o restore.log -j
# #
# spawn doesn't wait for restore to complete, so # spawn doesn't wait for restore to complete, so
# add some sleep here. Still better would be to # add some sleep here. Still better would be to
......
#!/bin/bash #!/bin/bash
source ../../env.sh || exit 1
[ -z "$CR_IP_TOOL" ] && CR_IP_TOOL=ip [ -z "$CR_IP_TOOL" ] && CR_IP_TOOL=ip
cd `dirname $0` cd `dirname $0`
criu="../../../criu"
name=$1 name=$1
[ -z "$name" ] && { cat <<EOF [ -z "$name" ] && { cat <<EOF
Usage: $0 NAME [PID]" Usage: $0 NAME [PID]"
......
#!/bin/bash #!/bin/bash
source ../../functions.sh || exit 1 source ../../functions.sh || exit 1
source ../../env.sh || exit 1
criu="../../../criu"
cleanup_wd() { cleanup_wd() {
rm -f "ref-*" rm -f "ref-*"
......
#!/bin/bash #!/bin/bash
source ../../functions.sh || exit 1 source ../../functions.sh || exit 1
source ../../env.sh || exit 1
criu="../../../criu"
set -x set -x
......
#!/bin/bash #!/bin/bash
source ../../functions.sh || exit 1 source ../../functions.sh || exit 1
source ../../env.sh || exit 1
criu="../../../criu"
DEPTH=3 DEPTH=3
SPAN=5 SPAN=5
archref="arch-ref.tar.bz2" archref="arch-ref.tar.bz2"
......
set -m set -m
source ../../functions.sh || exit 1 source ../../functions.sh || exit 1
source ../../env.sh || exit 1
criu="../../../criu"
mkdir data mkdir data
......
#!/bin/sh
CRIU=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../criu)
criu=$CRIU
#!/bin/bash #!/bin/bash
source ../env.sh || exit 1
function fail { function fail {
echo "$@" echo "$@"
exit 1 exit 1
} }
set -x set -x
CRIU="../../criu"
IMGDIR="dump/" IMGDIR="dump/"
rm -rf "$IMGDIR" rm -rf "$IMGDIR"
......
#!/bin/bash #!/bin/bash
source ../env.sh || exit 1
USEPS=0 USEPS=0
if [ "$1" = "-s" ]; then if [ "$1" = "-s" ]; then
...@@ -18,7 +20,6 @@ function fail { ...@@ -18,7 +20,6 @@ function fail {
} }
set -x set -x
CRIU="../../criu"
IMGDIR="dump/" IMGDIR="dump/"
rm -rf "$IMGDIR" rm -rf "$IMGDIR"
......
#!/bin/bash #!/bin/bash
source ../env.sh || exit 1
USEPS=0 USEPS=0
if [ "$1" = "-s" ]; then if [ "$1" = "-s" ]; then
...@@ -18,7 +20,6 @@ function fail { ...@@ -18,7 +20,6 @@ function fail {
} }
set -x set -x
CRIU="../../criu"
IMGDIR="dump/" IMGDIR="dump/"
rm -rf "$IMGDIR" rm -rf "$IMGDIR"
......
#!/bin/bash #!/bin/bash
source ../env.sh || exit 1
set -x set -x
PORT=12345 PORT=12345
...@@ -7,7 +9,6 @@ CLN_PIPE="./clnt_pipe" ...@@ -7,7 +9,6 @@ CLN_PIPE="./clnt_pipe"
SRV_LOG="./srv.log" SRV_LOG="./srv.log"
CLN_LOG="./cln.log" CLN_LOG="./cln.log"
DDIR="dump" DDIR="dump"
CRIU="../../criu"
TEXT=$(hexdump -C /dev/urandom | head -n 1) TEXT=$(hexdump -C /dev/urandom | head -n 1)
......
...@@ -137,7 +137,8 @@ fanotify00 ...@@ -137,7 +137,8 @@ fanotify00
sk-netlink sk-netlink
" "
CRIU=$(readlink -f `dirname $0`/../criu) source $(readlink -f `dirname $0`/env.sh) || exit 1
CRIU_CPT=$CRIU CRIU_CPT=$CRIU
TMP_TREE="" TMP_TREE=""
SCRIPTDIR=`dirname $CRIU`/test SCRIPTDIR=`dirname $CRIU`/test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment