All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: <netdev@vger.kernel.org>
Cc: <linux-net-drivers@solarflare.com>
Subject: [PATCH ethtool 11/21] Add more test cases for command-line parsing
Date: Tue, 1 Nov 2011 23:17:32 +0000	[thread overview]
Message-ID: <1320189452.2758.41.camel@bwh-desktop> (raw)
In-Reply-To: <1320186901.2758.30.camel@bwh-desktop>

These test cases currently fail.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 test-cmdline.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/test-cmdline.c b/test-cmdline.c
index 88591df..7dd3b7c 100644
--- a/test-cmdline.c
+++ b/test-cmdline.c
@@ -55,8 +55,10 @@ static struct test_case {
 	{ 1, "-s devname msglvl hw" },
 	{ 0, "--change devname speed 100 duplex half port tp autoneg on advertise 0x1 phyad 1 xcvr external wol p sopass 01:23:45:67:89:ab msglvl 1" },
 	{ 1, "-s devname foo" },
+	{ 1, "-s" },
 	{ 0, "-a devname" },
 	{ 0, "--show-pause devname" },
+	{ 1, "-a" },
 	/* Many other sub-commands use parse_generic_cmdline() and
 	 * don't need to be check in that much detail. */
 	{ 0, "-A devname autoneg on" },
@@ -65,6 +67,7 @@ static struct test_case {
 	{ 0, "--pause devname rx off" },
 	{ 0, "-A devname tx on rx on autoneg off" },
 	{ 1, "--pause devname foo on" },
+	{ 1, "-A" },
 	{ 0, "-c devname" },
 	{ 0, "--show-coalesce devname" },
 	{ 0, "-C devname adaptive-rx on adaptive-tx off rx-usecs 1 rx-frames 2 rx-usecs-irq 3 rx-frames-irq 4 tx-usecs 5 tx-frames 6 tx-usecs-irq 7 tx-frames-irq 8 stats-block-usecs 9 pkt-rate-low 10" },
@@ -72,42 +75,53 @@ static struct test_case {
 	{ 1, "-C devname adaptive-rx foo" },
 	{ 1, "--coalesce devname adaptive-rx" },
 	{ 1, "-C devname foo on" },
+	{ 1, "-C" },
 	{ 0, "-g devname" },
 	{ 0, "--show-ring devname" },
+	{ 1, "-g" },
 	{ 0, "-G devname rx 1 rx-mini 2 rx-jumbo 3 tx 4" },
 	{ 0, "--set-ring devname rx 1 rx-mini 2 rx-jumbo 3 tx 4" },
 	{ 1, "-G devname rx foo" },
 	{ 1, "--set-ring devname rx" },
 	{ 1, "-G devname foo 1" },
+	{ 1, "-G" },
 	{ 0, "-k devname" },
 	{ 0, "--show-offload devname" },
+	{ 1, "-k" },
 	{ 0, "-K devname rx on tx off sg on tso off ufo on gso off gro on" },
 	{ 0, "--offload devname lro off rxvlan on txvlan off ntuple on rxhash off" },
 	{ 1, "-K devname rx foo" },
 	{ 1, "--offload devname rx" },
 	{ 1, "-K devname foo on" },
+	{ 1, "-K" },
 	{ 0, "-i devname" },
 	{ 0, "--driver devname" },
+	{ 1, "-i" },
 	{ 0, "-d devname" },
 	{ 0, "--register-dump devname raw on file foo" },
 	{ 1, "-d devname raw foo" },
 	{ 1, "--register-dump devname file" },
 	{ 1, "-d devname foo" },
+	{ 1, "-d" },
 	{ 0, "-e devname" },
 	{ 0, "--eeprom-dump devname raw on offset 1 length 2" },
 	{ 1, "-e devname raw foo" },
 	{ 1, "--eeprom-dump devname offset foo" },
 	{ 1, "-e devname length" },
 	{ 1, "--eeprom-dump devname foo" },
+	{ 1, "-e" },
 	{ 0, "-E devname" },
 	{ 0, "--change-eeprom devname magic 0x87654321 offset 0 value 1" },
 	{ 0, "-E devname magic 0x87654321 offset 0 length 2" },
+	{ 1, "-E" },
 	{ 0, "-r devname" },
 	{ 0, "--negotiate devname" },
+	{ 1, "-r" },
 	{ 0, "-p devname" },
 	{ 0, "--identify devname 1" },
 	{ 1, "-p devname 1 foo" },
 	{ 1, "--identify devname foo" },
+	{ 1, "-p" },
 	/* Argument parsing for -t is specialised */
 	{ 0, "-t devname" },
 	{ 0, "--test devname online" },
@@ -115,16 +129,20 @@ static struct test_case {
 	{ 1, "--test devname online foo" },
 	{ 0, "-S devname" },
 	{ 0, "--statistics devname" },
+	{ 1, "-S" },
 	/* Argument parsing for -n is specialised */
 	{ 0, "-n devname rx-flow-hash tcp4" },
 	{ 0, "--show-nfc devname rx-flow-hash udp6" },
 	{ 1, "-n devname rx-flow-hash foo" },
 	{ 1, "--show-nfc devname rx-flow-hash" },
 	{ 1, "-n devname foo" },
+	{ 1, "-n" },
 	/* Argument parsing for -f is specialised */
 	{ 1, "-f devname" },
 	{ 0, "--flash devname filename" },
 	{ 0, "-f devname filename 1" },
+	{ 1, "-f devname filename 1 foo" },
+	{ 1, "-f" },
 	/* Argument parsing for -N is specialised */
 	{ 0, "-N devname rx-flow-hash tcp4 mvtsdfn" },
 	{ 0, "--config-nfc devname rx-flow-hash tcp4 r" },
@@ -132,8 +150,10 @@ static struct test_case {
 	{ 1, "--config-nfc devname rx-flow-hash foo" },
 	{ 1, "-N devname rx-flow-hash" },
 	{ 1, "--config-nfc devname foo" },
+	{ 1, "-N" },
 	{ 0, "-x devname" },
 	{ 0, "--show-rxfh-indir devname" },
+	{ 1, "-x" },
 	/* Argument parsing for -X is specialised */
 	{ 0, "-X devname equal 2" },
 	{ 0, "--set-rxfh-indir devname equal 256" },
@@ -142,6 +162,7 @@ static struct test_case {
 	{ 1, "-X devname equal" },
 	{ 0, "--set-rxfh-indir devname weight 1 2 3 4" },
 	{ 1, "-X devname foo" },
+	{ 1, "-X" },
 	/* Argument parsing for -U is specialised */
 	{ 0, "-U devname delete 1" },
 	{ 1, "--config-ntuple devname delete foo" },
@@ -160,23 +181,30 @@ static struct test_case {
 	{ 1, "-U devname flow-type foo" },
 	{ 1, "--config-ntuple devname flow-type" },
 	{ 1, "-U devname foo" },
+	{ 1, "-U" },
 	{ 0, "-P devname" },
 	{ 0, "--show-permaddr devname" },
+	{ 1, "-P" },
 	{ 0, "-w devname" },
 	{ 0, "--get-dump devname data filename" },
 	{ 0, "-w devname data filename" },
 	{ 1, "--get-dump devname data" },
 	{ 1, "-w devname foo" },
+	{ 1, "-w" },
 	{ 0, "-W devname 1" },
 	{ 0, "--set-dump devname 2" },
+	{ 1, "-W devname 1 foo" },
 	{ 1, "-W devname foo" },
+	{ 1, "-W" },
 	{ 0, "-l devname" },
 	{ 0, "--show-channels devname" },
+	{ 1, "-l" },
 	{ 0, "-L devname rx 1 tx 2 other 3 combined 4" },
 	{ 0, "--set-channels devname rx 1 tx 2 other 3 combined 4" },
 	{ 1, "-L devname rx foo" },
 	{ 1, "--set-channels devname rx" },
 	{ 0, "-L devname" },
+	{ 1, "-L" },
 	{ 0, "-h" },
 	{ 0, "--help" },
 	{ 0, "--version" },
-- 
1.7.4.4



-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

  parent reply	other threads:[~2011-11-01 23:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 22:35 [PATCH ethtool 00/21] ethtool refactoring and misc changes Ben Hutchings
2011-11-01 23:13 ` [PATCH ethtool 01/21] Report pause frame autonegotiation result Ben Hutchings
2011-11-01 23:13 ` [PATCH ethtool 02/21] ethtool.8: Fix initial blank line/page Ben Hutchings
2011-11-01 23:14 ` [PATCH ethtool 03/21] Combine ethtool-{bitops,util}.h into internal.h Ben Hutchings
2011-11-01 23:14 ` [PATCH ethtool 04/21] Fix type of bit-number parameter to set_bit() and clear_bit() Ben Hutchings
2011-11-01 23:15 ` [PATCH ethtool 05/21] ethtool.8: Change device name metavariable from 'ethX' to 'devname' Ben Hutchings
2011-11-01 23:15 ` [PATCH ethtool 06/21] ethtool.8: Allow line-break in description of parameters after -N Ben Hutchings
2011-11-01 23:15 ` [PATCH ethtool 07/21] Fix format of help text for -f option Ben Hutchings
2011-11-01 23:15 ` [PATCH ethtool 08/21] Use standard indentation for definition of struct option args Ben Hutchings
2011-11-01 23:16 ` [PATCH ethtool 09/21] Encapsulate command context in a structure Ben Hutchings
2011-11-01 23:17 ` [PATCH ethtool 10/21] Add test cases for command-line parsing Ben Hutchings
2011-11-01 23:17 ` Ben Hutchings [this message]
2011-11-01 23:18 ` [PATCH ethtool 12/21] Move argument parsing to sub-command functions Ben Hutchings
2011-11-01 23:18 ` [PATCH ethtool 13/21] Support arbitrary numbers of option names for each mode Ben Hutchings
2011-11-01 23:18 ` [PATCH ethtool 14/21] Fix reference to cmdline_ring in do_schannels() Ben Hutchings
2011-11-01 23:19 ` [PATCH ethtool 15/21] Convert cmdline_msglvl into array of named flags; convert back at run-time Ben Hutchings
2011-11-01 23:20 ` [PATCH ethtool 16/21] Replace global devname variable with a field in struct cmd_context Ben Hutchings
2011-11-01 23:21 ` [PATCH ethtool 17/21] Change most static global variables into automatic variables Ben Hutchings
2011-11-01 23:22 ` [PATCH ethtool 18/21] rxclass: Replace global rmgr with automatic variable/parameter Ben Hutchings
2011-11-01 23:22 ` [PATCH ethtool 19/21] Declare static variables const as appropriate Ben Hutchings
2011-11-01 23:23 ` [PATCH ethtool 20/21] Run tests in-process Ben Hutchings
2011-11-02 20:25   ` Ben Hutchings
2011-11-01 23:24 ` [PATCH ethtool 21/21] Rearrange definitions and remove unnecessary forward declarations Ben Hutchings
2011-11-03 19:17 ` [PATCH ethtool 00/21] ethtool refactoring and misc changes Ben Hutchings

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=1320189452.2758.41.camel@bwh-desktop \
    --to=bhutchings@solarflare.com \
    --cc=linux-net-drivers@solarflare.com \
    --cc=netdev@vger.kernel.org \
    /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.