All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 1/3] netstress: TCONF if modprobe dccp fails
@ 2018-03-13 15:01 Petr Vorel
  2018-03-13 15:01 ` [LTP] [PATCH v2 2/3] lib: TCONF on "not supported" errnos in SAFE_SOCKET() Petr Vorel
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Petr Vorel @ 2018-03-13 15:01 UTC (permalink / raw)
  To: ltp

commit 22d43a959 ("netstress: load dccp module manually") added
functionality to trying to load dccp module. It's actually better to
exit with TCONF as unsuccessful modprobe means that dccp module is
missing.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
LianWen, hope TCONF is ok for you:
http://lists.linux.it/pipermail/ltp/2018-February/007200.html
---
 testcases/network/netstress/netstress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/network/netstress/netstress.c b/testcases/network/netstress/netstress.c
index 4754bacf6..369a5eeb8 100644
--- a/testcases/network/netstress/netstress.c
+++ b/testcases/network/netstress/netstress.c
@@ -941,7 +941,7 @@ static void setup(void)
 		static const char * const argv[] = {"modprobe", "dccp", NULL};
 
 		if (tst_run_cmd(argv, NULL, NULL, 1))
-			tst_res(TWARN, "Failed to load DCCP module");
+			tst_brk(TCONF, "Failed to load DCCP module");
 
 		tst_res(TINFO, "DCCP %s", (client_mode) ? "client" : "server");
 		fastopen_api = fastopen_sapi = NULL;
-- 
2.16.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH v2 2/3] lib: TCONF on "not supported" errnos in SAFE_SOCKET()
  2018-03-13 15:01 [LTP] [PATCH v2 1/3] netstress: TCONF if modprobe dccp fails Petr Vorel
@ 2018-03-13 15:01 ` Petr Vorel
  2018-03-14  0:42   ` sunlianwen
  2018-03-13 15:01 ` [LTP] [PATCH v2 3/3] tst_netload: Exit with TCONF when netstress exit with CONF Petr Vorel
  2018-03-14 12:14 ` [LTP] [PATCH v2 1/3] netstress: TCONF if modprobe dccp fails Petr Vorel
  2 siblings, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2018-03-13 15:01 UTC (permalink / raw)
  To: ltp

*NOSUPPORT errnos likely mean there is configuration issue rather than
test failure.

e.g. missing dccp module in netstress.c which was so far set as TBROK:
safe_net.c:117: BROK: netstress.c:654: socket(10, 6, 33) failed: ESOCKTNOSUPPORT

Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 lib/safe_net.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/lib/safe_net.c b/lib/safe_net.c
index 9ea9d2b42..9ed52dcd1 100644
--- a/lib/safe_net.c
+++ b/lib/safe_net.c
@@ -107,12 +107,24 @@ int tst_getsockport(const char *file, const int lineno, int sockfd)
 int safe_socket(const char *file, const int lineno, void (cleanup_fn)(void),
 		int domain, int type, int protocol)
 {
-	int rval;
+	int rval, ttype;
 
 	rval = socket(domain, type, protocol);
 
 	if (rval < 0) {
-		tst_brkm(TBROK | TERRNO, cleanup_fn,
+		switch (errno) {
+		case EPROTONOSUPPORT:
+		case ESOCKTNOSUPPORT:
+		case EOPNOTSUPP:
+		case EPFNOSUPPORT:
+		case EAFNOSUPPORT:
+			ttype = TCONF;
+			break;
+		default:
+			ttype = TBROK;
+		}
+
+		tst_brkm(ttype | TERRNO, cleanup_fn,
 			 "%s:%d: socket(%d, %d, %d) failed", file, lineno,
 			 domain, type, protocol);
 	}
-- 
2.16.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH v2 3/3] tst_netload: Exit with TCONF when netstress exit with CONF
  2018-03-13 15:01 [LTP] [PATCH v2 1/3] netstress: TCONF if modprobe dccp fails Petr Vorel
  2018-03-13 15:01 ` [LTP] [PATCH v2 2/3] lib: TCONF on "not supported" errnos in SAFE_SOCKET() Petr Vorel
