]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: move fs test binary into workunits dir so teuthology can build it
authorSage Weil <sage@inktank.com>
Fri, 5 Jul 2013 18:16:08 +0000 (11:16 -0700)
committerSage Weil <sage@inktank.com>
Fri, 5 Jul 2013 18:16:08 +0000 (11:16 -0700)
Teuthology does a make in the workunits dir, so move this in there.

Signed-off-by: Sage Weil <sage@inktank.com>
qa/Makefile
qa/fs/Makefile [deleted file]
qa/fs/test_o_trunc.c [deleted file]
qa/workunits/Makefile
qa/workunits/fs/.gitignore [new file with mode: 0644]
qa/workunits/fs/Makefile [new file with mode: 0644]
qa/workunits/fs/test_o_trunc.c [new file with mode: 0644]

index c4efe2c9f3aba1dbb9b2d43a0ae62db7c8ada7a9..ad655b7e743cb4468bfb6e691bfcb7ad875dd565 100644 (file)
@@ -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 (file)
index c993425..0000000
+++ /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 (file)
index 0210528..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-
-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;
-}
index d79ecd7f8b1d5d45c409a50708f7ba4904862d80..f75f5dfd4a5e25c97878c1ccaf06e53a0d7bfc08 100644 (file)
@@ -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 (file)
index 0000000..f7f7a06
--- /dev/null
@@ -0,0 +1 @@
+test_o_trunc
diff --git a/qa/workunits/fs/Makefile b/qa/workunits/fs/Makefile
new file mode 100644 (file)
index 0000000..c993425
--- /dev/null
@@ -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 (file)
index 0000000..0210528
--- /dev/null
@@ -0,0 +1,44 @@
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+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;
+}