[LTP] [PATCH] save_restore: Introduce new struct field for flags
Martin Doucha
mdoucha@suse.cz
Mon Nov 7 17:17:41 CET 2022
On 06. 11. 22 7:24, Li Wang wrote:
> This is a good thought to split the permission and respectively
> handle them, but I feel that these names are a bit ambiguous.
>
> For example TST_SR_IGNORE_RO, I was puzzled a while when
> reading it in the below code, it can be thought of as ignoring the
> READ_ONLY permission if just from the literal meaning.
The only sensible way to ignore read-only permissions is to skip writing
into the file. Especially when the test can run without root privileges.
> We need to find more precise names.
>
> +
> +#define TST_SR_REQUIRED (TST_SR_FAIL_MISSING | TST_SR_FAIL_RO)
> +#define TST_SR_IF_ACCESS (TST_SR_IGNORE_MISSING | TST_SR_IGNORE_RO)
>
>
> Here as well, especially these two will be more frequently used in
> testcase writing.
I am open to suggestions.
> +void tst_sys_conf_save_str(const char *path, const char *value);
>
>
> Do we have any other place to use tst_sys_conf_save_str?
> If no, I would suggest declaring it only as a static function
> in the tst_sys_conf.c
I'm not sure such change belongs in this patch but feel free to submit
another patch for it.
--
Martin Doucha mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
More information about the ltp
mailing list