summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-03-10 00:43:57 +0100
committerGünther Deschner <gd@samba.org>2010-03-10 00:46:23 +0100
commitae79d8ce02921e9a5c82433527909c7f707051e3 (patch)
tree4a82a546b569e0d0723c80b7fef3be5a4edf3358 /source4/torture
parent722daf43d0ef3a7951d8ee6b4aea97fd3e056719 (diff)
downloadsamba-ae79d8ce02921e9a5c82433527909c7f707051e3.tar.gz
samba-ae79d8ce02921e9a5c82433527909c7f707051e3.tar.bz2
samba-ae79d8ce02921e9a5c82433527909c7f707051e3.zip
s4-smbtorture: on HKLM hive test the well known CurrentVersion value.
Guenther
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/winreg.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index 9bcd0e414f..e4de39ebb7 100644
--- a/source4/torture/rpc/winreg.c
+++ b/source4/torture/rpc/winreg.c
@@ -1929,6 +1929,9 @@ static bool test_Open_Security(struct torture_context *tctx,
return ret;
}
+#define KEY_CURRENT_VERSION "SOFTWARE\\MICROSOFT\\WINDOWS NT\\CURRENTVERSION"
+#define VALUE_CURRENT_VERSION "CurrentVersion"
+
static bool test_Open(struct torture_context *tctx, struct dcerpc_pipe *p,
void *userdata)
{
@@ -1947,6 +1950,20 @@ static bool test_Open(struct torture_context *tctx, struct dcerpc_pipe *p,
torture_assert_ntstatus_ok(tctx, open_fn(p, tctx, &r),
"open");
+ if (open_fn == (void *)dcerpc_winreg_OpenHKLM) {
+#if 0
+ torture_assert(tctx, test_OpenKey(p, tctx, &handle, KEY_CURRENT_VERSION, &newhandle),
+ "failed to open current version key");
+#else
+ torture_assert(tctx, _test_OpenKey(p, tctx, &handle, KEY_CURRENT_VERSION, KEY_QUERY_VALUE, &newhandle, WERR_OK, NULL),
+ "failed to open current version key");
+#endif
+ torture_assert(tctx, test_QueryValue_full(p, tctx, &newhandle, VALUE_CURRENT_VERSION, true),
+ "failed to query current version");
+ torture_assert(tctx, test_CloseKey(p, tctx, &newhandle),
+ "failed to close current version key");
+ }
+
test_Cleanup(p, tctx, &handle, TEST_KEY_BASE);
if (!test_CreateKey(p, tctx, &handle, TEST_KEY_BASE, NULL)) {