~ubuntu-branches/ubuntu/maverick/upstart/maverick-updates

« back to all changes in this revision

Viewing changes to init/tests/test_job_process.c

  • Committer: Scott James Remnant
  • Date: 2010-02-26 15:39:13 UTC
  • Revision ID: scott@netsplit.com-20100226153913-lhnqsjuuh3dw85qi
Merge patches from trunk to use /proc/self/fd instead of /dev/fd, and
to always mount /proc and /sys on boot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 *
3
3
 * test_job_process.c - test suite for init/job_process.c
4
4
 *
5
 
 * Copyright © 2009 Canonical Ltd.
 
5
 * Copyright © 2010 Canonical Ltd.
6
6
 * Author: Scott James Remnant <scott@netsplit.com>.
7
7
 *
8
8
 * This program is free software; you can redistribute it and/or modify
519
519
        }
520
520
 
521
521
 
522
 
        if (stat ("/dev/fd", &statbuf) < 0) {
523
 
                printf ("SKIP: no /dev/fd\n");
524
 
                goto no_devfd;
525
 
        }
526
 
 
527
522
        /* Check that a particularly long script is instead invoked by
528
 
         * using the /dev/fd feature, with the shell script fed to the
 
523
         * using the /proc/self/fd feature, with the shell script fed to the
529
524
         * child process by an NihIo structure.
530
525
         */
531
526
        TEST_FEATURE ("with long script");
580
575
                TEST_EQ (WEXITSTATUS (status), 0);
581
576
 
582
577
                output = fopen (filename, "r");
583
 
                TEST_FILE_EQ_N (output, "/dev/fd/");
 
578
                TEST_FILE_EQ_N (output, "/proc/self/fd/");
584
579
                TEST_FILE_EQ (output, "\n");
585
580
                TEST_FILE_END (output);
586
581
                fclose (output);
590
585
        }
591
586
 
592
587
 
593
 
no_devfd:
594
588
        /* Check that if we're running a non-daemon job, the trace state
595
589
         * is reset and no process trace is established.
596
590
         */