diff mbox series

[14/31] madvise02: Remove UCLINUX

Message ID 20240411143025.352507-15-pvorel@suse.cz
State Accepted
Headers show
Series Remove UCLINUX (nommu support) from LTP legacy C API | expand

Commit Message

Petr Vorel April 11, 2024, 2:30 p.m. UTC
skip is now off by default for all cases.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/kernel/syscalls/madvise/madvise02.c | 25 ++++++++-----------
 1 file changed, 11 insertions(+), 14 deletions(-)

Comments

Cyril Hrubis April 11, 2024, 3:37 p.m. UTC | #1
Hi!
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  testcases/kernel/syscalls/madvise/madvise02.c | 25 ++++++++-----------
>  1 file changed, 11 insertions(+), 14 deletions(-)
> 
> diff --git a/testcases/kernel/syscalls/madvise/madvise02.c b/testcases/kernel/syscalls/madvise/madvise02.c
> index 90c0431c5..793bda98d 100644
> --- a/testcases/kernel/syscalls/madvise/madvise02.c
> +++ b/testcases/kernel/syscalls/madvise/madvise02.c
> @@ -65,17 +65,17 @@ static struct tcase {
>  	int exp_errno;
>  	int skip;
>  } tcases[] = {
> -	{MADV_NORMAL,      "MADV_NORMAL",      &nonalign, EINVAL, 0},
> -	{1212,             "MADV_NORMAL",      &file1,    EINVAL, 0},
> -	{MADV_REMOVE,      "MADV_REMOVE",      &file1,    EINVAL, 0},
> -	{MADV_DONTNEED,    "MADV_DONTNEED",    &file1,    EINVAL, 1},
> -	{MADV_MERGEABLE,   "MADV_MERGEABLE",   &file1,    EINVAL, 0},
> -	{MADV_UNMERGEABLE, "MADV_UNMERGEABLE", &file1,    EINVAL, 0},
> -	{MADV_NORMAL,      "MADV_NORMAL",      &file2,    ENOMEM, 0},
> -	{MADV_WILLNEED,    "MADV_WILLNEED",    &file2,    ENOMEM, 0},
> -	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF, 0},
> -	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL, 0},
> -	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL, 0},
> +	{MADV_NORMAL,      "MADV_NORMAL",      &nonalign, EINVAL},
> +	{1212,             "MADV_NORMAL",      &file1,    EINVAL},
> +	{MADV_REMOVE,      "MADV_REMOVE",      &file1,    EINVAL},
> +	{MADV_DONTNEED,    "MADV_DONTNEED",    &file1,    EINVAL},
> +	{MADV_MERGEABLE,   "MADV_MERGEABLE",   &file1,    EINVAL},
> +	{MADV_UNMERGEABLE, "MADV_UNMERGEABLE", &file1,    EINVAL},
> +	{MADV_NORMAL,      "MADV_NORMAL",      &file2,    ENOMEM},
> +	{MADV_WILLNEED,    "MADV_WILLNEED",    &file2,    ENOMEM},
> +	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF},
> +	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL},
> +	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL},
>  	{MADV_WIPEONFORK,  "MADV_WIPEONFORK shared_anon", &shared_anon, EINVAL, 0},
>  	{MADV_WIPEONFORK,  "MADV_WIPEONFORK private file backed", &file3, EINVAL, 0},

You should have removed these two zeroes as well, it's a bit confusing
that they stayed in there.

>  };
> @@ -89,11 +89,8 @@ static void tcases_filter(void)
>  
>  		switch (tc->advice) {
>  		case MADV_DONTNEED:
> -#if !defined(UCLINUX)
>  			if (mlock(file1, st.st_size) < 0)
>  				tst_brk(TBROK | TERRNO, "mlock failed");
> -			tc->skip = 0;
> -#endif /* if !defined(UCLINUX) */
>  		break;
>  		case MADV_MERGEABLE:
>  		case MADV_UNMERGEABLE:
> -- 
> 2.43.0
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp
Petr Vorel April 11, 2024, 8:51 p.m. UTC | #2
Hi Cyril,


> Hi!
> > Signed-off-by: Petr Vorel <pvorel@suse.cz>
> > ---
> >  testcases/kernel/syscalls/madvise/madvise02.c | 25 ++++++++-----------
> >  1 file changed, 11 insertions(+), 14 deletions(-)

> > diff --git a/testcases/kernel/syscalls/madvise/madvise02.c b/testcases/kernel/syscalls/madvise/madvise02.c
> > index 90c0431c5..793bda98d 100644
> > --- a/testcases/kernel/syscalls/madvise/madvise02.c
> > +++ b/testcases/kernel/syscalls/madvise/madvise02.c
> > @@ -65,17 +65,17 @@ static struct tcase {
> >  	int exp_errno;
> >  	int skip;
> >  } tcases[] = {
> > -	{MADV_NORMAL,      "MADV_NORMAL",      &nonalign, EINVAL, 0},
> > -	{1212,             "MADV_NORMAL",      &file1,    EINVAL, 0},
> > -	{MADV_REMOVE,      "MADV_REMOVE",      &file1,    EINVAL, 0},
> > -	{MADV_DONTNEED,    "MADV_DONTNEED",    &file1,    EINVAL, 1},
> > -	{MADV_MERGEABLE,   "MADV_MERGEABLE",   &file1,    EINVAL, 0},
> > -	{MADV_UNMERGEABLE, "MADV_UNMERGEABLE", &file1,    EINVAL, 0},
> > -	{MADV_NORMAL,      "MADV_NORMAL",      &file2,    ENOMEM, 0},
> > -	{MADV_WILLNEED,    "MADV_WILLNEED",    &file2,    ENOMEM, 0},
> > -	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF, 0},
> > -	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL, 0},
> > -	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL, 0},
> > +	{MADV_NORMAL,      "MADV_NORMAL",      &nonalign, EINVAL},
> > +	{1212,             "MADV_NORMAL",      &file1,    EINVAL},
> > +	{MADV_REMOVE,      "MADV_REMOVE",      &file1,    EINVAL},
> > +	{MADV_DONTNEED,    "MADV_DONTNEED",    &file1,    EINVAL},
> > +	{MADV_MERGEABLE,   "MADV_MERGEABLE",   &file1,    EINVAL},
> > +	{MADV_UNMERGEABLE, "MADV_UNMERGEABLE", &file1,    EINVAL},
> > +	{MADV_NORMAL,      "MADV_NORMAL",      &file2,    ENOMEM},
> > +	{MADV_WILLNEED,    "MADV_WILLNEED",    &file2,    ENOMEM},
> > +	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF},
> > +	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL},
> > +	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL},
> >  	{MADV_WIPEONFORK,  "MADV_WIPEONFORK shared_anon", &shared_anon, EINVAL, 0},
> >  	{MADV_WIPEONFORK,  "MADV_WIPEONFORK private file backed", &file3, EINVAL, 0},

