From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3 3/3] syscalls/getxattr04.c: add new regression test
Date: Fri, 3 Mar 2017 10:57:59 +0100 [thread overview]
Message-ID: <20170303095759.GD17012@rei.lan> (raw)
In-Reply-To: <1488507513-30941-1-git-send-email-yangx.jy@cn.fujitsu.com>
Hi!
> +/*
> + * Copyright (c) 2017 Fujitsu Ltd.
> + * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of version 2 of the GNU General Public License as
> + * published by the Free Software Foundation.
Can we please use GPLv2+ (the one with any later clausule)?
> + * This program is distributed in the hope that it would be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> + *
> + * You should have received a copy of the GNU General Public License
> + * alone with this program.
> + *
> + */
> +
...
> +static void loop_getxattr(void)
> +{
> + int res;
> +
> + while (!end) {
> + res = getxattr(TEST_FILE, TRUSTED_SMALL, NULL, 0);
> + if (res == -1) {
> + if (errno == ENODATA) {
> + tst_res(TFAIL, "getxattr() failed to get an "
> + "existing attribute");
> + } else {
> + tst_res(TFAIL | TERRNO,
> + "getxattr() failed without ENOATTR");
> + }
> +
> + exit(0);
> + }
> + }
> +
> + tst_res(TPASS, "getxattr() succeeded to get an existing attribute");
> + exit(0);
> +}
> +
> +static void verify_getxattr(void)
> +{
> + pid_t pid;
> + int n;
We should reset the end variable here, in case that the program is
looping (-i option).
Otherwise it look good.
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2017-03-03 9:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-02 10:37 [LTP] [PATCH 1/3] safe_macros: remove unused code in xattr related functions Xiao Yang
2017-03-02 10:37 ` [LTP] [PATCH 2/3] safe_macros: add safe_removexattr() Xiao Yang
2017-03-02 10:37 ` [LTP] [PATCH 3/3] syscalls/getxattr04.c: Add new regression test Xiao Yang
2017-03-02 16:23 ` Cyril Hrubis
2017-03-03 1:21 ` [LTP] [PATCH v2 3/3] syscalls/getxattr04.c: add " Xiao Yang
2017-03-03 2:14 ` Xiao Yang
2017-03-03 1:34 ` [LTP] [PATCH 3/3] syscalls/getxattr04.c: Add " Xiao Yang
2017-03-03 2:18 ` [LTP] [PATCH v3 3/3] syscalls/getxattr04.c: add " Xiao Yang
2017-03-03 9:57 ` Cyril Hrubis [this message]
2017-03-06 8:50 ` [LTP] [PATCH v4 " Xiao Yang
2017-03-06 9:58 ` Cyril Hrubis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170303095759.GD17012@rei.lan \
--to=chrubis@suse.cz \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.