source: rtems/testsuites/fstests/mrfs_support/fs_support.c @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.7 KB
Line 
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.org/license/LICENSE.
8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
13#include "pmacros.h"
14
15#include <sys/stat.h>
16#include <sys/types.h>
17
18#include <rtems/libio.h>
19#include <rtems/rtems-rfs-format.h>
20
21#include "ramdisk_support.h"
22
23#include "fstest.h"
24#include "fstest_support.h"
25
26#define BLOCK_SIZE (512)
27
28rtems_rfs_format_config rfs_config = {
29block_size:BLOCK_SIZE
30};
31
32
33void
34test_initialize_filesystem (void)
35{
36  int rc = 0;
37  rc = mkdir (BASE_FOR_TEST,S_IRWXU|S_IRWXG|S_IRWXO);
38  rtems_test_assert (rc == 0);
39
40  init_ramdisk ();
41
42  rc = rtems_rfs_format (RAMDISK_PATH, &rfs_config);
43  rtems_test_assert (rc == 0);
44
45  rc = mount (RAMDISK_PATH,
46              BASE_FOR_TEST, "rfs", RTEMS_FILESYSTEM_READ_WRITE, NULL);
47  rtems_test_assert (rc == 0);
48}
49
50
51void
52test_shutdown_filesystem (void)
53{
54  int rc = 0;
55  rc = unmount (BASE_FOR_TEST);
56  rtems_test_assert (rc == 0);
57  del_ramdisk ();
58}
59
60/* configuration information */
61#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
62#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
63
64#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
65
66#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
67
68#define CONFIGURE_MAXIMUM_TASKS                     10
69#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
70#define CONFIGURE_MAXIMUM_DRIVERS                   10
71#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS    40
72#define CONFIGURE_INIT_TASK_STACK_SIZE (32 * 1024)
73
74#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
75
76#define CONFIGURE_FILESYSTEM_RFS
77
78#define CONFIGURE_INIT
79#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.