source: rtems/testsuites/samples/pppd/init.c @ 3cbedb1

4.11
Last change on this file since 3cbedb1 was 3cbedb1, checked in by Chris Johns <chrisj@…>, on May 22, 2014 at 9:56:50 AM

testsuite: Add a user keypress to start pppd.

Allow the test to run and pass when automatic testing.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2012.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13
14#include <stdio.h>
15#include <stdlib.h>
16#include <string.h>
17
18#define CONFIGURE_INIT
19#include "system.h"
20
21#include <rtems/rtems_bsdnet.h>
22#include <rtems/rtemspppd.h>
23#include <rtems/shell.h>
24#include "netconfig.h"
25
26const char rtems_test_name[] = "PPPD";
27
28static void notification(int fd, int seconds_remaining, void *arg)
29{
30  printf(
31    "Press any key to start pppd (%is remaining)\n",
32    seconds_remaining
33  );
34}
35
36rtems_task Init(rtems_task_argument argument)
37{
38  rtems_status_code status;
39
40  rtems_test_begin();
41
42  status = rtems_shell_wait_for_input(
43    STDIN_FILENO,
44    10,
45    notification,
46    NULL
47  );
48  if (status != RTEMS_SUCCESSFUL) {
49    rtems_test_end();
50    exit( 0 );
51  }
52
53  /* initialize network */
54  rtems_bsdnet_initialize_network();
55  rtems_pppd_initialize();
56  pppdapp_initialize();
57  rtems_task_delete(RTEMS_SELF);
58}
Note: See TracBrowser for help on using the repository browser.