source: rtems/testsuites/libtests/devfs03/init.c @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2010.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  Modifications to support reference counting in the file system are
6 *  Copyright (c) 2012 embedded brains GmbH.
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 */
12
13#ifdef HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#include <tmacros.h>
18#include "test_support.h"
19#include <rtems/devfs.h>
20#include <errno.h>
21#include <unistd.h>
22#include <sys/types.h>
23#include <sys/stat.h>
24#include <fcntl.h>
25
26rtems_task Init(
27  rtems_task_argument argument
28)
29{
30  int status;
31  devFS_node nodes [1];
32  devFS_data data = {
33    .nodes = nodes,
34    .count = 1
35  };
36
37  puts( "\n\n*** TEST DEVFS03 ***" );
38
39  puts( "Init - attempt to create /dir01 -- OK" );
40  status = mkdir( "/dir01", S_IRWXU );
41  rtems_test_assert( status == 0 );
42
43  puts( "Init - mount a new fs at /dir01 - expect EINVAL" );
44  status = mount( NULL,
45                  "/dir01",
46                  "devfs",
47                  RTEMS_FILESYSTEM_READ_WRITE,
48                  NULL );
49  rtems_test_assert( status == -1 );
50  rtems_test_assert( errno == EINVAL );
51
52  puts( "Init - mount a new fs at /dir01 - OK" );
53  status = mount( NULL,
54                  "/dir01",
55                  "devfs",
56                  RTEMS_FILESYSTEM_READ_WRITE,
57                  &data );
58  rtems_test_assert( status == 0 );
59
60  puts( "Init - make file /dir01/dev -- expect ENOTSUP" );
61  status = creat( "/dir01/dev", S_IRWXU );
62  rtems_test_assert( status == -1 );
63  rtems_test_assert( errno == ENOTSUP );
64
65  puts( "Init - unmount fs at /dir01 - OK" );
66  status = unmount( "/dir01" );
67  rtems_test_assert( status == 0 );
68
69  status = rmdir( "/dir01" );
70  rtems_test_assert( status == 0 );
71
72  puts( "*** END OF TEST DEVFS03 ***" );
73
74  rtems_test_exit(0);
75}
76
77/* configuration information */
78
79#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
80#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
81
82#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 4
83#define CONFIGURE_MAXIMUM_TASKS             1
84#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
85
86#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
87#define CONFIGURE_FILESYSTEM_DEVFS
88
89#define CONFIGURE_INIT
90#include <rtems/confdefs.h>
91/* end of file */
Note: See TracBrowser for help on using the repository browser.