[netfilter-cvslog] r3413 - trunk/nfsim/core
rusty at netfilter.org
rusty at netfilter.org
Thu Dec 16 08:30:41 CET 2004
Author: rusty at netfilter.org
Date: 2004-12-16 08:30:40 +0100 (Thu, 16 Dec 2004)
New Revision: 3413
Modified:
trunk/nfsim/core/core.c
trunk/nfsim/core/failtest.c
Log:
Move failtest option descriptions to failtest.c
Change --usage to the more normal --help.
Modified: trunk/nfsim/core/core.c
===================================================================
--- trunk/nfsim/core/core.c 2004-12-16 07:05:08 UTC (rev 3412)
+++ trunk/nfsim/core/core.c 2004-12-16 07:30:40 UTC (rev 3413)
@@ -171,7 +171,7 @@
{"echo", 0, 0, 'x'},
/*** XML Argument:
<section id="a:echo">
- <title><option>--echo</option></title>
+ <title><option>--echo</option>, <option>-x</option></title>
<subtitle>Echo commands as they are executed</subtitle>
<para>nfsim will echo each command before it is executed. Useful when
commands are read from a file</para>
@@ -180,7 +180,7 @@
{"quiet", 0, 0, 'q'},
/*** XML Argument:
<section id="a:quiet">
- <title><option>--quiet</option></title>
+ <title><option>--quiet</option>, <option>-q</option></title>
<subtitle>Run quietly</subtitle>
<para>Causes nfsim to reduce its output to the minimum possible - no prompt
is displayed, and most warning messages are suppressed
@@ -190,7 +190,7 @@
{"exit", 0, 0, 'e'},
/*** XML Argument:
<section id="a:exit">
- <title><option>--exit</option></title>
+ <title><option>--exit</option>, <option>-e</option></title>
<subtitle>Exit on error</subtitle>
<para>If <option>--exit</option> is specified, nfsim will exit (with a
non-zero error code) on the first script error it encounters (eg an
@@ -211,44 +211,20 @@
{"version", 0, 0, 'V'},
/*** XML Argument:
<section id="a:version">
- <title><option>--version</option></title>
+ <title><option>--version</option>, <option>-V</option></title>
<subtitle>Print the version of the simulator and kernel</subtitle>
</section>
*/
- {"usage", 0, 0, 'u'},
+ {"help", 0, 0, 'h'},
/*** XML Argument:
- <section id="a:usage">
- <title><option>--usage</option></title>
+ <section id="a:help">
+ <title><option>--help</option></title>
<subtitle>Print usage information</subtitle>
<para>Causes nfsim to print its command line arguments and then exit</para>
</section>
*/
{"failtest", 0, 0, 1},
-/*** XML Argument:
- <section id="a:failtest">
- <title><option>--failtest</option></title>
- <subtitle>Try every combination of external failures</subtitle>
- <para>This option will <function>fork()</function> the simulator
- whenever a possible failure point is reacked (eg
- <function>kmalloc</function>). The child process will fail the function,
- while the parent will succeed. If the simulator reaches an error (other
- than a script failure - these can be reasonable behaviour) the pattern of
- successes/failures will be printed out, which can be replayed using
- <option>--failpattern</option></para>
- </section>
-*/
-
{"failpattern", 1, 0, 2},
-/*** XML Argument:
- <section id="a:failpattern">
- <title><option>--failpattern
- <replaceable>pattern</replaceable></option></title>
- <subtitle>Replay a failure pattern</subtitle>
- <para>Given a failure pattern, (from <option>failtest</option>), this will
- replay the sequence of sucesses/failures, allowing debugging of a
- command</para>
- </section>
-*/
{0, 0, 0, 0 }
};
@@ -260,7 +236,7 @@
char *p;
char *failpattern = NULL;
- while ((c = getopt_long(argc, argv, "xqeNV", options, NULL)) != EOF) {
+ while ((c = getopt_long(argc, argv, "xqeNVh", options, NULL)) != EOF) {
switch (c) {
case 'x':
tui_echo_commands = 1;
@@ -280,7 +256,7 @@
print_license();
exit(EXIT_SUCCESS);
break;
- case 'u':
+ case 'h':
print_license();
print_usage(argv[0]);
exit(EXIT_SUCCESS);
Modified: trunk/nfsim/core/failtest.c
===================================================================
--- trunk/nfsim/core/failtest.c 2004-12-16 07:05:08 UTC (rev 3412)
+++ trunk/nfsim/core/failtest.c 2004-12-16 07:30:40 UTC (rev 3413)
@@ -34,31 +34,38 @@
/* Failure pattern to follow (initialized by --failpattern). */
static const char *failpattern = NULL;
-/* static void failtest_help(int argc, char **argv) */
-/* { */
-/* #include "failtest-help:failtest" */
-/* /\*** XML Help: */
-/* <section id="a:failtest"> */
-/* <title><command>failtest</command></title> */
-/* <para>Recursively test allocation etc. failures.</para> */
-/* <cmdsynopsis> */
-/* <command>failtest</command> */
-/* </cmdsynopsis> */
+/*** XML Argument:
+ <section id="a:failtest">
+ <title><option>--failtest</option></title>
+ <subtitle>Try every combination of external failures</subtitle>
-/* <para>The <command>failtest</command> command runs the rest of the */
-/* script, but deliberately inserts failures (currently allocation */
-/* failures and user-copying failures). At each potential failure, */
-/* both failure and success will be simulated: where we fail, the */
-/* script will no doubt fail later which is OK, but we ensure that */
-/* the entire system doesn't fall over or leak memory.</para> */
+ <para>The <option>--failtest</option> option runs the script,
+ but deliberately inserts failures (currently allocation failures
+ and user-copying failures). At each potential failure, both
+ failure and success will be simulated: where we fail, the script
+ will no doubt fail later which is OK, but we ensure that the
+ entire system doesn't fall over or leak memory. If an error is
+ found, the pattern of successes/failures will be printed out,
+ which can be replayed using <option>--failpattern</option></para>
+ </section>
+*/
-/* <para>This testing can be slow, but allows for testing of failure */
-/* paths which would otherwise be very difficult to test */
-/* automatically.</para> */
-/* </section> */
-/* *\/ */
-/* } */
+/*** XML Argument:
+ <section id="a:failpattern">
+ <title><option>--failpattern
+ <replaceable>pattern</replaceable></option></title>
+ <subtitle>Replay a failure pattern</subtitle>
+ <para>Given a failure pattern, (from <option>--failtest</option>), this will
+ replay the sequence of sucesses/failures, allowing debugging. The input
+ should be the same as the original which caused the failure.
+ </para>
+ <para>This testing can be slow, but allows for testing of failure
+ paths which would otherwise be very difficult to test
+ automatically.</para>
+ </section>
+*/
+
static bool do_failpattern(const char *func)
{
if (*failpattern == '[') {
More information about the netfilter-cvslog
mailing list