2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-28 12:57:57 +00:00

8 Commits

Author SHA1 Message Date
Kir Kolyshkin
10c619adb9 test/zdtm: pr_err / pr_perror fixes
1. Use pr_perror where errno needs to be shown.

2. Use pr_err in cases where errno is not set
   by the previous failed call.

3. Make sure pr_err's first argument do not have \n.

4. While at it, fix some error messages.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-09-03 10:31:00 -07:00
Kir Kolyshkin
b20694835d test/zdtm: don't use \n with fail()
Macro fail already appends \n to the message, so there's no need to do
it explicitly.

Brought to you by

	for f in $(git grep -l fail test/zdtm); do
		test -f $f || continue
		echo $f
		sed -i '\%^[[:space:]]*fail(.*\\n"%s/\\n"/"/' $f
	done

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-09-03 10:31:00 -07:00
Kir Kolyshkin
f3be776ccc Drop \n from pr_perror
Another pr_perror spring cleaning time!

As pr_perror adds a semicolon, an strerror(errno), and a newline,
there's no need to add one manually.

Brought to you by

	for f in $(git grep -l pr_perror); do
		test -f $f || continue
		echo $f
		sed -i '\%^[[:space:]]*pr_perror(.*\\n"%s/\\n//' $f
	done

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-09-03 10:31:00 -07:00
Andrei Vagin
00413cb5a7 test: check ipv6 sockets which handle ipv4 connections
A server socket is created with AF_INET6, but a client
socket is create with AF_INET.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23 20:23:14 +03:00
Andrei Vagin
10dc2a5c36 zdtm: use pr_err if errno isn't required
205             if (fd < 0) {
>>> >>>     CID 175317:    (PW.BAD_PRINTF_FORMAT_STRING)
>>> >>>     invalid format string conversion
206                     pr_perror("can't accept client connection %m");

travis-ci: success for zdtm: use pr_err if errno isn't required
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-06 14:09:33 +03:00
Andrei Vagin
3dd21b1bdd zdtm: improve socket-tcp-close-wait.c
* Don't send uninitialized data
* Close descriptors more carefully
* Add comments

travis-ci: success for zdtm: improve socket-tcp-close-wait.c
Reported-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:33 +03:00
Andrei Vagin
673f18d05c zdtm: fix typo in socket-tcp-.*
CID 174774 (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement: return 1;.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-02-01 18:41:30 +03:00
Andrey Vagin
903ed07084 zdtm: add test cases on TCP_CLOSE_WAIT and TCP_LAST_ACK states
TCP_CLOSE_WAIT remote side has shutdown and is waiting for
               us to finish writing our data and to shutdown
               (we have to close() to move on to LAST_ACK)

TCP_LAST_ACK   out side has shutdown after remote has
               shutdown.  There may still be data in our
               buffer that we have to finish sending

travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:04:49 +03:00