qa: do not use automake for workunit makefiles

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
This commit is contained in:
Sage Weil 2011-06-14 12:53:33 -07:00
parent 40f5ab9659
commit 954e09661f
12 changed files with 43 additions and 41 deletions

2
.gitignore vendored
View File

@ -18,7 +18,7 @@ core.*
vgcore.*
src/Makefile
Makefile.in
Makefile
/Makefile
aclocal.m4
autom4te.cache
config.log

View File

@ -1,13 +1,14 @@
AUTOMAKE_OPTIONS = gnu
EXTRA_DIST = autogen.sh ceph.spec.in
# the "." here makes sure check-local builds gtest before it is used
SUBDIRS = . src qa man
SUBDIRS = . src man
EXTRA_DIST += \
src/test/run-cli-tests \
src/test/cli \
src/test/downloads \
udev/50-rbd.rules
check-local:
# Build gtest before we build our own tests. Doing this instead
# of SUBDIRS because with that, gtest's own tests would be run

View File

@ -348,8 +348,5 @@ AC_CONFIG_HEADERS([src/acconfig.h])
AC_CONFIG_FILES([Makefile
src/Makefile
man/Makefile
qa/Makefile
qa/workunits/Makefile
qa/workunits/direct_io/Makefile
ceph.spec])
AC_OUTPUT

4
qa/Makefile Normal file
View File

@ -0,0 +1,4 @@
DIRS= workunits
all:
for d in $(DIRS) ; do ( cd $$d ; $(MAKE) all ) ; done

View File

@ -1,3 +0,0 @@
AUTOMAKE_OPTIONS = gnu
SUBDIRS = . workunits

4
qa/workunits/Makefile Normal file
View File

@ -0,0 +1,4 @@
DIRS = direct_io
all:
for d in $(DIRS) ; do ( cd $$d ; $(MAKE) all ) ; done

View File

@ -1,2 +0,0 @@
AUTOMAKE_OPTIONS = gnu
SUBDIRS = direct_io

View File

@ -0,0 +1,11 @@
CFLAGS=-Wall -Wextra
TARGETS= direct_io_test test_sync_io test_short_dio_read
.c:
$(CC) $(CFLAGS) $@.c -o $@
all: $(TARGETS)
clean:
rm $(TARGETS)

View File

@ -1,14 +0,0 @@
AUTOMAKE_OPTIONS = gnu
SUBDIRS =
bin_PROGRAMS =
AM_CFLAGS = -Wall
direct_io_test_SOURCES = direct_io_test.c
test_sync_io_SOURCES = test_sync_io.c
test_short_dio_read_SOURCES = test_short_dio_read.c
if WITH_DEBUG
bin_PROGRAMS += direct_io_test test_sync_io test_short_dio_read
endif

View File

@ -5,15 +5,15 @@
#include <fcntl.h>
#include <stdio.h>
int main(int argc, char **argv)
int main()
{
char buf[409600];
int fd = open("shortfile", O_WRONLY|O_CREAT, 0644);
ssize_t r;
printf("writing first 3 bytes of 10k file\n");
write(fd, "foo", 3);
ftruncate(fd, 10000);
r = write(fd, "foo", 3);
r = ftruncate(fd, 10000);
fsync(fd);
close(fd);

View File

@ -25,9 +25,10 @@ void write_pattern()
int fd = open("foo", O_CREAT|O_WRONLY, 0644);
uint64_t i;
int r;
for (i=0; i<1048576 * sizeof(i); i += sizeof(i)) {
write(fd, &i, sizeof(i));
r = write(fd, &i, sizeof(i));
}
close(fd);
@ -66,12 +67,12 @@ int read_direct(int buf_align, uint64_t offset, int len)
(unsigned long long)offset, len);
int fd = open("foo", O_RDONLY|O_DIRECT);
void *rawbuf;
posix_memalign(&rawbuf, 4096, len + buf_align);
int r = posix_memalign(&rawbuf, 4096, len + buf_align);
void *buf = (char *)rawbuf + buf_align;
memset(buf, 0, len);
pread(fd, buf, len, offset);
r = pread(fd, buf, len, offset);
close(fd);
int r = verify_pattern(buf, len, offset);
r = verify_pattern(buf, len, offset);
free(rawbuf);
return r;
}
@ -83,12 +84,12 @@ int read_sync(int buf_align, uint64_t offset, int len)
int fd = open("foo", O_RDONLY);
ioctl(fd, CEPH_IOC_SYNCIO);
void *rawbuf;
posix_memalign(&rawbuf, 4096, len + buf_align);
int r = posix_memalign(&rawbuf, 4096, len + buf_align);
void *buf = (char *)rawbuf + buf_align;
memset(buf, 0, len);
pread(fd, buf, len, offset);
r = pread(fd, buf, len, offset);
close(fd);
int r = verify_pattern(buf, len, offset);
r = verify_pattern(buf, len, offset);
free(rawbuf);
return r;
}
@ -101,19 +102,20 @@ int write_direct(int buf_align, uint64_t offset, int len)
void *rawbuf;
posix_memalign(&rawbuf, 4096, len + buf_align);
void *buf = (char *)rawbuf + buf_align;
int r;
generate_pattern(buf, len, offset);
pwrite(fd, buf, len, offset);
r = pwrite(fd, buf, len, offset);
close(fd);
fd = open("foo", O_RDONLY);
void *buf2 = malloc(len);
memset(buf2, 0, len);
pread(fd, buf2, len, offset);
r = pread(fd, buf2, len, offset);
close(fd);
int r = verify_pattern(buf2, len, offset);
r = verify_pattern(buf2, len, offset);
unlink("foo");
free(rawbuf);
@ -128,21 +130,21 @@ int write_sync(int buf_align, uint64_t offset, int len)
int fd = open("foo", O_WRONLY|O_CREAT, 0644);
ioctl(fd, CEPH_IOC_SYNCIO);
void *rawbuf;
posix_memalign(&rawbuf, 4096, len + buf_align);
int r = posix_memalign(&rawbuf, 4096, len + buf_align);
void *buf = (char *)rawbuf + buf_align;
generate_pattern(buf, len, offset);
pwrite(fd, buf, len, offset);
r = pwrite(fd, buf, len, offset);
close(fd);
fd = open("foo", O_RDONLY);
void *buf2 = malloc(len);
memset(buf2, 0, len);
pread(fd, buf2, len, offset);
r = pread(fd, buf2, len, offset);
close(fd);
int r = verify_pattern(buf2, len, offset);
r = verify_pattern(buf2, len, offset);
unlink("foo");
free(buf2);

2
src/.gitignore vendored
View File

@ -67,6 +67,8 @@ crush/CrushWrapper_wrap.cxx
/psim
/sample.fetch_config
Makefile
/gtest/build-aux/config.h
/gtest/build-aux/config.h.in
/gtest/lib/