[CRIU] [PATCH cr 01/11] zdtm: write some data in pipe and read it after suspend/resume

Andrey Vagin avagin at openvz.org
Thu Apr 5 12:02:05 EDT 2012


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 test/zdtm/live/static/pipe00.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/test/zdtm/live/static/pipe00.c b/test/zdtm/live/static/pipe00.c
index 8e903f0..1ae10cd 100644
--- a/test/zdtm/live/static/pipe00.c
+++ b/test/zdtm/live/static/pipe00.c
@@ -58,6 +58,11 @@ int main(int argc, char ** argv)
 		while (test_go())
 			;
 
+		ret = read(12, buf, sizeof(TEST_STRING));
+		if (ret != sizeof(TEST_STRING)) {
+			err("read failed: %d", ret);
+			goto err;
+		}
 		ret = write(11, TEST_STRING, sizeof(TEST_STRING));
 		if (ret != sizeof(TEST_STRING)) {
 			err("write failed: %d", ret);
@@ -82,6 +87,11 @@ int main(int argc, char ** argv)
 
 		pass();
 	} else {
+		ret = write(11, TEST_STRING, sizeof(TEST_STRING));
+		if (ret != sizeof(TEST_STRING)) {
+			err("write failed: %d", ret);
+			return 1;
+		}
 		ret = read(12, buf, sizeof(TEST_STRING));
 		if (ret != sizeof(TEST_STRING)) {
 			err("read failed: %d", ret);
-- 
1.7.1



More information about the CRIU mailing list