aboutsummaryrefslogtreecommitdiff
path: root/lib/parse_opts.c
diff options
context:
space:
mode:
authorCyril Hrubis <chrubis@suse.cz>2014-06-10 13:49:05 +0200
committerCyril Hrubis <chrubis@suse.cz>2014-06-10 14:15:22 +0200
commit1dbf0b4a70c0ef7c849a0b3cd42da2c3874f9432 (patch)
tree2459d246cda4839136c2c24a6868c3f7bc0587ee /lib/parse_opts.c
parent3492b03c1e86370d719328aa4abefac14fd27c6f (diff)
lib: Remove -c option and STD_COPIES
Remove -c option that was never working correctly. The -c option, if set, forks the test in test setup() creating several instances of the test to be running at the same time. The problems with the implementation were: * The failure of the forked tests WAS NOT popagaged to the first instance * The test driver (ltp-pan) tracks only the first instance and kills the rest of the tests instances once the first one finishes * Most of the tests does not expect to be running concurently (there are races in using the same test directory, loop devices, etc.) While the first two would be easy to fix the last one would require reviewing and testing all testcases which is too much work. Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Diffstat (limited to 'lib/parse_opts.c')
-rw-r--r--lib/parse_opts.c48
1 files changed, 0 insertions, 48 deletions
diff --git a/lib/parse_opts.c b/lib/parse_opts.c
index 2ac222c48..1249ce982 100644
--- a/lib/parse_opts.c
+++ b/lib/parse_opts.c
@@ -63,7 +63,6 @@ static int STD_PAUSE = 0; /* flag indicating to pause before actual start, */
/* for contention mode */
static int STD_INFINITE = 0; /* flag indciating to loop forever */
int STD_LOOP_COUNT = 1; /* number of iterations */
-int STD_COPIES = 1; /* number of copies */
int STD_ERRNO_LOG = 0; /* flag indicating to do errno logging */
static float STD_LOOP_DURATION = 0.0; /* duration value in fractional seconds */
@@ -97,7 +96,6 @@ static struct std_option_t {
char *flag;
char **arg;
} std_options[] = {
- {"c:", " -c n Run n copies concurrently\n", NULL, NULL},
{"e", " -e Turn on errno logging\n", NULL, NULL},
{"h", " -h Show this help screen\n", NULL, NULL},
{"i:", " -i n Execute test n times\n", NULL, NULL},
@@ -250,20 +248,6 @@ const char *parse_opts(int ac, char **av, const option_t * user_optarr,
if (STD_LOOP_DURATION == 0.0)
STD_INFINITE = 1;
break;
- case 'c': /* Copies */
- fprintf(stderr,
- "WARNING * WARNING * WARNING * WARNING * "
- "WARNING * WARNING * WARNING * WARNING\n\n"
- "The -c option is broken by desing. See:\n\n"
- "http://www.mail-archive.com/"
- "ltp-list@lists.sourceforge.net/msg13418.html\n"
- "\nIn short don't use it in runtest files "
- "as the option will be removed.\n\n"
- "WARNING * WARNING * WARNING * WARNING * "
- "WARNING * WARNING * WARNING * WARNING\n\n");
- options |= OPT_copies;
- STD_COPIES = atoi(optarg);
- break;
case 'p': /* Pause for SIGUSR1 */
STD_PAUSE = 1;
break;
@@ -408,19 +392,6 @@ const char *parse_opts(int ac, char **av, const option_t * user_optarr,
}
/*
- * If the USC_COPIES environmental variable is set,
- * use that number as copies (same as -c option).
- * The -c option with arg will be used even if this env var is set.
- */
- if (!(options & OPT_copies) && (ptr = getenv(USC_COPIES)) != NULL) {
- if (sscanf(ptr, "%d", &STD_COPIES) == 1 && STD_COPIES >= 0) {
- if (Debug)
- printf("Using env %s, set STD_COPIES = %d\n",
- USC_COPIES, STD_COPIES);
- }
- }
-
- /*
* The following are special system testing envs to turn on special
* hooks in the code.
*/
@@ -526,7 +497,6 @@ const char *parse_opts(int ac, char **av, const option_t * user_optarr,
printf("The following variables after option and env parsing:\n");
printf("STD_LOOP_DURATION = %f\n", STD_LOOP_DURATION);
printf("STD_LOOP_DELAY = %f\n", STD_LOOP_DELAY);
- printf("STD_COPIES = %d\n", STD_COPIES);
printf("STD_LOOP_COUNT = %d\n", STD_LOOP_COUNT);
printf("STD_INFINITE = %d\n", STD_INFINITE);
printf("STD_TIMING_ON = %d\n", STD_TIMING_ON);
@@ -556,28 +526,10 @@ static void STD_go(int sig)
int usc_global_setup_hook(void)
{
#ifndef UCLINUX
- int cnt;
/* temp variable to store old signal action to be restored after pause */
int (*_TMP_FUNC) (void);
/*
- * Fork STD_COPIES-1 copies.
- */
- for (cnt = 1; cnt < STD_COPIES; cnt++) {
- switch (fork()) {
- case -1:
- fprintf(stderr, "%s: fork failed: %d - %s\n",
- __FILE__, errno, strerror(errno));
- break;
- case 0:
- cnt = STD_COPIES; /* to stop the forking */
- break;
- default:
- break;
- }
- }
-
- /*
* pause waiting for sigusr1.
*/
if (STD_PAUSE) {