Skip cgroup-related tests if `/sys/fs/cgroup` readonly
PATCH 1/1 Skip cgroup-related tests if `/sys/fs/cgroup` readonly
Otherwise clone303 fails with TBROK when /sys/fs/cgroup is mounted as read-only which is normal in a container. The test result should better be TCONF like it is already done in case of a permission error.
--- lib/tst_cgroup.c | 3 +++ 1 file changed, 3 insertions(+)
lib/tst_cgroup.c +3 -0
@@ -383,6 +383,9 @@ static void cgroup_dir_mk(const struct cgroup_dir *const parent,tst_brk (TCONF |TERRNO ,"Lack permission to make '%s/%s'; premake it or run as root" , dpath, dir_name); + }else if (errno ==EROFS ) { +tst_brk (TCONF |TERRNO ,"'%s/%s' must not be read-only" , + dpath, dir_name); }else { tst_brk(TBROK | TERRNO, "mkdirat(%d<%s>, '%s', 0777)",
Signature · 5 lines
2.42.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi all,
Quoted 3 lines
Otherwise clone303 fails with TBROK when
/sys/fs/cgroupis mounted as read-only which is normal in a container. The test result should better be TCONF like it is already done in case of a permission error.
IMHO another candidate for merging before release.
Kind regards,
Petr
Quoted 19 lines
Signed-off-by Marius Kittler <[email protected]>--- lib/tst_cgroup.c | 3 +++ 1 file changed, 3 insertions(+)lib/tst_cgroup.c +3
-0@@ -383,6 +383,9 @@ static void cgroup_dir_mk(const struct cgroup_dir *const parent,tst_brk (TCONF |TERRNO ,"Lack permission to make '%s/%s'; premake it or run as root" , dpath, dir_name); + }else if (errno ==EROFS ) { +tst_brk (TCONF |TERRNO ,"'%s/%s' must not be read-only" , + dpath, dir_name); }else { tst_brk(TBROK | TERRNO, "mkdirat(%d<%s>, '%s', 0777)",
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Wei Gao via ltp
Tested-by Wei GaoQuoted 7 lines · Petr Vorel
Hi all,
Quoted 3 lines
Otherwise clone303 fails with TBROK when
/sys/fs/cgroupis mounted as read-only which is normal in a container. The test result should better be TCONF like it is already done in case of a permission error.Reviewed-by Petr Vorel <[email protected]>
Quoted 28 lines
IMHO another candidate for merging before release.
Kind regards,
PetrQuoted 19 lines
Signed-off-by Marius Kittler <[email protected]>--- lib/tst_cgroup.c | 3 +++ 1 file changed, 3 insertions(+)lib/tst_cgroup.c +3
-0@@ -383,6 +383,9 @@ static void cgroup_dir_mk(const struct cgroup_dir *const parent,tst_brk (TCONF |TERRNO ,"Lack permission to make '%s/%s'; premake it or run as root" , dpath, dir_name); + }else if (errno ==EROFS ) { +tst_brk (TCONF |TERRNO ,"'%s/%s' must not be read-only" , + dpath, dir_name); }else { tst_brk(TBROK | TERRNO, "mkdirat(%d<%s>, '%s', 0777)",Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hi,
...
Quoted 2 lines
Quoted 1 line
Reviewed-by Petr Vorel <[email protected]>Tested-by Wei Gao <[email protected]>
^
Unwanted whitespace before the tag.
Wei, please don't put this whitespace space next time.
Not only this is wrong, but it breaks automatic adding of your tag. Patchwork (https://patchwork.ozlabs.org/project/ltp/list/) which we use for downloading patches automatically adds all tags associated with the patch, unless there is whitespace before the tag.
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Quoted 8 lines · Petr Vorel
Hi,
...
Quoted 2 lines
Quoted 1 line
Reviewed-by Petr Vorel <[email protected]>Tested-by Wei Gao <[email protected]>^
Unwanted whitespace before the tag.
Quoted 6 lines
Wei, please don't put this whitespace space next time.
Not only this is wrong, but it breaks automatic adding of your tag. Patchwork (https://patchwork.ozlabs.org/project/ltp/list/) which we use for downloading patches automatically adds all tags associated with the patch, unless there is whitespace before the tag.
Got it. Thanks for correcting the error.
Quoted 3 lines
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Hello,
Quoted 5 lines · Marius Kittler
Otherwise clone303 fails with TBROK when
/sys/fs/cgroupis mounted as read-only which is normal in a container. The test result should better be TCONF like it is already done in case of a permission error.Signed-off-by Marius Kittler <[email protected]>
Quoted 20 lines
--- lib/tst_cgroup.c | 3 +++ 1 file changed, 3 insertions(+)lib/tst_cgroup.c +3
-0@@ -383,6 +383,9 @@ static void cgroup_dir_mk(const struct cgroup_dir *const parent,tst_brk (TCONF |TERRNO ,"Lack permission to make '%s/%s'; premake it or run as root" , dpath, dir_name); + }else if (errno ==EROFS ) { +tst_brk (TCONF |TERRNO ,"'%s/%s' must not be read-only" , + dpath, dir_name); }else { tst_brk(TBROK | TERRNO, "mkdirat(%d<%s>, '%s', 0777)",Signature · 1 line
2.42.0
Signature · 5 lines
Thank you, Richard. -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Richie, Wei,
thanks for your review/testing, merged.
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp