StackExchange / wmi

WMI for Go
http://godoc.org/github.com/StackExchange/wmi
MIT License
434 stars 173 forks source link

tests doesn't run on Windows XP #10

Closed bbigras closed 8 years ago

bbigras commented 9 years ago
--- FAIL: TestQuery (0.08s)
    wmi_test.go:21: Unknown name.
--- FAIL: TestFieldMismatch (0.03s)
    wmi_test.go:34: Expected err field mismatch
Disabling GC
--- FAIL: TestStrings (0.07s)
    wmi_test.go:47: Unknown name. SELECT CSCreationClassName, CSName, Caption, CommandLine, CreationClassName, CreationDate, Description, ExecutablePath, ExecutionState, Handle, HandleCount, InstallDate, KernelModeTime, MaximumWorkingSetSize, MinimumWorkingSetSize, Name, OSCreationClassName, OSName, OtherOperationCount, OtherTransferCount, PageFaults, PageFileUsage, ParentProcessId, PeakPageFileUsage, PeakVirtualSize, PeakWorkingSetSize, Priority, PrivatePageCount, ProcessId, QuotaNonPagedPoolUsage, QuotaPagedPoolUsage, QuotaPeakNonPagedPoolUsage, QuotaPeakPagedPoolUsage, ReadOperationCount, ReadTransferCount, SessionId, Status, TerminationDate, ThreadCount, UserModeTime, VirtualSize, WindowsVersion, WorkingSetSize, WriteOperationCount, WriteTransferCount FROM Win32_Process 
--- FAIL: TestNamespace (0.04s)
    wmi_test.go:87: Unknown name.
FAIL
exit status 1
FAIL    github.com/StackExchange/wmi    0.351s

Windows XP go version go1.4.2 windows/386

The tests works on Windows 7 64-bit.

maddyblue commented 9 years ago

Repro'd here. Will possibly fix soon.

bbigras commented 9 years ago

:+1:

maddyblue commented 9 years ago

See: https://github.com/golang/go/issues/8293#issuecomment-66096515

This is occurring because ItemIndex doesn't exist on SWbemObjectSet in Windows XP. The comment above recommends using _NewEnum. I do not know if I can work on this soon. But maybe it's enough to point someone in the right direction.

ahall commented 9 years ago

I just had the same problem on Windows 2003 :). Be great if we could fix this.

Durgababu commented 8 years ago

Hi ,

Is this fixed or not? it is not working for me on windows XP and windows 2003 because of "ItemIndex". can you help me on this?

mjibson, Are you working on this?

ahall commented 8 years ago

Should run now?

bbigras commented 8 years ago

Since it wasn't clear if it was fixed or not I tested again and it seems fine.

Y:\go\src\github.com\StackExchange\wmi>go test
Disabling GC
iter 0 zeros: 0
iter 1 zeros: 0
iter 2 zeros: 0
iter 3 zeros: 0
iter 4 zeros: 0
Enabling GC
iter 0 zeros: 0
iter 1 zeros: 0
iter 2 zeros: 0
iter 3 zeros: 0
iter 4 zeros: 0
PASS
ok      github.com/StackExchange/wmi    1.512s

go version go1.6.3 windows/386