X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fqa%2Fworkunits%2Ffs%2Ftest_o_trunc.c;fp=src%2Fceph%2Fqa%2Fworkunits%2Ffs%2Ftest_o_trunc.c;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=1ce19e4bbdefc904220d9461c46b650a84586df4;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/qa/workunits/fs/test_o_trunc.c b/src/ceph/qa/workunits/fs/test_o_trunc.c deleted file mode 100644 index 1ce19e4..0000000 --- a/src/ceph/qa/workunits/fs/test_o_trunc.c +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -int main(int argc, char *argv[]) -{ - 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) { - int fd, ret; - 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"); - close(fd); - break; - } - close(fd); - } - return 0; -}