diff options
Diffstat (limited to 'testsuites/fstests/fsimfsconfig02')
-rw-r--r-- | testsuites/fstests/fsimfsconfig02/Makefile.am | 19 | ||||
-rw-r--r-- | testsuites/fstests/fsimfsconfig02/fsimfsconfig02.doc | 11 | ||||
-rw-r--r-- | testsuites/fstests/fsimfsconfig02/fsimfsconfig02.scn | 2 | ||||
-rw-r--r-- | testsuites/fstests/fsimfsconfig02/init.c | 84 |
4 files changed, 116 insertions, 0 deletions
diff --git a/testsuites/fstests/fsimfsconfig02/Makefile.am b/testsuites/fstests/fsimfsconfig02/Makefile.am new file mode 100644 index 0000000000..9567eea8ec --- /dev/null +++ b/testsuites/fstests/fsimfsconfig02/Makefile.am @@ -0,0 +1,19 @@ +rtems_tests_PROGRAMS = fsimfsconfig02 +fsimfsconfig02_SOURCES = init.c + +dist_rtems_tests_DATA = fsimfsconfig02.scn fsimfsconfig02.doc + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am +include $(top_srcdir)/../automake/leaf.am + +AM_CPPFLAGS += -I$(top_srcdir)/../support/include + +LINK_OBJS = $(fsimfsconfig02_OBJECTS) +LINK_LIBS = $(fsimfsconfig02_LDLIBS) + +fsimfsconfig02$(EXEEXT): $(fsimfsconfig02_OBJECTS) $(fsimfsconfig02_DEPENDENCIES) + @rm -f fsimfsconfig02$(EXEEXT) + $(make-exe) + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/fstests/fsimfsconfig02/fsimfsconfig02.doc b/testsuites/fstests/fsimfsconfig02/fsimfsconfig02.doc new file mode 100644 index 0000000000..3693513eea --- /dev/null +++ b/testsuites/fstests/fsimfsconfig02/fsimfsconfig02.doc @@ -0,0 +1,11 @@ +This file describes the directives and concepts tested by this test set. + +test set name: fsimfsconfig02 + +directives: + + TBD + +concepts: + + - Ensure that the IMFS configuration defines work. diff --git a/testsuites/fstests/fsimfsconfig02/fsimfsconfig02.scn b/testsuites/fstests/fsimfsconfig02/fsimfsconfig02.scn new file mode 100644 index 0000000000..c89a4a219a --- /dev/null +++ b/testsuites/fstests/fsimfsconfig02/fsimfsconfig02.scn @@ -0,0 +1,2 @@ +*** BEGIN OF TEST FSIMFSCONFIG 2 *** +*** END OF TEST FSIMFSCONFIG 2 *** diff --git a/testsuites/fstests/fsimfsconfig02/init.c b/testsuites/fstests/fsimfsconfig02/init.c new file mode 100644 index 0000000000..35f9c83b58 --- /dev/null +++ b/testsuites/fstests/fsimfsconfig02/init.c @@ -0,0 +1,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_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> |