@@ -29,7 +29,7 @@ def initialize(info={})
29
29
register_options (
30
30
[
31
31
OptString . new ( "QSERVICE" , [ true , "Service (keyname) to query" , "winmgmt" ] ) ,
32
- OptString . new ( "NSERVICE" , [ true , "New Service (keyname) to create/del" , "testes " ] ) ,
32
+ OptString . new ( "NSERVICE" , [ true , "New Service (keyname) to create/del" , "test " ] ) ,
33
33
OptString . new ( "SSERVICE" , [ true , "Service (keyname) to start/stop" , "W32Time" ] ) ,
34
34
OptString . new ( "DNAME" , [ true , "Display name used for create test" , "Cool display name" ] ) ,
35
35
OptString . new ( "BINPATH" , [ true , "Binary path for create test" , "C:\\ WINDOWS\\ system32\\ svchost.exe -k netsvcs" ] ) ,
@@ -69,7 +69,18 @@ def test_list
69
69
70
70
ret &&= results . kind_of? Array
71
71
ret &&= results . length > 0
72
- ret &&= results . include? datastore [ "QSERVICE" ]
72
+
73
+ # Adjust the QSERVICE to match the case of the service name. This is used
74
+ # later in test_info, which is case-sensitive.
75
+ found = false
76
+ results . each do |service |
77
+ if service . downcase == datastore [ "QSERVICE" ] . downcase
78
+ datastore [ "QSERVICE" ] = service . to_s
79
+ found = true
80
+ break
81
+ end
82
+ end
83
+ ret &&= found
73
84
74
85
ret
75
86
end
@@ -83,7 +94,8 @@ def test_info
83
94
ret &&= results . kind_of? Hash
84
95
if ret
85
96
ret &&= results . has_key? "Name"
86
- ret &&= ( results [ "Name" ] == "Windows Management Instrumentation" )
97
+ ret &&= ( [ results [ "Name" ] ] &
98
+ [ "Windows Management Instrumentation" , "@%Systemroot%\\ system32\\ wbem\\ \w misvc.dll,-205" ] ) . any?
87
99
ret &&= results . has_key? "Startup"
88
100
ret &&= results . has_key? "Command"
89
101
ret &&= results . has_key? "Credentials"
0 commit comments