kanrisuru 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kanrisuru/version.rb +1 -1
- data/spec/unit/core/apt_spec.rb +42 -0
- data/spec/unit/core/archive_spec.rb +11 -0
- data/spec/unit/core/disk_spec.rb +21 -0
- data/spec/unit/core/file_spec.rb +9 -0
- data/spec/unit/core/find_spec.rb +9 -0
- data/spec/unit/core/group_spec.rb +10 -0
- data/spec/unit/core/ip_spec.rb +59 -0
- data/spec/unit/core/path_spec.rb +16 -0
- data/spec/unit/core/socket_spec.rb +38 -0
- data/spec/unit/core/stat_spec.rb +14 -0
- data/spec/unit/core/system_spec.rb +79 -0
- data/spec/unit/core/transfer_spec.rb +15 -0
- data/spec/unit/core/user_spec.rb +11 -0
- data/spec/unit/core/yum_spec.rb +47 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc51b70af722636189fb05ba719d22c08c1d75c1905d52c6e2991df39791aea3
|
4
|
+
data.tar.gz: fd2aa46cc297aff5fd90e353341a6075f795569c853f0e318424b6e71cd70b4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45697cadc87c9a88a289994570631c68e211e85b655321cb2794f8be463b8eff44095c1e5590bee2676df88dfaa70ba7a419015e63c90407437cc0acce78f009
|
7
|
+
data.tar.gz: 3721081463490e767b26950cf6cb2855887ecdf8c00f1dd33c7de5c24bc6583d5fa34df77dfe2028f103adbe162075153e44f51b02865d3361c0ef44dae7f222
|
data/lib/kanrisuru/version.rb
CHANGED
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Kanrisuru::Core::Apt do
|
6
|
+
it 'responds to apt fields' do
|
7
|
+
expect(Kanrisuru::Core::Apt::Source.new).to respond_to(
|
8
|
+
:url, :dist, :architecture
|
9
|
+
)
|
10
|
+
|
11
|
+
expect(Kanrisuru::Core::Apt::PackageOverview.new).to respond_to(
|
12
|
+
:package, :version, :suites, :architecture, :installed, :upgradeable, :automatic
|
13
|
+
)
|
14
|
+
|
15
|
+
expect(Kanrisuru::Core::Apt::PackageDetail.new).to respond_to(
|
16
|
+
:package,
|
17
|
+
:version,
|
18
|
+
:priority,
|
19
|
+
:section,
|
20
|
+
:origin,
|
21
|
+
:maintainer,
|
22
|
+
:original_maintainer,
|
23
|
+
:bugs,
|
24
|
+
:install_size,
|
25
|
+
:dependencies,
|
26
|
+
:recommends,
|
27
|
+
:provides,
|
28
|
+
:suggests,
|
29
|
+
:breaks,
|
30
|
+
:conflicts,
|
31
|
+
:replaces,
|
32
|
+
:homepage,
|
33
|
+
:task,
|
34
|
+
:supported,
|
35
|
+
:download_size,
|
36
|
+
:apt_manual_installed,
|
37
|
+
:apt_sources,
|
38
|
+
:description,
|
39
|
+
:summary
|
40
|
+
)
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Kanrisuru::Core::Disk do
|
6
|
+
it 'responds to disk fields' do
|
7
|
+
expect(Kanrisuru::Core::Disk::DiskUsage.new).to respond_to(:fsize, :path)
|
8
|
+
expect(Kanrisuru::Core::Disk::DiskFree.new).to respond_to(
|
9
|
+
:file_system, :type, :total, :used, :capacity, :mount
|
10
|
+
)
|
11
|
+
expect(Kanrisuru::Core::Disk::LsblkDevice.new).to respond_to(
|
12
|
+
:name, :maj_dev, :min_dev, :removable_device, :readonly_device, :owner, :group,
|
13
|
+
:mode, :fsize, :type, :mount_point, :fs_type, :uuid, :children
|
14
|
+
)
|
15
|
+
expect(Kanrisuru::Core::Disk::BlkidDevice.new).to respond_to(
|
16
|
+
:name, :label, :uuid, :type, :uuid_sub, :label_fatboot, :version, :usage,
|
17
|
+
:part_uuid, :part_entry_scheme, :part_entry_uuid, :part_entry_type,
|
18
|
+
:part_entry_number, :part_entry_offset, :part_entry_size, :part_entry_disk
|
19
|
+
)
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Kanrisuru::Core::Group do
|
6
|
+
it 'responds to group fields' do
|
7
|
+
expect(Kanrisuru::Core::Group::Group.new).to respond_to(:gid, :name, :users)
|
8
|
+
expect(Kanrisuru::Core::Group::GroupUser.new).to respond_to(:uid, :name)
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Kanrisuru::Core::IP do
|
6
|
+
it 'responds to ip fields' do
|
7
|
+
expect(Kanrisuru::Core::IP::IPROUTE2_JSON_VERSION).to(
|
8
|
+
eq(180_129)
|
9
|
+
)
|
10
|
+
|
11
|
+
expect(Kanrisuru::Core::IP::IP_ROUTE_TYPES).to(
|
12
|
+
eq(%w[
|
13
|
+
unicast unreachable blackhole prohibit local
|
14
|
+
broadcast throw nat via anycast multicast
|
15
|
+
])
|
16
|
+
)
|
17
|
+
|
18
|
+
expect(Kanrisuru::Core::IP::IPLinkProperty.new).to respond_to(
|
19
|
+
:index, :name, :flags, :mtu,
|
20
|
+
:qdisc, :state, :group, :qlen,
|
21
|
+
:link_mode, :link_type, :mac_address, :alias,
|
22
|
+
:stats
|
23
|
+
)
|
24
|
+
expect(Kanrisuru::Core::IP::IPAddressProperty.new).to respond_to(
|
25
|
+
:index, :name, :flags, :mtu,
|
26
|
+
:qdisc, :state, :group, :qlen,
|
27
|
+
:link_type, :mac_address,
|
28
|
+
:address_info, :stats
|
29
|
+
)
|
30
|
+
expect(Kanrisuru::Core::IP::IPAddressInfo.new).to respond_to(
|
31
|
+
:family, :ip, :broadcast, :scope,
|
32
|
+
:dynamic, :valid_life_time, :preferred_life_time
|
33
|
+
)
|
34
|
+
expect(Kanrisuru::Core::IP::IPAddressLabel.new).to respond_to(
|
35
|
+
:address, :prefix_length, :label
|
36
|
+
)
|
37
|
+
expect(Kanrisuru::Core::IP::IPRoute.new).to respond_to(
|
38
|
+
:destination, :gateway, :device, :protocol, :scope, :preferred_source, :metric, :flags
|
39
|
+
)
|
40
|
+
expect(Kanrisuru::Core::IP::IPRule.new).to respond_to(:priority, :source, :table)
|
41
|
+
expect(Kanrisuru::Core::IP::IPNeighbour.new).to respond_to(
|
42
|
+
:destination, :device, :lladdr, :state, :stats
|
43
|
+
)
|
44
|
+
expect(Kanrisuru::Core::IP::IPNeighbourStats.new).to respond_to(
|
45
|
+
:used, :confirmed, :updated, :probes, :ref_count
|
46
|
+
)
|
47
|
+
expect(Kanrisuru::Core::IP::IPMAddress.new).to respond_to(:index, :name, :maddr)
|
48
|
+
expect(Kanrisuru::Core::IP::IPMAddressEntry.new).to respond_to(
|
49
|
+
:family, :link, :address, :users
|
50
|
+
)
|
51
|
+
expect(Kanrisuru::Core::IP::IPStats.new).to respond_to(:rx, :tx)
|
52
|
+
expect(Kanrisuru::Core::IP::IPStatRX.new).to respond_to(
|
53
|
+
:bytes, :packets, :errors, :dropped, :over_errors, :multicast
|
54
|
+
)
|
55
|
+
expect(Kanrisuru::Core::IP::IPStatTX.new).to respond_to(
|
56
|
+
:bytes, :packets, :errors, :dropped, :carrier_errors, :collisions
|
57
|
+
)
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Kanrisuru::Core::Path do
|
6
|
+
it 'responds to path fields' do
|
7
|
+
expect(Kanrisuru::Core::Path::FilePath.new).to respond_to(:path)
|
8
|
+
expect(Kanrisuru::Core::Path::FileInfoId.new).to respond_to(
|
9
|
+
:inode, :mode, :memory_blocks, :uid, :gid, :fsize, :date, :path, :type
|
10
|
+
)
|
11
|
+
expect(Kanrisuru::Core::Path::FileInfo.new).to respond_to(
|
12
|
+
:inode, :mode, :memory_blocks, :owner, :group, :fsize, :date, :path, :type
|
13
|
+
)
|
14
|
+
expect(Kanrisuru::Core::Path::UserName.new).to respond_to(:user)
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Kanrisuru::Core::Socket do
|
6
|
+
it 'responds to socket fields' do
|
7
|
+
expect(Kanrisuru::Core::Socket::Statistics.new).to respond_to(
|
8
|
+
:netid, :state, :receive_queue, :send_queue,
|
9
|
+
:local_address, :local_port, :peer_address, :peer_port,
|
10
|
+
:memory
|
11
|
+
)
|
12
|
+
expect(Kanrisuru::Core::Socket::StatisticsMemory.new).to respond_to(
|
13
|
+
:rmem_alloc, :rcv_buf, :wmem_alloc, :snd_buf,
|
14
|
+
:fwd_alloc, :wmem_queued, :ropt_mem, :back_log, :sock_drop
|
15
|
+
)
|
16
|
+
expect(Kanrisuru::Core::Socket::TCP_STATES).to eq(
|
17
|
+
%w[
|
18
|
+
established syn-sent syn-recv
|
19
|
+
fin-wait-1 fin-wait-2 time-wait
|
20
|
+
closed close-wait last-ack listening closing
|
21
|
+
]
|
22
|
+
)
|
23
|
+
expect(Kanrisuru::Core::Socket::OTHER_STATES).to eq(
|
24
|
+
%w[
|
25
|
+
all connected synchronized bucket syn-recv
|
26
|
+
big
|
27
|
+
]
|
28
|
+
)
|
29
|
+
expect(Kanrisuru::Core::Socket::TCP_STATE_ABBR).to eq(
|
30
|
+
{
|
31
|
+
'ESTAB' => 'established', 'LISTEN' => 'listening', 'UNCONN' => 'unconnected',
|
32
|
+
'SYN-SENT' => 'syn-sent', 'SYN-RECV' => 'syn-recv', 'FIN-WAIT-1' => 'fin-wait-1',
|
33
|
+
'FIN-WAIT-2' => 'fin-wait-2', 'TIME-WAIT' => 'time-wait', 'CLOSE-WAIT' => 'close-wait',
|
34
|
+
'LAST-ACK' => 'last-ack', 'CLOSING' => 'closing'
|
35
|
+
}
|
36
|
+
)
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Kanrisuru::Core::Stat do
|
6
|
+
it 'responds to stat fields' do
|
7
|
+
expect(Kanrisuru::Core::Stat::FileStat.new).to respond_to(
|
8
|
+
:mode, :blocks, :device, :file_type,
|
9
|
+
:gid, :group, :links, :inode,
|
10
|
+
:path, :fsize, :uid, :user,
|
11
|
+
:last_access, :last_modified, :last_changed
|
12
|
+
)
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Kanrisuru::Core::System do
|
6
|
+
it 'responds to system fields' do
|
7
|
+
expect(Kanrisuru::Core::System::CPUArchitectureVulnerability.new).to respond_to(
|
8
|
+
:name,
|
9
|
+
:data
|
10
|
+
)
|
11
|
+
expect(Kanrisuru::Core::System::CPUArchitecture.new).to respond_to(
|
12
|
+
:architecture,
|
13
|
+
:cores,
|
14
|
+
:byte_order,
|
15
|
+
:address_sizes,
|
16
|
+
:operation_modes,
|
17
|
+
:online_cpus,
|
18
|
+
:threads_per_core,
|
19
|
+
:cores_per_socket,
|
20
|
+
:sockets,
|
21
|
+
:numa_mode,
|
22
|
+
:vendor_id,
|
23
|
+
:cpu_family,
|
24
|
+
:model,
|
25
|
+
:model_name,
|
26
|
+
:stepping,
|
27
|
+
:cpu_mhz,
|
28
|
+
:cpu_max_mhz,
|
29
|
+
:cpu_min_mhz,
|
30
|
+
:bogo_mips,
|
31
|
+
:virtualization,
|
32
|
+
:hypervisor_vendor,
|
33
|
+
:virtualization_type,
|
34
|
+
:l1d_cache,
|
35
|
+
:l1i_cache,
|
36
|
+
:l2_cache,
|
37
|
+
:l3_cache,
|
38
|
+
:numa_nodes,
|
39
|
+
:vulnerabilities,
|
40
|
+
:flags
|
41
|
+
)
|
42
|
+
expect(Kanrisuru::Core::System::KernelStatisticCpu.new).to respond_to(
|
43
|
+
:user,
|
44
|
+
:nice,
|
45
|
+
:system,
|
46
|
+
:idle,
|
47
|
+
:iowait,
|
48
|
+
:irq,
|
49
|
+
:softirq,
|
50
|
+
:steal,
|
51
|
+
:guest,
|
52
|
+
:guest_nice
|
53
|
+
)
|
54
|
+
expect(Kanrisuru::Core::System::KernelStatistic.new).to respond_to(
|
55
|
+
:cpu_total,
|
56
|
+
:cpus,
|
57
|
+
:interrupt_total,
|
58
|
+
:interrupts,
|
59
|
+
:ctxt,
|
60
|
+
:btime,
|
61
|
+
:processes,
|
62
|
+
:procs_running,
|
63
|
+
:procs_blocked,
|
64
|
+
:softirq_total,
|
65
|
+
:softirqs
|
66
|
+
)
|
67
|
+
expect(Kanrisuru::Core::System::ProcessInfo.new).to respond_to(
|
68
|
+
:uid, :user, :gid, :group, :ppid, :pid,
|
69
|
+
:cpu_usage, :memory_usage, :stat, :priority,
|
70
|
+
:flags, :policy_abbr, :policy, :cpu_time, :command
|
71
|
+
)
|
72
|
+
expect(Kanrisuru::Core::System::Uptime.new).to respond_to(
|
73
|
+
:boot_time, :uptime, :seconds, :minutes, :hours, :days
|
74
|
+
)
|
75
|
+
expect(Kanrisuru::Core::System::UserLoggedIn.new).to respond_to(
|
76
|
+
:user, :tty, :ip, :login, :idle, :jcpu, :pcpu, :command
|
77
|
+
)
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Kanrisuru::Core::Transfer do
|
6
|
+
it 'responds to transfer fields' do
|
7
|
+
expect(Kanrisuru::Core::Transfer::WGET_FILENAME_MODES).to eq(
|
8
|
+
%w[unix windows nocontrol ascii lowercase uppercase]
|
9
|
+
)
|
10
|
+
|
11
|
+
expect(Kanrisuru::Core::Transfer::WGET_SSL_PROTO).to eq(
|
12
|
+
%w[auto SSLv2 SSLv3 TLSv1]
|
13
|
+
)
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Kanrisuru::Core::User do
|
6
|
+
it 'responds to user fields' do
|
7
|
+
expect(Kanrisuru::Core::User::User.new).to respond_to(:uid, :name, :home, :shell, :groups)
|
8
|
+
expect(Kanrisuru::Core::User::UserGroup.new).to respond_to(:gid, :name)
|
9
|
+
expect(Kanrisuru::Core::User::FilePath.new).to respond_to(:path)
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
RSpec.describe Kanrisuru::Core::Yum do
|
6
|
+
it 'responds to yum fields' do
|
7
|
+
expect(Kanrisuru::Core::Yum::PackageOverview.new).to respond_to(
|
8
|
+
:package, :architecture, :version, :installed
|
9
|
+
)
|
10
|
+
|
11
|
+
expect(Kanrisuru::Core::Yum::PackageSearchResult.new).to respond_to(
|
12
|
+
:package, :architecture, :summary
|
13
|
+
)
|
14
|
+
|
15
|
+
expect(Kanrisuru::Core::Yum::PackageDetail.new).to respond_to(
|
16
|
+
:package,
|
17
|
+
:version,
|
18
|
+
:release,
|
19
|
+
:architecture,
|
20
|
+
:install_size,
|
21
|
+
:source,
|
22
|
+
:yum_id,
|
23
|
+
:repository,
|
24
|
+
:summary,
|
25
|
+
:url,
|
26
|
+
:license,
|
27
|
+
:description
|
28
|
+
)
|
29
|
+
|
30
|
+
expect(Kanrisuru::Core::Yum::Repolist.new).to respond_to(
|
31
|
+
:id,
|
32
|
+
:name,
|
33
|
+
:status,
|
34
|
+
:revision,
|
35
|
+
:packages,
|
36
|
+
:available_packages,
|
37
|
+
:repo_size,
|
38
|
+
:mirrors,
|
39
|
+
:metalink,
|
40
|
+
:updated,
|
41
|
+
:baseurl,
|
42
|
+
:expire,
|
43
|
+
:filters,
|
44
|
+
:filename
|
45
|
+
)
|
46
|
+
end
|
47
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kanrisuru
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Mammina
|
@@ -199,7 +199,21 @@ files:
|
|
199
199
|
- spec/helper/test_hosts.rb
|
200
200
|
- spec/hosts.json
|
201
201
|
- spec/spec_helper.rb
|
202
|
+
- spec/unit/core/apt_spec.rb
|
203
|
+
- spec/unit/core/archive_spec.rb
|
204
|
+
- spec/unit/core/disk_spec.rb
|
202
205
|
- spec/unit/core/dmi_spec.rb
|
206
|
+
- spec/unit/core/file_spec.rb
|
207
|
+
- spec/unit/core/find_spec.rb
|
208
|
+
- spec/unit/core/group_spec.rb
|
209
|
+
- spec/unit/core/ip_spec.rb
|
210
|
+
- spec/unit/core/path_spec.rb
|
211
|
+
- spec/unit/core/socket_spec.rb
|
212
|
+
- spec/unit/core/stat_spec.rb
|
213
|
+
- spec/unit/core/system_spec.rb
|
214
|
+
- spec/unit/core/transfer_spec.rb
|
215
|
+
- spec/unit/core/user_spec.rb
|
216
|
+
- spec/unit/core/yum_spec.rb
|
203
217
|
- spec/unit/core/zypper_spec.rb
|
204
218
|
- spec/unit/fstab_spec.rb
|
205
219
|
- spec/unit/kanrisuru_spec.rb
|