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
471d73e3
Commit
471d73e3
authored
Jul 03, 2014
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zdtm: Add test for opened ghost directory
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
d0097b2d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
0 deletions
+73
-0
zdtm.sh
test/zdtm.sh
+1
-0
.gitignore
test/zdtm/.gitignore
+1
-0
Makefile
test/zdtm/live/static/Makefile
+1
-0
rmdir_open.c
test/zdtm/live/static/rmdir_open.c
+70
-0
No files found.
test/zdtm.sh
View file @
471d73e3
...
...
@@ -78,6 +78,7 @@ static/unlink_fstat03
static/unlink_mmap00
static/unlink_mmap01
static/unlink_mmap02
static/rmdir_open
static/eventfs00
static/signalfd00
static/inotify00
...
...
test/zdtm/.gitignore
View file @
471d73e3
...
...
@@ -143,6 +143,7 @@
/live/static/unlink_mmap00
/live/static/unlink_mmap01
/live/static/unlink_mmap02
/live/static/rmdir_open
/live/static/uptime_grow
/live/static/utsname
/live/static/vdso00
...
...
test/zdtm/live/static/Makefile
View file @
471d73e3
...
...
@@ -160,6 +160,7 @@ TST_DIR = \
tempfs
\
bind-mount
\
cgroup00
\
rmdir_open
\
TST_DIR_FILE
=
\
chroot
\
...
...
test/zdtm/live/static/rmdir_open.c
0 → 100644
View file @
471d73e3
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <string.h>
#include <fcntl.h>
#include "zdtmtst.h"
const
char
*
test_doc
=
"Check that opened removed dir works"
;
const
char
*
test_author
=
"Pavel Emelianov <xemul@parallels.com>"
;
char
*
dirname
;
TEST_OPTION
(
dirname
,
string
,
"directory name"
,
1
);
int
main
(
int
argc
,
char
**
argv
)
{
int
fd
;
struct
stat
st
;
test_init
(
argc
,
argv
);
if
(
mkdir
(
dirname
,
0700
))
{
err
(
"Can't make dir
\n
"
);
goto
out
;
}
fd
=
open
(
dirname
,
O_DIRECTORY
);
if
(
fd
<
0
)
{
err
(
"Can't open dir
\n
"
);
goto
outr
;
}
if
(
rmdir
(
dirname
))
{
err
(
"Can't remove dir
\n
"
);
goto
outr
;
}
test_daemon
();
test_waitsig
();
/*
* We can't compare anything with previous, since
* inode _will_ change, so can the device. The only
* reasonable thing we can do is check that the fd
* still points to some removed directory.
*/
if
(
fstat
(
fd
,
&
st
))
{
fail
(
"Can't stat fd
\n
"
);
goto
out
;
}
if
(
!
S_ISDIR
(
st
.
st_mode
))
{
fail
(
"Fd is no longer directory
\n
"
);
goto
out
;
}
if
(
st
.
st_nlink
!=
0
)
{
fail
(
"Directory is not removed
\n
"
);
goto
out
;
}
pass
();
return
0
;
outr:
rmdir
(
dirname
);
out:
return
1
;
}
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