win32-service 1.0.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/win32/daemon.rb +2 -1
- data/lib/win32/service.rb +145 -36
- data/lib/win32/windows/version.rb +1 -1
- metadata +50 -39
- data/CHANGELOG.md +0 -347
- data/Gemfile +0 -5
- data/MANIFEST +0 -24
- data/README.md +0 -75
- data/Rakefile +0 -83
- data/VERSION +0 -1
- data/appveyor.yml +0 -48
- data/doc/daemon.txt +0 -157
- data/doc/service.txt +0 -363
- data/examples/demo_daemon.rb +0 -96
- data/examples/demo_daemon_ctl.rb +0 -123
- data/examples/demo_services.rb +0 -30
- data/test/test_win32_daemon.rb +0 -58
- data/test/test_win32_service.rb +0 -468
- data/test/test_win32_service_configure.rb +0 -110
- data/test/test_win32_service_create.rb +0 -153
- data/test/test_win32_service_info.rb +0 -189
- data/test/test_win32_service_status.rb +0 -110
- data/win32-service.gemspec +0 -41
@@ -1,110 +0,0 @@
|
|
1
|
-
########################################################################
|
2
|
-
# test_win32_service_status.rb
|
3
|
-
#
|
4
|
-
# Test case for the Struct::ServiceStatus struct.
|
5
|
-
########################################################################
|
6
|
-
require 'test-unit'
|
7
|
-
require 'win32/service'
|
8
|
-
|
9
|
-
class TC_Win32_ServiceStatus_Struct < Test::Unit::TestCase
|
10
|
-
def setup
|
11
|
-
@service_name = 'Schedule'
|
12
|
-
@service_stat = Win32::Service.status(@service_name)
|
13
|
-
|
14
|
-
@types = [
|
15
|
-
'file system driver',
|
16
|
-
'kernel driver',
|
17
|
-
'own process',
|
18
|
-
'share process',
|
19
|
-
'recognizer token',
|
20
|
-
'driver',
|
21
|
-
'win32',
|
22
|
-
'all',
|
23
|
-
'own process, interactive',
|
24
|
-
'share process, interactive',
|
25
|
-
nil
|
26
|
-
]
|
27
|
-
|
28
|
-
@states = [
|
29
|
-
'continue pending',
|
30
|
-
'pause pending',
|
31
|
-
'paused',
|
32
|
-
'running',
|
33
|
-
'start pending',
|
34
|
-
'stop pending',
|
35
|
-
'stopped',
|
36
|
-
nil
|
37
|
-
]
|
38
|
-
|
39
|
-
@controls = [
|
40
|
-
'netbind change',
|
41
|
-
'param change',
|
42
|
-
'pause continue',
|
43
|
-
'shutdown',
|
44
|
-
'stop',
|
45
|
-
'hardware profile change',
|
46
|
-
'power event',
|
47
|
-
'session change'
|
48
|
-
]
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_service_status_service_type
|
52
|
-
assert_respond_to(@service_stat, :service_type)
|
53
|
-
assert(@types.include?(@service_stat.service_type))
|
54
|
-
end
|
55
|
-
|
56
|
-
def test_service_status_current_state
|
57
|
-
assert_respond_to(@service_stat, :current_state)
|
58
|
-
assert(@states.include?(@service_stat.current_state))
|
59
|
-
end
|
60
|
-
|
61
|
-
def test_service_status_controls_accepted
|
62
|
-
assert_respond_to(@service_stat, :controls_accepted)
|
63
|
-
assert_kind_of(Array, @service_stat.controls_accepted)
|
64
|
-
@service_stat.controls_accepted.each{ |control|
|
65
|
-
assert_true(@controls.include?(control))
|
66
|
-
}
|
67
|
-
end
|
68
|
-
|
69
|
-
def test_service_status_win32_exit_code
|
70
|
-
assert_respond_to(@service_stat, :win32_exit_code)
|
71
|
-
assert_kind_of(Fixnum, @service_stat.win32_exit_code)
|
72
|
-
end
|
73
|
-
|
74
|
-
def test_service_status_service_specific_exit_code
|
75
|
-
assert_respond_to(@service_stat, :service_specific_exit_code)
|
76
|
-
assert_kind_of(Fixnum, @service_stat.service_specific_exit_code)
|
77
|
-
end
|
78
|
-
|
79
|
-
def test_service_status_check_point
|
80
|
-
assert_respond_to(@service_stat, :check_point)
|
81
|
-
assert_kind_of(Fixnum, @service_stat.check_point)
|
82
|
-
end
|
83
|
-
|
84
|
-
def test_service_status_wait_hint
|
85
|
-
assert_respond_to(@service_stat, :wait_hint)
|
86
|
-
assert_kind_of(Fixnum, @service_stat.wait_hint)
|
87
|
-
end
|
88
|
-
|
89
|
-
def test_service_status_interactive
|
90
|
-
assert_respond_to(@service_stat, :interactive)
|
91
|
-
assert([true, false].include?(@service_stat.interactive))
|
92
|
-
end
|
93
|
-
|
94
|
-
def test_service_status_pid
|
95
|
-
assert_respond_to(@service_stat, :pid)
|
96
|
-
assert_kind_of(Fixnum, @service_stat.pid)
|
97
|
-
end
|
98
|
-
|
99
|
-
def test_service_status_service_flags
|
100
|
-
assert_respond_to(@service_stat, :service_flags)
|
101
|
-
assert_kind_of(Fixnum, @service_stat.service_flags)
|
102
|
-
end
|
103
|
-
|
104
|
-
def teardown
|
105
|
-
@service_stat = nil
|
106
|
-
@types = nil
|
107
|
-
@states = nil
|
108
|
-
@controls = nil
|
109
|
-
end
|
110
|
-
end
|
data/win32-service.gemspec
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
lib = File.expand_path("../lib", __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require "win32/windows/version"
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = 'win32-service'
|
8
|
-
spec.version = Win32::Service::VERSION
|
9
|
-
spec.authors = ['Daniel J. Berger', 'Park Heesob']
|
10
|
-
spec.license = 'Artistic 2.0'
|
11
|
-
spec.email = 'djberg96@gmail.com'
|
12
|
-
spec.homepage = 'http://github.com/chef/win32-service'
|
13
|
-
spec.summary = 'An interface for MS Windows services'
|
14
|
-
spec.test_files = Dir['test/test*.rb']
|
15
|
-
|
16
|
-
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
17
|
-
|
18
|
-
spec.extra_rdoc_files = [
|
19
|
-
'CHANGELOG.md',
|
20
|
-
'README.md',
|
21
|
-
'MANIFEST',
|
22
|
-
'doc/service.txt',
|
23
|
-
'doc/daemon.txt'
|
24
|
-
]
|
25
|
-
|
26
|
-
spec.add_dependency('ffi')
|
27
|
-
spec.add_dependency('ffi-win32-extensions')
|
28
|
-
|
29
|
-
spec.add_development_dependency('test-unit')
|
30
|
-
spec.add_development_dependency('rake')
|
31
|
-
spec.add_development_dependency('win32-security')
|
32
|
-
|
33
|
-
spec.description = <<-EOF
|
34
|
-
The win32-service library provides a Ruby interface to services on
|
35
|
-
MS Windows. You can create new services, or control, configure and
|
36
|
-
inspect existing services.
|
37
|
-
|
38
|
-
In addition, you can create a pure Ruby service by using the Daemon
|
39
|
-
class that is included as part of the library.
|
40
|
-
EOF
|
41
|
-
end
|