Skip to contentSkip to conversation

Add a test for hstor_keys

PATCH In review Pete Zaitcev 2 participants 2 messages Sep 28, 2010

lore
Share & tools
lore
#0 lore raw

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
index 9264cba..cc4e6fe 100644
@@ -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

#1 lore raw
Quoted 7 lines · Pete Zaitcev

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.

Quoted 6 lines
---
  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.