rhn_satellite 0.0.6 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +6 -0
- data/Gemfile +7 -6
- data/Gemfile.lock +28 -24
- data/README.rdoc +1 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/rhn_satellite/connection/base.rb +1 -10
- data/lib/rhn_satellite/connection/handler.rb +4 -0
- data/lib/rhn_satellite/schedule.rb +55 -0
- data/lib/rhn_satellite/system.rb +28 -0
- data/lib/rhn_satellite/systemgroup.rb +12 -0
- data/lib/rhn_satellite.rb +1 -0
- data/rhn_satellite.gemspec +32 -28
- data/spec/unit/rhn_satellite/connection/base_spec.rb +10 -2
- data/spec/unit/rhn_satellite/connection/handler_spec.rb +17 -7
- data/spec/unit/rhn_satellite/schedule_spec.rb +403 -0
- data/spec/unit/rhn_satellite/system_spec.rb +91 -1
- data/spec/unit/rhn_satellite/systemgroup_spec.rb +22 -0
- metadata +96 -122
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a42ab7be6ea1207a68ea1fe4e82f86bf2c830a34
|
4
|
+
data.tar.gz: da447112d6d5fa2fc63c2cca06ab84c89d9899d2
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d864e0de2eba9106561752ad6367fdf473ad9a436053e479eb25af00cc9949530dfc8831bfad4fd3c4053e26edaf5e06c096876147c87651775ad8e3df23721c
|
7
|
+
data.tar.gz: a40b8d97e97cb32a6a863fcb3dfffdb288e32a2b6a30285e9b2a04045b8b0ba4bcee287fbb26db8848b51dfdf499d6175e8d7bcf1c5fb8626f6a4588208295de
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -6,10 +6,11 @@ source "http://rubygems.org"
|
|
6
6
|
# Add dependencies to develop your gem here.
|
7
7
|
# Include everything needed to run rake, tests, features, etc.
|
8
8
|
group :development do
|
9
|
-
gem "rspec", "~> 2.
|
10
|
-
gem "
|
11
|
-
gem "
|
12
|
-
gem "
|
13
|
-
gem "
|
14
|
-
gem "
|
9
|
+
gem "rspec", "~> 2.5.0"
|
10
|
+
gem "rdoc", "~> 3.8"
|
11
|
+
gem "mocha", "~> 0.10.0"
|
12
|
+
gem "bundler"
|
13
|
+
gem "jeweler"
|
14
|
+
gem "simplecov"
|
15
15
|
end
|
16
|
+
|
data/Gemfile.lock
CHANGED
@@ -1,38 +1,42 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
coderay (1.0.6)
|
5
4
|
diff-lcs (1.1.3)
|
6
|
-
|
5
|
+
docile (1.1.3)
|
6
|
+
git (1.2.6)
|
7
7
|
jeweler (1.6.4)
|
8
8
|
bundler (~> 1.0)
|
9
9
|
git (>= 1.2.5)
|
10
10
|
rake
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
rspec (2.
|
20
|
-
rspec-core (~> 2.
|
21
|
-
rspec-expectations (~> 2.
|
22
|
-
rspec-mocks (~> 2.
|
23
|
-
rspec-core (2.
|
24
|
-
rspec-expectations (2.
|
11
|
+
json (1.8.1)
|
12
|
+
metaclass (0.0.4)
|
13
|
+
mocha (0.10.5)
|
14
|
+
metaclass (~> 0.0.1)
|
15
|
+
multi_json (1.10.1)
|
16
|
+
rake (10.3.2)
|
17
|
+
rdoc (3.12.2)
|
18
|
+
json (~> 1.4)
|
19
|
+
rspec (2.5.0)
|
20
|
+
rspec-core (~> 2.5.0)
|
21
|
+
rspec-expectations (~> 2.5.0)
|
22
|
+
rspec-mocks (~> 2.5.0)
|
23
|
+
rspec-core (2.5.2)
|
24
|
+
rspec-expectations (2.5.0)
|
25
25
|
diff-lcs (~> 1.1.2)
|
26
|
-
rspec-mocks (2.
|
27
|
-
|
26
|
+
rspec-mocks (2.5.0)
|
27
|
+
simplecov (0.8.2)
|
28
|
+
docile (~> 1.1.0)
|
29
|
+
multi_json
|
30
|
+
simplecov-html (~> 0.8.0)
|
31
|
+
simplecov-html (0.8.0)
|
28
32
|
|
29
33
|
PLATFORMS
|
30
34
|
ruby
|
31
35
|
|
32
36
|
DEPENDENCIES
|
33
|
-
bundler
|
34
|
-
jeweler
|
35
|
-
mocha (~> 0.
|
36
|
-
|
37
|
-
|
38
|
-
|
37
|
+
bundler
|
38
|
+
jeweler
|
39
|
+
mocha (~> 0.10.0)
|
40
|
+
rdoc (~> 3.8)
|
41
|
+
rspec (~> 2.5.0)
|
42
|
+
simplecov
|
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.1.1
|
@@ -2,8 +2,7 @@ module RhnSatellite
|
|
2
2
|
module Connection
|
3
3
|
class Base
|
4
4
|
class << self
|
5
|
-
attr_accessor :hostname, :username, :password
|
6
|
-
attr_writer :timeout, :https
|
5
|
+
attr_accessor :hostname, :username, :password, :timeout, :https
|
7
6
|
|
8
7
|
attr_reader :collection_cmd
|
9
8
|
|
@@ -11,14 +10,6 @@ module RhnSatellite
|
|
11
10
|
RhnSatellite::Connection::Handler.reset_instance(self.name)
|
12
11
|
end
|
13
12
|
|
14
|
-
def timeout
|
15
|
-
@timeout ||= 30
|
16
|
-
end
|
17
|
-
|
18
|
-
def https
|
19
|
-
@https.nil? ? (@https=true) : @https
|
20
|
-
end
|
21
|
-
|
22
13
|
private
|
23
14
|
def base
|
24
15
|
RhnSatellite::Connection::Handler.instance_for(self.name, hostname, username, password, timeout, https)
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module RhnSatellite
|
2
|
+
class Schedule < RhnSatellite::Connection::Base
|
3
|
+
collection 'schedule.listAllActions'
|
4
|
+
class << self
|
5
|
+
|
6
|
+
def archive_actions(action_ids)
|
7
|
+
base.default_call('schedule.archiveActions',action_ids)
|
8
|
+
end
|
9
|
+
|
10
|
+
def cancel_actions(action_ids)
|
11
|
+
base.default_call('schedule.cancelActions',action_ids)
|
12
|
+
end
|
13
|
+
|
14
|
+
def delete_actions(action_ids)
|
15
|
+
base.default_call('schedule.deleteActions',action_ids)
|
16
|
+
end
|
17
|
+
|
18
|
+
def list_all_actions
|
19
|
+
base.default_call('schedule.listAllActions').to_a
|
20
|
+
end
|
21
|
+
|
22
|
+
def list_archived_actions
|
23
|
+
base.default_call('schedule.listArchivedActions').to_a
|
24
|
+
end
|
25
|
+
|
26
|
+
def list_completed_actions
|
27
|
+
base.default_call('schedule.listCompletedActions').to_a
|
28
|
+
end
|
29
|
+
|
30
|
+
def list_completed_systems(action_id)
|
31
|
+
base.default_call('schedule.listCompletedSystems',action_id).to_a
|
32
|
+
end
|
33
|
+
|
34
|
+
def list_failed_actions
|
35
|
+
base.default_call('schedule.listFailedActions').to_a
|
36
|
+
end
|
37
|
+
|
38
|
+
def list_failed_systems(action_id)
|
39
|
+
base.default_call('schedule.listFailedSystems',action_id).to_a
|
40
|
+
end
|
41
|
+
|
42
|
+
def list_in_progress_actions
|
43
|
+
base.default_call('schedule.listInProgressActions').to_a
|
44
|
+
end
|
45
|
+
|
46
|
+
def list_in_progress_systems(action_id)
|
47
|
+
base.default_call('schedule.listInProgressSystems',action_id).to_a
|
48
|
+
end
|
49
|
+
|
50
|
+
def reschedule_actions(action_ids,only_failed)
|
51
|
+
base.default_call('schedule.rescheduleActions',action_ids,only_failed)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
data/lib/rhn_satellite/system.rb
CHANGED
@@ -3,9 +3,17 @@ module RhnSatellite
|
|
3
3
|
collection 'system.listUserSystems'
|
4
4
|
class << self
|
5
5
|
|
6
|
+
def get_id(name)
|
7
|
+
base.default_call('system.getId',name)
|
8
|
+
end
|
9
|
+
|
6
10
|
def active_systems
|
7
11
|
base.default_call('system.listActiveSystems').to_a
|
8
12
|
end
|
13
|
+
|
14
|
+
def delete(system_ids)
|
15
|
+
base.default_call('system.deleteSystems',[*system_ids].collect{|i| i.to_i })
|
16
|
+
end
|
9
17
|
|
10
18
|
def details(system_id)
|
11
19
|
base.default_call('system.getDetails',system_id.to_i)
|
@@ -25,6 +33,10 @@ module RhnSatellite
|
|
25
33
|
base.default_call('system.getRelevantErrata',system_id).to_a
|
26
34
|
end
|
27
35
|
|
36
|
+
def newer_installed_packages(system_id,package_name,version,release,epoch)
|
37
|
+
base.default_call('system.listNewerInstalledPackages',system_id,package_name,version,release,epoch).to_a
|
38
|
+
end
|
39
|
+
|
28
40
|
def latest_available_packages(system_ids)
|
29
41
|
base.default_call('system.listLatestAvailablePackages',system_ids).to_a
|
30
42
|
end
|
@@ -78,6 +90,22 @@ module RhnSatellite
|
|
78
90
|
def schedule_package_install(system_id,package_ids,earliest_occurence='now')
|
79
91
|
base.default_call('system.schedulePackageInstall',system_id.to_i,package_ids,RhnSatellite::Common::Misc.gen_date_time(earliest_occurence))
|
80
92
|
end
|
93
|
+
|
94
|
+
def schedule_script_run(system_id,user,group,timeout,script,earliest_occurence='now')
|
95
|
+
base.default_call('system.scheduleScriptRun',system_id.to_i,user,group,timeout.to_i,script,RhnSatellite::Common::Misc.gen_date_time(earliest_occurence))
|
96
|
+
end
|
97
|
+
|
98
|
+
def schedule_script_runs(system_ids,user,group,timeout,script,earliest_occurence='now')
|
99
|
+
base.default_call('system.scheduleScriptRun',system_ids,user,group,timeout.to_i,script,RhnSatellite::Common::Misc.gen_date_time(earliest_occurence))
|
100
|
+
end
|
101
|
+
|
102
|
+
def script_results(action_id)
|
103
|
+
base.default_call('system.getScriptResults',action_id).to_a
|
104
|
+
end
|
105
|
+
|
106
|
+
def script_action_details(action_id)
|
107
|
+
base.default_call('system.getScriptActionDetails',action_id).to_a
|
108
|
+
end
|
81
109
|
end
|
82
110
|
end
|
83
111
|
end
|
@@ -11,6 +11,18 @@ module RhnSatellite
|
|
11
11
|
base.default_call('systemgroup.create',group_name,description)
|
12
12
|
end
|
13
13
|
|
14
|
+
def active_systems(group_name)
|
15
|
+
base.default_call('systemgroup.listActiveSystemsInGroup',group_name)
|
16
|
+
end
|
17
|
+
|
18
|
+
def inactive_systems(group_name,days=nil)
|
19
|
+
if days
|
20
|
+
base.default_call('systemgroup.listInactiveSystemsInGroup',group_name,days.to_i)
|
21
|
+
else
|
22
|
+
base.default_call('systemgroup.listInactiveSystemsInGroup',group_name)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
14
26
|
def systems(group_name)
|
15
27
|
base.default_call('systemgroup.listSystems',group_name)
|
16
28
|
end
|
data/lib/rhn_satellite.rb
CHANGED
@@ -12,6 +12,7 @@ require 'rhn_satellite/api'
|
|
12
12
|
require 'rhn_satellite/channel'
|
13
13
|
require 'rhn_satellite/channel_software'
|
14
14
|
require 'rhn_satellite/channel_access'
|
15
|
+
require 'rhn_satellite/schedule'
|
15
16
|
require 'rhn_satellite/system'
|
16
17
|
require 'rhn_satellite/systemgroup'
|
17
18
|
require 'rhn_satellite/packages'
|
data/rhn_satellite.gemspec
CHANGED
@@ -2,22 +2,25 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: rhn_satellite 0.1.0 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.
|
8
|
+
s.name = "rhn_satellite"
|
9
|
+
s.version = "0.1.1"
|
9
10
|
|
10
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib"]
|
11
13
|
s.authors = ["duritong"]
|
12
|
-
s.date =
|
13
|
-
s.description =
|
14
|
-
s.email =
|
14
|
+
s.date = "2014-06-03"
|
15
|
+
s.description = "It provides an easy way to interact with a RedHat Satellite API."
|
16
|
+
s.email = "peter.meier@immerda.ch"
|
15
17
|
s.extra_rdoc_files = [
|
16
18
|
"LICENSE.txt",
|
17
19
|
"README.rdoc"
|
18
20
|
]
|
19
21
|
s.files = [
|
20
22
|
".rspec",
|
23
|
+
".travis.yml",
|
21
24
|
"Gemfile",
|
22
25
|
"Gemfile.lock",
|
23
26
|
"LICENSE.txt",
|
@@ -36,6 +39,7 @@ Gem::Specification.new do |s|
|
|
36
39
|
"lib/rhn_satellite/connection/base.rb",
|
37
40
|
"lib/rhn_satellite/connection/handler.rb",
|
38
41
|
"lib/rhn_satellite/packages.rb",
|
42
|
+
"lib/rhn_satellite/schedule.rb",
|
39
43
|
"lib/rhn_satellite/system.rb",
|
40
44
|
"lib/rhn_satellite/systemgroup.rb",
|
41
45
|
"rhn_satellite.gemspec",
|
@@ -51,40 +55,40 @@ Gem::Specification.new do |s|
|
|
51
55
|
"spec/unit/rhn_satellite/connection/base_spec.rb",
|
52
56
|
"spec/unit/rhn_satellite/connection/handler_spec.rb",
|
53
57
|
"spec/unit/rhn_satellite/packages_spec.rb",
|
58
|
+
"spec/unit/rhn_satellite/schedule_spec.rb",
|
54
59
|
"spec/unit/rhn_satellite/system_spec.rb",
|
55
60
|
"spec/unit/rhn_satellite/systemgroup_spec.rb"
|
56
61
|
]
|
57
|
-
s.homepage =
|
62
|
+
s.homepage = "http://github.com/duritong/ruby-rhn_satellite"
|
58
63
|
s.licenses = ["MIT"]
|
59
|
-
s.
|
60
|
-
s.
|
61
|
-
s.summary = %q{RhnSatellite is a ruby api to the RedHat Satellite}
|
64
|
+
s.rubygems_version = "2.2.1"
|
65
|
+
s.summary = "RhnSatellite is a ruby api to the RedHat Satellite"
|
62
66
|
|
63
67
|
if s.respond_to? :specification_version then
|
64
|
-
s.specification_version =
|
68
|
+
s.specification_version = 4
|
65
69
|
|
66
70
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
67
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.
|
68
|
-
s.add_development_dependency(%q<
|
69
|
-
s.add_development_dependency(%q<
|
70
|
-
s.add_development_dependency(%q<
|
71
|
-
s.add_development_dependency(%q<
|
72
|
-
s.add_development_dependency(%q<
|
71
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.5.0"])
|
72
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.8"])
|
73
|
+
s.add_development_dependency(%q<mocha>, ["~> 0.10.0"])
|
74
|
+
s.add_development_dependency(%q<bundler>, [">= 0"])
|
75
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
76
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
73
77
|
else
|
74
|
-
s.add_dependency(%q<rspec>, ["~> 2.
|
75
|
-
s.add_dependency(%q<
|
76
|
-
s.add_dependency(%q<
|
77
|
-
s.add_dependency(%q<
|
78
|
-
s.add_dependency(%q<
|
79
|
-
s.add_dependency(%q<
|
78
|
+
s.add_dependency(%q<rspec>, ["~> 2.5.0"])
|
79
|
+
s.add_dependency(%q<rdoc>, ["~> 3.8"])
|
80
|
+
s.add_dependency(%q<mocha>, ["~> 0.10.0"])
|
81
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
82
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
83
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
80
84
|
end
|
81
85
|
else
|
82
|
-
s.add_dependency(%q<rspec>, ["~> 2.
|
83
|
-
s.add_dependency(%q<
|
84
|
-
s.add_dependency(%q<
|
85
|
-
s.add_dependency(%q<
|
86
|
-
s.add_dependency(%q<
|
87
|
-
s.add_dependency(%q<
|
86
|
+
s.add_dependency(%q<rspec>, ["~> 2.5.0"])
|
87
|
+
s.add_dependency(%q<rdoc>, ["~> 3.8"])
|
88
|
+
s.add_dependency(%q<mocha>, ["~> 0.10.0"])
|
89
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
90
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
91
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
88
92
|
end
|
89
93
|
end
|
90
94
|
|
@@ -26,6 +26,15 @@ describe RhnSatellite::Connection::Base do
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
[ :hostname,:username, :password, :timeout, :https ].each do |field|
|
30
|
+
describe "##{field}" do
|
31
|
+
it "takes over the default" do
|
32
|
+
RhnSatellite::Test.reset
|
33
|
+
RhnSatellite::Connection::Handler.send("default_#{field}=","bla")
|
34
|
+
RhnSatellite::Test.send(:base).instance_variable_get("@#{field}").should eql("bla")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
29
38
|
[ :hostname,:username, :password, :timeout, :https ].each do |field|
|
30
39
|
describe "##{field}" do
|
31
40
|
it "provides a way to set and read a #{field}" do
|
@@ -40,5 +49,4 @@ describe RhnSatellite::Connection::Base do
|
|
40
49
|
end
|
41
50
|
end
|
42
51
|
end
|
43
|
-
|
44
|
-
end
|
52
|
+
end
|
@@ -2,6 +2,9 @@
|
|
2
2
|
require File.dirname(__FILE__) + '/../../../spec_helper'
|
3
3
|
|
4
4
|
describe RhnSatellite::Connection::Handler do
|
5
|
+
before(:each) do
|
6
|
+
RhnSatellite::Connection::Handler.reset_defaults
|
7
|
+
end
|
5
8
|
|
6
9
|
[:hostname,:username, :password, :timeout, :https ].each do |field|
|
7
10
|
it "provides a way to set and read a default #{field}" do
|
@@ -13,15 +16,13 @@ describe RhnSatellite::Connection::Handler do
|
|
13
16
|
describe 'sane defaults' do
|
14
17
|
describe 'timeout' do
|
15
18
|
it "should default to 30" do
|
16
|
-
RhnSatellite::
|
17
|
-
RhnSatellite::Test.timeout.should eql(30)
|
19
|
+
RhnSatellite::Connection::Handler.default_timeout.should eql(30)
|
18
20
|
end
|
19
21
|
end
|
20
22
|
|
21
23
|
describe 'https' do
|
22
24
|
it "should default to true" do
|
23
|
-
RhnSatellite::
|
24
|
-
RhnSatellite::Test.https.should be_true
|
25
|
+
RhnSatellite::Connection::Handler.default_https.should be_true
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|
@@ -64,7 +65,7 @@ describe RhnSatellite::Connection::Handler do
|
|
64
65
|
|
65
66
|
it "takes default timeout if no argument is passed" do
|
66
67
|
RhnSatellite::Connection::Handler.default_timeout = 60
|
67
|
-
RhnSatellite::Connection::Handler.instance_for(:default_timeout,'bla','user','foo'
|
68
|
+
RhnSatellite::Connection::Handler.instance_for(:default_timeout,'bla','user','foo').instance_variable_get('@timeout').should eql(60)
|
68
69
|
end
|
69
70
|
it "takes passed timeout" do
|
70
71
|
RhnSatellite::Connection::Handler.default_timeout = 60
|
@@ -100,11 +101,19 @@ describe RhnSatellite::Connection::Handler do
|
|
100
101
|
end
|
101
102
|
end
|
102
103
|
|
103
|
-
describe "
|
104
|
+
describe ".reset_defaults" do
|
105
|
+
it "resets all set defaults" do
|
106
|
+
RhnSatellite::Connection::Handler.default_timeout = 99
|
107
|
+
RhnSatellite::Connection::Handler.reset_defaults
|
108
|
+
RhnSatellite::Connection::Handler.default_timeout.should eql(30)
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
context "connecting" do
|
104
113
|
before :each do
|
105
114
|
RhnSatellite::Connection::Handler.default_hostname = 'connecttest'
|
106
115
|
end
|
107
|
-
|
116
|
+
describe "#connect" do
|
108
117
|
it "creates a new connection with the passed timeout" do
|
109
118
|
RhnSatellite::Connection::Handler.default_timeout = 60
|
110
119
|
XMLRPC::Client.expects(:new2).with('https://connecttest/rpc/api',nil,60)
|
@@ -122,6 +131,7 @@ describe RhnSatellite::Connection::Handler do
|
|
122
131
|
a.connected?.should eql(false)
|
123
132
|
end
|
124
133
|
end
|
134
|
+
end
|
125
135
|
|
126
136
|
describe "#make_call" do
|
127
137
|
context "without a connection"
|
@@ -0,0 +1,403 @@
|
|
1
|
+
|
2
|
+
#! /usr/bin/env ruby
|
3
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
4
|
+
|
5
|
+
describe RhnSatellite::Schedule do
|
6
|
+
before(:each) do
|
7
|
+
RhnSatellite::Schedule.reset
|
8
|
+
conn = Object.new
|
9
|
+
conn.stubs(:call)
|
10
|
+
|
11
|
+
XMLRPC::Client.stubs(:new2).returns(conn)
|
12
|
+
|
13
|
+
RhnSatellite::Schedule.username = 'user'
|
14
|
+
RhnSatellite::Schedule.password = 'pwd'
|
15
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with("auth.login",'user','pwd').returns("token")
|
16
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with("auth.logout",'token')
|
17
|
+
end
|
18
|
+
|
19
|
+
describe ".archive_actions" do
|
20
|
+
it "should archive actions" do
|
21
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with("schedule.archiveActions",'token',[1,2]).returns(1)
|
22
|
+
|
23
|
+
RhnSatellite::Schedule.archive_actions([1,2]).should eql(1)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
describe ".cancel_actions" do
|
27
|
+
it "should cancel actions" do
|
28
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with("schedule.cancelActions",'token',[1,2]).returns(1)
|
29
|
+
|
30
|
+
RhnSatellite::Schedule.cancel_actions([1,2]).should eql(1)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
describe ".reschedule_actions" do
|
34
|
+
it "should reschedule actions" do
|
35
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with("schedule.rescheduleActions",'token',[1,2], true).returns(1)
|
36
|
+
|
37
|
+
RhnSatellite::Schedule.reschedule_actions([1,2], true).should eql(1)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
describe ".delete_actions" do
|
41
|
+
it "should delete actions" do
|
42
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with("schedule.deleteActions",'token',[1,2]).returns(1)
|
43
|
+
|
44
|
+
RhnSatellite::Schedule.delete_actions([1,2]).should eql(1)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
describe ".list_all_actions" do
|
48
|
+
it "should list all the actions" do
|
49
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with("schedule.listAllActions",'token').returns([
|
50
|
+
{
|
51
|
+
'id' => 1,
|
52
|
+
'name' => 'name1',
|
53
|
+
'type' => 'type1',
|
54
|
+
'scheduler' => 'user1',
|
55
|
+
'earliest' => 1234,
|
56
|
+
'completedSystems' => 1,
|
57
|
+
'failedSystems' => 2,
|
58
|
+
'inProgressSystems' => 0,
|
59
|
+
},
|
60
|
+
{
|
61
|
+
'id' => 2,
|
62
|
+
'name' => 'name2',
|
63
|
+
'type' => 'type2',
|
64
|
+
'scheduler' => 'user2',
|
65
|
+
'earliest' => 1235,
|
66
|
+
'completedSystems' => 2,
|
67
|
+
'failedSystems' => 3,
|
68
|
+
'inProgressSystems' => 1,
|
69
|
+
}
|
70
|
+
])
|
71
|
+
|
72
|
+
RhnSatellite::Schedule.list_all_actions.should eql([
|
73
|
+
{
|
74
|
+
'id' => 1,
|
75
|
+
'name' => 'name1',
|
76
|
+
'type' => 'type1',
|
77
|
+
'scheduler' => 'user1',
|
78
|
+
'earliest' => 1234,
|
79
|
+
'completedSystems' => 1,
|
80
|
+
'failedSystems' => 2,
|
81
|
+
'inProgressSystems' => 0,
|
82
|
+
},
|
83
|
+
{
|
84
|
+
'id' => 2,
|
85
|
+
'name' => 'name2',
|
86
|
+
'type' => 'type2',
|
87
|
+
'scheduler' => 'user2',
|
88
|
+
'earliest' => 1235,
|
89
|
+
'completedSystems' => 2,
|
90
|
+
'failedSystems' => 3,
|
91
|
+
'inProgressSystems' => 1,
|
92
|
+
}
|
93
|
+
])
|
94
|
+
end
|
95
|
+
end
|
96
|
+
describe ".list_archived_actions" do
|
97
|
+
it "should list all the archived actions" do
|
98
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with("schedule.listArchivedActions",'token').returns([
|
99
|
+
{
|
100
|
+
'id' => 1,
|
101
|
+
'name' => 'name1',
|
102
|
+
'type' => 'type1',
|
103
|
+
'scheduler' => 'user1',
|
104
|
+
'earliest' => 1234,
|
105
|
+
'completedSystems' => 1,
|
106
|
+
'failedSystems' => 2,
|
107
|
+
'inProgressSystems' => 0,
|
108
|
+
},
|
109
|
+
{
|
110
|
+
'id' => 2,
|
111
|
+
'name' => 'name2',
|
112
|
+
'type' => 'type2',
|
113
|
+
'scheduler' => 'user2',
|
114
|
+
'earliest' => 1235,
|
115
|
+
'completedSystems' => 2,
|
116
|
+
'failedSystems' => 3,
|
117
|
+
'inProgressSystems' => 1,
|
118
|
+
}
|
119
|
+
])
|
120
|
+
|
121
|
+
RhnSatellite::Schedule.list_archived_actions.should eql([
|
122
|
+
{
|
123
|
+
'id' => 1,
|
124
|
+
'name' => 'name1',
|
125
|
+
'type' => 'type1',
|
126
|
+
'scheduler' => 'user1',
|
127
|
+
'earliest' => 1234,
|
128
|
+
'completedSystems' => 1,
|
129
|
+
'failedSystems' => 2,
|
130
|
+
'inProgressSystems' => 0,
|
131
|
+
},
|
132
|
+
{
|
133
|
+
'id' => 2,
|
134
|
+
'name' => 'name2',
|
135
|
+
'type' => 'type2',
|
136
|
+
'scheduler' => 'user2',
|
137
|
+
'earliest' => 1235,
|
138
|
+
'completedSystems' => 2,
|
139
|
+
'failedSystems' => 3,
|
140
|
+
'inProgressSystems' => 1,
|
141
|
+
}
|
142
|
+
])
|
143
|
+
end
|
144
|
+
end
|
145
|
+
describe ".list_completed_actions" do
|
146
|
+
it "should list all the completed actions" do
|
147
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with("schedule.listCompletedActions",'token').returns([
|
148
|
+
{
|
149
|
+
'id' => 1,
|
150
|
+
'name' => 'name1',
|
151
|
+
'type' => 'type1',
|
152
|
+
'scheduler' => 'user1',
|
153
|
+
'earliest' => 1234,
|
154
|
+
'completedSystems' => 1,
|
155
|
+
'failedSystems' => 2,
|
156
|
+
'inProgressSystems' => 0,
|
157
|
+
},
|
158
|
+
{
|
159
|
+
'id' => 2,
|
160
|
+
'name' => 'name2',
|
161
|
+
'type' => 'type2',
|
162
|
+
'scheduler' => 'user2',
|
163
|
+
'earliest' => 1235,
|
164
|
+
'completedSystems' => 2,
|
165
|
+
'failedSystems' => 3,
|
166
|
+
'inProgressSystems' => 1,
|
167
|
+
}
|
168
|
+
])
|
169
|
+
|
170
|
+
RhnSatellite::Schedule.list_completed_actions.should eql([
|
171
|
+
{
|
172
|
+
'id' => 1,
|
173
|
+
'name' => 'name1',
|
174
|
+
'type' => 'type1',
|
175
|
+
'scheduler' => 'user1',
|
176
|
+
'earliest' => 1234,
|
177
|
+
'completedSystems' => 1,
|
178
|
+
'failedSystems' => 2,
|
179
|
+
'inProgressSystems' => 0,
|
180
|
+
},
|
181
|
+
{
|
182
|
+
'id' => 2,
|
183
|
+
'name' => 'name2',
|
184
|
+
'type' => 'type2',
|
185
|
+
'scheduler' => 'user2',
|
186
|
+
'earliest' => 1235,
|
187
|
+
'completedSystems' => 2,
|
188
|
+
'failedSystems' => 3,
|
189
|
+
'inProgressSystems' => 1,
|
190
|
+
}
|
191
|
+
])
|
192
|
+
end
|
193
|
+
end
|
194
|
+
describe ".list_failed_actions" do
|
195
|
+
it "should list all the failed actions" do
|
196
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with("schedule.listFailedActions",'token').returns([
|
197
|
+
{
|
198
|
+
'id' => 1,
|
199
|
+
'name' => 'name1',
|
200
|
+
'type' => 'type1',
|
201
|
+
'scheduler' => 'user1',
|
202
|
+
'earliest' => 1234,
|
203
|
+
'completedSystems' => 1,
|
204
|
+
'failedSystems' => 2,
|
205
|
+
'inProgressSystems' => 0,
|
206
|
+
},
|
207
|
+
{
|
208
|
+
'id' => 2,
|
209
|
+
'name' => 'name2',
|
210
|
+
'type' => 'type2',
|
211
|
+
'scheduler' => 'user2',
|
212
|
+
'earliest' => 1235,
|
213
|
+
'completedSystems' => 2,
|
214
|
+
'failedSystems' => 3,
|
215
|
+
'inProgressSystems' => 1,
|
216
|
+
}
|
217
|
+
])
|
218
|
+
|
219
|
+
RhnSatellite::Schedule.list_failed_actions.should eql([
|
220
|
+
{
|
221
|
+
'id' => 1,
|
222
|
+
'name' => 'name1',
|
223
|
+
'type' => 'type1',
|
224
|
+
'scheduler' => 'user1',
|
225
|
+
'earliest' => 1234,
|
226
|
+
'completedSystems' => 1,
|
227
|
+
'failedSystems' => 2,
|
228
|
+
'inProgressSystems' => 0,
|
229
|
+
},
|
230
|
+
{
|
231
|
+
'id' => 2,
|
232
|
+
'name' => 'name2',
|
233
|
+
'type' => 'type2',
|
234
|
+
'scheduler' => 'user2',
|
235
|
+
'earliest' => 1235,
|
236
|
+
'completedSystems' => 2,
|
237
|
+
'failedSystems' => 3,
|
238
|
+
'inProgressSystems' => 1,
|
239
|
+
}
|
240
|
+
])
|
241
|
+
end
|
242
|
+
end
|
243
|
+
describe ".list_in_progress_actions" do
|
244
|
+
it "should list all the actions in progress" do
|
245
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with("schedule.listInProgressActions",'token').returns([
|
246
|
+
{
|
247
|
+
'id' => 1,
|
248
|
+
'name' => 'name1',
|
249
|
+
'type' => 'type1',
|
250
|
+
'scheduler' => 'user1',
|
251
|
+
'earliest' => 1234,
|
252
|
+
'completedSystems' => 1,
|
253
|
+
'failedSystems' => 2,
|
254
|
+
'inProgressSystems' => 0,
|
255
|
+
},
|
256
|
+
{
|
257
|
+
'id' => 2,
|
258
|
+
'name' => 'name2',
|
259
|
+
'type' => 'type2',
|
260
|
+
'scheduler' => 'user2',
|
261
|
+
'earliest' => 1235,
|
262
|
+
'completedSystems' => 2,
|
263
|
+
'failedSystems' => 3,
|
264
|
+
'inProgressSystems' => 1,
|
265
|
+
}
|
266
|
+
])
|
267
|
+
|
268
|
+
RhnSatellite::Schedule.list_in_progress_actions.should eql([
|
269
|
+
{
|
270
|
+
'id' => 1,
|
271
|
+
'name' => 'name1',
|
272
|
+
'type' => 'type1',
|
273
|
+
'scheduler' => 'user1',
|
274
|
+
'earliest' => 1234,
|
275
|
+
'completedSystems' => 1,
|
276
|
+
'failedSystems' => 2,
|
277
|
+
'inProgressSystems' => 0,
|
278
|
+
},
|
279
|
+
{
|
280
|
+
'id' => 2,
|
281
|
+
'name' => 'name2',
|
282
|
+
'type' => 'type2',
|
283
|
+
'scheduler' => 'user2',
|
284
|
+
'earliest' => 1235,
|
285
|
+
'completedSystems' => 2,
|
286
|
+
'failedSystems' => 3,
|
287
|
+
'inProgressSystems' => 1,
|
288
|
+
}
|
289
|
+
])
|
290
|
+
end
|
291
|
+
end
|
292
|
+
describe ".list_completed_systems" do
|
293
|
+
it "should list all the completed systems" do
|
294
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with("schedule.listCompletedSystems",'token','1').returns([
|
295
|
+
{
|
296
|
+
'id' => 1,
|
297
|
+
'name' => 'name1',
|
298
|
+
'base_channel' => 'channel1',
|
299
|
+
'timestamp' => 1234,
|
300
|
+
'message' => '',
|
301
|
+
},
|
302
|
+
{
|
303
|
+
'id' => 2,
|
304
|
+
'name' => 'name2',
|
305
|
+
'base_channel' => 'channel2',
|
306
|
+
'timestamp' => 1234,
|
307
|
+
'message' => '',
|
308
|
+
}
|
309
|
+
])
|
310
|
+
|
311
|
+
RhnSatellite::Schedule.list_completed_systems('1').should eql([
|
312
|
+
{
|
313
|
+
'id' => 1,
|
314
|
+
'name' => 'name1',
|
315
|
+
'base_channel' => 'channel1',
|
316
|
+
'timestamp' => 1234,
|
317
|
+
'message' => '',
|
318
|
+
},
|
319
|
+
{
|
320
|
+
'id' => 2,
|
321
|
+
'name' => 'name2',
|
322
|
+
'base_channel' => 'channel2',
|
323
|
+
'timestamp' => 1234,
|
324
|
+
'message' => '',
|
325
|
+
}
|
326
|
+
])
|
327
|
+
end
|
328
|
+
end
|
329
|
+
describe ".list_failed_systems" do
|
330
|
+
it "should list all the completed systems" do
|
331
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with("schedule.listFailedSystems",'token','1').returns([
|
332
|
+
{
|
333
|
+
'id' => 1,
|
334
|
+
'name' => 'name1',
|
335
|
+
'base_channel' => 'channel1',
|
336
|
+
'timestamp' => 1234,
|
337
|
+
'message' => '',
|
338
|
+
},
|
339
|
+
{
|
340
|
+
'id' => 2,
|
341
|
+
'name' => 'name2',
|
342
|
+
'base_channel' => 'channel2',
|
343
|
+
'timestamp' => 1234,
|
344
|
+
'message' => '',
|
345
|
+
}
|
346
|
+
])
|
347
|
+
|
348
|
+
RhnSatellite::Schedule.list_failed_systems('1').should eql([
|
349
|
+
{
|
350
|
+
'id' => 1,
|
351
|
+
'name' => 'name1',
|
352
|
+
'base_channel' => 'channel1',
|
353
|
+
'timestamp' => 1234,
|
354
|
+
'message' => '',
|
355
|
+
},
|
356
|
+
{
|
357
|
+
'id' => 2,
|
358
|
+
'name' => 'name2',
|
359
|
+
'base_channel' => 'channel2',
|
360
|
+
'timestamp' => 1234,
|
361
|
+
'message' => '',
|
362
|
+
}
|
363
|
+
])
|
364
|
+
end
|
365
|
+
end
|
366
|
+
describe ".list_in_progress_systems" do
|
367
|
+
it "should list all the completed systems" do
|
368
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with("schedule.listInProgressSystems",'token','1').returns([
|
369
|
+
{
|
370
|
+
'id' => 1,
|
371
|
+
'name' => 'name1',
|
372
|
+
'base_channel' => 'channel1',
|
373
|
+
'timestamp' => 1234,
|
374
|
+
'message' => '',
|
375
|
+
},
|
376
|
+
{
|
377
|
+
'id' => 2,
|
378
|
+
'name' => 'name2',
|
379
|
+
'base_channel' => 'channel2',
|
380
|
+
'timestamp' => 1234,
|
381
|
+
'message' => '',
|
382
|
+
}
|
383
|
+
])
|
384
|
+
|
385
|
+
RhnSatellite::Schedule.list_in_progress_systems('1').should eql([
|
386
|
+
{
|
387
|
+
'id' => 1,
|
388
|
+
'name' => 'name1',
|
389
|
+
'base_channel' => 'channel1',
|
390
|
+
'timestamp' => 1234,
|
391
|
+
'message' => '',
|
392
|
+
},
|
393
|
+
{
|
394
|
+
'id' => 2,
|
395
|
+
'name' => 'name2',
|
396
|
+
'base_channel' => 'channel2',
|
397
|
+
'timestamp' => 1234,
|
398
|
+
'message' => '',
|
399
|
+
}
|
400
|
+
])
|
401
|
+
end
|
402
|
+
end
|
403
|
+
end
|
@@ -57,6 +57,15 @@ describe RhnSatellite::System do
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
end
|
60
|
+
|
61
|
+
describe '.get_id' do
|
62
|
+
before :each do
|
63
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.getId',"token",'sysname').returns({'name' => "sysname", 'id' => '123'})
|
64
|
+
end
|
65
|
+
it "finds a system id" do
|
66
|
+
RhnSatellite::System.get_id('sysname').should eql({'name' => 'sysname', 'id' => '123'})
|
67
|
+
end
|
68
|
+
end
|
60
69
|
|
61
70
|
describe ".relevant_erratas" do
|
62
71
|
it "logins and returns a bunch of activation keys" do
|
@@ -72,6 +81,20 @@ describe RhnSatellite::System do
|
|
72
81
|
end
|
73
82
|
end
|
74
83
|
|
84
|
+
describe ".newer_installed_packages" do
|
85
|
+
it "logins and returns a bunch of packages" do
|
86
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.listNewerInstalledPackages',"token","1","kernel","0","0","").returns(["package1","package2"])
|
87
|
+
|
88
|
+
RhnSatellite::System.newer_installed_packages("1","kernel","0","0","").should eql(["package1","package2"])
|
89
|
+
end
|
90
|
+
|
91
|
+
it "returns an empty array on an empty answer" do
|
92
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.listNewerInstalledPackages',"token","1","noexist","0","0","").returns(nil)
|
93
|
+
|
94
|
+
RhnSatellite::System.newer_installed_packages("1","noexist","0","0","").should eql([])
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
75
98
|
describe ".latest_installable_packages" do
|
76
99
|
it "logins and returns a bunch of packages" do
|
77
100
|
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.listLatestInstallablePackages',"token","1").returns(["package1","package2"])
|
@@ -177,6 +200,26 @@ describe RhnSatellite::System do
|
|
177
200
|
end
|
178
201
|
end
|
179
202
|
|
203
|
+
describe ".delete" do
|
204
|
+
it "logs in and should delete a system ID" do
|
205
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.deleteSystems','token',[1]).returns(1)
|
206
|
+
|
207
|
+
RhnSatellite::System.delete(1).should eql(1)
|
208
|
+
end
|
209
|
+
|
210
|
+
it "logs in and should delete multiple system IDs" do
|
211
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.deleteSystems','token',[1,2]).returns(1)
|
212
|
+
|
213
|
+
RhnSatellite::System.delete([1,2]).should eql(1)
|
214
|
+
end
|
215
|
+
|
216
|
+
it "returns nothing on an inexistant system ID" do
|
217
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.deleteSystems',"token",[1233]).returns(nil)
|
218
|
+
|
219
|
+
RhnSatellite::System.delete(1233).should eql(nil)
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
180
223
|
describe ".detail" do
|
181
224
|
it "logins and returns details of a system" do
|
182
225
|
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.getDetails',"token",1).returns("foo")
|
@@ -308,13 +351,60 @@ describe RhnSatellite::System do
|
|
308
351
|
RhnSatellite::System.schedule_package_install(1,[1,2]).should eql(1)
|
309
352
|
end
|
310
353
|
|
311
|
-
it "should schedule a
|
354
|
+
it "should schedule a package install to a certain time" do
|
312
355
|
later = DateTime.now+600
|
313
356
|
XMLRPC::DateTime.expects(:new).once.returns('foo')
|
314
357
|
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.schedulePackageInstall','token',1,[1,2],'foo').returns(1)
|
315
358
|
RhnSatellite::System.schedule_package_install(1,[1,2],later).should eql(1)
|
316
359
|
|
360
|
+
end
|
361
|
+
end
|
362
|
+
|
363
|
+
describe ".schedule_script_run" do
|
364
|
+
it "should schedule a script run immediately by default" do
|
365
|
+
now = Time.now
|
366
|
+
Time.expects(:now).once.returns(now)
|
367
|
+
XMLRPC::DateTime.expects(:new).once.returns('foo')
|
368
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.scheduleScriptRun','token',1,'user','group',5,'#!/bin/bash\necho "hello"','foo').returns(1)
|
369
|
+
RhnSatellite::System.schedule_script_run(1,'user','group',5,'#!/bin/bash\necho "hello"').should eql(1)
|
370
|
+
end
|
371
|
+
|
372
|
+
it "should schedule a script run to a certain time" do
|
373
|
+
later = DateTime.now+600
|
374
|
+
XMLRPC::DateTime.expects(:new).once.returns('foo')
|
375
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.scheduleScriptRun','token',[1,2],'user','group',5,'#!/bin/bash\necho "hello"','foo').returns(1)
|
376
|
+
RhnSatellite::System.schedule_script_runs([1,2],'user','group',5,'#!/bin/bash\necho "hello"',later).should eql(1)
|
377
|
+
|
317
378
|
end
|
318
379
|
end
|
380
|
+
|
381
|
+
describe ".script_results" do
|
382
|
+
it "logins and returns results of a script" do
|
383
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.getScriptResults',"token","1").returns(["result1","result2"])
|
384
|
+
|
385
|
+
RhnSatellite::System.script_results("1").should eql(["result1","result2"])
|
386
|
+
end
|
387
|
+
|
388
|
+
it "returns an empty array on an empty answer" do
|
389
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.getScriptResults',"token","1").returns(nil)
|
390
|
+
|
391
|
+
RhnSatellite::System.script_results("1").should eql([])
|
392
|
+
end
|
393
|
+
end
|
394
|
+
|
395
|
+
describe ".script_action_details" do
|
396
|
+
it "logins and returns details of a script" do
|
397
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.getScriptActionDetails',"token","1").returns(["details1","details2"])
|
398
|
+
|
399
|
+
RhnSatellite::System.script_action_details("1").should eql(["details1","details2"])
|
400
|
+
end
|
401
|
+
|
402
|
+
it "returns an empty array on an empty answer" do
|
403
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('system.getScriptActionDetails',"token","1").returns(nil)
|
404
|
+
|
405
|
+
RhnSatellite::System.script_action_details("1").should eql([])
|
406
|
+
end
|
407
|
+
end
|
408
|
+
|
319
409
|
end
|
320
410
|
end
|
@@ -88,6 +88,28 @@ describe RhnSatellite::Systemgroup do
|
|
88
88
|
RhnSatellite::Systemgroup.add_systems('foogroup',['1','2']).should eql(true)
|
89
89
|
end
|
90
90
|
end
|
91
|
+
|
92
|
+
describe ".active_systems" do
|
93
|
+
it "should list active systems in a group" do
|
94
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('systemgroup.listActiveSystemsInGroup',"token",'foogroup').returns([1])
|
95
|
+
|
96
|
+
RhnSatellite::Systemgroup.active_systems('foogroup').should eql([1])
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
describe ".inactive_systems" do
|
101
|
+
it "should list inactive systems in a group" do
|
102
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('systemgroup.listInactiveSystemsInGroup',"token",'foogroup').returns([1])
|
103
|
+
|
104
|
+
RhnSatellite::Systemgroup.inactive_systems('foogroup').should eql([1])
|
105
|
+
end
|
106
|
+
|
107
|
+
it "should list inactive systems in a group based on given days" do
|
108
|
+
RhnSatellite::Connection::Handler.any_instance.expects(:make_call).with('systemgroup.listInactiveSystemsInGroup',"token",'foogroup',7).returns([1])
|
109
|
+
|
110
|
+
RhnSatellite::Systemgroup.inactive_systems('foogroup',7).should eql([1])
|
111
|
+
end
|
112
|
+
end
|
91
113
|
|
92
114
|
[:systems, :systems_safe].each do |m|
|
93
115
|
describe ".#{m.to_s}" do
|
metadata
CHANGED
@@ -1,126 +1,109 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rhn_satellite
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 6
|
10
|
-
version: 0.0.6
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- duritong
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
11
|
+
date: 2014-06-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 2.5.0
|
22
20
|
type: :development
|
23
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
24
|
-
none: false
|
25
|
-
requirements:
|
26
|
-
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 3
|
29
|
-
segments:
|
30
|
-
- 2
|
31
|
-
- 3
|
32
|
-
- 0
|
33
|
-
version: 2.3.0
|
34
|
-
requirement: *id001
|
35
21
|
prerelease: false
|
36
|
-
|
37
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.5.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rdoc
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.8'
|
38
34
|
type: :development
|
39
|
-
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
|
-
none: false
|
41
|
-
requirements:
|
42
|
-
- - ~>
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
hash: 23
|
45
|
-
segments:
|
46
|
-
- 1
|
47
|
-
- 0
|
48
|
-
- 0
|
49
|
-
version: 1.0.0
|
50
|
-
requirement: *id002
|
51
35
|
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.8'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: mocha
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.10.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.10.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
52
56
|
name: bundler
|
53
|
-
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
54
62
|
type: :development
|
55
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
56
|
-
none: false
|
57
|
-
requirements:
|
58
|
-
- - ~>
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
hash: 7
|
61
|
-
segments:
|
62
|
-
- 1
|
63
|
-
- 6
|
64
|
-
- 4
|
65
|
-
version: 1.6.4
|
66
|
-
requirement: *id003
|
67
63
|
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
68
70
|
name: jeweler
|
69
|
-
|
70
|
-
|
71
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
72
|
-
none: false
|
73
|
-
requirements:
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
74
73
|
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
segments:
|
78
|
-
- 0
|
79
|
-
version: "0"
|
80
|
-
requirement: *id004
|
81
|
-
prerelease: false
|
82
|
-
name: rcov
|
83
|
-
- !ruby/object:Gem::Dependency
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
84
76
|
type: :development
|
85
|
-
version_requirements: &id005 !ruby/object:Gem::Requirement
|
86
|
-
none: false
|
87
|
-
requirements:
|
88
|
-
- - ~>
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
hash: 47
|
91
|
-
segments:
|
92
|
-
- 0
|
93
|
-
- 9
|
94
|
-
- 10
|
95
|
-
version: 0.9.10
|
96
|
-
requirement: *id005
|
97
77
|
prerelease: false
|
98
|
-
|
99
|
-
|
100
|
-
type: :development
|
101
|
-
version_requirements: &id006 !ruby/object:Gem::Requirement
|
102
|
-
none: false
|
103
|
-
requirements:
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
104
80
|
- - ">="
|
105
|
-
- !ruby/object:Gem::Version
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: simplecov
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
111
91
|
prerelease: false
|
112
|
-
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
113
97
|
description: It provides an easy way to interact with a RedHat Satellite API.
|
114
98
|
email: peter.meier@immerda.ch
|
115
99
|
executables: []
|
116
|
-
|
117
100
|
extensions: []
|
118
|
-
|
119
|
-
extra_rdoc_files:
|
101
|
+
extra_rdoc_files:
|
120
102
|
- LICENSE.txt
|
121
103
|
- README.rdoc
|
122
|
-
files:
|
123
|
-
- .rspec
|
104
|
+
files:
|
105
|
+
- ".rspec"
|
106
|
+
- ".travis.yml"
|
124
107
|
- Gemfile
|
125
108
|
- Gemfile.lock
|
126
109
|
- LICENSE.txt
|
@@ -139,6 +122,7 @@ files:
|
|
139
122
|
- lib/rhn_satellite/connection/base.rb
|
140
123
|
- lib/rhn_satellite/connection/handler.rb
|
141
124
|
- lib/rhn_satellite/packages.rb
|
125
|
+
- lib/rhn_satellite/schedule.rb
|
142
126
|
- lib/rhn_satellite/system.rb
|
143
127
|
- lib/rhn_satellite/systemgroup.rb
|
144
128
|
- rhn_satellite.gemspec
|
@@ -154,41 +138,31 @@ files:
|
|
154
138
|
- spec/unit/rhn_satellite/connection/base_spec.rb
|
155
139
|
- spec/unit/rhn_satellite/connection/handler_spec.rb
|
156
140
|
- spec/unit/rhn_satellite/packages_spec.rb
|
141
|
+
- spec/unit/rhn_satellite/schedule_spec.rb
|
157
142
|
- spec/unit/rhn_satellite/system_spec.rb
|
158
143
|
- spec/unit/rhn_satellite/systemgroup_spec.rb
|
159
|
-
has_rdoc: true
|
160
144
|
homepage: http://github.com/duritong/ruby-rhn_satellite
|
161
|
-
licenses:
|
145
|
+
licenses:
|
162
146
|
- MIT
|
147
|
+
metadata: {}
|
163
148
|
post_install_message:
|
164
149
|
rdoc_options: []
|
165
|
-
|
166
|
-
require_paths:
|
150
|
+
require_paths:
|
167
151
|
- lib
|
168
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
169
|
-
|
170
|
-
requirements:
|
152
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
153
|
+
requirements:
|
171
154
|
- - ">="
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
version: "0"
|
177
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
|
-
none: false
|
179
|
-
requirements:
|
155
|
+
- !ruby/object:Gem::Version
|
156
|
+
version: '0'
|
157
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
158
|
+
requirements:
|
180
159
|
- - ">="
|
181
|
-
- !ruby/object:Gem::Version
|
182
|
-
|
183
|
-
segments:
|
184
|
-
- 0
|
185
|
-
version: "0"
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
186
162
|
requirements: []
|
187
|
-
|
188
163
|
rubyforge_project:
|
189
|
-
rubygems_version:
|
164
|
+
rubygems_version: 2.2.1
|
190
165
|
signing_key:
|
191
|
-
specification_version:
|
166
|
+
specification_version: 4
|
192
167
|
summary: RhnSatellite is a ruby api to the RedHat Satellite
|
193
168
|
test_files: []
|
194
|
-
|