예제 #1
0
파일: init.c 프로젝트: greenmeent/rtems
void test_untar_from_memory(void)
{
  rtems_status_code sc;
  rtems_printer     printer;

  rtems_print_printer_printf(&printer);

  printf("Untaring from memory - ");
  sc = Untar_FromMemory_Print((void *)TARFILE_START, TARFILE_SIZE, &printer);
  if (sc != RTEMS_SUCCESSFUL) {
    printf ("error: untar failed: %s\n", rtems_status_text (sc));
    exit(1);
  }
  printf ("successful\n");

  /******************/
  printf( "========= /home/test_file =========\n" );
  test_cat( "/home/test_file", 0, 0 );

  /******************/
  printf( "========= /home/test_script =========\n" );
  test_cat( "/home/test_script", 0, 0 );
  test_untar_check_mode("/home/test_script", 0755);

  /******************/
  printf( "========= /symlink =========\n" );
  test_cat( "/symlink", 0, 0 );

}
예제 #2
0
void test_untar_unzip_txz(void)
{
#if HAVE_XZ
  int status;
  rtems_printer     printer;
  int rv;
  Untar_XzChunkContext ctx;
  size_t i = 0;
  char *buffer = (char *)TARFILE_XZ_START;
  size_t buflen = TARFILE_XZ_SIZE;
  char inflate_buffer;

  puts( "" );

  rtems_test_assert( buflen != 0 );

  rtems_print_printer_printf(&printer);

  /* make a directory to untar it into */
  rv = mkdir( "/dest4", 0777 );
  rtems_test_assert( rv == 0 );

  rv = chdir( "/dest4" );
  rtems_test_assert( rv == 0 );

  printf( "Untaring chunks from txz - " );

  /*
   * Use 8K dict, this is set on the command line of xz when compressing.
   */
  status = Untar_XzChunkContext_Init(&ctx, XZ_DYNALLOC,
                                     8 * 1024, &inflate_buffer, 1);
  rtems_test_assert(status == UNTAR_SUCCESSFUL);
  for(i = 0; i < buflen; i++) {
    status = Untar_FromXzChunk_Print(&ctx, &buffer[i], 1, &printer);
    rtems_test_assert(status == UNTAR_SUCCESSFUL);
  }
  printf( "successful\n" );

  /******************/
  printf( "========= /dest4/home/test_file =========\n" );
  test_cat( "/dest4/home/test_file", 0, 0 );

  /******************/
  printf( "========= /dest4/home/test_script =========\n" );
  test_cat( "/dest4/home/test_script", 0, 0 );
  test_untar_check_mode("/dest4/home/test_script", 0755);

  /******************/
  printf( "========= /dest4/symlink =========\n" );
  test_cat( "/dest4/symlink", 0, 0 );
#endif
}
예제 #3
0
파일: init.c 프로젝트: greenmeent/rtems
int main( void )
#endif
{
#if __rtems__
  rtems_print_printer_printf(&rtems_test_printer);
  rtems_test_begin();
#endif

  domathf();

#if __rtems__
  rtems_test_end();
#endif
  exit( 0 );
}
예제 #4
0
int main( void )
#endif
{
#if __rtems__
  rtems_print_printer_printf(&rtems_test_printer);
  rtems_test_begin();
#endif

  docomplex();
  docomplexf();
  docomplexl();
#if __rtems__
  rtems_test_end();
#endif
  exit( 0 );
}
예제 #5
0
void test_untar_unzip_tgz(void)
{
  int status;
  rtems_printer     printer;
  int rv;
  Untar_GzChunkContext ctx;
  size_t i = 0;
  char *buffer = (char *)TARFILE_GZ_START;
  size_t buflen = TARFILE_GZ_SIZE;
  char inflate_buffer;

  puts( "" );

  rtems_test_assert( buflen != 0 );

  rtems_print_printer_printf(&printer);

  /* make a directory to untar it into */
  rv = mkdir( "/dest3", 0777 );
  rtems_test_assert( rv == 0 );

  rv = chdir( "/dest3" );
  rtems_test_assert( rv == 0 );

  printf( "Untaring chunks from tgz - " );

  status = Untar_GzChunkContext_Init(&ctx, &inflate_buffer, 1);
  rtems_test_assert(status == UNTAR_SUCCESSFUL);
  for(i = 0; i < buflen; i++) {
    status = Untar_FromGzChunk_Print(&ctx, &buffer[i], 1, &printer);
    rtems_test_assert(status == UNTAR_SUCCESSFUL);
  }
  printf( "successful\n" );

  /******************/
  printf( "========= /dest3/home/test_file =========\n" );
  test_cat( "/dest3/home/test_file", 0, 0 );

  /******************/
  printf( "========= /dest3/home/test_script =========\n" );
  test_cat( "/dest3/home/test_script", 0, 0 );
  test_untar_check_mode("/dest3/home/test_script", 0755);

  /******************/
  printf( "========= /dest3/symlink =========\n" );
  test_cat( "/dest3/symlink", 0, 0 );
}
예제 #6
0
/*
 * RTEMS Startup Task
 */
