Skip to content

Commit d992cf0

Browse files
authored
[KMTEST] Skip tests that bugcheck on Vista (reactos#8406)
- [kmtest_drv] Increase timeout period from 10 seconds to 30 seconds. This was needed on my machine because of log spam in the kmtest:IoDeviceInterface test. I also reduced the log spam in that test, making this not necessary. However, I left it in as I figured if I ran into this issue, others may too in the future with other tests. - [kmtest:ExFastMutex] Skip concurrent fast mutex tests on Vista+. It appears that this was also causing hangs on WS03 x64 so I moved the skip logic there and combined it with the vista+ skip. - [kmtest:IoDeviceInterface] Change some traces to DPRINTs since it was creating excessive log spam that slowed down the test enough to trigger the previous timeout. - [kmtest:KeEvent] Skip concurrent event tests on Vista+. - [kmtest:KeGuardedMutex] Skip on Vista+. - [kmtest:ObType] Disable making custom object types as this is invalid on Vista+. - [kmtest:PoIrp] Skip on Vista+ (already skipped on WS03 x64). - [kmtest:SeInheritance] Skip on Vista+.
1 parent 146624e commit d992cf0

File tree

9 files changed

+42
-25
lines changed

9 files changed

+42
-25
lines changed

modules/rostests/kmtests/kmtest_drv/kmtest_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static PDEVICE_OBJECT MainDeviceObject;
5858
PDRIVER_OBJECT KmtDriverObject = NULL;
5959
static KMT_USER_WORK_LIST WorkList;
6060
static ULONG RequestId = 0;
61-
static const LONGLONG TimeoutDuration = -10LL * (1000 * 1000 * 10); // 10 seconds
61+
static const LONGLONG TimeoutDuration = -30LL * (1000 * 1000 * 10); // 30 seconds
6262

6363
/* Entry */
6464
/**

modules/rostests/kmtests/ntos_ex/ExFastMutex.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,13 @@ TestFastMutexConcurrent(
255255
LARGE_INTEGER Timeout;
256256
Timeout.QuadPart = -50 * MILLISECOND;
257257

258+
#ifdef _M_AMD64
259+
if (skip(FALSE, "ROSTESTS-367: Skipping TestFastMutexConcurrent() because it hangs on Windows Server 2003 x64-Testbot.\n"))
260+
#else
261+
if (skip(GetNTVersion() < _WIN32_WINNT_VISTA, "TestFastMutexConcurrent() doesn't work on Vista+.\n"))
262+
#endif
263+
return;
264+
258265
InitThreadData(&ThreadData, Mutex, ExAcquireFastMutex, NULL, ExReleaseFastMutex);
259266
InitThreadData(&ThreadData2, Mutex, ExAcquireFastMutex, NULL, ExReleaseFastMutex);
260267
InitThreadData(&ThreadDataUnsafe, Mutex, ExAcquireFastMutexUnsafe, NULL, ExReleaseFastMutexUnsafe);
@@ -310,14 +317,6 @@ TestFastMutexConcurrent(
310317

311318
START_TEST(ExFastMutex)
312319
{
313-
#if defined(_M_AMD64)
314-
if (TRUE)
315-
{
316-
skip(FALSE, "ROSTESTS-367: Skipping kmtest:ExFastMutex because it hangs on Windows Server 2003 x64-Testbot.\n");
317-
return;
318-
}
319-
#endif
320-
321320
FAST_MUTEX Mutex;
322321
KIRQL Irql;
323322

modules/rostests/kmtests/ntos_io/IoDeviceInterface.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Test_IoOpenDeviceInterfaceRegistryKey(
7272
if (skip(NT_SUCCESS(Status), "IoOpenDeviceInterfaceRegistryKey() failed: 0x%lx\n", Status))
7373
return;
7474

75-
trace("IoOpenDeviceInterfaceRegistryKey() success: 0x%p\n", DeviceInterfaceKey);
75+
DPRINT("IoOpenDeviceInterfaceRegistryKey() success: 0x%p\n", DeviceInterfaceKey);
7676

7777
for (n = 0; n < RTL_NUMBER_OF(Types); ++n)
7878
{
@@ -96,7 +96,7 @@ Test_IoOpenDeviceInterfaceRegistryKey(
9696
if (skip(NT_SUCCESS(Status), "ZwCreateKey() failed to create a subkey: %d 0x%lx\n", n, Status))
9797
continue;
9898

99-
trace("ZwCreateKey(): successfully created subkey: %d 0x%p\n", n, DeviceInterfaceSubKey);
99+
DPRINT("ZwCreateKey(): successfully created subkey: %d 0x%p\n", n, DeviceInterfaceSubKey);
100100

101101
ZwDeleteKey(DeviceInterfaceSubKey);
102102
ZwClose(DeviceInterfaceSubKey);
@@ -123,7 +123,7 @@ Test_IoGetDeviceInterfaceAlias(
123123
if (skip(NT_SUCCESS(Status), "IoGetDeviceInterfaceAlias(): fail: %d 0x%x\n", n, Status))
124124
continue;
125125

126-
trace("IoGetDeviceInterfaceAlias(): success: %d %wZ\n", n, &AliasSymbolicLinkName);
126+
DPRINT("IoGetDeviceInterfaceAlias(): success: %d %wZ\n", n, &AliasSymbolicLinkName);
127127

128128
/* Test IoOpenDeviceInterfaceRegistryKey with alias symbolic link too */
129129
Test_IoOpenDeviceInterfaceRegistryKey(AliasSymbolicLinkName.Buffer);
@@ -149,7 +149,7 @@ Test_IoSetDeviceInterfaceState(
149149
if (skip(NT_SUCCESS(Status), "IoSetDeviceInterfaceState(): failed to enable interface: %d 0x%x\n", n, Status))
150150
continue;
151151

152-
trace("IoSetDeviceInterfaceState(): successfully enabled interface: %d %wZ\n", n, &SymbolicLinkName);
152+
DPRINT("IoSetDeviceInterfaceState(): successfully enabled interface: %d %wZ\n", n, &SymbolicLinkName);
153153
}
154154
}
155155

