From: Sage Weil Date: Fri, 5 Jul 2013 18:16:08 +0000 (-0700) Subject: qa: move fs test binary into workunits dir so teuthology can build it X-Git-Tag: v0.67-rc1~149 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=507a4ec87b04afe16a4885c3af8cd89506be3b1a;p=ceph.git qa: move fs test binary into workunits dir so teuthology can build it Teuthology does a make in the workunits dir, so move this in there. Signed-off-by: Sage Weil --- diff --git a/qa/Makefile b/qa/Makefile index c4efe2c9f3ab..ad655b7e743c 100644 --- a/qa/Makefile +++ b/qa/Makefile @@ -1,4 +1,4 @@ -DIRS= workunits btrfs fs +DIRS= workunits btrfs all: for d in $(DIRS) ; do ( cd $$d ; $(MAKE) all ) ; done diff --git a/qa/fs/Makefile b/qa/fs/Makefile deleted file mode 100644 index c9934254d35e..000000000000 --- a/qa/fs/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -CFLAGS = -Wall -Wextra -D_GNU_SOURCE - -TARGETS = test_o_trunc - -.c: - $(CC) $(CFLAGS) $@.c -o $@ - -all: $(TARGETS) - -clean: - rm $(TARGETS) diff --git a/qa/fs/test_o_trunc.c b/qa/fs/test_o_trunc.c deleted file mode 100644 index 021052882175..000000000000 --- a/qa/fs/test_o_trunc.c +++ /dev/null @@ -1,44 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -int main(int argc, char *argv[]) -{ - int fd, ret; - char obuf[32], ibuf[1024]; - int n, max = 0; - - if (argc > 2) - max = atoi(argv[2]); - if (!max) - max = 600; - - memset(obuf, 0xff, sizeof(obuf)); - - for (n = 1; n <= max; ++n) { - fd = open(argv[1], O_RDWR | O_CREAT | O_TRUNC, 0644); - printf("%d/%d: open fd = %d\n", n, max, fd); - - ret = write(fd, obuf, sizeof(obuf)); - printf("write ret = %d\n", ret); - - sleep(1); - - ret = write(fd, obuf, sizeof(obuf)); - printf("write ret = %d\n", ret); - - ret = pread(fd, ibuf, sizeof(ibuf), 0); - printf("pread ret = %d\n", ret); - - if (memcmp(obuf, ibuf, sizeof(obuf))) { - printf("mismatch\n"); - break; - } - close(fd); - } - return 0; -} diff --git a/qa/workunits/Makefile b/qa/workunits/Makefile index d79ecd7f8b1d..f75f5dfd4a5e 100644 --- a/qa/workunits/Makefile +++ b/qa/workunits/Makefile @@ -1,4 +1,4 @@ -DIRS = direct_io +DIRS = direct_io fs all: for d in $(DIRS) ; do ( cd $$d ; $(MAKE) all ) ; done diff --git a/qa/workunits/fs/.gitignore b/qa/workunits/fs/.gitignore new file mode 100644 index 000000000000..f7f7a0614fac --- /dev/null +++ b/qa/workunits/fs/.gitignore @@ -0,0 +1 @@ +test_o_trunc diff --git a/qa/workunits/fs/Makefile b/qa/workunits/fs/Makefile new file mode 100644 index 000000000000..c9934254d35e --- /dev/null +++ b/qa/workunits/fs/Makefile @@ -0,0 +1,11 @@ +CFLAGS = -Wall -Wextra -D_GNU_SOURCE + +TARGETS = test_o_trunc + +.c: + $(CC) $(CFLAGS) $@.c -o $@ + +all: $(TARGETS) + +clean: + rm $(TARGETS) diff --git a/qa/workunits/fs/test_o_trunc.c b/qa/workunits/fs/test_o_trunc.c new file mode 100644 index 000000000000..021052882175 --- /dev/null +++ b/qa/workunits/fs/test_o_trunc.c @@ -0,0 +1,44 @@ +#include +#include +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + int fd, ret; + char obuf[32], ibuf[1024]; + int n, max = 0; + + if (argc > 2) + max = atoi(argv[2]); + if (!max) + max = 600; + + memset(obuf, 0xff, sizeof(obuf)); + + for (n = 1; n <= max; ++n) { + fd = open(argv[1], O_RDWR | O_CREAT | O_TRUNC, 0644); + printf("%d/%d: open fd = %d\n", n, max, fd); + + ret = write(fd, obuf, sizeof(obuf)); + printf("write ret = %d\n", ret); + + sleep(1); + + ret = write(fd, obuf, sizeof(obuf)); + printf("write ret = %d\n", ret); + + ret = pread(fd, ibuf, sizeof(ibuf), 0); + printf("pread ret = %d\n", ret); + + if (memcmp(obuf, ibuf, sizeof(obuf))) { + printf("mismatch\n"); + break; + } + close(fd); + } + return 0; +}