@ 2018-03-13 15:01 ` Petr Vorel
  2018-03-14 12:14 ` [LTP] [PATCH v2 1/3] netstress: TCONF if modprobe dccp fails Petr Vorel
  2 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2018-03-13 15:01 UTC (permalink / raw)
  To: ltp

as some issues are configuration issues.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Alexey, I kept grepping as in v1, see:
http://lists.linux.it/pipermail/ltp/2018-March/007240.html
---
 testcases/lib/test_net.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/testcases/lib/test_net.sh b/testcases/lib/test_net.sh
index 0e78dfd8b..203464f0d 100644
--- a/testcases/lib/test_net.sh
+++ b/testcases/lib/test_net.sh
@@ -459,7 +459,9 @@ tst_netload()
 	tst_rhost_run -c "netstress $s_opts" > tst_netload.log 2>&1
 	if [ $? -ne 0 ]; then
 		cat tst_netload.log
-		tst_brkm TFAIL "server failed"
+		local ttype="TFAIL"
+		grep -e 'CONF:' tst_netload.log && ttype="TCONF"
+		tst_brkm $ttype "server failed"
 	fi
 
 	local port=$(tst_rhost_run -s -c "cat $TST_TMPDIR/netstress_port")
-- 
2.16.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [LTP] [PATCH v2 2/3] lib: TCONF on "not supported" errnos in SAFE_SOCKET()
  2018-03-13 15:01 ` [LTP] [PATCH v2 2/3] lib: TCONF on "not supported" errnos in SAFE_SOCKET() Petr Vorel
@ 2018-03-14  0:42   ` sunlianwen
  2018-03-14 12:09     ` Petr Vorel
  0 siblings, 1 reply; 6+ messages in thread
From: sunlianwen @ 2018-03-14  0:42 UTC (permalink / raw)
  To: ltp

Hi
    I am sorry I forget to report my debug info on RHEL7.5Beta about 
this question.
I write a testcase on RHEL7.5Beta. the test case is below.

#include <netinet/in.h>
#include <sys/socket.h>
#include <stdio.h>

int main (int argc, const char * argv[])
{
     //create a dccp socket
     int server_socket = socket(AF_INET6, SOCK_DCCP, IPPROTO_DCCP);
     if (server_socket == -1) {
         perror("socket error");
         return 1;
     }
    printf("test is ok \n");
}

And the  RHEL7.5Beta will report "Socket type not supported"  when run 
my testcase  on RHEL7.5Beta .
and the RHEL7.4GA will report "Permission denied " when run my testcase 
on RHEL7.4GA
it's ok when run my testcase on RHEL7.3GA.

That's all.

Thanks
Lianwen Sun

On 03/13/2018 11:01 PM, Petr Vorel wrote:
> *NOSUPPORT errnos likely mean there is configuration issue rather than
> test failure.
>
> e.g. missing dccp module in netstress.c which was so far set as TBROK:
> safe_net.c:117: BROK: netstress.c:654: socket(10, 6, 33) failed: ESOCKTNOSUPPORT
>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>
> ---
>   lib/safe_net.c | 16 ++++++++++++++--
>   1 file changed, 14 insertions(+), 2 deletions(-)
>
> diff --git a/lib/safe_net.c b/lib/safe_net.c
> index 9ea9d2b42..9ed52dcd1 100644
> --- a/lib/safe_net.c
> +++ b/lib/safe_net.c
> @@ -107,12 +107,24 @@ int tst_getsockport(const char *file, const int lineno, int sockfd)
>   int safe_socket(const char *file, const int lineno, void (cleanup_fn)(void),
>   		int domain, int type, int protocol)
>   {
> -	int rval;
> +	int rval, ttype;
>   
>   	rval = socket(domain, type, protocol);
>   
>   	if (rval < 0) {
> -		tst_brkm(TBROK | TERRNO, cleanup_fn,
> +		switch (errno) {
> +		case EPROTONOSUPPORT:
> +		case ESOCKTNOSUPPORT:
> +		case EOPNOTSUPP:
> +		case EPFNOSUPPORT:
> +		case EAFNOSUPPORT:
> +			ttype = TCONF;
> +			break;
> +		default:
> +			ttype = TBROK;
> +		}
> +
> +		tst_brkm(ttype | TERRNO, cleanup_fn,
>   			 "%s:%d: socket(%d, %d, %d) failed", file, lineno,
>   			 domain, type, protocol);
>   	}



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20180314/e9a14bbf/attachment.html>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [PATCH v2 2/3] lib: TCONF on "not supported" errnos in SAFE_SOCKET()
  2018-03-14  0:42   ` sunlianwen