> You should have removed these two zeroes as well, it's a bit confusing
> that they stayed in there.

I wonder why I left these two. I'll amend the patch with the diff bellow.

Kind regards,
Petr

+++ testcases/kernel/syscalls/madvise/madvise02.c
@@ -76,8 +76,8 @@ static struct tcase {
 	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF},
 	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL},
 	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL},
-	{MADV_WIPEONFORK,  "MADV_WIPEONFORK shared_anon", &shared_anon, EINVAL, 0},
-	{MADV_WIPEONFORK,  "MADV_WIPEONFORK private file backed", &file3, EINVAL, 0},
+	{MADV_WIPEONFORK,  "MADV_WIPEONFORK shared_anon", &shared_anon, EINVAL},
+	{MADV_WIPEONFORK,  "MADV_WIPEONFORK private file backed", &file3, EINVAL},
 };
 
 static void tcases_filter(void)
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/madvise/madvise02.c b/testcases/kernel/syscalls/madvise/madvise02.c
index 90c0431c5..793bda98d 100644
--- a/testcases/kernel/syscalls/madvise/madvise02.c
+++ b/testcases/kernel/syscalls/madvise/madvise02.c
@@ -65,17 +65,17 @@  static struct tcase {
 	int exp_errno;
 	int skip;
 } tcases[] = {
-	{MADV_NORMAL,      "MADV_NORMAL",      &nonalign, EINVAL, 0},
-	{1212,             "MADV_NORMAL",      &file1,    EINVAL, 0},
-	{MADV_REMOVE,      "MADV_REMOVE",      &file1,    EINVAL, 0},
-	{MADV_DONTNEED,    "MADV_DONTNEED",    &file1,    EINVAL, 1},
-	{MADV_MERGEABLE,   "MADV_MERGEABLE",   &file1,    EINVAL, 0},
-	{MADV_UNMERGEABLE, "MADV_UNMERGEABLE", &file1,    EINVAL, 0},
-	{MADV_NORMAL,      "MADV_NORMAL",      &file2,    ENOMEM, 0},
-	{MADV_WILLNEED,    "MADV_WILLNEED",    &file2,    ENOMEM, 0},
-	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF, 0},
-	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL, 0},
-	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL, 0},
+	{MADV_NORMAL,      "MADV_NORMAL",      &nonalign, EINVAL},
+	{1212,             "MADV_NORMAL",      &file1,    EINVAL},
+	{MADV_REMOVE,      "MADV_REMOVE",      &file1,    EINVAL},
+	{MADV_DONTNEED,    "MADV_DONTNEED",    &file1,    EINVAL},
+	{MADV_MERGEABLE,   "MADV_MERGEABLE",   &file1,    EINVAL},
+	{MADV_UNMERGEABLE, "MADV_UNMERGEABLE", &file1,    EINVAL},
+	{MADV_NORMAL,      "MADV_NORMAL",      &file2,    ENOMEM},
+	{MADV_WILLNEED,    "MADV_WILLNEED",    &file2,    ENOMEM},
+	{MADV_WILLNEED,    "MADV_WILLNEED",    &tmp_addr,  EBADF},
+	{MADV_FREE,        "MADV_FREE",        &file1,    EINVAL},
+	{MADV_WIPEONFORK,  "MADV_WIPEONFORK",  &file1,    EINVAL},
 	{MADV_WIPEONFORK,  "MADV_WIPEONFORK shared_anon", &shared_anon, EINVAL, 0},
 	{MADV_WIPEONFORK,  "MADV_WIPEONFORK private file backed", &file3, EINVAL, 0},
 };
@@ -89,11 +89,8 @@  static void tcases_filter(void)
 
 		switch (tc->advice) {
 		case MADV_DONTNEED:
-#if !defined(UCLINUX)
 			if (mlock(file1, st.st_size) < 0)
 				tst_brk(TBROK | TERRNO, "mlock failed");
-			tc->skip = 0;
-#endif /* if !defined(UCLINUX) */
 		break;
 		case MADV_MERGEABLE:
 		case MADV_UNMERGEABLE: