1 | /* |
---|
2 | * COPYRIGHT (c) 1989-2011. |
---|
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.com/license/LICENSE. |
---|
8 | * |
---|
9 | * $Id$ |
---|
10 | */ |
---|
11 | |
---|
12 | #ifdef HAVE_CONFIG_H |
---|
13 | #include "config.h" |
---|
14 | #endif |
---|
15 | #include "pmacros.h" |
---|
16 | |
---|
17 | #include <sys/stat.h> |
---|
18 | #include <sys/types.h> |
---|
19 | |
---|
20 | #include <rtems/libio.h> |
---|
21 | #include <rtems/rtems-rfs-format.h> |
---|
22 | |
---|
23 | #include "ramdisk_support.h" |
---|
24 | |
---|
25 | #include "fstest.h" |
---|
26 | |
---|
27 | #define BLOCK_SIZE (512) |
---|
28 | |
---|
29 | rtems_rfs_format_config config = { |
---|
30 | block_size:BLOCK_SIZE |
---|
31 | }; |
---|
32 | |
---|
33 | |
---|
34 | void |
---|
35 | test_initialize_filesystem (void) |
---|
36 | { |
---|
37 | int rc = 0; |
---|
38 | rc = mkdir (BASE_FOR_TEST,S_IRWXU|S_IRWXG|S_IRWXO); |
---|
39 | rtems_test_assert (rc == 0); |
---|
40 | |
---|
41 | init_ramdisk (); |
---|
42 | |
---|
43 | rc = rtems_rfs_format (RAMDISK_PATH, &config); |
---|
44 | rtems_test_assert (rc == 0); |
---|
45 | |
---|
46 | rc = mount (RAMDISK_PATH, |
---|
47 | BASE_FOR_TEST, "rfs", RTEMS_FILESYSTEM_READ_WRITE, NULL); |
---|
48 | rtems_test_assert (rc == 0); |
---|
49 | } |
---|
50 | |
---|
51 | |
---|
52 | void |
---|
53 | test_shutdown_filesystem (void) |
---|
54 | { |
---|
55 | int rc = 0; |
---|
56 | rc = unmount (BASE_FOR_TEST); |
---|
57 | rtems_test_assert (rc == 0); |
---|
58 | del_ramdisk (); |
---|
59 | } |
---|
60 | |
---|
61 | /* configuration information */ |
---|
62 | #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
63 | #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
64 | |
---|
65 | #define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
66 | |
---|
67 | #define CONFIGURE_MAXIMUM_TASKS 10 |
---|
68 | #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM |
---|
69 | #define CONFIGURE_MAXIMUM_DRIVERS 10 |
---|
70 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 40 |
---|
71 | |
---|
72 | #define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK |
---|
73 | |
---|
74 | #define CONFIGURE_FILESYSTEM_RFS |
---|
75 | |
---|
76 | #define CONFIGURE_INIT |
---|
77 | #include <rtems/confdefs.h> |
---|