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
2c765509
Commit
2c765509
authored
Sep 02, 2014
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: Check that criu's donwgrading quirk works
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
96e6ea5a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
0 deletions
+55
-0
zdtm.sh
test/zdtm.sh
+1
-0
Makefile
test/zdtm/live/static/Makefile
+1
-0
file_locks05.c
test/zdtm/live/static/file_locks05.c
+52
-0
file_locks05.opts
test/zdtm/live/static/file_locks05.opts
+1
-0
No files found.
test/zdtm.sh
View file @
2c765509
...
...
@@ -118,6 +118,7 @@ static/file_locks01
static/file_locks02
static/file_locks03
static/file_locks04
static/file_locks05
static/sigpending
static/sigaltstack
static/sk-netlink
...
...
test/zdtm/live/static/Makefile
View file @
2c765509
...
...
@@ -152,6 +152,7 @@ TST_FILE = \
file_locks02
\
file_locks03
\
file_locks04
\
file_locks05
\
netns-nf
\
maps_file_prot
\
...
...
test/zdtm/live/static/file_locks05.c
0 → 100644
View file @
2c765509
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/file.h>
#include <string.h>
#include <sys/wait.h>
#include "zdtmtst.h"
const
char
*
test_doc
=
"Sanity check for criu lock-test quirk"
;
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
;
test_init
(
argc
,
argv
);
fd
=
open
(
filename
,
O_CREAT
|
O_RDWR
,
0600
);
if
(
fd
<
0
)
{
err
(
"No file"
);
return
-
1
;
}
fd2
=
open
(
filename
,
O_RDWR
);
if
(
fd2
<
0
)
{
err
(
"No file2"
);
return
-
1
;
}
flock
(
fd
,
LOCK_SH
);
test_daemon
();
test_waitsig
();
if
(
flock
(
fd2
,
LOCK_SH
)
==
0
)
pass
();
else
fail
(
"Flock file locks check failed"
);
close
(
fd
);
close
(
fd2
);
unlink
(
filename
);
return
0
;
}
test/zdtm/live/static/file_locks05.opts
0 → 100644
View file @
2c765509
--file-locks
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