Message ID | 146713615389.18194.8686195323807378037.stgit@pro |
---|---|
State | Rejected |
Series | "Series without cover letter" |
Headers | show |
diff --git a/test/zdtm/static/file_locks04.c b/test/zdtm/static/file_locks04.c index dfb7c53..6feb27b 100644 --- a/test/zdtm/static/file_locks04.c +++ b/test/zdtm/static/file_locks04.c @@ -105,6 +105,20 @@ int main(int argc, char **argv) return -1; } + ret = check_file_locks(pid, fd, child_fd); + if (ret < 0) { + fail("Pre-check failed\n"); + goto out_kill; + } else if (ret == 0) { + test_msg("Old kernel?\n"); + test_daemon(); + test_waitsig(); + pass(); + goto out_kill; + } + + test_msg("Daemonize\n"); + test_daemon(); test_waitsig();
On Tue, Jun 28, 2016 at 08:49:53PM +0300, Kirill Tkhai wrote: > On some kernel (on travis.org, for example) either child > or parent fdinfo do not contain flock information, on the > configuration the test setups. > > Pre-check if lock contains in child's fdinfo before the > daemonization, and simply pass if not so. > > Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> > --- > test/zdtm/static/file_locks04.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/test/zdtm/static/file_locks04.c b/test/zdtm/static/file_locks04.c > index dfb7c53..6feb27b 100644 > --- a/test/zdtm/static/file_locks04.c > +++ b/test/zdtm/static/file_locks04.c > @@ -105,6 +105,20 @@ int main(int argc, char **argv) > return -1; > } > > + ret = check_file_locks(pid, fd, child_fd); > + if (ret < 0) { > + fail("Pre-check failed\n"); > + goto out_kill; > + } else if (ret == 0) { > + test_msg("Old kernel?\n"); > + test_daemon(); > + test_waitsig(); you can add "'feature': 'fdinfo_lock'" to file_locks04.desc instead of this code > + pass(); > + goto out_kill; > + } > + > + test_msg("Daemonize\n"); > + > test_daemon(); > test_waitsig(); > >
On 28.06.2016 21:16, Andrew Vagin wrote: > On Tue, Jun 28, 2016 at 08:49:53PM +0300, Kirill Tkhai wrote: >> On some kernel (on travis.org, for example) either child >> or parent fdinfo do not contain flock information, on the >> configuration the test setups. >> >> Pre-check if lock contains in child's fdinfo before the >> daemonization, and simply pass if not so. >> >> Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> >> --- >> test/zdtm/static/file_locks04.c | 14 ++++++++++++++ >> 1 file changed, 14 insertions(+) >> >> diff --git a/test/zdtm/static/file_locks04.c b/test/zdtm/static/file_locks04.c >> index dfb7c53..6feb27b 100644 >> --- a/test/zdtm/static/file_locks04.c >> +++ b/test/zdtm/static/file_locks04.c >> @@ -105,6 +105,20 @@ int main(int argc, char **argv) >> return -1; >> } >> >> + ret = check_file_locks(pid, fd, child_fd); >> + if (ret < 0) { >> + fail("Pre-check failed\n"); >> + goto out_kill; >> + } else if (ret == 0) { >> + test_msg("Old kernel?\n"); >> + test_daemon(); >> + test_waitsig(); > > you can add "'feature': 'fdinfo_lock'" to file_locks04.desc instead of > this code Ok, thanks > >> + pass(); >> + goto out_kill; >> + } >> + >> + test_msg("Daemonize\n"); >> + >> test_daemon(); >> test_waitsig(); >> >>
On some kernel (on travis.org, for example) either child or parent fdinfo do not contain flock information, on the configuration the test setups. Pre-check if lock contains in child's fdinfo before the daemonization, and simply pass if not so. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> --- test/zdtm/static/file_locks04.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)