@ 2018-03-14 12:09     ` Petr Vorel
  0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2018-03-14 12:09 UTC (permalink / raw)
  To: ltp

Hi Lianwen,

> Hi
>    I am sorry I forget to report my debug info on RHEL7.5Beta about this
> question.
> I write a testcase on RHEL7.5Beta. the test case is below.

> #include <netinet/in.h>
> #include <sys/socket.h>
> #include <stdio.h>

> int main (int argc, const char * argv[])
> {
>     //create a dccp socket
>     int server_socket = socket(AF_INET6, SOCK_DCCP, IPPROTO_DCCP);
>     if (server_socket == -1) {
>         perror("socket error");
>         return 1;
>     }
>    printf("test is ok \n");
> }

> And the  RHEL7.5Beta will report "Socket type not supported"  when run my
> testcase  on RHEL7.5Beta .
This is ESOCKTNOSUPPORT.

> and the RHEL7.4GA will report "Permission denied " when run my testcase on
> RHEL7.4GA
Not sure why it does not report ESOCKTNOSUPPORT, but I've seen some of these.

> it's ok when run my testcase on RHEL7.3GA.

> That's all.

> Thanks
> Lianwen Sun

Thanks for testing!


Kind regards,
Petr

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [LTP] [PATCH v2 1/3] netstress: TCONF if modprobe dccp fails
  2018-03-13 15:01 [LTP] [PATCH v2 1/3] netstress: TCONF if modprobe dccp fails Petr Vorel
  2018-03-13 15:01 ` [LTP] [PATCH v2 2/3] lib: TCONF on "not supported" errnos in SAFE_SOCKET() Petr Vorel
  2018-03-13 15:01 ` [LTP] [PATCH v2 3/3] tst_netload: Exit with TCONF when netstress exit with CONF Petr Vorel
@ 2018-03-14 12:14 ` Petr Vorel
  2 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2018-03-14 12:14 UTC (permalink / raw)
  To: ltp

Hi,

> commit 22d43a959 ("netstress: load dccp module manually") added
> functionality to trying to load dccp module. It's actually better to
> exit with TCONF as unsuccessful modprobe means that dccp module is
> missing.

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> LianWen, hope TCONF is ok for you:
> http://lists.linux.it/pipermail/ltp/2018-February/007200.html
> ---
>  testcases/network/netstress/netstress.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/testcases/network/netstress/netstress.c b/testcases/network/netstress/netstress.c
> index 4754bacf6..369a5eeb8 100644
> --- a/testcases/network/netstress/netstress.c
> +++ b/testcases/network/netstress/netstress.c
> @@ -941,7 +941,7 @@ static void setup(void)
>  		static const char * const argv[] = {"modprobe", "dccp", NULL};

>  		if (tst_run_cmd(argv, NULL, NULL, 1))
> -			tst_res(TWARN, "Failed to load DCCP module");
> +			tst_brk(TCONF, "Failed to load DCCP module");

>  		tst_res(TINFO, "DCCP %s", (client_mode) ? "client" : "server");
>  		fastopen_api = fastopen_sapi = NULL;

FYI: merged whole patche-set.


Kind regards,
Petr

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-03-14 12:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13 15:01 [LTP] [PATCH v2 1/3] netstress: TCONF if modprobe dccp fails Petr Vorel
2018-03-13 15:01 ` [LTP] [PATCH v2 2/3] lib: TCONF on "not supported" errnos in SAFE_SOCKET() Petr Vorel
2018-03-14  0:42   ` sunlianwen
2018-03-14 12:09     ` Petr Vorel
2018-03-13 15:01 ` [LTP] [PATCH v2 3/3] tst_netload: Exit with TCONF when netstress exit with CONF Petr Vorel
2018-03-14 12:14 ` [LTP] [PATCH v2 1/3] netstress: TCONF if modprobe dccp fails Petr Vorel

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.