Commit 12db8f23 authored by Ruslan Kuprieiev's avatar Ruslan Kuprieiev Committed by Pavel Emelyanov

test: add crit test

Test steps:
1) generate img files by dumping loop.sh
2) convert img files to json files
3) convert json files to img files
4) cmp original and produces img files

It also uses i/o redirection and --format nice options to
check if they work properly.
Signed-off-by: 's avatarRuslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent ec9ab827
...@@ -55,6 +55,7 @@ clean: ...@@ -55,6 +55,7 @@ clean:
$(Q) $(MAKE) -C zdtm cleandep clean cleanout $(Q) $(MAKE) -C zdtm cleandep clean cleanout
$(Q) $(MAKE) -C libcriu clean $(Q) $(MAKE) -C libcriu clean
$(Q) $(MAKE) -C rpc clean $(Q) $(MAKE) -C rpc clean
$(Q) $(MAKE) -C crit clean
mount_cgroups: .FORCE mount_cgroups: .FORCE
flock zdtm_mount_cgroups ./zdtm_mount_cgroups flock zdtm_mount_cgroups ./zdtm_mount_cgroups
......
*.img
*.log
*.txt
stats-*
*.json
images:
setsid ./loop.sh < /dev/null &> /dev/null & \
../../criu dump -v4 -o dump.log -D ./ -t $${!} --shell-job
run: images
./test.sh
clean:
rm -f *.img *.log *.txt stats-* *.json
#!/bin/bash
while :; do
sleep 1
done
images_list=$(ls -1 *.img)
function _exit {
if [ $? -ne 0 ]; then
echo "FAIL"
exit -1
fi
}
for x in $images_list
do
echo "=== $x"
if [[ $x == pages* ]]; then
echo "skip"
continue
fi
echo " -- to json"
../../crit convert -o "$x"".json" --format nice < $x || _exit $?
echo " -- to img"
../../crit convert -i "$x"".json" > "$x"".json.img" || _exit $?
echo " -- cmp"
cmp $x "$x"".json.img" || _exit $?
echo "=== done"
done
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