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
057adb4c
Commit
057adb4c
authored
Sep 19, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zdtm: Check that O_APPEND is preserved properly
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
3c0ea1c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
0 deletions
+63
-0
zdtm.sh
test/zdtm.sh
+1
-0
Makefile
test/zdtm/live/static/Makefile
+1
-0
file_append.c
test/zdtm/live/static/file_append.c
+61
-0
No files found.
test/zdtm.sh
View file @
057adb4c
...
@@ -24,6 +24,7 @@ static/vdso00
...
@@ -24,6 +24,7 @@ static/vdso00
static/sched_prio00
static/sched_prio00
static/sched_policy00
static/sched_policy00
static/file_shared
static/file_shared
static/file_append
static/timers
static/timers
static/posix_timers
static/posix_timers
static/futex
static/futex
...
...
test/zdtm/live/static/Makefile
View file @
057adb4c
...
@@ -127,6 +127,7 @@ TST_FILE = \
...
@@ -127,6 +127,7 @@ TST_FILE = \
unlink_fifo
\
unlink_fifo
\
unlink_fifo_wronly
\
unlink_fifo_wronly
\
file_shared
\
file_shared
\
file_append
\
cow01
\
cow01
\
fdt_shared
\
fdt_shared
\
sockets00
\
sockets00
\
...
...
test/zdtm/live/static/file_append.c
0 → 100644
View file @
057adb4c
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include "zdtmtst.h"
const
char
*
test_doc
=
"Check O_APPEND preserved"
;
const
char
*
test_author
=
"Pavel Emelyanov <xemul@parallels.com>"
;
char
*
filename
;
TEST_OPTION
(
filename
,
string
,
"file name"
,
1
);
int
main
(
int
argc
,
char
**
argv
)
{
int
fd
,
fd2
,
ret
;
char
tmp
[
3
];
test_init
(
argc
,
argv
);
fd
=
open
(
filename
,
O_RDWR
|
O_CREAT
|
O_APPEND
,
0644
);
if
(
fd
==
-
1
)
return
1
;
fd2
=
open
(
filename
,
O_RDWR
,
0644
);
if
(
fd2
==
-
1
)
return
1
;
test_daemon
();
test_waitsig
();
if
(
write
(
fd2
,
"x"
,
1
)
!=
1
)
{
err
(
"Can't write x"
);
return
1
;
}
if
(
write
(
fd
,
"y"
,
1
)
!=
1
)
{
err
(
"Can't write y"
);
return
1
;
}
lseek
(
fd2
,
0
,
SEEK_SET
);
ret
=
read
(
fd2
,
tmp
,
3
);
if
(
ret
!=
2
)
{
fail
(
"Smth's wrong with file size"
);
return
1
;
}
tmp
[
2
]
=
'\0'
;
if
(
strcmp
(
tmp
,
"xy"
))
{
fail
(
"Smth's wron with file contents (%s)"
,
tmp
);
return
1
;
}
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