Example #1
0
bool torture_local_replace(struct torture_context *ctx)
{
	bool ret = true;
	ret &= test_ftruncate();
	ret &= test_strlcpy();
	ret &= test_strlcat();
	ret &= test_mktime();
	ret &= test_initgroups();
	ret &= test_memmove();
	ret &= test_strdup();
	ret &= test_setlinebuf();
	ret &= test_vsyslog();
	ret &= test_timegm();
	ret &= test_setenv();
	ret &= test_strndup();
	ret &= test_strnlen();
	ret &= test_waitpid();
	ret &= test_seteuid();
	ret &= test_setegid();
	ret &= test_asprintf();
	ret &= test_snprintf();
	ret &= test_vasprintf();
	ret &= test_vsnprintf();
	ret &= test_opendir();
	ret &= test_readdir();
	ret &= test_telldir();
	ret &= test_seekdir();
	ret &= test_dlopen();
	ret &= test_chroot();
	ret &= test_bzero();
	ret &= test_strerror();
	ret &= test_errno();
	ret &= test_mkdtemp();
	ret &= test_mkstemp();
	ret &= test_pread();
	ret &= test_pwrite();
	ret &= test_getpass();
	ret &= test_inet_ntoa();
	ret &= test_strtoll();
	ret &= test_strtoull();
	ret &= test_va_copy();
	ret &= test_FUNCTION();
	ret &= test_MIN();
	ret &= test_MAX();
	ret &= test_socketpair();
	ret &= test_strptime();
	ret &= test_getifaddrs();
	ret &= test_utime();
	ret &= test_utimes();
	ret &= test_memmem();

	return ret;
}
Example #2
0
int
main(int argc, char* argv[])
{
    file_info(STDIN_FILENO);
    file_info(STDOUT_FILENO);

    test_access();
    test_faccessat();
    test_mode();
    test_chown();
    test_write_test();
    test_unlink();
    test_link();
    test_mkdir();
    test_readdir();
    test_openat();
    test_ln();

    return EXIT_SUCCESS;
}
Example #3
0
int main(int argc, char **argv) {
    char workdir[1024];
    char workdirbasename[1024];
    char *nfsdir, *nfshost, *hosttemp=DEFAULT_HOSTTEMP;
    int c;
    int skipread=0, skipwrite=0, skipdir=0;

    while (1) {
        c=getopt(argc, argv, "o:t:l:f:c:");
        if (c == -1)
            break;

        switch(c) {
        case '?':
            usage(argv[0]);
        /* notreached */
        case 'o':
            if (!strcmp(optarg, "skipread")) {
                skipread=1;
            } else if (!strcmp(optarg, "skipwrite")) {
                skipwrite=1;
            } else if (!strcmp(optarg, "skipdir")) {
                skipdir=1;
            } else {
                printf("Unrecognized -o option: %s\n", optarg);
                usage(argv[0]);
            }
            break;
        case 't':
            hosttemp=strdup(optarg);
            break;
        case 'l':
            localtemp=strdup(optarg);
            break;
        case 'f':
            testfile=strdup(optarg);
            break;
        case 'c':
            testfiles=atoi(optarg);
            break;
        }
    }

    if (argc-optind != 2) {
        printf("Invalid number of required arguments\n");
        usage(argv[0]);
    }

    nfshost=argv[optind++];
    nfsdir=argv[optind++];

    /* Begin */

    test_statfs(nfsdir);

    /* Start with a fresh work area */
    sprintf(workdirbasename, "tmp%d", getpid());
    sprintf(workdir, "%s/%s", nfsdir, workdirbasename);
    printf("workdir is %s\n", workdir);

    test_mkdir(workdir);

    test_create(workdir);

    test_setattr(workdir);

    test_link(workdir);

    if (!skipread)
        test_read(nfsdir);

    if (!skipwrite)
        test_write(workdir, nfshost, hosttemp, workdirbasename);

    test_rename(workdir);

    if (!skipdir)
        test_readdir(workdir);

    test_remove(workdir);

    test_rmdir(workdir);

    return 0;

}