source: rtems/testsuites/fstests/fsimfsconfig02/init.c @ c4b8b147

5
Last change on this file since c4b8b147 was c4b8b147, checked in by Sebastian Huber <sebastian.huber@…>, on 11/03/17 at 07:35:38

tests: Use simple console driver

Update #3170.
Update #3199.

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 * Copyright (c) 2015 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#ifdef HAVE_CONFIG_H
16  #include "config.h"
17#endif
18
19#include "tmacros.h"
20
21#include <sys/stat.h>
22#include <errno.h>
23#include <unistd.h>
24
25#include <rtems/imfs.h>
26#include <rtems/libio.h>
27
28const char rtems_test_name[] = "FSIMFSCONFIG 2";
29
30static void Init(rtems_task_argument arg)
31{
32  const char *mnt = "mnt";
33  const char *link = "link";
34  char buf[1];
35  int rv;
36
37  TEST_BEGIN();
38
39  rv = mkdir(mnt, S_IRWXU);
40  rtems_test_assert(rv == 0);
41
42  rv = mount(
43    "",
44    mnt,
45    RTEMS_FILESYSTEM_TYPE_IMFS,
46    RTEMS_FILESYSTEM_READ_ONLY,
47    NULL
48  );
49  rtems_test_assert(rv == 0);
50
51  errno = 0;
52  rv = unmount(mnt);
53  rtems_test_assert(rv == -1);
54  rtems_test_assert(errno == ENOTSUP);
55
56  rv = symlink(mnt, link);
57  rtems_test_assert(rv == 0);
58
59  errno = 0;
60  rv = readlink(link, &buf[0], sizeof(buf));
61  rtems_test_assert(rv == -1);
62  rtems_test_assert(errno == ENOTSUP);
63
64  TEST_END();
65  rtems_test_exit(0);
66}
67
68#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
69#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
70
71#define CONFIGURE_FILESYSTEM_IMFS
72
73#define CONFIGURE_IMFS_DISABLE_READLINK
74#define CONFIGURE_IMFS_DISABLE_UNMOUNT
75
76#define CONFIGURE_MAXIMUM_TASKS 1
77
78#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
79
80#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
81
82#define CONFIGURE_INIT
83
84#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.