2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

test: create env.sh for environment setting

Currently, env.sh only contains the location of criu executable.

Signed-off-by: Yicheng Qin <yichengq@google.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Yicheng Qin
2013-08-20 14:52:34 +04:00
committed by Pavel Emelyanov
parent f1684be8a4
commit 156b1b8195
13 changed files with 25 additions and 18 deletions

View File

@@ -1,8 +1,7 @@
#!/bin/bash
source ../../../functions.sh || exit 1
criu="../../../../criu"
source ../../../env.sh || exit 1
cleanup_class() {
rm -f ./*.class

View File

@@ -1,5 +1,7 @@
#!/usr/bin/expect
source ../../env.sh || exit 1
exec rm -rf ./dump
exec mkdir ./dump
@@ -21,7 +23,7 @@ switch $current {
puts "FAIL: Timed out on ready"
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
exit 0
}
@@ -37,7 +39,7 @@ switch $current {
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
# add some sleep here. Still better would be to

View File

@@ -1,11 +1,11 @@
#!/bin/bash
source ../../env.sh || exit 1
[ -z "$CR_IP_TOOL" ] && CR_IP_TOOL=ip
cd `dirname $0`
criu="../../../criu"
name=$1
[ -z "$name" ] && { cat <<EOF
Usage: $0 NAME [PID]"

View File

@@ -1,8 +1,7 @@
#!/bin/bash
source ../../functions.sh || exit 1
criu="../../../criu"
source ../../env.sh || exit 1
cleanup_wd() {
rm -f "ref-*"

View File

@@ -1,8 +1,7 @@
#!/bin/bash
source ../../functions.sh || exit 1
criu="../../../criu"
source ../../env.sh || exit 1
set -x

View File

@@ -1,8 +1,8 @@
#!/bin/bash
source ../../functions.sh || exit 1
source ../../env.sh || exit 1
criu="../../../criu"
DEPTH=3
SPAN=5
archref="arch-ref.tar.bz2"

View File

@@ -1,8 +1,7 @@
set -m
source ../../functions.sh || exit 1
criu="../../../criu"
source ../../env.sh || exit 1
mkdir data

4
test/env.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
CRIU=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../criu)
criu=$CRIU

View File

@@ -1,12 +1,13 @@
#!/bin/bash
source ../env.sh || exit 1
function fail {
echo "$@"
exit 1
}
set -x
CRIU="../../criu"
IMGDIR="dump/"
rm -rf "$IMGDIR"

View File

@@ -1,5 +1,7 @@
#!/bin/bash
source ../env.sh || exit 1
USEPS=0
if [ "$1" = "-s" ]; then
@@ -18,7 +20,6 @@ function fail {
}
set -x
CRIU="../../criu"
IMGDIR="dump/"
rm -rf "$IMGDIR"

View File

@@ -1,5 +1,7 @@
#!/bin/bash
source ../env.sh || exit 1
USEPS=0
if [ "$1" = "-s" ]; then
@@ -18,7 +20,6 @@ function fail {
}
set -x
CRIU="../../criu"
IMGDIR="dump/"
rm -rf "$IMGDIR"

View File

@@ -1,5 +1,7 @@
#!/bin/bash
source ../env.sh || exit 1
set -x
PORT=12345
@@ -7,7 +9,6 @@ CLN_PIPE="./clnt_pipe"
SRV_LOG="./srv.log"
CLN_LOG="./cln.log"
DDIR="dump"
CRIU="../../criu"
TEXT=$(hexdump -C /dev/urandom | head -n 1)

View File

@@ -137,7 +137,8 @@ fanotify00
sk-netlink
"
CRIU=$(readlink -f `dirname $0`/../criu)
source $(readlink -f `dirname $0`/env.sh) || exit 1
CRIU_CPT=$CRIU
TMP_TREE=""
SCRIPTDIR=`dirname $CRIU`/test