source:
rtems/testsuites/fstests/mrfs_support/fs_support.c
@
db6fbdf
Last change on this file since db6fbdf was db6fbdf, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/07/11 at 07:32:05 | |
---|---|
|
|
File size: 1.6 KB |
Rev | Line | |
---|---|---|
[7336d4af] | 1 | /* |
[858e013f] | 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 | * | |
[db6fbdf] | 9 | * $Id$ |
[7336d4af] | 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> | |
[858e013f] | 22 | |
[7336d4af] | 23 | #include "ramdisk_support.h" |
24 | ||
[858e013f] | 25 | #include "fstest.h" |
26 | ||
[7336d4af] | 27 | #define BLOCK_SIZE (512) |
28 | ||
[858e013f] | 29 | rtems_rfs_format_config config = { |
[7336d4af] | 30 | block_size:BLOCK_SIZE |
31 | }; | |
32 | ||
33 | ||
[858e013f] | 34 | void |
35 | test_initialize_filesystem (void) | |
[7336d4af] | 36 | { |
[858e013f] | 37 | int rc = 0; |
38 | rc = mkdir (BASE_FOR_TEST,S_IRWXU|S_IRWXG|S_IRWXO); | |
39 | rtems_test_assert (rc == 0); | |
[7336d4af] | 40 | |
[858e013f] | 41 | init_ramdisk (); |
[7336d4af] | 42 | |
[858e013f] | 43 | rc = rtems_rfs_format (RAMDISK_PATH, &config); |
44 | rtems_test_assert (rc == 0); | |
[7336d4af] | 45 | |
[858e013f] | 46 | rc = mount (RAMDISK_PATH, |
47 | BASE_FOR_TEST, "rfs", RTEMS_FILESYSTEM_READ_WRITE, NULL); | |
48 | rtems_test_assert (rc == 0); | |
[7336d4af] | 49 | } |
50 | ||
51 | ||
[858e013f] | 52 | void |
53 | test_shutdown_filesystem (void) | |
[7336d4af] | 54 | { |
[858e013f] | 55 | int rc = 0; |
56 | rc = unmount (BASE_FOR_TEST); | |
57 | rtems_test_assert (rc == 0); | |
58 | del_ramdisk (); | |
[7336d4af] | 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 | ||
[858e013f] | 67 | #define CONFIGURE_MAXIMUM_TASKS 10 |
[7336d4af] | 68 | #define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM |
[858e013f] | 69 | #define CONFIGURE_MAXIMUM_DRIVERS 10 |
70 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 40 | |
71 | ||
[7336d4af] | 72 | #define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK |
73 | ||
74 | #define CONFIGURE_FILESYSTEM_RFS | |
75 | ||
76 | #define CONFIGURE_INIT | |
77 | #include <rtems/confdefs.h> |
Note: See TracBrowser
for help on using the repository browser.