source: rtems/testsuites/fstests/mimfs_support/fs_support.c @ 60cf8a5

4.11
Last change on this file since 60cf8a5 was 60cf8a5, checked in by Sebastian Huber <sebastian.huber@…>, on Feb 6, 2015 at 3:32:39 PM

IMFS: Add root directory to FS info

Fix memory leak in IMFS_fsunmount().

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[a2f875f]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
[c499856]7 *  http://www.rtems.org/license/LICENSE.
[a2f875f]8 */
9
10#ifdef HAVE_CONFIG_H
11#include "config.h"
12#endif
[7336d4af]13#include "pmacros.h"
14
[a2f875f]15#include <sys/stat.h>
16#include <rtems/libio.h>
[60cf8a5]17#include <rtems/libcsupport.h>
[a2f875f]18
[858e013f]19#include "fstest.h"
[28860ec0]20#include "fstest_support.h"
[7336d4af]21
[60cf8a5]22static rtems_resource_snapshot before_mount;
23
[858e013f]24void
25test_initialize_filesystem (void)
[a2f875f]26{
[858e013f]27  int rc = 0;
28  rc = mkdir (BASE_FOR_TEST,S_IRWXU|S_IRWXG|S_IRWXO);
29  rtems_test_assert (rc == 0);
[7336d4af]30
[60cf8a5]31  rtems_resource_snapshot_take(&before_mount);
32
[858e013f]33  rc = mount (NULL, BASE_FOR_TEST, "imfs", RTEMS_FILESYSTEM_READ_WRITE, NULL);
34  rtems_test_assert (rc == 0);
[a2f875f]35}
36
[7336d4af]37
[858e013f]38void
39test_shutdown_filesystem (void)
[a2f875f]40{
[858e013f]41  int rc = 0;
42  rc = unmount (BASE_FOR_TEST);
43  rtems_test_assert (rc == 0);
[60cf8a5]44
45  rtems_test_assert(rtems_resource_snapshot_check(&before_mount));
[7336d4af]46}
[a2f875f]47
[7336d4af]48/* configuration information */
49
50/* drivers */
51#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
52#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
53
54/**
55 * Configure base RTEMS resources.
56 */
57
[bc75887]58#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
[7336d4af]59
[858e013f]60#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
[7336d4af]61
[6fed43e]62#define CONFIGURE_MAXIMUM_TASKS                  10
[858e013f]63#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 40
[23c6f93a]64#define CONFIGURE_INIT_TASK_STACK_SIZE (16 * 1024)
[5c0c0cf]65#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS  1
[7336d4af]66
67#define CONFIGURE_INIT
68#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.