[Pvfs2-cvs] commit by pcarns in pvfs2-1/test/client/sysint:
precreate.c module.mk.in
CVS commit program
cvs at parl.clemson.edu
Wed Feb 6 12:16:40 EST 2008
Update of /projects/cvsroot/pvfs2-1/test/client/sysint
In directory parlweb1:/tmp/cvs-serv511/test/client/sysint
Modified Files:
Tag: small-file-branch
module.mk.in
Added Files:
Tag: small-file-branch
precreate.c
Log Message:
Use setparam state machine as a temporary test harness for get_handles()
interface to precreate pools. Added test program to trigger it. Stub for
get_handles() function.
--- /dev/null 2004-06-24 14:04:38.000000000 -0400
+++ precreate.c 2008-02-06 12:16:40.000000000 -0500
@@ -0,0 +1,67 @@
+/*
+ * (C) 2001 Clemson University and The University of Chicago
+ *
+ * See COPYING in top-level directory.
+ */
+
+#include <assert.h>
+#include <sys/time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#include "client.h"
+#include "pvfs2-util.h"
+#include "pvfs2-internal.h"
+#include "pvfs2-mgmt.h"
+
+int main(int argc,char **argv)
+{
+ int ret = -1;
+ PVFS_fs_id fs_id;
+ PVFS_credentials credentials;
+
+ if (argc != 1)
+ {
+ fprintf(stderr, "USAGE: %s\n", argv[0]);
+ return 1;
+ }
+
+ PVFS_util_gen_credentials(&credentials);
+
+ ret = PVFS_util_init_defaults();
+ if (ret < 0)
+ {
+ PVFS_perror("PVFS_util_init_defaults", ret);
+ return (-1);
+ }
+
+ ret = PVFS_util_get_default_fsid(&fs_id);
+ if (ret < 0)
+ {
+ PVFS_perror("PVFS_util_get_default_fsid", ret);
+ return (-1);
+ }
+
+ ret = PVFS_mgmt_setparam_all(fs_id,
+ &credentials,
+ PVFS_SERV_PARAM_TEST_PRECREATE,
+ 0,
+ NULL,
+ NULL);
+
+ if(ret < 0)
+ {
+ PVFS_perror("PVFS_mgmg_setparam_all(PVFS_SERV_PARAM_TEST_PRECREATE)", ret);
+ }
+
+ ret = PVFS_sys_finalize();
+ if (ret < 0)
+ {
+ printf("finalizing sysint failed with errcode = %d\n", ret);
+ return (-1);
+ }
+ return 0;
+}
Index: module.mk.in
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/test/client/sysint/module.mk.in,v
diff -p -u -r1.54 -r1.54.2.1
--- module.mk.in 10 Jan 2008 15:20:24 -0000 1.54
+++ module.mk.in 6 Feb 2008 17:16:40 -0000 1.54.2.1
@@ -38,7 +38,8 @@ TESTSRC += \
$(DIR)/list-eattr.c \
$(DIR)/test-accesses.c \
$(DIR)/test-hindexed-test.c \
- $(DIR)/io-stress.c
+ $(DIR)/io-stress.c \
+ $(DIR)/precreate.c
MODCFLAGS_$(DIR)/io-stress.c := -D_GNU_SOURCE
MODLDFLAGS_$(DIR) := -lrt
More information about the Pvfs2-cvs
mailing list