Whamcloud - gitweb
b=16098
[fs/lustre-release.git] / lustre / liblustre / tests / test_common.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * GPL HEADER START
5  *
6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 only,
10  * as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * General Public License version 2 for more details (a copy is included
16  * in the LICENSE file that accompanied this code).
17  *
18  * You should have received a copy of the GNU General Public License
19  * version 2 along with this program; If not, see [sun.com URL with a
20  * copy of GPLv2].
21  *
22  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23  * CA 95054 USA or visit www.sun.com if you need additional information or
24  * have any questions.
25  *
26  * GPL HEADER END
27  */
28 /*
29  * Copyright  2008 Sun Microsystems, Inc. All rights reserved
30  * Use is subject to license terms.
31  */
32 /*
33  * This file is part of Lustre, http://www.lustre.org/
34  * Lustre is a trademark of Sun Microsystems, Inc.
35  */
36
37 #ifndef __TEST_COMMON__H
38 #define __TEST_COMMON__H
39
40 #define ENV_LUSTRE_MNTPNT               "LIBLUSTRE_MOUNT_POINT"
41 #define ENV_LUSTRE_MNTTGT               "LIBLUSTRE_MOUNT_TARGET"
42 #define ENV_LUSTRE_TIMEOUT              "LIBLUSTRE_TIMEOUT"
43 #define ENV_LUSTRE_DUMPFILE             "LIBLUSTRE_DUMPFILE"
44
45 extern int exit_on_err;
46
47 #include <utime.h> /* for utimbuf */
48
49 void t_touch(const char *path);
50 void t_create(const char *path);
51 void t_link(const char *src, const char *dst);
52 void t_unlink(const char *path);
53 void t_mkdir(const char *path);
54 void t_rmdir(const char *path);
55 void t_symlink(const char *src, const char *new);
56 void t_mknod(const char *path, mode_t mode, int major, int minor);
57 void t_chmod_raw(const char *path, mode_t mode);
58 void t_chmod(const char *path, const char *format, ...);
59 void t_rename(const char *oldpath, const char *newpath);
60 int t_open_readonly(const char *path);
61 int t_open(const char *path);
62 int t_chdir(const char *path);
63 int t_utime(const char *path, const struct utimbuf *buf);
64 int t_opendir(const char *path);
65 void t_close(int fd);
66 int t_check_stat(const char *name, struct stat *buf);
67 int t_check_stat_fail(const char *name);
68 void t_echo_create(const char *path, const char *str);
69 void t_grep(const char *path, char *str);
70 void t_grep_v(const char *path, char *str);
71 void t_ls(int fd, char *buf, int size);
72 int t_fcntl(int fd, int cmd, ...);
73
74 char *safe_strncpy(char *dst, char *src, int max_size);
75
76 #endif