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