@@ -172,14 +172,14 @@ Test_IoGetDeviceInterfaces(
172172
return;
173173
}
174174

175-
trace("IoGetDeviceInterfaces '%wZ' results:\n", &GuidString);
175+
DPRINT("IoGetDeviceInterfaces '%wZ' results:\n", &GuidString);
176176
RtlFreeUnicodeString(&GuidString);
177177

178178
for (SymbolicLink = SymbolicLinkList;
179179
SymbolicLink[0] != UNICODE_NULL;
180180
SymbolicLink += wcslen(SymbolicLink) + 1)
181181
{
182-
trace("Symbolic Link: %S\n", SymbolicLink);
182+
DPRINT("Symbolic Link: %S\n", SymbolicLink);
183183
Test_IoGetDeviceInterfaceAlias(SymbolicLink);
184184
Test_IoOpenDeviceInterfaceRegistryKey(SymbolicLink);
185185
Test_IoSetDeviceInterfaceState(SymbolicLink);
@@ -209,7 +209,7 @@ NotificationCallback(
209209
ok_eq_uint(Notification->Size, sizeof(*Notification));
210210

211211
/* symbolic link must exist */
212-
trace("Interface change: %wZ\n", Notification->SymbolicLinkName);
212+
DPRINT("Interface change: %wZ\n", Notification->SymbolicLinkName);
213213
InitializeObjectAttributes(&ObjectAttributes,
214214
Notification->SymbolicLinkName,
215215
OBJ_KERNEL_HANDLE,

modules/rostests/kmtests/ntos_io/IoInterrupt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ TestSynchronizeExecution(VOID)
5656
KSPIN_LOCK ActualLock;
5757
BOOLEAN Ret;
5858

59+
if (skip(GetNTVersion() < _WIN32_WINNT_VISTA, "We can't create fake interrupts on Vista+.\n"))
60+
return;
61+
5962
RtlFillMemory(&Interrupt, sizeof Interrupt, 0x55);
6063
Interrupt.ActualLock = &ActualLock;
6164
KeInitializeSpinLock(Interrupt.ActualLock);

modules/rostests/kmtests/ntos_ke/KeEvent.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ TestEventConcurrent(
160160
LongTimeout.QuadPart = -100 * MILLISECOND;
161161
ShortTimeout.QuadPart = -1 * MILLISECOND;
162162

163+
if (skip(GetNTVersion() < _WIN32_WINNT_VISTA, "TestEventConcurrent() is broken on Vista+.\n"))
164+
return;
165+
163166
KeInitializeEvent(Event, Type, FALSE);
164167

165168
for (i = 0; i < ThreadCount; ++i)

modules/rostests/kmtests/ntos_ke/KeGuardedMutex.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,9 @@ START_TEST(KeGuardedMutex)
440440
return;
441441
}
442442

443+
if (skip(GetNTVersion() < _WIN32_WINNT_VISTA, "kmtest:KeGuardedMutex is broken on Vista+.\n"))
444+
return;
445+
443446
for (i = 0; i < sizeof TestIterations / sizeof TestIterations[0]; ++i)
444447
{
445448
trace("Run %d\n", i);

modules/rostests/kmtests/ntos_ob/ObType.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ QueryNameProc(
169169
}
170170

171171
static
172-
VOID
172+
NTSTATUS
173173
ObtCreateObjectTypes(VOID)
174174
{
175175
INT i;
@@ -183,6 +183,9 @@ ObtCreateObjectTypes(VOID)
183183
HANDLE ObjectTypeHandle;
184184
UNICODE_STRING ObjectPath;
185185

186+
if (skip(GetNTVersion() < _WIN32_WINNT_VISTA, "Custom object types are not supported on Vista+.\n"))
187+
return STATUS_NOT_SUPPORTED;
188+
186189
RtlCopyMemory(&Name.DirectoryName, L"\\ObjectTypes\\", sizeof Name.DirectoryName);
187190

188191
for (i = 0; i < NUM_OBTYPES; ++i)
@@ -244,6 +247,8 @@ ObtCreateObjectTypes(VOID)
244247
ok_eq_hex(Status, STATUS_SUCCESS);
245248
ok(ObTypes[i] != NULL, "ObType = NULL\n");
246249
}
250+
251+
return STATUS_SUCCESS;
247252
}
248253

249254
static
@@ -415,10 +420,12 @@ VOID
415420
TestObjectType(
416421
IN BOOLEAN Clean)
417422
{
423+
NTSTATUS Status;
424+
418425
RtlZeroMemory(&Counts, sizeof Counts);
419426

420-
ObtCreateObjectTypes();
421-
DPRINT("ObtCreateObjectTypes() done\n");
427+
Status = ObtCreateObjectTypes();
428+
DPRINT("ObtCreateObjectTypes() %s\n", NT_SUCCESS(Status) ? "succeeded" : "failed");
422429

423430
ObtCreateDirectory();
424431
DPRINT("ObtCreateDirectory() done\n");

modules/rostests/kmtests/ntos_po/PoIrp_user.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ START_TEST(PoIrp)
1212
{
1313
DWORD Error;
1414

15-
#if defined(_M_AMD64)
16-
if (TRUE)
17-
{
18-
skip(FALSE, "ROSTESTS-368: Skipping kmtest:PoIrp because it crashes on Windows Server 2003 x64-Testbot.\n");
19-
return;
20-
}
15+
#ifdef _M_AMD64
16+
if (skip(FALSE, "ROSTESTS-368: Skipping kmtest:PoIrp because it crashes on Windows Server 2003 x64-Testbot.\n"))
17+
#else
18+
if (skip(GetNTVersion() < _WIN32_WINNT_VISTA, "kmtest:PoIrp is broken on Vista+.\n"))
2119
#endif
20+
return;
2221

2322
Error = KmtLoadAndOpenDriver(L"PoIrp", TRUE);
2423
ok_eq_int(Error, ERROR_SUCCESS);

modules/rostests/kmtests/ntos_se/SeInheritance.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,6 +949,9 @@ START_TEST(SeInheritance)
949949
{
950950
PKTHREAD Thread;
951951

952+
if (skip(GetNTVersion() < _WIN32_WINNT_VISTA, "kmtest:SeInheritance is broken on Vista+.\n"))
953+
return;
954+
952955
TestObRootSecurity();
953956
Thread = KmtStartThread(SystemThread, NULL);
954957
KmtFinishThread(Thread, NULL);

0 commit comments

Comments
 (0)