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
8717463a
Commit
8717463a
authored
Apr 05, 2012
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zdtm: Add unix connected streams test
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
12316c49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
sockets00.c
test/zdtm/live/static/sockets00.c
+25
-5
No files found.
test/zdtm/live/static/sockets00.c
View file @
8717463a
...
...
@@ -29,7 +29,7 @@ const char *test_author = "Cyrill Gorcunov <gorcunov@openvz.org";
int
main
(
int
argc
,
char
*
argv
[])
{
int
ssk_icon
[
2
];
int
ssk_icon
[
4
];
int
ssk_pair
[
2
];
struct
sockaddr_un
addr
;
struct
sockaddr_un
name_bound
;
...
...
@@ -65,7 +65,8 @@ int main(int argc, char *argv[])
ssk_icon
[
0
]
=
socket
(
AF_UNIX
,
SOCK_STREAM
,
0
);
ssk_icon
[
1
]
=
socket
(
AF_UNIX
,
SOCK_STREAM
,
0
);
if
(
ssk_icon
[
0
]
<
0
||
ssk_icon
[
1
]
<
0
)
{
ssk_icon
[
2
]
=
socket
(
AF_UNIX
,
SOCK_STREAM
,
0
);
if
(
ssk_icon
[
0
]
<
0
||
ssk_icon
[
1
]
<
0
||
ssk_icon
[
2
]
<
0
)
{
fail
(
"socket
\n
"
);
exit
(
1
);
}
...
...
@@ -82,6 +83,18 @@ int main(int argc, char *argv[])
exit
(
1
);
}
ret
=
connect
(
ssk_icon
[
2
],
&
addr
,
addrlen
);
if
(
ret
)
{
fail
(
"connect
\n
"
);
exit
(
1
);
}
ssk_icon
[
3
]
=
accept
(
ssk_icon
[
0
],
NULL
,
NULL
);
if
(
ssk_icon
[
3
]
<
0
)
{
fail
(
"accept"
);
exit
(
1
);
}
ret
=
connect
(
ssk_icon
[
1
],
&
addr
,
addrlen
);
if
(
ret
)
{
fail
(
"connect
\n
"
);
...
...
@@ -204,17 +217,24 @@ int main(int argc, char *argv[])
if
(
ret
<
0
)
{
fail
(
"accept
\n
"
);
exit
(
1
);
}
else
ssk_icon
[
0
]
=
ret
;
}
write
(
ssk_icon
[
1
],
SK_DATA
,
sizeof
(
SK_DATA
));
read
(
ssk_icon
[
0
]
,
&
buf
,
sizeof
(
buf
));
read
(
ret
,
&
buf
,
sizeof
(
buf
));
if
(
strcmp
(
buf
,
SK_DATA
))
{
fail
(
"data corrupted
\n
"
);
exit
(
1
);
}
test_msg
(
"stream : '%s'
\n
"
,
buf
);
write
(
ssk_icon
[
2
],
SK_DATA
,
sizeof
(
SK_DATA
));
read
(
ssk_icon
[
3
],
&
buf
,
sizeof
(
buf
));
if
(
strcmp
(
buf
,
SK_DATA
))
{
fail
(
"data corrupted
\n
"
);
exit
(
1
);
}
test_msg
(
"stream2 : '%s'
\n
"
,
buf
);
sendto
(
sk_dgram_bound_client
,
SK_DATA_BOUND
,
sizeof
(
SK_DATA_BOUND
),
0
,
&
name_bound
,
sizeof
(
name_bound
));
read
(
sk_dgram_bound_server
,
&
buf
,
sizeof
(
buf
));
...
...
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