public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1] Add chdir05 test
Date: Fri, 2 Feb 2024 18:17:40 +0100	[thread overview]
Message-ID: <Zb0jtL90aF5K0258@yuki> (raw)
In-Reply-To: <20240119085939.11801-1-andrea.cervesato@suse.de>

Hi!
> +/*\
> + * [Description]
> + *
> + * This test verifies that chdir() is working correctly on symlink()
> + * generated files.
> + */
> +
> +#include "tst_test.h"
> +
> +static void test_chdir(void)
> +{
> +	char *symname = "my_symlink0";
> +
> +	SAFE_SYMLINK(tst_get_tmpdir(), symname);
> +	TST_EXP_PASS(chdir(symname));
> +
> +	SAFE_UNLINK(symname);
> +}
> +
> +static void test_chdir_no_path(void)
> +{
> +	char *symname = "my_symlink1";
> +
> +	SAFE_SYMLINK("bc+eFhi!k", symname);
> +	TST_EXP_FAIL(chdir(symname), ENOENT);
> +
> +	SAFE_UNLINK(symname);
> +}

This two should go to chdir01.c and possibly chdir01 should be split
into positive cases and negative cases when you are at it.

> +static void test_chdir_loop(void)
> +{
> +	char *symname = "my_symlink2";
> +
> +	TST_EXP_PASS(symlink(symname, symname));
> +	TST_EXP_FAIL(chdir(symname), ELOOP);
> +
> +	SAFE_UNLINK(symname);
> +}

This is already in chdir01.c

> +static void run(void)
> +{
> +	test_chdir();
> +	test_chdir_no_path();
> +	test_chdir_loop();
> +}
> +
> +static struct tst_test test = {
> +	.test_all = run,
> +	.needs_tmpdir = 1,
> +};
> -- 
> 2.35.3
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2024-02-02 17:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-19  8:59 [LTP] [PATCH v1] Add chdir05 test Andrea Cervesato
2024-02-02 17:17 ` Cyril Hrubis [this message]
2024-02-20 12:20   ` Andrea Cervesato via ltp

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=Zb0jtL90aF5K0258@yuki \
    --to=chrubis@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox