summaryrefslogtreecommitdiffstats
path: root/tests/basic/quota-nfs.c
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2015-01-10 05:49:42 +0100
committerVijay Bellur <vbellur@redhat.com>2015-01-10 00:00:25 -0800
commit12022fc87ee6b12c07bff0381701e2977e722382 (patch)
tree7ca735936ce56b5bc587afeb6393b69f4f64c905 /tests/basic/quota-nfs.c
parent548547b2e41c8e2cf79b929405cf18aecbdedebc (diff)
Spare spurious regression in quota.t
Like quota-nfs.t, quota.t shows spurious regressions because dd writes too fast. Reuse the C program used by quota-nfs.t to write slowly, and rename it to show it is not specific to quota-nfs.t BUG: 1129939 Change-Id: I14b50e368023e88dc8bcc76c266cc908d62f89e2 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9410 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'tests/basic/quota-nfs.c')
-rw-r--r--tests/basic/quota-nfs.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/tests/basic/quota-nfs.c b/tests/basic/quota-nfs.c
deleted file mode 100644
index 4cc0322e132..00000000000
--- a/tests/basic/quota-nfs.c
+++ /dev/null
@@ -1,47 +0,0 @@
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-int
-file_write (char *filename, int filesize)
-{
- int fd, ret = 0;
- int i = 0;
- char buf[1024] = {'a',};
- fd = open (filename, O_RDWR|O_CREAT|O_APPEND, 0600);
- while (i < filesize) {
- ret = write(fd, buf, sizeof(buf));
- if (ret == -1) {
- close (fd);
- return ret;
- }
- i += sizeof(buf);
- ret = fdatasync(fd);
- if (ret) {
- close (fd);
- return ret;
- }
- }
- ret = close(fd);
- if (ret)
- return ret;
-
- return 0;
-}
-
-int
-main (int argc, char **argv)
-{
- if (argc != 3) {
- printf("Usage: %s <filename> <size(in bytes)>\n", argv[0]);
- return EXIT_FAILURE;
- }
-
- printf ("argv[2] is %s\n", argv[2]);
- if (file_write (argv[1], atoi(argv[2])) == -1)
- return EXIT_FAILURE;
-
- return EXIT_SUCCESS;
-}