rtems_task
Init (rtems_task_argument ignored)
{
    rtems_status_code sc;

    rtems_print_printer_printf(&rtems_test_printer);

    rtems_test_begin();

    sc = rtems_semaphore_create(rtems_build_name('P','m','t','x'),
                                1,
                                RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE|RTEMS_INHERIT_PRIORITY|
                                RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL,
                                0,
                                &printMutex);
    if (sc != RTEMS_SUCCESSFUL)
        rtems_panic("Can't create printf mutex:", rtems_status_text(sc));
    printf("\"Network\" initializing!\n");
    rtems_bsdnet_initialize_network();
    printf("\"Network\" initialized!\n");

    printf("Try running client with no server present.\n");
    printf("Should fail with `connection refused'.\n");
    clientWorker(0);

    printf("\nStart server.\n");
    spawnTask(serverTask, 150, 0);

    printf("\nTry running client with server present.\n");
    spawnTask(clientTask, 120, 1);
    rtems_task_wake_after(500);

    printf("\nTry running two clients.\n");
    spawnTask(clientTask, 120, 2);
    spawnTask(clientTask, 120, 3);
    rtems_task_wake_after(500);

    printf("\nTry running three clients.\n");
    spawnTask(clientTask, 120, 4);
    spawnTask(clientTask, 120, 5);
    spawnTask(clientTask, 120, 6);

    rtems_task_wake_after(500);
    rtems_test_end();
    exit( 0 );
}
예제 #7
0
void test_untar_chunks_from_memory(void)
{
  rtems_status_code sc;
  rtems_printer     printer;
  int rv;
  Untar_ChunkContext ctx;
  unsigned long counter = 0;
  char *buffer = (char *)TARFILE_START;
  size_t buflen = TARFILE_SIZE;

  puts( "" );

  rtems_print_printer_printf(&printer);

  /* make a directory to untar it into */
  rv = mkdir( "/dest2", 0777 );
  rtems_test_assert( rv == 0 );

  rv = chdir( "/dest2" );
  rtems_test_assert( rv == 0 );

  printf( "Untaring chunks from memory - " );
  Untar_ChunkContext_Init(&ctx);
  do {
    sc = Untar_FromChunk_Print(&ctx, &buffer[counter], (size_t)1 , &printer);
    rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    counter ++;
  } while (counter < buflen);
  printf("successful\n");

  /******************/
  printf( "========= /dest2/home/test_file =========\n" );
  test_cat( "/dest2/home/test_file", 0, 0 );

  /******************/
  printf( "========= /dest2/home/test_script =========\n" );
  test_cat( "/dest2/home/test_script", 0, 0 );
  test_untar_check_mode("/dest2/home/test_script", 0755);

  /******************/
  printf( "========= /dest2/symlink =========\n" );
  test_cat( "/dest2/symlink", 0, 0 );

}
예제 #8
0
파일: init.c 프로젝트: greenmeent/rtems
rtems_task Init(
  rtems_task_argument ignored
)
{
  /*
   *  Install whatever optional floating point assistance package
   *  is required by this CPU.
   */

#if (defined (m68040))
  M68KFPSPInstallExceptionHandlers ();
#endif

  rtems_print_printer_printf(&rtems_test_printer);
  rtems_test_begin();
  paranoia(1, args);
  rtems_test_end();
  exit( 0 );
}