source: rtems/testsuites/libtests/tar02/init.c @ cf36b70

4.115
Last change on this file since cf36b70 was cf36b70, checked in by Sebastian Huber <sebastian.huber@…>, on 12/31/14 at 09:56:05

IMFS: Replace node union with individual struct

This reduces the average node size.

Add and use IMFS_GENERIC_INITIALIZER().

  • Property mode set to 100644
File size: 1.9 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-2012.
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
14#include <bsp.h> /* for device driver prototypes */
15#include "tmacros.h"
16#include <rtems/imfs.h>
17#include <rtems/error.h>
18
19#include <stdio.h>
20#include <stdlib.h>
21#include <sys/types.h>
22#include <sys/stat.h>
23#include <fcntl.h>
24#include <unistd.h>
25
26#include "initial_filesystem_tar.h"
27
28const char rtems_test_name[] = "TAR 2";
29
30/* forward declarations to avoid warnings */
31rtems_task Init(rtems_task_argument argument);
32void test_tarfs_load(void);
33
34#define TARFILE_START initial_filesystem_tar
35#define TARFILE_SIZE  initial_filesystem_tar_size
36
37void test_cat(
38  char *file,
39  int   offset_arg,
40  int   length
41);
42
43void test_tarfs_load(void)
44{
45  rtems_status_code sc;
46
47  printf("Loading tarfs image ... ");
48  sc = rtems_tarfs_load("/",(void *)TARFILE_START, TARFILE_SIZE);
49  if (sc != RTEMS_SUCCESSFUL) {
50    printf ("error: untar failed: %s\n", rtems_status_text (sc));
51    exit(1);
52  }
53  printf ("successful\n");
54
55  /******************/
56  printf( "========= /home/test_file =========\n" );
57  test_cat( "/home/test_file", 0, 0 );
58 
59  /******************/
60  printf( "========= /symlink =========\n" );
61  test_cat( "/symlink", 0, 0 );
62}
63
64rtems_task Init(
65  rtems_task_argument ignored
66)
67{
68  TEST_BEGIN();
69
70  test_tarfs_load();
71
72  TEST_END();
73  exit( 0 );
74}
75
76
77/* NOTICE: the clock driver is explicitly disabled */
78#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
79#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
80
81#define CONFIGURE_MAXIMUM_TASKS            1
82#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 5
83
84#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
85
86#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
87
88#define CONFIGURE_INIT
89#include <rtems/confdefs.h>
Note: See TracBrowser for help on using the repository browser.