The branch, master has been updated
       via  714c926... s4-smbtorture: add test for different winreg SetValue 
value names.
      from  ff5ace2... s4:selftest Fix up netbios names for rpc_echo test

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 714c926cf04c837902fdcfa097c51429f31ee581
Author: Günther Deschner <[email protected]>
Date:   Wed Jun 23 12:09:35 2010 +0200

    s4-smbtorture: add test for different winreg SetValue value names.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source4/torture/rpc/winreg.c |   51 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index 67afce2..eec8de7 100644
--- a/source4/torture/rpc/winreg.c
+++ b/source4/torture/rpc/winreg.c
@@ -2003,6 +2003,55 @@ static bool test_SetValue_simple(struct 
dcerpc_binding_handle *b,
        return true;
 }
 
+static bool test_SetValue_values(struct dcerpc_binding_handle *b,
+                                struct torture_context *tctx,
+                                struct policy_handle *handle)
+{
+       DATA_BLOB blob;
+       const char *values[] = {
+               "torture_value",
+               "torture value",
+               "torture,value",
+               "torture;value",
+               "torture/value",
+               "torture\\value"
+       };
+       int i;
+
+       torture_comment(tctx, "Testing SetValue (values)\n");
+
+       for (i=0; i < ARRAY_SIZE(values); i++) {
+
+               enum winreg_Type w_type;
+               uint32_t w_size, w_length;
+               uint8_t *w_data;
+
+               blob = data_blob_string_const("binary_blob");
+
+               torture_assert(tctx,
+                       test_SetValue(b, tctx, handle, values[i], REG_BINARY, 
blob.data, blob.length),
+                       "test_SetValue failed");
+               torture_assert(tctx,
+                       test_QueryValue_full(b, tctx, handle, values[i], true),
+                       talloc_asprintf(tctx, "test_QueryValue_full for %s 
value failed", values[i]));
+               torture_assert(tctx,
+                       test_winreg_QueryValue(tctx, b, handle, values[i], 
&w_type, &w_size, &w_length, &w_data),
+                       "test_winreg_QueryValue failed");
+               torture_assert(tctx,
+                       test_DeleteValue(b, tctx, handle, values[i]),
+                       "test_DeleteValue failed");
+
+               torture_assert_int_equal(tctx, w_type, REG_BINARY, "winreg type 
mismatch");
+               torture_assert_int_equal(tctx, w_size, blob.length, "winreg 
size mismatch");
+               torture_assert_int_equal(tctx, w_length, blob.length, "winreg 
length mismatch");
+               torture_assert_mem_equal(tctx, w_data, blob.data, blob.length, 
"winreg buffer mismatch");
+       }
+
+       torture_comment(tctx, "Testing SetValue (values) succeeded\n");
+
+       return true;
+}
+
 typedef NTSTATUS (*winreg_open_fn)(struct dcerpc_binding_handle *, TALLOC_CTX 
*, void *);
 
 static bool test_SetValue_extended(struct dcerpc_binding_handle *b,
@@ -2489,6 +2538,8 @@ static bool test_key_base(struct torture_context *tctx,
                if (hkey == HKEY_CURRENT_USER) {
                        torture_assert(tctx, test_SetValue_simple(b, tctx, 
&newhandle),
                                "simple SetValue test failed");
+                       torture_assert(tctx, test_SetValue_values(b, tctx, 
&newhandle),
+                               "values SetValue test failed");
                        torture_assert(tctx, test_SetValue_extended(b, tctx, 
&newhandle),
                                "extended SetValue test failed");
                } else {


-- 
Samba Shared Repository

Reply via email to