[CRIU] [PATCH 1/3] zdtm: compare file descriptors only for static tests

Andrey Vagin avagin at openvz.org
Sat Nov 8 04:19:02 PST 2014


For other tests set of file descriptors can be changed

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 test/zdtm.sh | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/test/zdtm.sh b/test/zdtm.sh
index 9bc87c1..a3aef71 100755
--- a/test/zdtm.sh
+++ b/test/zdtm.sh
@@ -596,8 +596,10 @@ EOF
 
 		[ -n "$dump_only" ] && cpt_args="$cpt_args $POSTDUMP"
 
-		save_fds $PID  $ddump/dump.fd
-		save_maps $PID  $ddump/dump.maps
+		expr $tname : "static" > /dev/null && {
+			save_fds $PID  $ddump/dump.fd
+			save_maps $PID  $ddump/dump.maps
+		}
 		setsid $CRIU_CPT $dump_cmd -D $ddump -o dump.log -v4 -t $PID $gen_args $cpt_args
 		retcode=$?
 
@@ -629,11 +631,11 @@ EOF
 		fi
 
 		if [ -n "$dump_only" ]; then
-			save_fds $PID  $ddump/dump.fd.after
-			diff_fds $ddump/dump.fd $ddump/dump.fd.after || return 1
-
-			save_maps $PID  $ddump/dump.maps.after
 			expr $tname : "static" > /dev/null && {
+				save_fds $PID  $ddump/dump.fd.after
+				diff_fds $ddump/dump.fd $ddump/dump.fd.after || return 1
+
+				save_maps $PID  $ddump/dump.maps.after
 				diff_maps $ddump/dump.maps $ddump/dump.maps.after || return 1
 			}
 
@@ -667,11 +669,10 @@ EOF
 
 			[ -n "$PIDNS" ] && PID=`cat $TPID`
 
-			save_fds $PID  $ddump/restore.fd
-			diff_fds $ddump/dump.fd $ddump/restore.fd || return 2
-
-			save_maps $PID $ddump/restore.maps
 			expr $tname : "static" > /dev/null && {
+				save_fds $PID  $ddump/restore.fd
+				save_maps $PID $ddump/restore.maps
+				diff_fds $ddump/dump.fd $ddump/restore.fd || return 2
 				diff_maps $ddump/dump.maps $ddump/restore.maps || return 2
 			}
 		fi
-- 
1.9.3



More information about the CRIU mailing list