Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
c8f3e09f
Commit
c8f3e09f
authored
Jul 01, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zdtm: Add test for semi-closed unix connection
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
1148edc1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
0 deletions
+56
-0
zdtm.sh
test/zdtm.sh
+1
-0
Makefile
test/zdtm/live/static/Makefile
+1
-0
sockets02.c
test/zdtm/live/static/sockets02.c
+54
-0
No files found.
test/zdtm.sh
View file @
c8f3e09f
...
...
@@ -38,6 +38,7 @@ streaming/pipe_shared00
transition/file_read
static/sockets00
static/sockets01
static/sockets02
static/sock_opts00
static/sock_opts01
static/sockets_spair
...
...
test/zdtm/live/static/Makefile
View file @
c8f3e09f
...
...
@@ -47,6 +47,7 @@ TST_NOFILE = \
utsname
\
pstree
\
sockets01
\
sockets02
\
sockets_spair
\
socket_queues
\
socket_queues02
\
...
...
test/zdtm/live/static/sockets02.c
0 → 100644
View file @
c8f3e09f
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <sys/un.h>
#include <sys/stat.h>
#include <limits.h>
#include <fcntl.h>
#include "zdtmtst.h"
const
char
*
test_doc
=
"Test semi-closed unix stream connection
\n
"
;
const
char
*
test_author
=
"Pavel Emelyanov <xemul@parallels.com>
\n
"
;
int
main
(
int
argc
,
char
*
argv
[])
{
int
ssk_pair
[
2
],
ret
;
char
aux
;
test_init
(
argc
,
argv
);
if
(
socketpair
(
AF_UNIX
,
SOCK_STREAM
,
0
,
ssk_pair
)
==
-
1
)
{
fail
(
"socketpair
\n
"
);
exit
(
1
);
}
close
(
ssk_pair
[
1
]);
test_daemon
();
test_waitsig
();
errno
=
0
;
ret
=
read
(
ssk_pair
[
0
],
&
aux
,
sizeof
(
aux
));
if
(
ret
!=
0
||
errno
!=
0
)
{
fail
(
"Opened end in wrong state (%d/%d)"
,
ret
,
errno
);
return
0
;
}
errno
=
0
;
ret
=
read
(
ssk_pair
[
1
],
&
aux
,
sizeof
(
aux
));
if
(
ret
!=
-
1
||
errno
!=
EBADF
)
{
fail
(
"Closed end in wrong state (%d/%d)"
,
ret
,
errno
);
return
0
;
}
pass
();
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment