summaryrefslogtreecommitdiff
path: root/testapp.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix function protypes for clang errorsKhem Raj2022-10-131-1/+1
| | | | | | | | | | | clang-15+ has started diagnosing them as errors thread.c:925:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] | void STATS_UNLOCK() { | ^ | void Signed-off-by: Khem Raj <raj.khem@gmail.com>
* Fix FTBFS with GCC 12 on ppc64elSergio Durigan Junior2022-07-241-1/+1
| | | | | | | GCC 12 on ppc64el complains about "key" being undefined on testapp.c. This commit silences the error. Signed-off-by: Sergio Durigan Junior <sergiodj@sergiodj.net>
* Fix a memory leak in cache_limit_revised_downward_testRaphael Isemann2022-07-031-0/+2
|
* Fix full unit test suite under test_tlsKevin Lin2021-11-231-1/+1
| | | | | This allows `make test_tls` to reliably pass when running without parallelism.
* core: cache.c cleanups, use queue.h freelistdormando2021-08-091-70/+5
| | | | | | | | | cache constructors/destructors were never used, which just ended up being wasted branches. Since there's no constructor/destructor for cache objects, we can use the memory itself for the freelist. This removes a doubling realloc for the freelist of cache objects and simplifies the code a bunch.
* Fix typos in doc/code comments (tem->item, etc)Tyson Andre2021-08-051-1/+1
| | | | | Note: Do not fix typos in crc32.c because it's copied from an upstream source
* arm64: Re-add arm crc32c hw accelerationAli Saidi2020-10-271-0/+32
| | | | | | Use the .arch_extension directive so that a config options and special cflags aren't required. Add a few tests for both the software and hardware implementations
* testapp: check if memory is allocatedKleber2020-10-271-0/+18
|
* Fix over-freeing in internal object cachebitground2020-10-261-0/+29
| | | | | | When returning item to the cache and the items allocated exceeded cache->limit, we should free the item and not put it to the cache. The current code will free any item that tried returned to the cache when cache->total < cache->limit which is true in most cases if the total objects has never exceeded the limit.
* fixing the basic tls test so it exits correctly when failsTharanga Gamaethige2020-07-011-3/+10
|
* testapp: Fix failure with -flto=autoKanak Kshetri2020-04-091-6/+5
|
* stats_prefix: fix test failure due to non-determinismKanak Kshetri2020-02-151-13/+12
| | | | | | | | If you have multiple keys, the order in which they are dumped is non-deterministic because it involves iterating over a hash table. Fix the assertions by searching for expected lines in output instead of checking that the strings are exactly the same.
* unit tests couple of memory leak fixes proposals.David Carlier2020-02-011-8/+20
|
* stats: Rename stats.c to stats_prefix.cKanak Kshetri2020-01-131-1/+1
|
* stats: Move unit tests to testapp.cKanak Kshetri2020-01-131-0/+154
| | | | | | | | * Remove bespoke testing system in favor of testapp.c * Change stats_prefix_init function to take prefix delimiter. Otherwise, we would have to include memcached.h in testapp.c to get the settings struct, which in turn would cause a conflicting definition of the conn struct.
* add error handling when calling dup functionminkikim892019-08-271-0/+1
|
* memory leak and possible ptr dereferenceDavid Carlier2019-08-271-0/+12
|
* Fix small memory leak in testapp.c.David Carlier2019-05-201-0/+1
| | | | Only affects unit test application.
* Basic implementation of TLS for memcached.1.5.13Tharanga Gamaethige2019-04-151-37/+167
| | | | | | | | | | | | | Most of the work done by Tharanga. Some commits squashed in by dormando. Also reviewed by dormando. Tested, working, but experimental implementation of TLS for memcached. Enable with ./configure --enable-tls Requires OpenSSL 1.1.0 or better. See `memcached -h` output for usage.
* Add drop_privileges() for LinuxStanisław Pitucha2017-08-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement an aggressive version of drop_privileges(). Additionally add similar initialization function for threads drop_worker_privileges(). This version is similar to Solaris one and prohibits memcached from making any not approved syscalls. Current list narrows down the allowed calls to socket sends/recvs, accept, epoll handling, futex (and dependencies - mmap), getrusage (for stats), and signal / exit handling. Any incorrect behaviour will result in EACCES returned. This should be restricted further to KILL in the future (after more testing). The feature is only tested for i386 and x86_64. It depends on bpf filters and seccomp enabled in the kernel. It also requires libsecomp for abstraction to seccomp filters. All are available since Linux 3.5. Seccomp filtering can be enabled at compile time with --enable-seccomp. In case of local customisations which require more rights, memcached allows disabling drop_privileges() with "-o no_drop_privileges" at startup. Tests have to run with "-o relaxed_privileges", since they require disk access after the tests complete. This adds a few allowed syscalls, but does not disable the protection system completely.
* Spelling fixesJosh Soref2017-05-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * accesses * amount * append * command * cyrillic * daemonize * detaches * detail * documentation * dynamically * enabled * existence * extra * implementations * incoming * increment * initialize * issue * javascript * number * optimization * overall * pipeline * reassign * reclaimed * response * responses * sigabrt * specific * specificity * tidiness
* gatkq: return key in responseOskari Saarenmaa2014-12-311-13/+71
| | | | | | | | | GATKQ was incorrectly mapped to GAT instead of GATK in binary protocol handling and thus didn't return a key in the response. Fixed that and added test cases for GAT, GATQ, GATK and GATKQ in testapp. Noticed this while testing a new memcahe client library, OMcache: https://github.com/saaros/omcache/
* fix for "variable length array folded to constant array as an extension" errorWing Lian2013-12-091-1/+1
|
* This adds the "shutdown" command to the server. This allows for betterBrian Aker2012-10-171-1/+26
| | | | automation (at least,... I find that it makes for better automation).
* Avoid race condition in test by re-tryingClint Byrum2012-07-271-3/+7
| | | | | (ed note: yes it doesn't check for a NULL and die after 20 times. this should mitigate until we can do better with writing the pidfile)
* Add binary GATK/GATKQdormando2011-09-271-2/+5
| | | | | | | | Apparently nothing tests GETK/GETKQ, so tests still have to be added. 1.6 doesn't have GATK/GATKQ because the membase folks didn't need it. I'm adding them for completeness and because I don't want to argue about why people can't have it. If you're reading this, please use opaques :)
* Backport binary TOUCH/GAT/GATQ commandsdormando2011-09-271-0/+34
| | | | | Taken from the 1.6 branch, partly written by Trond. I hope the CAS handling is correct.
* Issue 221: Increment treats leading spaces as 0Trond Norbye2011-09-031-0/+4
|
* Issue 161 incorrect allocation in cache_createTrond Norbye2010-11-101-0/+34
|
* Remove compile warnings on openBSDTrond Norbye2009-12-301-6/+9
|
* Allow semi-broken C99 compilers to compile memcachedTrond Norbye2009-11-041-3/+1
| | | | | | | | | Some C compilers understand the syntax we use in memcached, but do not ship stdbool.h or stdint.h. According to C99 inttypes.h contains the formatting macros we use (PRInn) and is supposed to include stdint.h. This patch tries to detect stdbool.h and inttypes.h and tries to include them from config.h
* Extend test-case for 102 to verify that large multigets work1.4.3-rc2Trond Norbye2009-11-021-0/+31
|
* Enable test for bug101 to be skipped.Dustin Sallings2009-10-301-0/+4
| | | | | | | | This can potentially use a lot of memory on a host and some of the build slaves don't like that too much. It will run everywhere by default, but may be disabled by setting the SKIP_TEST_101 environment variable.
* Use non-blocking connect_server in test.Dustin Sallings2009-10-281-8/+2
|
* Issue 101: Not reading server responses will hang the serverTrond Norbye2009-10-281-0/+74
|
* Issue 102: Piping null to the server will crash itTrond Norbye2009-10-281-0/+17
|
* Add a parameter to connect_server to get a nonblocking connectionTrond Norbye2009-10-281-5/+14
|
* SASL auth support.Dustin Sallings2009-10-251-1/+5
|
* Removed issue_72 C test (emits invalid key).Dustin Sallings2009-10-071-30/+0
| | | | | This issue has coverage in the perl codebase, but relies on keys larger than 250 bytes long working.
* Issue 92: stats cachedump should respond CLIENT_ERROR for illegal slab idsTrond Norbye2009-09-221-0/+66
|
* binary set with cas does not return the new cas idTrond Norbye2009-09-021-0/+11
| | | | | (dustin) I updated the perl test to check for this when it's doing CAS stuff. Found some bugs in the perl test that took too long to fix.
* Add more tests on the binary protocolTrond Norbye2009-09-021-6/+1163
|
* Deal with C tests running as root.Dustin Sallings2009-08-291-0/+5
|
* Issue #77: Bug in the realloc code caused the previous allocated buffer to ↵Trond Norbye2009-08-221-0/+5
| | | | be reused...
* Remove compilation errors from gcc on SolarisTrond Norbye2009-08-221-2/+2
|
* vperror implementationDustin Sallings2009-08-191-0/+47
| | | | | This allows us to provide much more useful error messages for syscalls.
* Put a time limit on memcached processes started from within tests.Dustin Sallings2009-08-141-2/+7
| | | | | This solves the problem where certain test failures would cause indefinite hangs as child processes refused to ever exit.
* Fix for issue 72: 1.4.0 binary multi-get crash issueTrond Norbye2009-08-141-0/+80
| | | | | | | | | | | | | Repack the input buffer if the current command and key doesn't fit in the input buffer (may occur if we read multiple commands in a pipeline) (Dustin's note): The original test was connecting to "localhost" which was resolving to ::1 on a few machines. With the ephemeral port binding, IPv4 and IPv6 were getting different ports, and the code was explicitly looking for the IPv4 port, but implicitly connecting to ::1. Now it explicitly connects to 127.0.0.1 over IPv4.
* The C test should emit TAP.Dustin Sallings2009-08-131-14/+10
|
* Allow memcached to bind to an ephemeral portTrond Norbye2009-08-131-16/+95
| | | | | | | | | | | | | | | To ease testing you can pass -p -1 to memcached and it will create and bind to an ephemeral port. If you set the environment variable MEMCACHED_PORT_FILENAME to a filename memcached will write the port numbers to the file in the following format: TCP INET6: 5555 TCP INET: 5555 UDP INET6: 6666 UDP INET: 6666 testapp can now just tell the server to start and don't try to locate a random port for it to use, but instead read the file and connect on the port.