* [LTP] [PATCH v4 1/4] lib/tst_kconfig.c: Add any kconfig to match the expected value function
@ 2019-12-19 13:18 Pengfei Xu
2019-12-19 13:18 ` [LTP] [PATCH v4 2/4] umip_basic_test.c: improve kconfig check to avoid umip wrong abort case Pengfei Xu
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Pengfei Xu @ 2019-12-19 13:18 UTC (permalink / raw)
To: ltp
Example: CONFIG_X86_INTEL_UMIP=y for umip kconfig before and v5.4
mainline kernel.
CONFIG_X86_UMIP=y for umip kconfig after v5.5 mainline kernel.
Format: CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y
Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
---
lib/tst_kconfig.c | 36 +++++++++++++++++++++++-------------
1 file changed, 23 insertions(+), 13 deletions(-)
diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
index 4b51413e5..74c46ebec 100644
--- a/lib/tst_kconfig.c
+++ b/lib/tst_kconfig.c
@@ -167,7 +167,8 @@ void tst_kconfig_read(const char *const *kconfigs,
struct match matches[cnt];
FILE *fp;
unsigned int i, j;
- char buf[1024];
+ char buf[1024], kconfig_multi[100];
+ char *kconfig_token = NULL, *p_left = NULL;
for (i = 0; i < cnt; i++) {
const char *val = strchr(kconfigs[i], '=');
@@ -176,12 +177,9 @@ void tst_kconfig_read(const char *const *kconfigs,
tst_brk(TBROK, "Invalid config string '%s'", kconfigs[i]);
matches[i].match = 0;
- matches[i].len = strlen(kconfigs[i]);
- if (val) {
+ if (val)
matches[i].val = val + 1;
- matches[i].len -= strlen(val);
- }
results[i].match = 0;
results[i].value = NULL;
@@ -193,17 +191,29 @@ void tst_kconfig_read(const char *const *kconfigs,
while (fgets(buf, sizeof(buf), fp)) {
for (i = 0; i < cnt; i++) {
- if (match(&matches[i], kconfigs[i], &results[i], buf)) {
- for (j = 0; j < cnt; j++) {
- if (matches[j].match)
- break;
+ memset(kconfig_multi, 0, sizeof(kconfig_multi));
+ /* strtok_r will split kconfigs[i] to multi string, so copy it */
+ memcpy(kconfig_multi, kconfigs[i], strlen(kconfigs[i]));
+ kconfig_token = strtok_r(kconfig_multi, "|=", &p_left);
+
+ while (kconfig_token != NULL) {
+ if (strncmp("CONFIG_", kconfig_token, 7))
+ tst_brk(TBROK, "Invalid config string '%s'", kconfig_token);
+ matches[i].len = strlen(kconfig_token);
+ if (match(&matches[i], kconfig_token, &results[i], buf)) {
+ for (j = 0; j < cnt; j++) {
+ if (matches[j].match)
+ break;
+ }
}
-
- if (j == cnt)
- goto exit;
+ kconfig_token = strtok_r(NULL, "|=", &p_left);
+ /* avoid to use after "=" string */
+ if (strlen(p_left) == 0)
+ break;
}
+ if (j == cnt)
+ goto exit;
}
-
}
exit:
--
2.14.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [LTP] [PATCH v4 2/4] umip_basic_test.c: improve kconfig check to avoid umip wrong abort case
2019-12-19 13:18 [LTP] [PATCH v4 1/4] lib/tst_kconfig.c: Add any kconfig to match the expected value function Pengfei Xu
@ 2019-12-19 13:18 ` Pengfei Xu
2019-12-19 13:18 ` [LTP] [PATCH v4 3/4] lib: add any kconfig to match the expected value function into kconfig test Pengfei Xu
` (2 subsequent siblings)
3 siblings, 0 replies; 13+ messages in thread
From: Pengfei Xu @ 2019-12-19 13:18 UTC (permalink / raw)
To: ltp
From v5.5 main line, umip kconfig changed from "CONFIG_X86_INTEL_UMIP=y"
to "CONFIG_X86_UMIP=y".
We could use "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" to check kconfig
CONFIG_X86_INTEL_UMIP=y(old kernel) or CONFIG_X86_UMIP=y(new kernel) for umip.
Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
---
testcases/kernel/security/umip/umip_basic_test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/kernel/security/umip/umip_basic_test.c b/testcases/kernel/security/umip/umip_basic_test.c
index 1baa26c52..24eca8890 100644
--- a/testcases/kernel/security/umip/umip_basic_test.c
+++ b/testcases/kernel/security/umip/umip_basic_test.c
@@ -171,7 +171,7 @@ static struct tst_test test = {
.forks_child = 1,
.test = verify_umip_instruction,
.needs_kconfigs = (const char *[]){
- "CONFIG_X86_INTEL_UMIP=y",
+ "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y",
NULL
},
.needs_root = 1,
--
2.14.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [LTP] [PATCH v4 3/4] lib: add any kconfig to match the expected value function into kconfig test
2019-12-19 13:18 [LTP] [PATCH v4 1/4] lib/tst_kconfig.c: Add any kconfig to match the expected value function Pengfei Xu
2019-12-19 13:18 ` [LTP] [PATCH v4 2/4] umip_basic_test.c: improve kconfig check to avoid umip wrong abort case Pengfei Xu
@ 2019-12-19 13:18 ` Pengfei Xu
2019-12-19 13:18 ` [LTP] [PATCH v4 4/4] lib: add any kconfig to match the expected value function document Pengfei Xu
2019-12-20 5:12 ` [LTP] [PATCH v4 1/4] lib/tst_kconfig.c: Add any kconfig to match the expected value function Yang Xu
3 siblings, 0 replies; 13+ messages in thread
From: Pengfei Xu @ 2019-12-19 13:18 UTC (permalink / raw)
To: ltp
config01/02/03/04 should be passed for UMIP kconfig
All cases in config05 should be failed.
Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
---
lib/newlib_tests/config01 | 1 +
lib/newlib_tests/config02 | 1 +
lib/newlib_tests/config03 | 1 +
lib/newlib_tests/config04 | 1 +
lib/newlib_tests/config05 | 2 ++
lib/newlib_tests/test_kconfig.c | 1 +
6 files changed, 7 insertions(+)
diff --git a/lib/newlib_tests/config01 b/lib/newlib_tests/config01
index 96d68d836..085c9368c 100644
--- a/lib/newlib_tests/config01
+++ b/lib/newlib_tests/config01
@@ -2,3 +2,4 @@
CONFIG_MMU=y
CONFIG_EXT4_FS=m
CONFIG_PGTABLE_LEVELS=4
+CONFIG_X86_UMIP=y
diff --git a/lib/newlib_tests/config02 b/lib/newlib_tests/config02
index 2de45cff8..ca71d26c1 100644
--- a/lib/newlib_tests/config02
+++ b/lib/newlib_tests/config02
@@ -2,3 +2,4 @@
# CONFIG_MMU is not set
CONFIG_EXT4_FS=m
CONFIG_PGTABLE_LEVELS=4
+CONFIG_X86_INTEL_UMIP=y
diff --git a/lib/newlib_tests/config03 b/lib/newlib_tests/config03
index 1a3b9e648..8a92def74 100644
--- a/lib/newlib_tests/config03
+++ b/lib/newlib_tests/config03
@@ -2,3 +2,4 @@
CONFIG_MMU=y
CONFIG_EXT4_FS=m
CONFIG_PGTABLE_LEVELS=44
+CONFIG_X86_UMIP=y
diff --git a/lib/newlib_tests/config04 b/lib/newlib_tests/config04
index cce7051ae..424157fec 100644
--- a/lib/newlib_tests/config04
+++ b/lib/newlib_tests/config04
@@ -1,4 +1,5 @@
# Unexpected CONFIG_EXT4_FS compiled in
CONFIG_MMU=y
CONFIG_EXT4_FS=y
+CONFIG_X86_INTEL_UMIP=y
CONFIG_PGTABLE_LEVELS=4
diff --git a/lib/newlib_tests/config05 b/lib/newlib_tests/config05
index a9d7bab4d..e68fa8913 100644
--- a/lib/newlib_tests/config05
+++ b/lib/newlib_tests/config05
@@ -1,3 +1,5 @@
# Everything is wrong
CONFIG_EXT4_FS=y
CONFIG_PGTABLE_LEVELS=44
+CONFIG_X86_UMI=y
+CONFIG_X86_INT_UMIP=y
diff --git a/lib/newlib_tests/test_kconfig.c b/lib/newlib_tests/test_kconfig.c
index d9c662fc5..9515b60e2 100644
--- a/lib/newlib_tests/test_kconfig.c
+++ b/lib/newlib_tests/test_kconfig.c
@@ -14,6 +14,7 @@ static const char *kconfigs[] = {
"CONFIG_MMU",
"CONFIG_EXT4_FS=m",
"CONFIG_PGTABLE_LEVELS=4",
+ "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y",
NULL
};
--
2.14.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [LTP] [PATCH v4 4/4] lib: add any kconfig to match the expected value function document
2019-12-19 13:18 [LTP] [PATCH v4 1/4] lib/tst_kconfig.c: Add any kconfig to match the expected value function Pengfei Xu
2019-12-19 13:18 ` [LTP] [PATCH v4 2/4] umip_basic_test.c: improve kconfig check to avoid umip wrong abort case Pengfei Xu
2019-12-19 13:18 ` [LTP] [PATCH v4 3/4] lib: add any kconfig to match the expected value function into kconfig test Pengfei Xu
@ 2019-12-19 13:18 ` Pengfei Xu
2019-12-20 5:37 ` Yang Xu
2019-12-20 5:12 ` [LTP] [PATCH v4 1/4] lib/tst_kconfig.c: Add any kconfig to match the expected value function Yang Xu
3 siblings, 1 reply; 13+ messages in thread
From: Pengfei Xu @ 2019-12-19 13:18 UTC (permalink / raw)
To: ltp
Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
---
doc/test-writing-guidelines.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt
index 79d857fea..e64ff8716 100644
--- a/doc/test-writing-guidelines.txt
+++ b/doc/test-writing-guidelines.txt
@@ -1590,7 +1590,9 @@ aborted with 'TCONF' if any of the required options were not set.
#include "tst_test.h"
static const char *kconfigs[] = {
- "CONFIG_X86_INTEL_UMIP",
+ "CONFIG_EXT4_FS=y",
+ "CONFIG_MMU",
+ "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y",
NULL
};
--
2.14.1
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [LTP] [PATCH v4 1/4] lib/tst_kconfig.c: Add any kconfig to match the expected value function
2019-12-19 13:18 [LTP] [PATCH v4 1/4] lib/tst_kconfig.c: Add any kconfig to match the expected value function Pengfei Xu
` (2 preceding siblings ...)
2019-12-19 13:18 ` [LTP] [PATCH v4 4/4] lib: add any kconfig to match the expected value function document Pengfei Xu
@ 2019-12-20 5:12 ` Yang Xu
2019-12-20 5:58 ` Pengfei Xu
3 siblings, 1 reply; 13+ messages in thread
From: Yang Xu @ 2019-12-20 5:12 UTC (permalink / raw)
To: ltp
Hi Pengfei
This patch set looks good to me, only a samll comment.
Reviewed-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
on 2019/12/19 21:18, Pengfei Xu wrote:
> Example: CONFIG_X86_INTEL_UMIP=y for umip kconfig before and v5.4
> mainline kernel.
> CONFIG_X86_UMIP=y for umip kconfig after v5.5 mainline kernel.
> Format: CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y
>
> Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
> ---
> lib/tst_kconfig.c | 36 +++++++++++++++++++++++-------------
> 1 file changed, 23 insertions(+), 13 deletions(-)
>
> diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
> index 4b51413e5..74c46ebec 100644
> --- a/lib/tst_kconfig.c
> +++ b/lib/tst_kconfig.c
> @@ -167,7 +167,8 @@ void tst_kconfig_read(const char *const *kconfigs,
> struct match matches[cnt];
> FILE *fp;
> unsigned int i, j;
> - char buf[1024];
> + char buf[1024], kconfig_multi[100];
> + char *kconfig_token = NULL, *p_left = NULL;
>
> for (i = 0; i < cnt; i++) {
> const char *val = strchr(kconfigs[i], '=');
> @@ -176,12 +177,9 @@ void tst_kconfig_read(const char *const *kconfigs,
> tst_brk(TBROK, "Invalid config string '%s'", kconfigs[i]);
>
> matches[i].match = 0;
> - matches[i].len = strlen(kconfigs[i]);
>
> - if (val) {
> + if (val)
> matches[i].val = val + 1;
> - matches[i].len -= strlen(val);
> - }
>
> results[i].match = 0;
> results[i].value = NULL;
> @@ -193,17 +191,29 @@ void tst_kconfig_read(const char *const *kconfigs,
>
> while (fgets(buf, sizeof(buf), fp)) {
> for (i = 0; i < cnt; i++) {
> - if (match(&matches[i], kconfigs[i], &results[i], buf)) {
> - for (j = 0; j < cnt; j++) {
> - if (matches[j].match)
> - break;
> + memset(kconfig_multi, 0, sizeof(kconfig_multi));
> + /* strtok_r will split kconfigs[i] to multi string, so copy it */
> + memcpy(kconfig_multi, kconfigs[i], strlen(kconfigs[i]));
> + kconfig_token = strtok_r(kconfig_multi, "|=", &p_left);
> +
> + while (kconfig_token != NULL) {
> + if (strncmp("CONFIG_", kconfig_token, 7))
> + tst_brk(TBROK, "Invalid config string '%s'", kconfig_token);
> + matches[i].len = strlen(kconfig_token);
> + if (match(&matches[i], kconfig_token, &results[i], buf)) {
> + for (j = 0; j < cnt; j++) {
> + if (matches[j].match)
> + break;
> + }
> }
> -
> - if (j == cnt)
It will report ?j? may be used uninitialized in this function when
compile. But I think it can be modified by maintainer when it is merged.
> - goto exit;
> + kconfig_token = strtok_r(NULL, "|=", &p_left);
> + /* avoid to use after "=" string */
> + if (strlen(p_left) == 0)
> + break;
> }
> + if (j == cnt)
> + goto exit;
> }
> -
> }
>
> exit:
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [LTP] [PATCH v4 4/4] lib: add any kconfig to match the expected value function document
2019-12-19 13:18 ` [LTP] [PATCH v4 4/4] lib: add any kconfig to match the expected value function document Pengfei Xu
@ 2019-12-20 5:37 ` Yang Xu
2019-12-20 6:01 ` Pengfei Xu
0 siblings, 1 reply; 13+ messages in thread
From: Yang Xu @ 2019-12-20 5:37 UTC (permalink / raw)
To: ltp
Hi Pengfei
on 2019/12/19 21:18, Pengfei Xu wrote:
> Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
> ---
> doc/test-writing-guidelines.txt | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt
> index 79d857fea..e64ff8716 100644
> --- a/doc/test-writing-guidelines.txt
> +++ b/doc/test-writing-guidelines.txt
> @@ -1590,7 +1590,9 @@ aborted with 'TCONF' if any of the required options were not set.
Before your patch, I know we can use the following two formats kconfigs
CONFIG_A
CONFIG_A=y/m/v
after your patch set, we can use the following three formats kconfigs
CONFIG_A
CONFIG_A=y/m/v
CONFIG_A|CONFIGB=y/m/v
As the usual extend logic, we think CONFIGA|CONFIGB is also ok. But in
fact, we use "|" or "=" to delim string. So we can't parse
CONFIGA|CONFIGB correctly. So, if we can tell user or developer about
this in here, it will be better.
ps: we can add configA| config B test in your third patch.
Kind Regards
Yang Xu
> #include "tst_test.h"
>
> static const char *kconfigs[] = {
> - "CONFIG_X86_INTEL_UMIP",
> + "CONFIG_EXT4_FS=y",
> + "CONFIG_MMU",
> + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y",
> NULL
> };
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [LTP] [PATCH v4 1/4] lib/tst_kconfig.c: Add any kconfig to match the expected value function
2019-12-20 5:12 ` [LTP] [PATCH v4 1/4] lib/tst_kconfig.c: Add any kconfig to match the expected value function Yang Xu
@ 2019-12-20 5:58 ` Pengfei Xu
0 siblings, 0 replies; 13+ messages in thread
From: Pengfei Xu @ 2019-12-20 5:58 UTC (permalink / raw)
To: ltp
Hi Xu,
Thanks for your advice!
I will send the new patch to solve the warning.
Thanks!
BR.
On 2019-12-20 at 13:12:17 +0800, Yang Xu wrote:
> Hi Pengfei
>
> This patch set looks good to me, only a samll comment.
> Reviewed-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
>
> on 2019/12/19 21:18, Pengfei Xu wrote:
> > Example: CONFIG_X86_INTEL_UMIP=y for umip kconfig before and v5.4
> > mainline kernel.
> > CONFIG_X86_UMIP=y for umip kconfig after v5.5 mainline kernel.
> > Format: CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y
> >
> > Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
> > ---
> > lib/tst_kconfig.c | 36 +++++++++++++++++++++++-------------
> > 1 file changed, 23 insertions(+), 13 deletions(-)
> >
> > diff --git a/lib/tst_kconfig.c b/lib/tst_kconfig.c
> > index 4b51413e5..74c46ebec 100644
> > --- a/lib/tst_kconfig.c
> > +++ b/lib/tst_kconfig.c
> > @@ -167,7 +167,8 @@ void tst_kconfig_read(const char *const *kconfigs,
> > struct match matches[cnt];
> > + break;
> > + }
> > }
> > -
> > - if (j == cnt)
> It will report ?j? may be used uninitialized in this function when compile.
> But I think it can be modified by maintainer when it is merged.
> > - goto exit;
> > + kconfig_token = strtok_r(NULL, "|=", &p_left);
> > + /* avoid to use after "=" string */
> > + if (strlen(p_left) == 0)
> > + break;
> > }
> > + if (j == cnt)
> > + goto exit;
> > }
> > -
> > }
> > exit:
> >
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [LTP] [PATCH v4 4/4] lib: add any kconfig to match the expected value function document
2019-12-20 6:01 ` Pengfei Xu
@ 2019-12-20 6:00 ` Yang Xu
2019-12-20 6:35 ` Pengfei Xu
2019-12-20 7:09 ` Pengfei Xu
0 siblings, 2 replies; 13+ messages in thread
From: Yang Xu @ 2019-12-20 6:00 UTC (permalink / raw)
To: ltp
Hi Pengfei
> Hi Xu,
>
>
> On 2019-12-20 at 13:37:21 +0800, Yang Xu wrote:
>>
>> Hi Pengfei
>>
>> on 2019/12/19 21:18, Pengfei Xu wrote:
>>> Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
>>> ---
>>> doc/test-writing-guidelines.txt | 4 +++-
>>> 1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt
>>> index 79d857fea..e64ff8716 100644
>>> --- a/doc/test-writing-guidelines.txt
>>> +++ b/doc/test-writing-guidelines.txt
>>> @@ -1590,7 +1590,9 @@ aborted with 'TCONF' if any of the required options were not set.
>> Before your patch, I know we can use the following two formats kconfigs
>> CONFIG_A
>> CONFIG_A=y/m/v
>> after your patch set, we can use the following three formats kconfigs
>> CONFIG_A
>> CONFIG_A=y/m/v
>> CONFIG_A|CONFIGB=y/m/v
>> As the usual extend logic, we think CONFIGA|CONFIGB is also ok. But in
>> fact, we use "|" or "=" to delim string. So we can't parse CONFIGA|CONFIGB
>> correctly. So, if we can tell user or developer about this in here, it will
>> be better.
>>
>> ps: we can add configA| config B test in your third patch.
>>
> Actually present patch could support CONFIG_A|CONFIG_B style, and it works
> well, you could change "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" to
> "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" in test_kconfig.c and have a try. : )
"CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" is useful because
CONFIG_X86_INTEL_UMIP is in our kernel configs . If you use
"CONFIG_X86_UMIP|CONFIG_X86_INTEL_UMIP", it will report error.
Kind Regards
Yang Xu
>
> Thanks!
>> Kind Regards
>> Yang Xu
>>> #include "tst_test.h"
>>> static const char *kconfigs[] = {
>>> - "CONFIG_X86_INTEL_UMIP",
>>> + "CONFIG_EXT4_FS=y",
>>> + "CONFIG_MMU",
>>> + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y",
>>> NULL
>>> };
>>>
>>
>>
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [LTP] [PATCH v4 4/4] lib: add any kconfig to match the expected value function document
2019-12-20 5:37 ` Yang Xu
@ 2019-12-20 6:01 ` Pengfei Xu
2019-12-20 6:00 ` Yang Xu
0 siblings, 1 reply; 13+ messages in thread
From: Pengfei Xu @ 2019-12-20 6:01 UTC (permalink / raw)
To: ltp
Hi Xu,
On 2019-12-20 at 13:37:21 +0800, Yang Xu wrote:
>
> Hi Pengfei
>
> on 2019/12/19 21:18, Pengfei Xu wrote:
> > Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
> > ---
> > doc/test-writing-guidelines.txt | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt
> > index 79d857fea..e64ff8716 100644
> > --- a/doc/test-writing-guidelines.txt
> > +++ b/doc/test-writing-guidelines.txt
> > @@ -1590,7 +1590,9 @@ aborted with 'TCONF' if any of the required options were not set.
> Before your patch, I know we can use the following two formats kconfigs
> CONFIG_A
> CONFIG_A=y/m/v
> after your patch set, we can use the following three formats kconfigs
> CONFIG_A
> CONFIG_A=y/m/v
> CONFIG_A|CONFIGB=y/m/v
> As the usual extend logic, we think CONFIGA|CONFIGB is also ok. But in
> fact, we use "|" or "=" to delim string. So we can't parse CONFIGA|CONFIGB
> correctly. So, if we can tell user or developer about this in here, it will
> be better.
>
> ps: we can add configA| config B test in your third patch.
>
Actually present patch could support CONFIG_A|CONFIG_B style, and it works
well, you could change "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" to
"CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" in test_kconfig.c and have a try. : )
Thanks!
> Kind Regards
> Yang Xu
> > #include "tst_test.h"
> > static const char *kconfigs[] = {
> > - "CONFIG_X86_INTEL_UMIP",
> > + "CONFIG_EXT4_FS=y",
> > + "CONFIG_MMU",
> > + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y",
> > NULL
> > };
> >
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [LTP] [PATCH v4 4/4] lib: add any kconfig to match the expected value function document
2019-12-20 6:00 ` Yang Xu
@ 2019-12-20 6:35 ` Pengfei Xu
2019-12-20 7:09 ` Pengfei Xu
1 sibling, 0 replies; 13+ messages in thread
From: Pengfei Xu @ 2019-12-20 6:35 UTC (permalink / raw)
To: ltp
Hi Xu,
Thanks for your comment.
I will try to fix it and send the patch.
Thanks!
BR.
On 2019-12-20 at 14:00:00 +0800, Yang Xu wrote:
> Hi Pengfei
> > Hi Xu,
> >
> >
> > On 2019-12-20 at 13:37:21 +0800, Yang Xu wrote:
> > >
> > > Hi Pengfei
> > >
> > > on 2019/12/19 21:18, Pengfei Xu wrote:
> > > > Signed-off-by: Pengfei Xu <pengfei.xu@intel.com>
> > > > ---
> > > > doc/test-writing-guidelines.txt | 4 +++-
> > > > 1 file changed, 3 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt
> > > > index 79d857fea..e64ff8716 100644
> > > > --- a/doc/test-writing-guidelines.txt
> > > > +++ b/doc/test-writing-guidelines.txt
> > > > @@ -1590,7 +1590,9 @@ aborted with 'TCONF' if any of the required options were not set.
> > > Before your patch, I know we can use the following two formats kconfigs
> > > CONFIG_A
> > > CONFIG_A=y/m/v
> > > after your patch set, we can use the following three formats kconfigs
> > > CONFIG_A
> > > CONFIG_A=y/m/v
> > > CONFIG_A|CONFIGB=y/m/v
> > > As the usual extend logic, we think CONFIGA|CONFIGB is also ok. But in
> > > fact, we use "|" or "=" to delim string. So we can't parse CONFIGA|CONFIGB
> > > correctly. So, if we can tell user or developer about this in here, it will
> > > be better.
> > >
> > > ps: we can add configA| config B test in your third patch.
> > >
> > Actually present patch could support CONFIG_A|CONFIG_B style, and it works
> > well, you could change "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" to
> > "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" in test_kconfig.c and have a try. : )
> "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" is useful because
> CONFIG_X86_INTEL_UMIP is in our kernel configs . If you use
> "CONFIG_X86_UMIP|CONFIG_X86_INTEL_UMIP", it will report error.
>
> Kind Regards
> Yang Xu
> >
> > Thanks!
> > > Kind Regards
> > > Yang Xu
> > > > #include "tst_test.h"
> > > > static const char *kconfigs[] = {
> > > > - "CONFIG_X86_INTEL_UMIP",
> > > > + "CONFIG_EXT4_FS=y",
> > > > + "CONFIG_MMU",
> > > > + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y",
> > > > NULL
> > > > };
> > > >
> > >
> > >
> >
> >
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [LTP] [PATCH v4 4/4] lib: add any kconfig to match the expected value function document
2019-12-20 6:00 ` Yang Xu
2019-12-20 6:35 ` Pengfei Xu
@ 2019-12-20 7:09 ` Pengfei Xu
2019-12-20 7:19 ` Yang Xu
1 sibling, 1 reply; 13+ messages in thread
From: Pengfei Xu @ 2019-12-20 7:09 UTC (permalink / raw)
To: ltp
Hi Xu,
Due to memory copy, there is some bit and display issue in last string.
So for your question, for CONFIG_A|CONFIG_B without expect value, maybe y
or m.
We could add it with below style:
"CONFIG_A|CONFIG_B|NA", and add it into guidelines, NA will not be solved,
actually you could fill with any string after last '|'.
Is it ok?
Thanks!
On 2019-12-20 at 14:00:00 +0800, Yang Xu wrote:
> Hi Pengfei
> > Hi Xu,
> >
> >
> > > Before your patch, I know we can use the following two formats kconfigs
> > > CONFIG_A
> > > CONFIG_A=y/m/v
> > > after your patch set, we can use the following three formats kconfigs
> > > CONFIG_A
> > > CONFIG_A=y/m/v
> > > CONFIG_A|CONFIGB=y/m/v
> > > As the usual extend logic, we think CONFIGA|CONFIGB is also ok. But in
> > > fact, we use "|" or "=" to delim string. So we can't parse CONFIGA|CONFIGB
> > > correctly. So, if we can tell user or developer about this in here, it will
> > > be better.
> > >
> > > ps: we can add configA| config B test in your third patch.
> > >
> > Actually present patch could support CONFIG_A|CONFIG_B style, and it works
> > well, you could change "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" to
> > "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" in test_kconfig.c and have a try. : )
> "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" is useful because
> CONFIG_X86_INTEL_UMIP is in our kernel configs . If you use
> "CONFIG_X86_UMIP|CONFIG_X86_INTEL_UMIP", it will report error.
>
> Kind Regards
> Yang Xu
> >
> > Thanks!
> > > Kind Regards
> > > Yang Xu
> > > > #include "tst_test.h"
> > > > static const char *kconfigs[] = {
> > > > - "CONFIG_X86_INTEL_UMIP",
> > > > + "CONFIG_EXT4_FS=y",
> > > > + "CONFIG_MMU",
> > > > + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y",
> > > > NULL
> > > > };
> > > >
> > >
> > >
> >
> >
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [LTP] [PATCH v4 4/4] lib: add any kconfig to match the expected value function document
2019-12-20 7:09 ` Pengfei Xu
@ 2019-12-20 7:19 ` Yang Xu
2019-12-21 2:14 ` Xu, Pengfei
0 siblings, 1 reply; 13+ messages in thread
From: Yang Xu @ 2019-12-20 7:19 UTC (permalink / raw)
To: ltp
Hi Pengfei
> Hi Xu,
> Due to memory copy, there is some bit and display issue in last string.
>
> So for your question, for CONFIG_A|CONFIG_B without expect value, maybe y
> or m.
> We could add it with below style:
> "CONFIG_A|CONFIG_B|NA", and add it into guidelines, NA will not be solved,
> actually you could fill with any string after last '|'.
> Is it ok?
It sounds reasonable. I think it is ok.
Kind Regards
Yang Xu
>
> Thanks!
>
> On 2019-12-20 at 14:00:00 +0800, Yang Xu wrote:
>> Hi Pengfei
>>> Hi Xu,
>>>
>>>
>>>> Before your patch, I know we can use the following two formats kconfigs
>>>> CONFIG_A
>>>> CONFIG_A=y/m/v
>>>> after your patch set, we can use the following three formats kconfigs
>>>> CONFIG_A
>>>> CONFIG_A=y/m/v
>>>> CONFIG_A|CONFIGB=y/m/v
>>>> As the usual extend logic, we think CONFIGA|CONFIGB is also ok. But in
>>>> fact, we use "|" or "=" to delim string. So we can't parse CONFIGA|CONFIGB
>>>> correctly. So, if we can tell user or developer about this in here, it will
>>>> be better.
>>>>
>>>> ps: we can add configA| config B test in your third patch.
>>>>
>>> Actually present patch could support CONFIG_A|CONFIG_B style, and it works
>>> well, you could change "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" to
>>> "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" in test_kconfig.c and have a try. : )
>> "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" is useful because
>> CONFIG_X86_INTEL_UMIP is in our kernel configs . If you use
>> "CONFIG_X86_UMIP|CONFIG_X86_INTEL_UMIP", it will report error.
>>
>> Kind Regards
>> Yang Xu
>>>
>>> Thanks!
>>>> Kind Regards
>>>> Yang Xu
>>>>> #include "tst_test.h"
>>>>> static const char *kconfigs[] = {
>>>>> - "CONFIG_X86_INTEL_UMIP",
>>>>> + "CONFIG_EXT4_FS=y",
>>>>> + "CONFIG_MMU",
>>>>> + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y",
>>>>> NULL
>>>>> };
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [LTP] [PATCH v4 4/4] lib: add any kconfig to match the expected value function document
2019-12-20 7:19 ` Yang Xu
@ 2019-12-21 2:14 ` Xu, Pengfei
0 siblings, 0 replies; 13+ messages in thread
From: Xu, Pengfei @ 2019-12-21 2:14 UTC (permalink / raw)
To: ltp
Thanks Xu! :)
BR.
> ? 2019?12?20??15:20?Yang Xu <xuyang2018.jy@cn.fujitsu.com> ???
>
> ?Hi Pengfei
>> Hi Xu,
>> Due to memory copy, there is some bit and display issue in last string.
>> So for your question, for CONFIG_A|CONFIG_B without expect value, maybe y
>> or m.
>> We could add it with below style:
>> "CONFIG_A|CONFIG_B|NA", and add it into guidelines, NA will not be solved,
>> actually you could fill with any string after last '|'.
>> Is it ok?
> It sounds reasonable. I think it is ok.
>
> Kind Regards
> Yang Xu
>> Thanks!
>>> On 2019-12-20 at 14:00:00 +0800, Yang Xu wrote:
>>> Hi Pengfei
>>>> Hi Xu,
>>>>
>>>>
>>>>> Before your patch, I know we can use the following two formats kconfigs
>>>>> CONFIG_A
>>>>> CONFIG_A=y/m/v
>>>>> after your patch set, we can use the following three formats kconfigs
>>>>> CONFIG_A
>>>>> CONFIG_A=y/m/v
>>>>> CONFIG_A|CONFIGB=y/m/v
>>>>> As the usual extend logic, we think CONFIGA|CONFIGB is also ok. But in
>>>>> fact, we use "|" or "=" to delim string. So we can't parse CONFIGA|CONFIGB
>>>>> correctly. So, if we can tell user or developer about this in here, it will
>>>>> be better.
>>>>>
>>>>> ps: we can add configA| config B test in your third patch.
>>>>>
>>>> Actually present patch could support CONFIG_A|CONFIG_B style, and it works
>>>> well, you could change "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y" to
>>>> "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" in test_kconfig.c and have a try. : )
>>> "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP" is useful because
>>> CONFIG_X86_INTEL_UMIP is in our kernel configs . If you use
>>> "CONFIG_X86_UMIP|CONFIG_X86_INTEL_UMIP", it will report error.
>>>
>>> Kind Regards
>>> Yang Xu
>>>>
>>>> Thanks!
>>>>> Kind Regards
>>>>> Yang Xu
>>>>>> #include "tst_test.h"
>>>>>> static const char *kconfigs[] = {
>>>>>> - "CONFIG_X86_INTEL_UMIP",
>>>>>> + "CONFIG_EXT4_FS=y",
>>>>>> + "CONFIG_MMU",
>>>>>> + "CONFIG_X86_INTEL_UMIP|CONFIG_X86_UMIP=y",
>>>>>> NULL
>>>>>> };
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2019-12-21 2:14 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-19 13:18 [LTP] [PATCH v4 1/4] lib/tst_kconfig.c: Add any kconfig to match the expected value function Pengfei Xu
2019-12-19 13:18 ` [LTP] [PATCH v4 2/4] umip_basic_test.c: improve kconfig check to avoid umip wrong abort case Pengfei Xu
2019-12-19 13:18 ` [LTP] [PATCH v4 3/4] lib: add any kconfig to match the expected value function into kconfig test Pengfei Xu
2019-12-19 13:18 ` [LTP] [PATCH v4 4/4] lib: add any kconfig to match the expected value function document Pengfei Xu
2019-12-20 5:37 ` Yang Xu
2019-12-20 6:01 ` Pengfei Xu
2019-12-20 6:00 ` Yang Xu
2019-12-20 6:35 ` Pengfei Xu
2019-12-20 7:09 ` Pengfei Xu
2019-12-20 7:19 ` Yang Xu
2019-12-21 2:14 ` Xu, Pengfei
2019-12-20 5:12 ` [LTP] [PATCH v4 1/4] lib/tst_kconfig.c: Add any kconfig to match the expected value function Yang Xu
2019-12-20 5:58 ` Pengfei Xu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.