mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-03 15:55:53 +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:
committed by
Pavel Emelyanov
parent
f1684be8a4
commit
156b1b8195
@@ -1,8 +1,7 @@
|
|||||||
#!/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
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
#!/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 {
|
|||||||
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 {
|
|||||||
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
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
#!/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]"
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
#!/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-*"
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
#!/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
|
||||||
|
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#!/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"
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
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
|
||||||
|
|
||||||
|
4
test/env.sh
Executable file
4
test/env.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
CRIU=$(readlink -f `dirname ${BASH_SOURCE[0]}`/../criu)
|
||||||
|
criu=$CRIU
|
@@ -1,12 +1,13 @@
|
|||||||
#!/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"
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
#!/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 {
|
|||||||
}
|
}
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
CRIU="../../criu"
|
|
||||||
IMGDIR="dump/"
|
IMGDIR="dump/"
|
||||||
|
|
||||||
rm -rf "$IMGDIR"
|
rm -rf "$IMGDIR"
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
#!/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 {
|
|||||||
}
|
}
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
CRIU="../../criu"
|
|
||||||
IMGDIR="dump/"
|
IMGDIR="dump/"
|
||||||
|
|
||||||
rm -rf "$IMGDIR"
|
rm -rf "$IMGDIR"
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
#!/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"
|
|||||||
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
|
|||||||
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
|
||||||
|
Reference in New Issue
Block a user