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