[LTP] [PATCH 7/9] syscalls/ipc: Add shmctl07 test

Cyril Hrubis chrubis@suse.cz
Mon Sep 7 16:45:29 CEST 2020


Hi!
> Shouldn't we do update 'ds' before checking the ds.shm_perm.mode?
> 
> --- a/testcases/kernel/syscalls/ipc/shmctl/shmctl07.c
> +++ b/testcases/kernel/syscalls/ipc/shmctl/shmctl07.c
> @@ -42,10 +42,11 @@ static void verify_shmlock(void)
>         else
>                 tst_res(TPASS, "shmctl(%i, SHM_UNLOCK, NULL)", shm_id);
> 
> +       SAFE_SHMCTL(shm_id, IPC_STAT, &ds);
>         if (ds.shm_perm.mode & SHM_LOCKED)
> -               tst_res(TPASS, "SHM_LOCKED bit is off in shm_perm.mode");
> -       else
>                 tst_res(TFAIL, "SMH_LOCKED bit is on in shm_perm.mode");
> +       else
> +               tst_res(TPASS, "SHM_LOCKED bit is off in shm_perm.mode");
>  }
> 
> 
> 
> > +       if (ds.shm_perm.mode & SHM_LOCKED)
> > +               tst_res(TPASS, "SHM_LOCKED bit is off in shm_perm.mode");
> >
> 
> And in this branch, the status should be "on" but not "off".

And also TFAIL.

All will be fixed in v2, thx for the review.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list