solaris-patch 1.0.2 → 1.0.3
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/README.rdoc +12 -13
- data/Rakefile +7 -7
- data/lib/solaris.rb +0 -2
- data/lib/solaris/exception.rb +0 -2
- data/lib/solaris/patch.rb +15 -17
- data/lib/solaris/patchdiag.rb +50 -32
- data/lib/solaris/patchdiag_entry.rb +24 -20
- data/lib/solaris/util.rb +6 -8
- data/test/test_patch.rb +39 -41
- data/test/test_patchdiag.rb +145 -105
- data/test/test_patchdiag_entry.rb +88 -68
- data/test/test_solaris.rb +1 -3
- data/test/test_util.rb +3 -5
- metadata +22 -21
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
require 'test/unit'
|
3
2
|
require 'solaris/patchdiag_entry'
|
4
3
|
|
@@ -7,109 +6,130 @@ class TestPatchdiagEntry < Test::Unit::TestCase #:nodoc:
|
|
7
6
|
|
8
7
|
def test_146636_01
|
9
8
|
line = '146336|01|Jan/13/11| | | | |10|sparc;118833-36;120011-14;127127-11;137137-09;142909-17;|SUNWarc:11.10.0,REV=2005.01.21.15.53;SUNWcsl:11.10.0,REV=2005.01.21.15.53;|SunOS 5.10: libsldap.so.1 patch'
|
10
|
-
pde = Solaris::PatchdiagEntry.new(
|
11
|
-
assert_equal(
|
12
|
-
assert_equal(
|
13
|
-
assert_equal(
|
14
|
-
assert_equal(
|
15
|
-
assert_equal(
|
16
|
-
assert_equal(
|
17
|
-
assert_equal(
|
18
|
-
assert_equal(
|
19
|
-
assert_equal(
|
20
|
-
'SUNWcsl:11.10.0,REV=2005.01.21.15.53'], pde.pkgs
|
21
|
-
assert_equal(
|
22
|
-
assert_equal(
|
23
|
-
assert_equal(
|
9
|
+
pde = Solaris::PatchdiagEntry.new(line)
|
10
|
+
assert_equal(146336, pde.major)
|
11
|
+
assert_equal(1, pde.minor)
|
12
|
+
assert_equal(false, pde.recommended?)
|
13
|
+
assert_equal(false, pde.obsolete?)
|
14
|
+
assert_equal(false, pde.security?)
|
15
|
+
assert_equal(Date.new(2011, 1, 13), pde.date)
|
16
|
+
assert_equal('10', pde.os)
|
17
|
+
assert_equal('146336-01', pde.patch.to_s)
|
18
|
+
assert_equal(['SUNWarc:11.10.0,REV=2005.01.21.15.53',
|
19
|
+
'SUNWcsl:11.10.0,REV=2005.01.21.15.53'], pde.pkgs)
|
20
|
+
assert_equal(['sparc', '118833-36', '120011-14', '127127-11', '137137-09', '142909-17'], pde.archs)
|
21
|
+
assert_equal('SunOS 5.10: libsldap.so.1 patch', pde.synopsis)
|
22
|
+
assert_equal(line, pde.to_s)
|
24
23
|
end
|
25
24
|
|
26
25
|
def test_100393_01
|
27
26
|
line = '100393|01|Sep/02/94| | |O| |Unbundled|||OBSOLETED by 100394'
|
28
|
-
pde = Solaris::PatchdiagEntry.new(
|
29
|
-
assert_equal(
|
30
|
-
assert_equal(
|
31
|
-
assert_equal(
|
32
|
-
assert_equal(
|
33
|
-
assert_equal(
|
34
|
-
assert_equal(
|
35
|
-
assert_equal(
|
36
|
-
assert_equal(
|
37
|
-
assert_equal(
|
38
|
-
assert_equal(
|
39
|
-
assert_equal(
|
40
|
-
assert_equal(
|
27
|
+
pde = Solaris::PatchdiagEntry.new(line)
|
28
|
+
assert_equal(100393, pde.major)
|
29
|
+
assert_equal(1, pde.minor)
|
30
|
+
assert_equal(false, pde.recommended?)
|
31
|
+
assert_equal(true, pde.obsolete?)
|
32
|
+
assert_equal(false, pde.security?)
|
33
|
+
assert_equal(Date.new(1994, 9, 2), pde.date)
|
34
|
+
assert_equal('Unbundled', pde.os)
|
35
|
+
assert_equal('100393-01', pde.patch.to_s)
|
36
|
+
assert_equal([], pde.pkgs)
|
37
|
+
assert_equal([], pde.archs)
|
38
|
+
assert_equal('OBSOLETED by 100394', pde.synopsis)
|
39
|
+
assert_equal(line, pde.to_s)
|
41
40
|
end
|
42
41
|
|
43
42
|
def test_146364_01
|
44
43
|
line = '146364|01|Jan/04/11|R|S| | |10_x86|i386;119758-19;|SUNWsfman:11.10.0,REV=2005.01.08.01.09;SUNWsmbaS:11.10.0,REV=2005.01.08.01.09;SUNWsmbar:11.10.0,REV=2005.01.08.01.09;SUNWsmbau:11.10.0,REV=2005.01.08.01.09;|SunOS 5.10_x86: Samba patch'
|
45
|
-
pde = Solaris::PatchdiagEntry.new(
|
46
|
-
assert_equal(
|
47
|
-
assert_equal(
|
48
|
-
assert_equal(
|
49
|
-
assert_equal(
|
50
|
-
assert_equal(
|
51
|
-
assert_equal(
|
52
|
-
assert_equal(
|
53
|
-
assert_equal(
|
54
|
-
assert_equal(
|
44
|
+
pde = Solaris::PatchdiagEntry.new(line)
|
45
|
+
assert_equal(146364, pde.major)
|
46
|
+
assert_equal(1, pde.minor)
|
47
|
+
assert_equal(true, pde.recommended?)
|
48
|
+
assert_equal(false, pde.obsolete?)
|
49
|
+
assert_equal(true, pde.security?)
|
50
|
+
assert_equal(Date.new(2011, 1, 4), pde.date)
|
51
|
+
assert_equal('10_x86', pde.os)
|
52
|
+
assert_equal('146364-01', pde.patch.to_s)
|
53
|
+
assert_equal(['SUNWsfman:11.10.0,REV=2005.01.08.01.09',
|
55
54
|
'SUNWsmbaS:11.10.0,REV=2005.01.08.01.09',
|
56
55
|
'SUNWsmbar:11.10.0,REV=2005.01.08.01.09',
|
57
56
|
'SUNWsmbau:11.10.0,REV=2005.01.08.01.09'],
|
58
|
-
pde.pkgs
|
59
|
-
assert_equal(
|
60
|
-
assert_equal(
|
61
|
-
assert_equal(
|
57
|
+
pde.pkgs)
|
58
|
+
assert_equal(['i386', '119758-19'], pde.archs)
|
59
|
+
assert_equal('SunOS 5.10_x86: Samba patch', pde.synopsis)
|
60
|
+
assert_equal(line, pde.to_s)
|
61
|
+
end
|
62
|
+
|
63
|
+
def test_date_padding
|
64
|
+
line = '103346|30|Oct/03/02| | | | |Unbundled|||Hardware/PROM: Sun Enterprise 3x00/4x00/5x00/6x00 flashprom update'
|
65
|
+
pde = Solaris::PatchdiagEntry.new(line)
|
66
|
+
assert_equal(line, pde.to_s)
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_y2k_bad
|
70
|
+
line = '104018|10|Jul/02/04| |S|O|YB|Unbundled|sparc;|SUNWsnmct:2.3;SUNWccrcv:1.2;SUNWsnmct:2.3,PATCH=10;SUNWccsnd:1.2;SUNWccsnd:1.2,PATCH=10;SUNWccrcv:1.2,PATCH=10;SUNWcccfg:1.2;SUNWsnmpd:2.3;SUNWcccfg:1.2,PATCH=10;SUNWsnmpd:2.3,PATCH=10;SUNWsnmag:2.3,PATCH=10;SUNWsnmag:2.3;|WITHDRAWN PATCH Obsoleted by: 104018-11 Solstice Site/SunNet/Domai'
|
71
|
+
pde = Solaris::PatchdiagEntry.new(line)
|
72
|
+
assert(pde.bad?)
|
73
|
+
assert(pde.y2k?)
|
74
|
+
assert_equal(line, pde.to_s)
|
62
75
|
end
|
63
76
|
|
64
77
|
def test_compare_equal
|
65
78
|
line = '100393|01|Sep/02/94| | |O| |Unbundled|||OBSOLETED by 100394'
|
66
|
-
assert_equal(Solaris::PatchdiagEntry.new(
|
67
|
-
Solaris::PatchdiagEntry.new(
|
79
|
+
assert_equal(Solaris::PatchdiagEntry.new(line),
|
80
|
+
Solaris::PatchdiagEntry.new(line))
|
68
81
|
end
|
69
82
|
|
70
83
|
def test_compare_less_than
|
71
84
|
line1 = '100393|01|Sep/02/94| | |O| |Unbundled|||OBSOLETED by 100394'
|
72
85
|
line2 = '146364|01|Jan/04/11|R|S| | |10_x86|i386;119758-19;|SUNWsfman:11.10.0,REV=2005.01.08.01.09;SUNWsmbaS:11.10.0,REV=2005.01.08.01.09;SUNWsmbar:11.10.0,REV=2005.01.08.01.09;SUNWsmbau:11.10.0,REV=2005.01.08.01.09;|SunOS 5.10_x86: Samba patch'
|
73
|
-
assert(
|
86
|
+
assert(Solaris::PatchdiagEntry.new(line1) < Solaris::PatchdiagEntry.new(line2))
|
74
87
|
end
|
75
88
|
|
76
89
|
def test_successor
|
77
|
-
assert_raise(
|
78
|
-
successor(
|
90
|
+
assert_raise(Solaris::Patch::NotObsolete) do
|
91
|
+
successor('100287|05|Oct/31/91| | | | |Unbundled|||PC-NFS 3.5c: Jumbo patch (updated PRT.COM to v3.5c)')
|
79
92
|
end
|
80
|
-
assert_equal(
|
81
|
-
assert_equal(
|
82
|
-
assert_equal(
|
83
|
-
assert_equal(
|
84
|
-
assert_raise(
|
85
|
-
successor(
|
93
|
+
assert_equal('110258-01', successor('109687|01|Aug/11/00| | |O| |Unbundled|sparc;|VRTSvxvm:3.0.4,REV=04.18.2000.10.00;|Obsoleted by : 110258-01 VxVM 3.0.4: vxio and vxdmp driver patch'))
|
94
|
+
assert_equal('101318-94', successor('101859|01|Feb/06/01| | |O| |2.3|sparc;|SUNWcsr:11.5.0,REV=2.0.19,PATCH=118;|Obsoleted by: 101318-94 SunOS 5.3: socket lib in 2.3/2.2 have prob'))
|
95
|
+
assert_equal('106542', successor('107440|01|Mar/26/99| | |O| |7_x86||SUNWcar:11.7.0,REV=1998.09.01.04.53;|OBSOLETED by: 106542 SunOS 5.7_x86: /platform/i86pc/kernel/mmu/mm'))
|
96
|
+
assert_equal('109212-02', successor('108191|01|Sep/07/99| | |O| B|Unbundled|||Obsoleted by: 109212-02 OBSOLETED by WITHDRAWN'))
|
97
|
+
assert_raise(Solaris::Patch::InvalidSuccessor) do
|
98
|
+
successor('100807|03|May/02/94| | |O| B|Unbundled|||OBSOLETED by WITHDRAWN')
|
86
99
|
end
|
87
|
-
assert_equal(
|
88
|
-
assert_raise(
|
89
|
-
successor(
|
100
|
+
assert_equal('100394', successor('100393|01|Sep/02/94| | |O| |Unbundled|||OBSOLETED by 100394'))
|
101
|
+
assert_raise(Solaris::Patch::MultipleSuccessors) do
|
102
|
+
successor('105716|07|Jun/30/99| |S|O| |Unbundled||SUNWdtbas:1.0.2,REV=10.96.04.12;|OBSOLETED by 108363 and 108289')
|
90
103
|
end
|
91
|
-
assert_raise(
|
92
|
-
successor(
|
104
|
+
assert_raise(Solaris::Patch::MultipleSuccessors) do
|
105
|
+
successor('105717|06|Jun/30/99| |S|O| |Unbundled||SUNWdtbas:1.0.2,REV=10.96.04.12;|OBSOLETED by 108290 and 108364')
|
93
106
|
end
|
94
|
-
assert_equal(
|
95
|
-
assert_equal(
|
96
|
-
assert_equal(
|
97
|
-
assert_raise(
|
107
|
+
assert_equal('110256-01', successor('109685|02|Feb/09/01| | |O| |Unbundled|sparc;|VRTSvxvm:3.0.4,REV=04.18.2000.10.00;|Obsoleted by 110256-01: VxVM 3.0.4: vxio and vxdmp driver patch'))
|
108
|
+
assert_equal('110257-01', successor('109686|02|Feb/09/01| | |O| |Unbundled|sparc;|VRTSvxvm:3.0.4,REV=04.18.2000.10.00;|OBSOLETED by 110257-01: VxVM 3.0.4: vxio and vxdmp driver patch'))
|
109
|
+
assert_equal('106513-07', successor('106513|06|Oct/03/00| | |O| B|Unbundled|sparc;|SUNWosafw:6.01,REV=01.11;SUNWosau:6.01,REV=01.11;108555-02;|WITHDRAWN Obsoleted by: 106513-07 RM 6.1.1: generic Raid Manager 6'))
|
110
|
+
assert_raise(Solaris::Patch::InvalidSuccessor) do
|
98
111
|
# NB fudged the obsolete flag here
|
99
|
-
successor(
|
112
|
+
successor('111442|01|May/04/01| | |O| B|2.5.1|sparc;sparc.sun4c;sparc.sun4d;sparc.sun4m;sparc.sun4u;sparc.sun4u1;103640-35;|SUNWcar:11.5.1,REV=96.05.02.21.09;SUNWcar:11.5.1,REV=97.02.21.21.14;SUNWcsr:11.5.1,REV=96.05.02.21.09;103640-36;|WITHDRAWN PATCH Obsolete by: <INTEGRATION> SunOS 5.5.1: Supplement')
|
100
113
|
end
|
101
|
-
assert_equal(
|
102
|
-
assert_raise(
|
114
|
+
assert_equal('103901-08', successor('103901|07|Aug/05/97| |S|O| B|2.5.1|||WITHDRAWN PATCH Obsoleted by: 103901-08 OpenWindows 3.5.1: Xview P'))
|
115
|
+
assert_raise(Solaris::Patch::InvalidSuccessor) do
|
103
116
|
# NB fudged the obsolete flag here
|
104
|
-
successor(
|
117
|
+
successor('111433|02|Jun/04/01| | |O| B|8|sparc;sparc.sun4d;sparc.sun4m;sparc.sun4u;sparc.sun4us;108528-08;|FJSVhea:1.0,REV=1999.12.23.19.10;SUNWcar:11.8.0,REV=2000.01.08.18.12;SUNWcar:11.8.0,REV=2000.01.13.13.40;SUNWcarx:11.8.0,REV=2000.01.08.18.12;SUNWcarx:11.8.0,REV=2000.01.13.13.40;SUNWcsr:11.8.0,REV=2000.01.08.18.12;SUNWhea:11.8.0,REV=2000.01.08.18.12;108528-09;|WITHDRAWN PATCH Obsoleted by: <Integration> SunOS 5.8: Supplementa')
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
def test_not_enough_fields
|
122
|
+
# YB field missing
|
123
|
+
line = '104018|10|Jul/02/04| |S|O|Unbundled|sparc;|SUNWsnmct:2.3;SUNWccrcv:1.2;SUNWsnmct:2.3,PATCH=10;SUNWccsnd:1.2;SUNWccsnd:1.2,PATCH=10;SUNWccrcv:1.2,PATCH=10;SUNWcccfg:1.2;SUNWsnmpd:2.3;SUNWcccfg:1.2,PATCH=10;SUNWsnmpd:2.3,PATCH=10;SUNWsnmag:2.3,PATCH=10;SUNWsnmag:2.3;|WITHDRAWN PATCH Obsoleted by: 104018-11 Solstice Site/SunNet/Domai'
|
124
|
+
assert_raise(ArgumentError) do
|
125
|
+
Solaris::PatchdiagEntry.new(line)
|
105
126
|
end
|
106
127
|
end
|
107
128
|
|
108
129
|
private
|
109
130
|
|
110
131
|
def successor(line)
|
111
|
-
Solaris::PatchdiagEntry.new(
|
132
|
+
Solaris::PatchdiagEntry.new(line).successor.to_s
|
112
133
|
end
|
113
134
|
|
114
135
|
end
|
115
|
-
|
data/test/test_solaris.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
require 'test/unit'
|
3
2
|
require 'solaris'
|
4
3
|
|
@@ -22,8 +21,7 @@ class TestSolaris < Test::Unit::TestCase #:nodoc:
|
|
22
21
|
end
|
23
22
|
|
24
23
|
def test_test
|
25
|
-
assert_raise(
|
24
|
+
assert_raise(NameError) { Solaris::DoesNotExist }
|
26
25
|
end
|
27
26
|
|
28
27
|
end
|
29
|
-
|
data/test/test_util.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
require 'test/unit'
|
3
2
|
require 'solaris/util'
|
4
3
|
|
@@ -6,7 +5,7 @@ require 'solaris/util'
|
|
6
5
|
class TestUtil < Test::Unit::TestCase #:nodoc:
|
7
6
|
|
8
7
|
def test_to_dir_to_file_mutually_exclusive
|
9
|
-
assert_raise(
|
8
|
+
assert_raise(ArgumentError) do
|
10
9
|
Solaris::Util.download!('http://example.com',
|
11
10
|
:to_dir => 'dir',
|
12
11
|
:to_file => 'file')
|
@@ -14,18 +13,17 @@ class TestUtil < Test::Unit::TestCase #:nodoc:
|
|
14
13
|
end
|
15
14
|
|
16
15
|
def test_user_without_password
|
17
|
-
assert_raise(
|
16
|
+
assert_raise(ArgumentError) do
|
18
17
|
Solaris::Util.download!('http://example.com',
|
19
18
|
:user => 'user')
|
20
19
|
end
|
21
20
|
end
|
22
21
|
|
23
22
|
def test_password_without_user
|
24
|
-
assert_raise(
|
23
|
+
assert_raise(ArgumentError) do
|
25
24
|
Solaris::Util.download!('http://example.com',
|
26
25
|
:password => 'password')
|
27
26
|
end
|
28
27
|
end
|
29
28
|
|
30
29
|
end
|
31
|
-
|
metadata
CHANGED
@@ -1,27 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solaris-patch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Martin Carpenter
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-09-01 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: mechanize
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 1.0.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.0.0
|
25
27
|
description: Provides methods to deal with Solaris patchdiag.xref and patches, including
|
26
28
|
parsing patchdiag.xref, downloads from Oracle (patch and readme), patch version
|
27
29
|
comparison, and generic patchdiag.xref manipulations such as seeking the latest
|
@@ -34,48 +36,47 @@ extra_rdoc_files:
|
|
34
36
|
- Rakefile
|
35
37
|
- README.rdoc
|
36
38
|
files:
|
39
|
+
- lib/solaris.rb
|
37
40
|
- lib/solaris/exception.rb
|
38
41
|
- lib/solaris/patch.rb
|
42
|
+
- lib/solaris/patchdiag.rb
|
39
43
|
- lib/solaris/patchdiag_entry.rb
|
40
44
|
- lib/solaris/util.rb
|
41
|
-
- lib/solaris/patchdiag.rb
|
42
|
-
- lib/solaris.rb
|
43
|
-
- test/test_patchdiag_entry.rb
|
44
45
|
- test/test_patch.rb
|
45
|
-
- test/test_util.rb
|
46
|
-
- test/test_solaris.rb
|
47
46
|
- test/test_patchdiag.rb
|
47
|
+
- test/test_patchdiag_entry.rb
|
48
|
+
- test/test_solaris.rb
|
49
|
+
- test/test_util.rb
|
48
50
|
- LICENSE
|
49
51
|
- Rakefile
|
50
52
|
- README.rdoc
|
51
53
|
homepage: http://mcarpenter.org/projects/solaris-patch
|
52
54
|
licenses:
|
53
55
|
- BSD
|
56
|
+
metadata: {}
|
54
57
|
post_install_message:
|
55
58
|
rdoc_options: []
|
56
59
|
require_paths:
|
57
60
|
- lib
|
58
61
|
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
-
none: false
|
60
62
|
requirements:
|
61
|
-
- -
|
63
|
+
- - '>='
|
62
64
|
- !ruby/object:Gem::Version
|
63
65
|
version: '0'
|
64
66
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
67
|
requirements:
|
67
|
-
- -
|
68
|
+
- - '>='
|
68
69
|
- !ruby/object:Gem::Version
|
69
70
|
version: '0'
|
70
71
|
requirements: []
|
71
72
|
rubyforge_project:
|
72
|
-
rubygems_version:
|
73
|
+
rubygems_version: 2.0.3
|
73
74
|
signing_key:
|
74
|
-
specification_version:
|
75
|
+
specification_version: 4
|
75
76
|
summary: Facilitate the manipulation of Solaris patches
|
76
77
|
test_files:
|
77
|
-
- test/test_patchdiag_entry.rb
|
78
78
|
- test/test_patch.rb
|
79
|
-
- test/test_util.rb
|
80
|
-
- test/test_solaris.rb
|
81
79
|
- test/test_patchdiag.rb
|
80
|
+
- test/test_patchdiag_entry.rb
|
81
|
+
- test/test_solaris.rb
|
82
|
+
- test/test_util.rb
|