Esempio n. 1
0
/* Simple testing thing */
void test_xenbus(void)
{
    printk("Doing xenbus test.\n");
    xenbus_debug_msg("Testing xenbus...\n");

    printk("Doing ls test.\n");
    do_ls_test("device");
    do_ls_test("device/vif");
    do_ls_test("device/vif/0");

    printk("Doing read test.\n");
    do_read_test("device/vif/0/mac");
    do_read_test("device/vif/0/backend");

    printk("Doing write test.\n");
    do_write_test("device/vif/0/flibble", "flobble");
    do_read_test("device/vif/0/flibble");
    do_write_test("device/vif/0/flibble", "widget");
    do_read_test("device/vif/0/flibble");

    printk("Doing rm test.\n");
    do_rm_test("device/vif/0/flibble");
    do_read_test("device/vif/0/flibble");
    printk("(Should have said ENOENT)\n");
}
Esempio n. 2
0
int main(void)
{
	struct growbuf buf;

	application_prepare_test();

	growbuf_init(&buf, 100);
	do_write_test(growbuf_write_stream_create(&buf));
	do_read_test(bytes_read_stream_create(growbuf_to_bytes(&buf)));

	growbuf_reset(&buf);
	do_write_test(byte_at_a_time_stream_create(
					     growbuf_write_stream_create(&buf)));
	do_read_test(byte_at_a_time_stream_create(
			      bytes_read_stream_create(growbuf_to_bytes(&buf))));

	growbuf_fini(&buf);
	return 0;
}
static int
do_one_test (const char *filename)
{
  int ret = 0;

  ret |= do_ftell_test (filename);
  ret |= do_write_test (filename);
  ret |= do_append_test (filename);
  ret |= do_rewind_test (filename);
  ret |= do_ftruncate_test (filename);

  return ret;
}
static void do_test(unsigned long size)
{
	void __iomem *p = ioremap_nocache(mmio_address, size);
	if (!p) {
		pr_err("could not ioremap, aborting.\n");
		return;
	}
	mmiotrace_printk("ioremap returned %p.\n", p);
	do_write_test(p);
	do_read_test(p);
	if (read_far && read_far < size - 4)
		do_read_far_test(p);
	iounmap(p);
}
Esempio n. 5
0
/* Simple testing thing */
void test_xenbus(void *ignored)
{
    printk("Doing xenbus test.\n");
    xenbus_debug_msg("Testing xenbus...\n");

    printk("Doing write test.\n");
    do_write_test("data/stuff", "flobble");
    do_read_test("data/stuff");

    printk("Doing ls test.\n");
    do_ls_test("data");
    do_ls_test("data/nonexistent");

    printk("Doing rm test.\n");
    do_rm_test("data/stuff");
    do_read_test("data/stuff");
    printk("(Should have said ENOENT)\n");

    vTaskDelete(NULL);
}
Esempio n. 6
0
/*
 * Function:    main
 * Purpose:     Run the program
 * Return:      EXIT_SUCCESS or EXIT_FAILURE
 * Programmer:  Bill Wendling, 05. June 2002
 * Modifications:
 */
int
main(int argc, char **argv)
{
    unsigned long min_buf_size = 128 * ONE_KB, max_buf_size = ONE_MB;
    unsigned long file_size = 64 * ONE_MB;
    int opt;

    prog = argv[0];
    
    /* Initialize h5tools lib */
    h5tools_init();

    while ((opt = get_option(argc, (const char **)argv, s_opts, l_opts)) > 0) {
        switch ((char)opt) {
        case '0': case '1': case '2':
        case '3': case '4': case '5':
        case '6': case '7': case '8':
        case '9':
            compress_level = opt - '0';
            break;
        case 'B':
            max_buf_size = parse_size_directive(opt_arg);
            break;
        case 'b':
            min_buf_size = parse_size_directive(opt_arg);
            break;
        case 'c':
            compress_percent = (int)HDstrtol(opt_arg, NULL, 10);

            if (compress_percent < 0)
                compress_percent = 0;
            else if (compress_percent > 100)
                compress_percent = 100;

            break;
        case 'p':
            option_prefix = opt_arg;
            break;
        case 'r':
            random_test = TRUE;
            break;
        case 's':
            file_size = parse_size_directive(opt_arg);
            break;
        case '?':
            usage();
            exit(EXIT_FAILURE);
            break;
        case 'h':
        default:
            usage();
            exit(EXIT_SUCCESS);
            break;
        }
    }

    if (min_buf_size > max_buf_size)
        error("minmum buffer size (%d) exceeds maximum buffer size (%d)",
              min_buf_size, max_buf_size);

    HDfprintf(stdout, "Filesize: %ld\n", file_size);

    if (compress_level == Z_DEFAULT_COMPRESSION)
        HDfprintf(stdout, "Compression Level: 6\n");
    else
        HDfprintf(stdout, "Compression Level: %d\n", compress_level);

    get_unique_name();
    do_write_test(file_size, min_buf_size, max_buf_size);
    cleanup();
    return EXIT_SUCCESS;
}