Add a test for hstor_keys
PATCH 1/1 Add a test for hstor_keys
Our current tests do not invoke hstor_keys at all, and so they did not catch a crash with double free in append_qparam.
Add a very basic test which at least calls hstor_keys to verify that it does not crash right away. This test does not excercise complex modes such as S3 paging, but better this than nothing.
--- test/Makefile.am | 4 + test/list-keys.c | 102 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-)
PASS: hdr-meta
tabled[6562]: client ::ffff:127.0.0.1 connected
chunkd[6560]: client host ::ffff:127.0.0.1 port 44394 connected
chunkd[6560]: client host ::ffff:127.0.0.1 port 44394 disconnected
*** glibc detected *** ./list-keys: double free or corruption (fasttop): 0x0000000000e93dc0 ***/bin/sh: line 5: 6609 Segmentation fault (core dumped) top_srcdir=.. ${dir}$tst
FAIL: list-keys
test/Makefile.am +3 -1
@@ -26,11 +26,12 @@ TESTS = \ large-object \ hdr-content-type \ hdr-meta \ + list-keys \ stop-daemon \ clean-db check_PROGRAMS = basic-bucket basic-object it-works large-object \ - hdr-content-type hdr-meta wait-for-listen + hdr-content-type hdr-meta list-keys wait-for-listen noinst_LIBRARIES = libtest.a
@@ -43,6 +44,7 @@ large_object_LDADD = $(TESTLDADD) hdr_content_type_LDADD = $(TESTLDADD) hdr_meta_LDADD = $(TESTLDADD) it_works_LDADD = $(TESTLDADD) +list_keys_LDADD = $(TESTLDADD) wait_for_listen_LDADD = libtest.a
test/list-keys.c new file +102 -0
102 lines not on this page · raw message
Quoted 7 lines · Pete Zaitcev
Our current tests do not invoke
hstor_keysat all, and so they did not catch a crash with double free inappend_qparam.Add a very basic test which at least calls
hstor_keysto verify that it does not crash right away. This test does not excercise complex modes such as S3 paging, but better this than nothing.
Quoted 6 lines
Signed-off-by Pete Zaitcev<[email protected]>--- test/Makefile.am | 4 + test/list-keys.c | 102 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-)
applied.. FYI you forgot to update test/.gitignore. Fixed.