All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lucas Bates <lucasb@mojatatu.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, xiyou.wangcong@gmail.com,
	jiri@resnulli.us, jhs@mojatatu.com, aring@mojatatu.com,
	mrv@mojatatu.com, Lucas Bates <lucasb@mojatatu.com>
Subject: [PATCH net-next 4/4] tc-testing: fix the -l argument bug in tdc.py script
Date: Wed, 11 Oct 2017 17:16:54 -0400	[thread overview]
Message-ID: <1507756614-30333-5-git-send-email-lucasb@mojatatu.com> (raw)
In-Reply-To: <1507756614-30333-1-git-send-email-lucasb@mojatatu.com>

This patch fixes a bug in the tdc script, where executing tdc
with the -l argument would cause the tests to start running
as opposed to listing all the known test cases.

Signed-off-by: Lucas Bates <lucasb@mojatatu.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
---
 tools/testing/selftests/tc-testing/tdc.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/tc-testing/tdc.py b/tools/testing/selftests/tc-testing/tdc.py
index cd61b78..d2391df 100755
--- a/tools/testing/selftests/tc-testing/tdc.py
+++ b/tools/testing/selftests/tc-testing/tdc.py
@@ -49,7 +49,7 @@ def exec_cmd(command, nsonly=True):
         stderr=subprocess.PIPE)
     (rawout, serr) = proc.communicate()

-    if proc.returncode != 0:
+    if proc.returncode != 0 and len(serr) > 0:
         foutput = serr.decode("utf-8")
     else:
         foutput = rawout.decode("utf-8")
@@ -203,7 +203,7 @@ def set_args(parser):
                         help='Run tests only from the specified category, or if no category is specified, list known categories.')
     parser.add_argument('-f', '--file', type=str,
                         help='Run tests from the specified file')
-    parser.add_argument('-l', '--list', type=str, nargs='?', const="", metavar='CATEGORY',
+    parser.add_argument('-l', '--list', type=str, nargs='?', const="++", metavar='CATEGORY',
                         help='List all test cases, or those only within the specified category')
     parser.add_argument('-s', '--show', type=str, nargs=1, metavar='ID', dest='showID',
                         help='Display the test case with specified id')
@@ -357,10 +357,10 @@ def set_operation_mode(args):
     testcases = get_categorized_testlist(alltests, ucat)

     if args.list:
-        if (len(args.list) == 0):
+        if (args.list == "++"):
             list_test_cases(alltests)
             exit(0)
-        elif(len(args.list > 0)):
+        elif(len(args.list) > 0):
             if (args.list not in ucat):
                 print("Unknown category " + args.list)
                 print("Available categories:")

  parent reply	other threads:[~2017-10-11 21:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11 21:16 [PATCH net-next 0/4] tc-testing: Test suite updates Lucas Bates
2017-10-11 21:16 ` [PATCH net-next 1/4] tc-testing: Add test cases for flushing actions Lucas Bates
2017-10-11 21:16 ` [PATCH net-next 2/4] tc-testing: Split test case files into smaller chunks Lucas Bates
2017-10-11 21:16 ` [PATCH net-next 3/4] tc-testing: Add test cases for police and skbmod Lucas Bates
2017-10-11 21:16 ` Lucas Bates [this message]
2017-10-13  5:31 ` [PATCH net-next 0/4] tc-testing: Test suite updates David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1507756614-30333-5-git-send-email-lucasb@mojatatu.com \
    --to=lucasb@mojatatu.com \
    --cc=aring@mojatatu.com \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=mrv@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.