All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [RFC PATCH 0/2] netstress, lib: TCONF on "not supported" in SAFE_SOCKET()
@ 2018-02-27 18:00 Petr Vorel
  2018-02-27 18:00 ` [LTP] [RFC PATCH 1/2] lib: TCONF on ESOCKTNOSUPPORT and EPROTONOSUPPORT " Petr Vorel
  2018-02-27 18:00 ` [LTP] [RFC PATCH 2/2] tst_netload: Exit with TCONF when netstress exit with CONF Petr Vorel
  0 siblings, 2 replies; 4+ messages in thread
From: Petr Vorel @ 2018-02-27 18:00 UTC (permalink / raw)
  To: ltp

Hi Alexey,

these patches on the top of your patch netstress: set port dynamically
on the server-side [1] can detect problems when some feature is missing
(e.g. dccp module not compiled).

The only problem is whether we are ok that SAFE_*() macros can exit with
TCONF or we expect it always to exit with TBROK.

[1] http://lists.linux.it/pipermail/ltp/2018-February/007173.html

Petr Vorel (2):
  lib: TCONF on ESOCKTNOSUPPORT and EPROTONOSUPPORT in SAFE_SOCKET()
  tst_netload: Exit with TCONF when netstress exit with CONF

 lib/safe_net.c            | 9 ++++-----
 testcases/lib/test_net.sh | 4 +++-
 2 files changed, 7 insertions(+), 6 deletions(-)

-- 
2.16.2


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

* [LTP] [RFC PATCH 1/2] lib: TCONF on ESOCKTNOSUPPORT and EPROTONOSUPPORT in SAFE_SOCKET()
  2018-02-27 18:00 [LTP] [RFC PATCH 0/2] netstress, lib: TCONF on "not supported" in SAFE_SOCKET() Petr Vorel
@ 2018-02-27 18:00 ` Petr Vorel
  2018-02-28 12:04   ` Cyril Hrubis
  2018-02-27 18:00 ` [LTP] [RFC PATCH 2/2] tst_netload: Exit with TCONF when netstress exit with CONF Petr Vorel
  1 sibling, 1 reply; 4+ messages in thread
From: Petr Vorel @ 2018-02-27 18:00 UTC (permalink / raw)
  To: ltp

As this is clearly configuration issue.

Example of use if missing dccp module in netstress.c:
safe_net.c:117: BROK: netstress.c:654: socket(10, 6, 33) failed: ESOCKTNOSUPPORT

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 lib/safe_net.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/safe_net.c b/lib/safe_net.c
index 9ea9d2b42..f8f4f44ca 100644
--- a/lib/safe_net.c
+++ b/lib/safe_net.c
@@ -111,11 +111,10 @@ int safe_socket(const char *file, const int lineno, void (cleanup_fn)(void),
 
 	rval = socket(domain, type, protocol);
 
-	if (rval < 0) {
-		tst_brkm(TBROK | TERRNO, cleanup_fn,
-			 "%s:%d: socket(%d, %d, %d) failed", file, lineno,
-			 domain, type, protocol);
-	}
+	if (rval < 0)
+		tst_brkm((errno == EPROTONOSUPPORT || errno == ESOCKTNOSUPPORT ? TCONF : TBROK)
+				 | TERRNO, cleanup_fn, "%s:%d: socket(%d, %d, %d) failed",
+				 file, lineno, domain, type, protocol);
 
 	return rval;
 }
-- 
2.16.2


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

* [LTP] [RFC PATCH 2/2] tst_netload: Exit with TCONF when netstress exit with CONF
  2018-02-27 18:00 [LTP] [RFC PATCH 0/2] netstress, lib: TCONF on "not supported" in SAFE_SOCKET() Petr Vorel
  2018-02-27 18:00 ` [LTP] [RFC PATCH 1/2] lib: TCONF on ESOCKTNOSUPPORT and EPROTONOSUPPORT " Petr Vorel
@ 2018-02-27 18:00 ` Petr Vorel
  1 sibling, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2018-02-27 18:00 UTC (permalink / raw)
  To: ltp

as some issues are configuration issues.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 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 95e13ee03..db9bb028d 100644
--- a/testcases/lib/test_net.sh
+++ b/testcases/lib/test_net.sh
@@ -453,7 +453,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] 4+ messages in thread

* [LTP] [RFC PATCH 1/2] lib: TCONF on ESOCKTNOSUPPORT and EPROTONOSUPPORT in SAFE_SOCKET()
  2018-02-27 18:00 ` [LTP] [RFC PATCH 1/2] lib: TCONF on ESOCKTNOSUPPORT and EPROTONOSUPPORT " Petr Vorel
@ 2018-02-28 12:04   ` Cyril Hrubis
  0 siblings, 0 replies; 4+ messages in thread
From: Cyril Hrubis @ 2018-02-28 12:04 UTC (permalink / raw)
  To: ltp

Hi!
> +	if (rval < 0)
> +		tst_brkm((errno == EPROTONOSUPPORT || errno == ESOCKTNOSUPPORT ? TCONF : TBROK)
> +				 | TERRNO, cleanup_fn, "%s:%d: socket(%d, %d, %d) failed",
> +				 file, lineno, domain, type, protocol);

This is kind of ugly code, can we please write it more readable?

-- 
Cyril Hrubis
chrubis@suse.cz

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

end of thread, other threads:[~2018-02-28 12:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-27 18:00 [LTP] [RFC PATCH 0/2] netstress, lib: TCONF on "not supported" in SAFE_SOCKET() Petr Vorel
2018-02-27 18:00 ` [LTP] [RFC PATCH 1/2] lib: TCONF on ESOCKTNOSUPPORT and EPROTONOSUPPORT " Petr Vorel
2018-02-28 12:04   ` Cyril Hrubis
2018-02-27 18:00 ` [LTP] [RFC PATCH 2/2] tst_netload: Exit with TCONF when netstress exit with CONF 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.