<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi All,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 22, 2022 at 4:02 PM Jan Stancek <<a href="mailto:jstancek@redhat.com">jstancek@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Nov 18, 2022 at 2:30 PM Cyril Hrubis <<a href="mailto:chrubis@suse.cz" target="_blank">chrubis@suse.cz</a>> wrote:<br>
><br>
> Hi!<br>
> > > +#define TST_SR_TCONF (TST_SR_TCONF_MISSING | TST_SR_TCONF_RO)<br>
> > > +#define TST_SR_TBROK (TST_SR_TBROK_MISSING | TST_SR_TBROK_RO)<br>
> > > +#define TST_SR_SKIP (TST_SR_SKIP_MISSING | TST_SR_SKIP_RO)<br>
> > ><br>
> ><br>
> > I'd suggest using "_TSKIP" to replace "_SKIP' to be consistent.<br>
> > Then the whole format will look quite perfect and easy to memorize:).<br>
><br>
> I think that it makse sense to keep it as _SKIP because that is the<br>
> option that does not map directly to the test result flags. If we named<br>
> it TSKIP people will be confused that there is no TSKIP in the test<br>
> result flags at all.<br>
<br>
+1 for SKIP<br>
<br>
Feel free to add my Acked-by back.<br></blockquote><div><br></div><div class="gmail_default" style="font-size:small">Sure, no problem.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">But before applying patch-v5 as it is, I found additional two tiny issues:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">1. the usage in newlib_tests should be corrected as well</div><div class="gmail_default" style="font-size:small">2. tst_hugepage need to update the argument in <span class="gmail_default"></span>tst_sys_conf_save()</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If everyone agrees on the improvements, I will merge with below fixes:</div><div class="gmail_default" style="font-size:small"><br></div>--- a/lib/newlib_tests/test19.c<br>+++ b/lib/newlib_tests/test19.c<br>@@ -24,9 +24,9 @@ static struct tst_test test = {<br> .test_all = run,<br> .setup = setup,<br> .save_restore = (const struct tst_path_val[]) {<br>- {"?/proc/nonexistent", NULL},<br>- {"!/proc/sys/kernel/numa_balancing", NULL},<br>- {"/proc/sys/kernel/core_pattern", NULL},<br>+ {"/proc/nonexistent", NULL, TST_SR_SKIP},<br>+ {"/proc/sys/kernel/numa_balancing", NULL, TST_SR_TBROK},<br>+ {"/proc/sys/kernel/core_pattern", NULL, TST_SR_TCONF},<br> {}<br> },<br> };<br>diff --git a/lib/newlib_tests/test20.c b/lib/newlib_tests/test20.c<br>index 3982ab7..3726cea 100644<br>--- a/lib/newlib_tests/test20.c<br>+++ b/lib/newlib_tests/test20.c<br>@@ -39,7 +39,7 @@ static struct tst_test test = {<br> .test_all = do_test,<br> .hugepages = {2, TST_NEEDS},<br> .save_restore = (const struct tst_path_val[]) {<br>- {"!/proc/sys/kernel/numa_balancing", "0"},<br>+ {"/proc/sys/kernel/numa_balancing", "0", TST_SR_TBROK},<br> {}<br> },<br> };<br>diff --git a/lib/tst_hugepage.c b/lib/tst_hugepage.c<br>index e97cc56..41f65d7 100644<br>--- a/lib/tst_hugepage.c<br>+++ b/lib/tst_hugepage.c<br>@@ -7,6 +7,7 @@<br> <br> #include "tst_test.h"<br> #include "tst_hugepage.h"<br>+#include "tst_sys_conf.h"<br> <br> unsigned long tst_hugepages;<br> char *nr_opt;<br>@@ -24,6 +25,12 @@ unsigned long tst_reserve_hugepages(struct tst_hugepage *hp)<br> {<br> unsigned long val, max_hpages;<br> <br>+ struct tst_path_val pvl = {<br>+ .path = PATH_NR_HPAGES,<br>+ .val = NULL,<br>+ .flags = TST_SR_SKIP,<br>+ };<br>+<br> if (access(PATH_HUGEPAGES, F_OK)) {<br> if (hp->policy == TST_NEEDS)<br> tst_brk(TCONF, "hugetlbfs is not supported");<br>@@ -59,7 +66,7 @@ unsigned long tst_reserve_hugepages(struct tst_hugepage *hp)<br> }<br> <br> set_hugepages:<br>- <span class="gmail_default" style="font-size:small"></span>tst_sys_conf_save("?/proc/sys/vm/nr_hugepages");<br>+ tst_sys_conf_save(&pvl);<br> SAFE_FILE_PRINTF(PATH_NR_HPAGES, "%lu", tst_hugepages);<br> SAFE_FILE_SCANF(PATH_NR_HPAGES, "%lu", &val);<br> if (val != tst_hugepages)<br><div class="gmail_default" style="font-size:small"></div></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>