zenoss_client 0.5.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +3 -1
- data/.travis.yml +9 -0
- data/Gemfile +1 -1
- data/README.textile +6 -1
- data/Rakefile +5 -4
- data/VERSION +1 -1
- data/lib/zenoss.rb +2 -2
- data/lib/zenoss/connection.rb +3 -2
- data/lib/zenoss/jsonapi/events_router.rb +0 -1
- data/lib/zenoss/model/devices/device.rb +9 -0
- data/test/docker/3.2.1/Dockerfile +11 -0
- data/test/docker/3.2.1/remote_start.sh +3 -0
- data/test/docker/3.2.1/start.sh +2 -0
- data/test/docker/4.2.5/Dockerfile +10 -0
- data/test/docker/4.2.5/remote_start.sh +12 -0
- data/test/docker/4.2.5/start.sh +2 -0
- data/test/fixtures/.gitkeep +0 -0
- data/test/fixtures/vcr_cassettes/3_2_1_initial_connection.yml +437 -0
- data/test/fixtures/vcr_cassettes/3_2_1_test_0001_returns_an_Array_of_devices_when_searched_by_name.yml +85 -0
- data/test/fixtures/vcr_cassettes/3_2_1_test_0002_returns_device_uptime_when_asked.yml +110 -0
- data/test/fixtures/vcr_cassettes/3_2_1_test_0003_returns_an_Array_of_events_for_a_device.yml +80 -0
- data/test/fixtures/vcr_cassettes/3_2_1_test_0004_returns_an_Array_of_historical_events_for_a_device.yml +80 -0
- data/test/fixtures/vcr_cassettes/3_2_1_test_0005_returns_info_for_a_device_in_the_form_of_a_Hash.yml +251 -0
- data/test/fixtures/vcr_cassettes/3_2_1_test_0006_returns_an_Array_of_events_for_all_devices.yml +86 -0
- data/test/fixtures/vcr_cassettes/3_2_1_test_0007_fetches_the_report_tree.yml +181 -0
- data/test/fixtures/vcr_cassettes/3_2_1_test_0008_fetches_available_report_types_and_returns_a_Hash.yml +82 -0
- data/test/fixtures/vcr_cassettes/3_2_1_test_0009_renames_the_device.yml +151 -0
- data/test/fixtures/vcr_cassettes/4_2_5_initial_connection.yml +594 -0
- data/test/fixtures/vcr_cassettes/4_2_5_test_0001_returns_an_Array_of_devices_when_searched_by_name.yml +93 -0
- data/test/fixtures/vcr_cassettes/4_2_5_test_0002_returns_device_uptime_when_asked.yml +114 -0
- data/test/fixtures/vcr_cassettes/4_2_5_test_0003_returns_an_Array_of_events_for_a_device.yml +99 -0
- data/test/fixtures/vcr_cassettes/4_2_5_test_0004_returns_an_Array_of_historical_events_for_a_device.yml +99 -0
- data/test/fixtures/vcr_cassettes/4_2_5_test_0005_returns_info_for_a_device_in_the_form_of_a_Hash.yml +234 -0
- data/test/fixtures/vcr_cassettes/4_2_5_test_0006_returns_an_Array_of_events_for_all_devices.yml +203 -0
- data/test/fixtures/vcr_cassettes/4_2_5_test_0007_fetches_the_report_tree.yml +203 -0
- data/test/fixtures/vcr_cassettes/4_2_5_test_0008_fetches_available_report_types_and_returns_a_Hash.yml +86 -0
- data/test/fixtures/vcr_cassettes/4_2_5_test_0009_renames_the_device.yml +160 -0
- data/test/test_helper.rb +20 -11
- data/test/zenoss_client_test.rb +140 -114
- data/zenoss_client.gemspec +13 -9
- metadata +104 -37
@@ -0,0 +1,160 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/device_router
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '[{"action":"DeviceRouter","method":"getDevices","data":[{"uid":"/zport/dmd/Devices","params":{"name":"UnitTestDevice"}}],"type":"rpc","tid":13}]'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
|
12
|
+
Accept:
|
13
|
+
- "*/*"
|
14
|
+
Date:
|
15
|
+
- Fri, 22 May 2015 12:14:36 GMT
|
16
|
+
Content-Type:
|
17
|
+
- application/json; charset=utf-8
|
18
|
+
Cookie:
|
19
|
+
- _ZopeId=47495875A68v.lkNK6o
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
|
27
|
+
Date:
|
28
|
+
- Fri, 22 May 2015 12:14:36 GMT
|
29
|
+
Content-Length:
|
30
|
+
- '906'
|
31
|
+
Content-Type:
|
32
|
+
- application/json
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"uuid": "97f48fcd-7b09-43c1-94f0-d2ec4e3dd7c8", "action": "DeviceRouter",
|
36
|
+
"result": {"totalCount": 1, "hash": "1", "success": true, "devices": [{"ipAddressString":
|
37
|
+
null, "serialNumber": "", "pythonClass": "Products.ZenModel.Device", "hwManufacturer":
|
38
|
+
null, "collector": "localhost", "osModel": null, "productionState": 1000,
|
39
|
+
"systems": [], "priority": 3, "hwModel": null, "tagNumber": "", "osManufacturer":
|
40
|
+
null, "location": null, "groups": [], "uid": "/zport/dmd/Devices/Server/devices/UnitTestDevice",
|
41
|
+
"ipAddress": null, "events": {"info": {"count": 0, "acknowledged_count": 0},
|
42
|
+
"clear": {"count": 0, "acknowledged_count": 0}, "warning": {"count": 0, "acknowledged_count":
|
43
|
+
0}, "critical": {"count": 0, "acknowledged_count": 0}, "error": {"count":
|
44
|
+
0, "acknowledged_count": 0}, "debug": {"count": 0, "acknowledged_count": 0}},
|
45
|
+
"name": "UnitTestDevice"}]}, "tid": 13, "type": "rpc", "method": "getDevices"}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Fri, 22 May 2015 12:14:36 GMT
|
48
|
+
- request:
|
49
|
+
method: get
|
50
|
+
uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/Devices/Server/devices/UnitTestDevice/renameDevice?newId=unit_test_temporary_device_name
|
51
|
+
body:
|
52
|
+
encoding: UTF-8
|
53
|
+
string: ''
|
54
|
+
headers:
|
55
|
+
User-Agent:
|
56
|
+
- HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
|
57
|
+
Accept:
|
58
|
+
- "*/*"
|
59
|
+
Date:
|
60
|
+
- Fri, 22 May 2015 12:14:36 GMT
|
61
|
+
Cookie:
|
62
|
+
- _ZopeId=47495875A68v.lkNK6o
|
63
|
+
response:
|
64
|
+
status:
|
65
|
+
code: 200
|
66
|
+
message: OK
|
67
|
+
headers:
|
68
|
+
Server:
|
69
|
+
- Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
|
70
|
+
Date:
|
71
|
+
- Fri, 22 May 2015 12:14:36 GMT
|
72
|
+
Content-Length:
|
73
|
+
- '65'
|
74
|
+
Content-Type:
|
75
|
+
- text/plain; charset=utf-8
|
76
|
+
body:
|
77
|
+
encoding: UTF-8
|
78
|
+
string: "/zport/dmd/Devices/Server/devices/unit_test_temporary_device_name"
|
79
|
+
http_version:
|
80
|
+
recorded_at: Fri, 22 May 2015 12:14:37 GMT
|
81
|
+
- request:
|
82
|
+
method: post
|
83
|
+
uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/device_router
|
84
|
+
body:
|
85
|
+
encoding: UTF-8
|
86
|
+
string: '[{"action":"DeviceRouter","method":"getDevices","data":[{"uid":"/zport/dmd/Devices","params":{"name":"unit_test_temporary_device_name"}}],"type":"rpc","tid":14}]'
|
87
|
+
headers:
|
88
|
+
User-Agent:
|
89
|
+
- HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
|
90
|
+
Accept:
|
91
|
+
- "*/*"
|
92
|
+
Date:
|
93
|
+
- Fri, 22 May 2015 12:14:37 GMT
|
94
|
+
Content-Type:
|
95
|
+
- application/json; charset=utf-8
|
96
|
+
Cookie:
|
97
|
+
- _ZopeId=47495875A68v.lkNK6o
|
98
|
+
response:
|
99
|
+
status:
|
100
|
+
code: 200
|
101
|
+
message: OK
|
102
|
+
headers:
|
103
|
+
Server:
|
104
|
+
- Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
|
105
|
+
Date:
|
106
|
+
- Fri, 22 May 2015 12:14:36 GMT
|
107
|
+
Content-Length:
|
108
|
+
- '940'
|
109
|
+
Content-Type:
|
110
|
+
- application/json
|
111
|
+
body:
|
112
|
+
encoding: UTF-8
|
113
|
+
string: '{"uuid": "ba140e8f-1063-46c9-95d7-0a8e5cbff659", "action": "DeviceRouter",
|
114
|
+
"result": {"totalCount": 1, "hash": "1", "success": true, "devices": [{"ipAddressString":
|
115
|
+
null, "serialNumber": "", "pythonClass": "Products.ZenModel.Device", "hwManufacturer":
|
116
|
+
null, "collector": "localhost", "osModel": null, "productionState": 1000,
|
117
|
+
"systems": [], "priority": 3, "hwModel": null, "tagNumber": "", "osManufacturer":
|
118
|
+
null, "location": null, "groups": [], "uid": "/zport/dmd/Devices/Server/devices/unit_test_temporary_device_name",
|
119
|
+
"ipAddress": null, "events": {"info": {"count": 0, "acknowledged_count": 0},
|
120
|
+
"clear": {"count": 0, "acknowledged_count": 0}, "warning": {"count": 0, "acknowledged_count":
|
121
|
+
0}, "critical": {"count": 0, "acknowledged_count": 0}, "error": {"count":
|
122
|
+
0, "acknowledged_count": 0}, "debug": {"count": 0, "acknowledged_count": 0}},
|
123
|
+
"name": "unit_test_temporary_device_name"}]}, "tid": 14, "type": "rpc", "method":
|
124
|
+
"getDevices"}'
|
125
|
+
http_version:
|
126
|
+
recorded_at: Fri, 22 May 2015 12:14:37 GMT
|
127
|
+
- request:
|
128
|
+
method: get
|
129
|
+
uri: http://192.168.56.2:8080/zport/dmd/zport/dmd/Devices/Server/devices/unit_test_temporary_device_name/renameDevice?newId=UnitTestDevice
|
130
|
+
body:
|
131
|
+
encoding: UTF-8
|
132
|
+
string: ''
|
133
|
+
headers:
|
134
|
+
User-Agent:
|
135
|
+
- HTTPClient/1.0 (2.6.0.1, ruby 2.2.0 (2014-12-25))
|
136
|
+
Accept:
|
137
|
+
- "*/*"
|
138
|
+
Date:
|
139
|
+
- Fri, 22 May 2015 12:14:37 GMT
|
140
|
+
Cookie:
|
141
|
+
- _ZopeId=47495875A68v.lkNK6o
|
142
|
+
response:
|
143
|
+
status:
|
144
|
+
code: 200
|
145
|
+
message: OK
|
146
|
+
headers:
|
147
|
+
Server:
|
148
|
+
- Zope/(2.13.13, python 2.7.2, linux2) ZServer/1.1
|
149
|
+
Date:
|
150
|
+
- Fri, 22 May 2015 12:14:37 GMT
|
151
|
+
Content-Length:
|
152
|
+
- '48'
|
153
|
+
Content-Type:
|
154
|
+
- text/plain; charset=utf-8
|
155
|
+
body:
|
156
|
+
encoding: UTF-8
|
157
|
+
string: "/zport/dmd/Devices/Server/devices/UnitTestDevice"
|
158
|
+
http_version:
|
159
|
+
recorded_at: Fri, 22 May 2015 12:14:37 GMT
|
160
|
+
recorded_with: VCR 2.9.3
|
data/test/test_helper.rb
CHANGED
@@ -1,11 +1,20 @@
|
|
1
|
-
$:.unshift File.join(File.dirname(__FILE__),'..','lib')
|
2
|
-
#http://net.tutsplus.com/tutorials/ruby/ruby-for-newbies-testing-with-rspec/
|
3
|
-
require_relative '../lib/zenoss'
|
4
|
-
require '
|
5
|
-
|
6
|
-
|
7
|
-
ZENOSS_URL = ENV['zenoss_client_url'] || "http://localhost:8080/zport/dmd"
|
8
|
-
ZENOSS_USER = ENV['zenoss_client_username'] || "admin"
|
9
|
-
ZENOSS_PASSWORD = ENV['zenoss_client_password'] || "zenoss"
|
10
|
-
|
11
|
-
TEST_DEVICE_NAME = "UnitTestDevice"
|
1
|
+
$:.unshift File.join(File.dirname(__FILE__),'..','lib')
|
2
|
+
#http://net.tutsplus.com/tutorials/ruby/ruby-for-newbies-testing-with-rspec/
|
3
|
+
require_relative '../lib/zenoss'
|
4
|
+
require 'vcr'
|
5
|
+
|
6
|
+
|
7
|
+
ZENOSS_URL = ENV['zenoss_client_url'] || "http://localhost:8080/zport/dmd"
|
8
|
+
ZENOSS_USER = ENV['zenoss_client_username'] || "admin"
|
9
|
+
ZENOSS_PASSWORD = ENV['zenoss_client_password'] || "zenoss"
|
10
|
+
|
11
|
+
TEST_DEVICE_NAME = "UnitTestDevice"
|
12
|
+
|
13
|
+
ZENOSS_VERSION = ENV['zenoss_version'] || '4.2.5'
|
14
|
+
|
15
|
+
|
16
|
+
# VCR
|
17
|
+
VCR.configure do |config|
|
18
|
+
config.cassette_library_dir = "test/fixtures/vcr_cassettes"
|
19
|
+
config.hook_into :webmock
|
20
|
+
end
|
data/test/zenoss_client_test.rb
CHANGED
@@ -1,114 +1,140 @@
|
|
1
|
-
require_relative './test_helper'
|
2
|
-
require 'minitest/spec'
|
3
|
-
require '
|
4
|
-
|
5
|
-
|
6
|
-
LOG
|
7
|
-
|
8
|
-
|
9
|
-
describe Zenoss do
|
10
|
-
#Simulate some "before all" type of setup
|
11
|
-
#https://github.com/seattlerb/minitest/issues/61#issuecomment-4581115
|
12
|
-
def self.zen
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
"
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
end
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
@
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
end
|
80
|
-
|
81
|
-
it
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
@dev.
|
89
|
-
@dev.
|
90
|
-
end
|
91
|
-
|
92
|
-
it
|
93
|
-
events
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
end
|
113
|
-
|
114
|
-
|
1
|
+
require_relative './test_helper'
|
2
|
+
require 'minitest/spec'
|
3
|
+
require 'minitest/autorun'
|
4
|
+
require 'logger'
|
5
|
+
|
6
|
+
LOG = Logger.new(STDOUT)
|
7
|
+
LOG.level = Logger::INFO
|
8
|
+
|
9
|
+
describe Zenoss do
|
10
|
+
# Simulate some "before all" type of setup
|
11
|
+
# https://github.com/seattlerb/minitest/issues/61#issuecomment-4581115
|
12
|
+
def self.zen
|
13
|
+
VCR.use_cassette "#{ZENOSS_VERSION}_initial connection", :match_requests_on => [:method, :path, :query] do
|
14
|
+
@zen ||= begin
|
15
|
+
connection = Zenoss.connect ZENOSS_URL, ZENOSS_USER, ZENOSS_PASSWORD
|
16
|
+
# We Need to Create A Device for testing
|
17
|
+
# We do this here, so we can re-use the same device over and over
|
18
|
+
# Without needing to create a new one per test
|
19
|
+
LOG.info('Creating a Fresh Device For Testing')
|
20
|
+
new_device_rsp = connection.json_request(
|
21
|
+
'DeviceRouter', 'addDevice',
|
22
|
+
[{:deviceName => TEST_DEVICE_NAME, :deviceClass => '/Devices/Server'}]
|
23
|
+
)
|
24
|
+
|
25
|
+
# Now we need to wait until the device is present before we proceed.
|
26
|
+
# Once we issue the create command, it takes
|
27
|
+
if new_device_rsp.key?('success') && new_device_rsp['success'] == true
|
28
|
+
# Our job was accepted
|
29
|
+
retries = 20
|
30
|
+
retry_delay = 15 # seconds
|
31
|
+
found_device = false
|
32
|
+
LOG.info('Waiting for the newly created device to be available. ' \
|
33
|
+
'This might take a minute or two')
|
34
|
+
while found_device == false
|
35
|
+
if retries > 0
|
36
|
+
# This will return an Array, so we wait until the array has
|
37
|
+
# something, or we give up after a while
|
38
|
+
devs = connection.find_devices_by_name(TEST_DEVICE_NAME)
|
39
|
+
if devs.empty?
|
40
|
+
retries -= 1
|
41
|
+
LOG.info("#{TEST_DEVICE_NAME} not available yet")
|
42
|
+
sleep(retry_delay) if VCR.current_cassette.recording?
|
43
|
+
else
|
44
|
+
found_device = true
|
45
|
+
LOG.info("#{TEST_DEVICE_NAME} is available. Proceeding with " \
|
46
|
+
'testing')
|
47
|
+
end
|
48
|
+
else
|
49
|
+
fail ZenossError, 'Unable to Create A New Device For Unit Tests'
|
50
|
+
end
|
51
|
+
end
|
52
|
+
else
|
53
|
+
# We failed to create a new device....
|
54
|
+
end
|
55
|
+
# Return the connection object
|
56
|
+
connection
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def gen_cassette_name
|
62
|
+
n = "#{ZENOSS_VERSION}_#{name}"
|
63
|
+
# name method is not available on ruby 1.9
|
64
|
+
rescue NoMethodError, NameError
|
65
|
+
fallback_method = [:__name__, :__NAME__].find { |m| self.respond_to? m }
|
66
|
+
n = "#{ZENOSS_VERSION}_#{send(fallback_method)}"
|
67
|
+
n.gsub!('.', '_')
|
68
|
+
n
|
69
|
+
end
|
70
|
+
|
71
|
+
before do
|
72
|
+
VCR.insert_cassette gen_cassette_name, :match_requests_on => [:method, :path, :query]
|
73
|
+
@zen = self.class.zen
|
74
|
+
@dev = @zen.find_devices_by_name(TEST_DEVICE_NAME).first
|
75
|
+
end
|
76
|
+
|
77
|
+
after do
|
78
|
+
VCR.eject_cassette gen_cassette_name
|
79
|
+
end
|
80
|
+
|
81
|
+
it 'returns an Array of devices when searched by name' do
|
82
|
+
x = @zen.find_devices_by_name(TEST_DEVICE_NAME)
|
83
|
+
x.must_be_kind_of Array
|
84
|
+
x.first.must_be_kind_of Zenoss::Model::Device
|
85
|
+
end
|
86
|
+
|
87
|
+
it 'returns device uptime when asked' do
|
88
|
+
@dev.sys_uptime.wont_be_nil
|
89
|
+
@dev.sys_uptime.wont_be_empty
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'returns an Array of events for a device' do
|
93
|
+
# There could be 0 or more, events so an empty Array is OK
|
94
|
+
@dev.get_events.must_be_kind_of Array
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'returns an Array of historical events for a device' do
|
98
|
+
# There could be 0 or more, events so an empty Array is OK
|
99
|
+
@dev.get_event_history.must_be_kind_of Array
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'returns info for a device in the form of a Hash' do
|
103
|
+
@dev.get_info.wont_be_nil
|
104
|
+
@dev.get_info.wont_be_empty
|
105
|
+
@dev.get_info.must_be_kind_of Hash
|
106
|
+
end
|
107
|
+
|
108
|
+
it 'returns an Array of events for all devices' do
|
109
|
+
events = @zen.query_events
|
110
|
+
events.must_be_kind_of Array
|
111
|
+
events.first.must_be_kind_of Zenoss::Events::ZEvent
|
112
|
+
end
|
113
|
+
|
114
|
+
it 'fetches the report tree' do
|
115
|
+
report_tree = @zen.get_report_tree
|
116
|
+
report_tree.must_be_kind_of Array
|
117
|
+
report_tree.first.must_be_kind_of Hash
|
118
|
+
report_tree.wont_be_empty
|
119
|
+
end
|
120
|
+
|
121
|
+
it 'fetches available report types and returns a Hash' do
|
122
|
+
report_types = @zen.get_report_types
|
123
|
+
report_types.must_be_kind_of Hash
|
124
|
+
report_types.wont_be_empty
|
125
|
+
report_types.key?('reportTypes').must_equal true
|
126
|
+
end
|
127
|
+
|
128
|
+
it 'renames the device' do
|
129
|
+
TEMPORARY_DEVICE_NAME = 'unit_test_temporary_device_name'
|
130
|
+
begin
|
131
|
+
@dev.rename_device(TEMPORARY_DEVICE_NAME)
|
132
|
+
renamed_devices = @zen.find_devices_by_name(TEMPORARY_DEVICE_NAME)
|
133
|
+
renamed_devices.wont_be_empty
|
134
|
+
renamed_device = renamed_devices.first
|
135
|
+
renamed_device.name.must_equal TEMPORARY_DEVICE_NAME
|
136
|
+
ensure
|
137
|
+
renamed_device.rename_device(TEST_DEVICE_NAME)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
data/zenoss_client.gemspec
CHANGED
@@ -6,16 +6,17 @@ require 'date'
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
gem.name = "zenoss_client"
|
8
8
|
gem.version = File.open('VERSION').readline.chomp
|
9
|
-
gem.date
|
9
|
+
gem.date = Date.today.to_s
|
10
10
|
gem.platform = Gem::Platform::RUBY
|
11
11
|
gem.rubyforge_project = nil
|
12
12
|
|
13
|
-
gem.
|
14
|
-
gem.email =
|
15
|
-
gem.homepage = "http://github.com/
|
13
|
+
gem.authors = ['Dan Wanek', 'Ben Miller', 'Marek Skrobacki']
|
14
|
+
gem.email = ['dan.wanek@gmail.com', 'bjmllr@gmail.com', 'marek@skrobacki.uk']
|
15
|
+
gem.homepage = "http://github.com/RubyOpenSource/zenoss_client"
|
16
16
|
|
17
17
|
gem.summary = "A wrapper around the Zenoss JSON and REST APIs"
|
18
|
-
gem.
|
18
|
+
gem.license = 'GPL-3.0'
|
19
|
+
gem.description = <<-EOF
|
19
20
|
This is a wrapper around the Zenoss JSON and REST APIs. For the most things it
|
20
21
|
should feel very familiar to zendmd, but there are some changes do to the merging
|
21
22
|
of the JSON and REST APIs. Please read the API docs for Zenoss and the YARDDoc for
|
@@ -24,13 +25,16 @@ Gem::Specification.new do |gem|
|
|
24
25
|
|
25
26
|
gem.files = `git ls-files`.split(/\n/)
|
26
27
|
gem.require_path = "lib"
|
27
|
-
gem.rdoc_options
|
28
|
+
gem.rdoc_options = %w(-x test/ -x examples/)
|
28
29
|
gem.extra_rdoc_files = %w(README.textile COPYING.txt)
|
29
30
|
|
30
|
-
gem.required_ruby_version
|
31
|
-
gem.add_runtime_dependency 'httpclient', '~> 2.
|
31
|
+
gem.required_ruby_version = '>= 1.8.7'
|
32
|
+
gem.add_runtime_dependency 'httpclient', '~> 2.0'
|
32
33
|
gem.add_runtime_dependency 'tzinfo', '~> 0.3.20'
|
33
34
|
gem.add_runtime_dependency 'json', '~> 1.5'
|
34
|
-
|
35
|
+
|
36
|
+
gem.add_development_dependency('rake')
|
35
37
|
gem.add_development_dependency('minitest')
|
38
|
+
gem.add_development_dependency('vcr')
|
39
|
+
gem.add_development_dependency('webmock')
|
36
40
|
end
|