------------------------------------------------------------ revno: 1387 committer: Steve Langasek <[email protected]> branch nick: upstream timestamp: Sun 2012-11-18 12:21:54 -0600 message: don't test the blocked/ignored signal list in a spawned job; this is not testing the upstart code but the characteristics of the system, and the test is wrong because it assumes the signal lists in /proc/self/status fit in an unsigned long int - patently untrue on mips, where we have 128 signals for historical reasons. modified: ChangeLog init/tests/test_job_process.c
-- lp:upstart https://code.launchpad.net/~upstart-devel/upstart/trunk Your team Upstart Reviewers is subscribed to branch lp:upstart. To unsubscribe from this branch go to https://code.launchpad.net/~upstart-devel/upstart/trunk/+edit-subscription
=== modified file 'ChangeLog' --- ChangeLog 2012-11-18 06:56:58 +0000 +++ ChangeLog 2012-11-18 18:21:54 +0000 @@ -2,6 +2,12 @@ * init/tests/test_job_process.c: fix test which was accidentally relying on a variable persisting after it's gone out of scope. + * init/tests/test_job_process.c: don't test the blocked/ignored + signal list in a spawned job; this is not testing the upstart code + but the characteristics of the system, and the test is wrong + because it assumes the signal lists in /proc/self/status fit in an + unsigned long int - patently untrue on mips, where we have 128 + signals for historical reasons. 2012-11-17 Steve Langasek <[email protected]> === modified file 'init/tests/test_job_process.c' --- init/tests/test_job_process.c 2012-11-18 06:56:58 +0000 +++ init/tests/test_job_process.c 2012-11-18 18:21:54 +0000 @@ -128,7 +128,6 @@ TEST_ENVIRONMENT, TEST_OUTPUT, TEST_OUTPUT_WITH_STOP, - TEST_SIGNALS, TEST_FDS }; @@ -233,21 +232,6 @@ fprintf(stdout, "ended\n"); fflush (NULL); break; - case TEST_SIGNALS: - /* Write signal stats for child process to stdout */ - in = fopen("/proc/self/status", "r"); - if (! in) { - abort(); - } - - while (fgets (buffer, sizeof (buffer), in) != NULL) { - if (strstr (buffer, "SigBlk:") == buffer || - strstr (buffer, "SigIgn:") == buffer) - fputs (buffer, out); - } - - fclose(in); - break; case TEST_FDS: /* Establish list of open (valid) and closed (invalid) * file descriptors. @@ -4516,96 +4500,6 @@ nih_free (class); - /* Check that when the job process is execed that no unexpected - * signals are blocked or ignored. - */ - TEST_FEATURE ("ensure sane signal state with no console"); - TEST_HASH_EMPTY (job_classes); - - sprintf (function, "%d", TEST_SIGNALS); - - args[0] = argv0; - args[1] = function; - args[2] = filename; - args[3] = NULL; - - class = job_class_new (NULL, "test", NULL); - class->console = CONSOLE_NONE; - job = job_new (class, ""); - - pid = job_process_spawn (job, args, NULL, FALSE, -1, PROCESS_MAIN); - TEST_GT (pid, 0); - - waitpid (pid, NULL, 0); - output = fopen (filename, "r"); - - TEST_NE_P (output, NULL); - - { - unsigned long int value; - - /* No signals should be blocked */ - TEST_TRUE (fgets (filebuf, sizeof(filebuf), output)); - TEST_EQ (sscanf (filebuf, "SigBlk: %lx", &value), 1); - TEST_EQ (value, 0x0); - - /* No signals should be ignored */ - TEST_TRUE (fgets (filebuf, sizeof(filebuf), output)); - TEST_EQ (sscanf (filebuf, "SigIgn: %lx", &value), 1); - TEST_EQ (value, 0x0); - - TEST_FILE_END (output); - } - - fclose (output); - assert0 (unlink (filename)); - - nih_free (class); - - /********************************************************************/ - TEST_FEATURE ("ensure sane signal state with log console"); - TEST_HASH_EMPTY (job_classes); - - sprintf (function, "%d", TEST_SIGNALS); - - args[0] = argv0; - args[1] = function; - args[2] = filename; - args[3] = NULL; - - class = job_class_new (NULL, "test", NULL); - class->console = CONSOLE_LOG; - job = job_new (class, ""); - - pid = job_process_spawn (job, args, NULL, FALSE, -1, PROCESS_MAIN); - TEST_GT (pid, 0); - - waitpid (pid, NULL, 0); - output = fopen (filename, "r"); - - TEST_NE_P (output, NULL); - - { - unsigned long int value; - - /* No signals should be blocked */ - TEST_TRUE (fgets (filebuf, sizeof(filebuf), output)); - TEST_EQ (sscanf (filebuf, "SigBlk: %lx", &value), 1); - TEST_EQ (value, 0x0); - - /* No signals should be ignored */ - TEST_TRUE (fgets (filebuf, sizeof(filebuf), output)); - TEST_EQ (sscanf (filebuf, "SigIgn: %lx", &value), 1); - TEST_EQ (value, 0x0); - - TEST_FILE_END (output); - } - - fclose (output); - assert0 (unlink (filename)); - - nih_free (class); - /********************************************************************/ TEST_FEATURE ("ensure sane fds with no console"); TEST_HASH_EMPTY (job_classes);
-- upstart-devel mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/upstart-devel
