[LTP] [PATCH 1/1] aiodio: Skip tests on tmpfs

Andrea Cervesato andrea.cervesato@suse.com
Fri Jan 21 11:32:19 CET 2022


Hi!

On 1/21/22 11:06, Petr Vorel wrote:
> tmpfs does not support it.
>
> Signed-off-by: Petr Vorel<pvorel@suse.cz>
> ---
>   testcases/kernel/io/ltp-aiodio/aiodio_append.c | 10 ++++++++--
>   testcases/kernel/io/ltp-aiodio/dio_append.c    |  4 ++++
>   testcases/kernel/io/ltp-aiodio/dio_read.c      |  4 ++++
>   testcases/kernel/io/ltp-aiodio/dio_sparse.c    | 10 ++++++++--
>   testcases/kernel/io/ltp-aiodio/dio_truncate.c  | 10 ++++++++--
>   5 files changed, 32 insertions(+), 6 deletions(-)
>
> diff --git a/testcases/kernel/io/ltp-aiodio/aiodio_append.c b/testcases/kernel/io/ltp-aiodio/aiodio_append.c
> index cb04b04a57..46cc74ee4e 100644
> --- a/testcases/kernel/io/ltp-aiodio/aiodio_append.c
> +++ b/testcases/kernel/io/ltp-aiodio/aiodio_append.c
> @@ -131,8 +131,10 @@ static void setup(void)
>   
>   static void cleanup(void)
>   {
> -	*run_child = 0;
> -	SAFE_MUNMAP(run_child, sizeof(int));
> +	if (run_child) {
> +		*run_child = 0;
> +		SAFE_MUNMAP(run_child, sizeof(int));

SAFE_MUNMAP should be called always, even if *run_child == 0 (which happens if run() completed successfully).

> +	}
>   }
>   
>   static void run(void)
> @@ -177,6 +179,10 @@ static struct tst_test test = {
>   		{"b:", &str_numaio, "Number of async IO blocks (default 16)"},
>   		{}
>   	},
> +	.skip_filesystems = (const char *[]) {
> +		"tmpfs",
> +		NULL
> +	},
>   };
>   #else
>   TST_TEST_TCONF("test requires libaio and its development packages");
> diff --git a/testcases/kernel/io/ltp-aiodio/dio_append.c b/testcases/kernel/io/ltp-aiodio/dio_append.c
> index 59fd710e70..c099793f6c 100644
> --- a/testcases/kernel/io/ltp-aiodio/dio_append.c
> +++ b/testcases/kernel/io/ltp-aiodio/dio_append.c
> @@ -93,4 +93,8 @@ static struct tst_test test = {
>   		{"c:", &str_appends, "Number of appends (default 1000)"},
>   		{}
>   	},
> +	.skip_filesystems = (const char *[]) {
> +		"tmpfs",
> +		NULL
> +	},
>   };
> diff --git a/testcases/kernel/io/ltp-aiodio/dio_read.c b/testcases/kernel/io/ltp-aiodio/dio_read.c
> index 2c2ec4bce0..67a28147fd 100644
> --- a/testcases/kernel/io/ltp-aiodio/dio_read.c
> +++ b/testcases/kernel/io/ltp-aiodio/dio_read.c
> @@ -177,4 +177,8 @@ static struct tst_test test = {
>   		{"s:", &str_filesize, "File size (default 128M)"},
>   		{}
>   	},
> +	.skip_filesystems = (const char *[]) {
> +		"tmpfs",
> +		NULL
> +	},
>   };
> diff --git a/testcases/kernel/io/ltp-aiodio/dio_sparse.c b/testcases/kernel/io/ltp-aiodio/dio_sparse.c
> index 4ee2fbab18..39fc895d65 100644
> --- a/testcases/kernel/io/ltp-aiodio/dio_sparse.c
> +++ b/testcases/kernel/io/ltp-aiodio/dio_sparse.c
> @@ -83,8 +83,10 @@ static void setup(void)
>   
>   static void cleanup(void)
>   {
> -	*run_child = 0;
> -	SAFE_MUNMAP(run_child, sizeof(int));
> +	if (run_child) {
> +		*run_child = 0;
> +		SAFE_MUNMAP(run_child, sizeof(int));
> +	}
>   }
>   
>   static void run(void)
> @@ -129,4 +131,8 @@ static struct tst_test test = {
>   		{"o:", &str_offset, "File offset (default 0)"},
>   		{}
>   	},
> +	.skip_filesystems = (const char *[]) {
> +		"tmpfs",
> +		NULL
> +	},
>   };
> diff --git a/testcases/kernel/io/ltp-aiodio/dio_truncate.c b/testcases/kernel/io/ltp-aiodio/dio_truncate.c
> index 4bf11c9588..1fbf83de06 100644
> --- a/testcases/kernel/io/ltp-aiodio/dio_truncate.c
> +++ b/testcases/kernel/io/ltp-aiodio/dio_truncate.c
> @@ -107,8 +107,10 @@ static void setup(void)
>   
>   static void cleanup(void)
>   {
> -	*run_child = 0;
> -	SAFE_MUNMAP(run_child, sizeof(int));
> +	if (run_child) {
> +		*run_child = 0;
> +		SAFE_MUNMAP(run_child, sizeof(int));
> +	}
>   }
>   
>   static void run(void)
> @@ -163,4 +165,8 @@ static struct tst_test test = {
>   		{"c:", &str_numwrites, "Number of append & truncate (default 100)"},
>   		{}
>   	},
> +	.skip_filesystems = (const char *[]) {
> +		"tmpfs",
> +		NULL
> +	},
>   };

Kind regards,

Andrea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20220121/13901fa9/attachment.htm>


More information about the ltp mailing list