summaryrefslogtreecommitdiff
path: root/source4/torture/local
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r5298: - got rid of pstring.h from includes.h. This at least makes it a bitAndrew Tridgell1-0/+1
less likely that anyone will use pstring for new code - got rid of winbind_client.h from includes.h. This one triggered a huge change, as winbind_client.h was including system/filesys.h and defining the old uint32 and uint16 types, as well as its own pstring and fstring. (This used to be commit 9db6c79e902ec538108d6b7d3324039aabe1704f)
2007-10-10r5197: moved events code to lib/events/ (suggestion from metze)Andrew Tridgell1-1/+1
(This used to be commit 7f54c8a339f36aa43c9340be70ab7f0067593ef2)
2007-10-10r5185: make all the events data structures private to events.c. This willAndrew Tridgell1-1/+2
make it possible to add optimisations to the events code such as keeping the next timed event in a sorted list, and using epoll for file descriptor events. I also removed the loop events code, as it wasn't being used anywhere, and changed timed events to always be one-shot (as adding a new timed event in the event handler is so easy to do if needed) (This used to be commit d7b4b6de51342a65bf46fce772d313f92f8d73d3)
2007-10-10r5102: This is a major simplification of the logic for controlling top levelAndrew Tridgell1-3/+3
servers in smbd. The old code still contained a fairly bit of legacy from the time when smbd was only handling SMB connection. The new code gets rid of all of the smb_server specific code in smbd/, and creates a much simpler infrastructures for new server code. Major changes include: - simplified the process model code a lot. - got rid of the top level server and service structures completely. The top level context is now the event_context. This got rid of service.h and server.h completely (they were the most confusing parts of the old code) - added service_stream.[ch] for the helper functions that are specific to stream type services (services that handle streams, and use a logically separate process per connection) - got rid of the builtin idle_handler code in the service logic, as none of the servers were using it, and it can easily be handled by a server in future by adding its own timed_event to the event context. - fixed some major memory leaks in the rpc server code. - added registration of servers, rather than hard coding our list of possible servers. This allows for servers as modules in the future. - temporarily disabled the winbind code until I add the helper functions for that type of server - added error checking on service startup. If a configured server fails to startup then smbd doesn't startup. - cleaned up the command line handling in smbd, removing unused options (This used to be commit cf6a46c3cbde7b1eb1b86bd3882b953a2de3a42e)
2007-10-10r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for theAndrew Tridgell1-1/+1
large commit. I thought this was worthwhile to get done for consistency. (This used to be commit ec32b22ed5ec224f6324f5e069d15e92e38e15c0)
2007-10-10r4832: added simple testing of tcp sockets to LOCAL-SOCKET testAndrew Tridgell1-0/+108
(This used to be commit c06b25c269fb34601e931079ff5658f6e19956bc)
2007-10-10r4831: added udp support to our generic sockets library.Andrew Tridgell1-0/+134
I decided to incorporate the udp support into the socket_ipv4.c backend (and later in socket_ipv6.c) rather than doing a separate backend, as so much of the code is shareable. Basically this adds a socket_sendto() and a socket_recvfrom() call and not much all. For udp servers, I decided to keep the call as socket_listen(), even though dgram servers don't actually call listen(). This keeps the API consistent. I also added a simple local sockets testsuite in smbtorture, LOCAL-SOCKET (This used to be commit 9f12a45a05c5c447fb4ec18c8dd28f70e90e32a5)
2007-10-10r4591: - converted the other _p talloc functions to not need _pAndrew Tridgell1-2/+2
- added #if TALLOC_DEPRECATED around the _p functions - fixes the code that broke from the above while doing this I fixed quite a number of places that were incorrectly using the non type-safe talloc functions to use the type safe ones. Some were even doing multiplies for array allocation, which is potentially unsafe. (This used to be commit 6e7754abd0c225527fb38363996a6e241b87b37e)
2007-10-10r4547: - added talloc_new(ctx) macro that is a neater form of the common ↵Andrew Tridgell1-1/+1
talloc(ctx, 0) call. - cleaned up some talloc usage in various files I'd like to get to the point that we have no calls to talloc(), at which point we will rename talloc_p() to talloc(), to encourage everyone to use the typesafe functions. (This used to be commit e6c81d7c9f8a6938947d3c1c8a971a0d6d50b67a)
2007-10-10r4473: - moved talloc into its own lib/talloc/ areaAndrew Tridgell1-724/+0
- added gcov flags to Makefile.talloc - expanded talloc testsuite to add a test for realloc with a child ptr - fixed a bug in talloc_realloc() with realloc of a ptr that has child ptrs (This used to be commit 98b5f73c1ba34d7576c5995069b485c1c5ede324)
2007-10-10r4466: rather than defining "STANDALONE" for building tdb, ldb and tallocAndrew Tridgell1-7/+6
outside the tree, instead defined _SAMBA_BUILD_ inside the Samba build. This makes it easier to pull code out of Samba for external use. (This used to be commit 09e98c8745cca7ccb1ad7134c0c09b8e4c0f4f06)
2007-10-10r4000: DATA_BLOB.data is uint8_t * not void * :-)Stefan Metzmacher1-1/+1
(thanks abartlet for telling me) metze (This used to be commit 2783bf393f6310f9d827538329d619dad5b02dd0)
2007-10-10r3967: fix compiler warningsStefan Metzmacher1-2/+2
metze (This used to be commit 3f2c3ce2f0d11ea9f3c058690e0bb14d590c714c)
2007-10-10r3749: don't consider it a failure if we fail to re-encode a codepoint aboveAndrew Tridgell1-19/+25
1M, or in the case of non-UTF charsets, above 256 (This used to be commit 02595c14ac44403dd193d084dea9b91a67554a94)
2007-10-10r3553: Allow talloc_reference to take a NULL pointer for the "ptr" argument.Andrew Bartlett1-1/+11
This allows potentially NULL pointers to be referenced, without an if () for every use. (previously, it would segfault). Update doco, and allow talloc_unlink to match. Andrew Bartlett (This used to be commit 59757c7f9d0e08e3acacfb3116f6205057d5b119)
2007-10-10r3507: - added deferred replies on sharing violation in pvfs open. TheAndrew Tridgell2-18/+21
deferred reply is short-circuited immediately when the file is closed by another user, allowing it to be opened by the waiting user. - added a sane set of timeval manipulation routines - converted all the events code and code that uses it to use struct timeval instead of time_t, which allows for microsecond resolution instead of 1 second resolution. This was needed for doing the pvfs deferred open code, and is why the patch is so big. (This used to be commit 0d51511d408d91eb5f68a35e980e0875299b1831)
2007-10-10r3447: more include/system/XXX.h include filesAndrew Tridgell1-0/+1
(This used to be commit 264ce9181089922547e8f6f67116f2d7277a5105)
2007-10-10r3446: created include/system/iconv.h and include/system/shmem.hAndrew Tridgell1-0/+1
(This used to be commit 70055fb1f499cd40e996e56c7ba9ef8d2267b421)
2007-10-10r3428: switched to using minimal includes for the auto-generated RPC code.Andrew Tridgell1-0/+1
The thing that finally convinced me that minimal includes was worth pursuing for rpc was a compiler (tcc) that failed to build Samba due to reaching internal limits of the size of include files. Also the fact that includes.h.gch was 16MB, which really seems excessive. This patch brings it back to 12M, which is still too large, but better. Note that this patch speeds up compile times for both the pch and non-pch case. This change also includes the addition iof a "depends()" option in our IDL files, allowing you to specify that one IDL file depends on another. This capability was needed for the auto-includes generation. (This used to be commit b8f5fa8ac8e8725f3d321004f0aedf4246fc6b49)
2007-10-10r3324: made the smbtorture code completely warning freeAndrew Tridgell5-7/+7
(This used to be commit 7067bb9b52223cafa28470f264f0b60646a07a01)
2007-10-10r3271: use "struct messaging_context *" instead of "void *" in messaging APIAndrew Tridgell1-6/+6
(This used to be commit cc93813e4a09c538ad485dc2b3cb4c9be34f3d18)
2007-10-10r3167: Add a member 'endpoint' to the dcerpc_binding struct to use instead ofJelmer Vernooij1-3/+1
options[0]. (This used to be commit 18582083af800abd3d8de40eb73255c8ae6598dd)
2007-10-10r3157: Add ncacn_httpJelmer Vernooij1-0/+6
(This used to be commit a0c4138edf919ee0c4b236f201c09fc4deb2cc09)
2007-10-10r3156: Couple of fixes in the conversion functions between binding structs andJelmer Vernooij1-1/+4
protocol towers (This used to be commit f41dfc6c5a85bf241e4bcc0669f6191bf531e89a)
2007-10-10r3136: - Allow specifying socket type when adding smbd serviceJelmer Vernooij1-2/+2
- Make sure a epm_tower struct is completely initialized - Some more minor fixes (This used to be commit d560dcbdb85cb2c6915bdb9e2f82f1872b0f5a52)
2007-10-10r3130: - added a LOCAL-IDTREE test suiteAndrew Tridgell1-0/+100
- made idtree return a "struct idr_context *" instead of a void* - more efficient idr_remove for ids that are not present (patch from Jim Houston) (This used to be commit f8d12d4b4ae5a38de7869deb782cb8f48504844c)
2007-10-10r3125: Store object UUID directly instead of using a pointer (struct ↵Jelmer Vernooij1-0/+10
dcerpc_binding) Let test fail if messaging_init() fails instead of generating segfault in the LOCAL-MESSAGING test (This used to be commit 0609f410ef756501d50c04b544387ae547fcd63c)
2007-10-10r3124: Add dcerpc_binding_from_tower()Jelmer Vernooij1-17/+59
Add tests for dcerpc_binding_from_tower() (This used to be commit 88c6d34bba1a409127b26f86bd963bfab30a804c)
2007-10-10r3123: Add dcerpc_binding_build_tower()Jelmer Vernooij1-0/+81
Add local test for testing the functions dcerpc_parse_binding(), dcerpc_binding_string() and dcerpc_binding_build_tower() (This used to be commit 7a07c2c769b8e51178789eed4a31577f5d39f63a)
2007-10-10r3026: - added automatic retry to messages when the servers listen queue isAndrew Tridgell1-8/+11
full. This means callers can just "send and forget" rather than having to check for a temporary failure. The mechanism takes nice advantage of the timed events handling is our events code. A message will only fail now if we completely run out of some resource (such as memory). - changed the test code not to do retries itself, but only to warn on real failures (This used to be commit 8cddc610a25e64c1ad39dd6a2fc2e7f467e04fc9)
2007-10-10r3023: added immediate send of messages when they are first queued. This ↵Andrew Tridgell1-6/+1
makes things a bit more efficient (This used to be commit 8380225d326e4bfb3f15fddc72c097870713132a)
2007-10-10r3021: under heavy load the listen queue for messaging unix domain socket ↵Andrew Tridgell1-12/+24
can fill up, leading to refused connections. The caller needs to retry. This adds testing of the retry in LOCAL-MESSAGING (This used to be commit 2c568d4dc20303061a89c815b9a9a0bafc283633)
2007-10-10r3019: make the LOCAL-MESSAGING test a 2 process testAndrew Tridgell1-13/+47
(This used to be commit 68890247c1247f5f9e299ac1f579052cd022e79f)
2007-10-10r3016: - converted the events code to tallocAndrew Tridgell1-0/+92
- added the new messaging system, based on unix domain sockets. It gets over 10k messages/second on my laptop without any socket cacheing, which is better than I expected. - added a LOCAL-MESSAGING torture test (This used to be commit 3af06478da7ab34a272226d8d9ac87e0a4940cfb)
2007-10-10r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots ↵Andrew Tridgell1-5/+49
of associated functions. The motivation for this change was to avoid having to convert to/from ucs2 strings for so many operations. Doing that was slow, used many static buffers, and was also incorrect as it didn't cope properly with unicode codepoints above 65536 (which could not be represented correctly as smb_ucs2_t chars) The two core functions that allowed this change are next_codepoint() and push_codepoint(). These functions allow you to correctly walk a arbitrary multi-byte string a character at a time without converting the whole string to ucs2. While doing this cleanup I also fixed several ucs2 string handling bugs. See the commit for details. The following code (which counts the number of occuraces of 'c' in a string) shows how to use the new interface: size_t count_chars(const char *s, char c) { size_t count = 0; while (*s) { size_t size; codepoint_t c2 = next_codepoint(s, &size); if (c2 == c) count++; s += size; } return count; } (This used to be commit 814881f0e50019196b3aa9fbe4aeadbb98172040)
2007-10-10r2799: removed one last occurance of torture_ldb_alloc()Andrew Tridgell1-3/+3
(This used to be commit 5045482b14dfcbb535eab3e5fa63ef1c3b46c40f)
2007-10-10r2791: got rid of talloc_unreference() and instead created talloc_unlink(),Andrew Tridgell1-21/+109
which is much clearer and simpler to use. It removes a specific parent from a pointer, no matter whether that parent is a "reference" or a direct parent. This gives complete control over the free process. (This used to be commit 6c563887f1b9b8c842309a523e88b6f2a32db10f)
2007-10-10r2744: ben elliston taught me about gcov today, which allows you to measureAndrew Tridgell1-20/+300
the % coverage in terms of lines of code of a test suite. I thought a good first place to start with gcov was the talloc test suite. When I started the test suite covered about 60% of all lines of code in talloc.c, and now it covers about 99%. The only lines not covered are talloc corruption errors, as that would cause smb_panic() to fire. It will be interesting to try gcov on the main Samba test suite for smbd. We won't achieve 100% coverage, but it would be nice to get to 90% or more. I also modified the talloc.c sources to be able to be build standalone, using: gcc -c -D_STANDALONE_ -Iinlcude lib/talloc.c that should make it much easier to re-use talloc in other projects (This used to be commit 8d4dc99b82efdf24b6811851c7bdd4af5a4c52c9)
2007-10-10r2742: - fixed a bug in talloc_unreference()Andrew Tridgell1-41/+113
- made the LOCAL-TALLOC smbtorture test much stricter, checking that block counts for every pointer are correct after every operation (This used to be commit 18d3e2647f0bedbba699d1ba2649c0cfe4526ef6)
2007-10-10r2718: - added a talloc_unreference() function as requested by metze.Andrew Tridgell1-17/+121
- added documentation for talloc_unreference() - made the abandoned child logic in talloc_free() clearer and more consistent (This used to be commit a87584c8e3fb06cd3ff29a918f681b5c6c32b9ff)
2007-10-10r2711: added a simple talloc speed tester. I get the following on my laptop:Andrew Tridgell1-0/+55
MEASURING TALLOC VS MALLOC SPEED talloc: 279154 ops/sec malloc: 318758 ops/sec which I think is an acceptable overhead for the increased functionality (This used to be commit 91669ea830c16db2730c5e43a7cad26d9db5c585)
2007-10-10r2709: finally solved the talloc reference problem.Andrew Tridgell1-0/+115
The problem was that the simple "uint_t ref_count;" in a talloc chunk did not give enough information. It told us that a pointer was referenced more than once, but it didn't say who it was referenced by. This means that when the pointer was freed we had no sane way to clean up the reference. I have now replaced ref_count with a "refs" list, which means that references point to the pointer, and the pointer has a linked list of references. So now we can cleanup from either direction without losing track of anything. I've also added a LOCAL-TALLOC smbtorture test that tests talloc behaviour for some common uses. (This used to be commit 911a8d590cb184bcb892810729955c2c4cf02550)
2007-10-10r2170: if we don't have a native iconv library then we can't build this testAndrew Tridgell1-1/+10
(This used to be commit 5cf9333f6021479d62cc99475f4fb9a19588f928)
2007-10-10r2165: generalise the charset torture test to add testing of CP850Andrew Tridgell1-30/+39
potentially we can test any charset (This used to be commit e754d0cbcab7cb5a65322e5bbbd1d2a8bcdf5375)
2007-10-10r2159: converted samba4 over to UTF-16.Andrew Tridgell1-0/+298
I had previously thought this was unnecessary, as windows doesn't use standards compliant UTF-16, and for filesystem operations treats bytes as UCS-2, but Bjoern Jacke has pointed out to me that this means we don't correctly store extended UTF-16 characters as UTF-8 on disk. This can be seen with (for example) the gothic characters with codepoints above 64k. This commit also adds a LOCAL-ICONV torture test that tests the first 1 million codepoints against the system iconv library, and tests 5 million random UTF-16LE buffers for identical error handling to the system iconv library. the lib/iconv.c changes need backporting to samba3 (This used to be commit 756f28ac95feaa84b42402723d5f7286865c78db)