specinfra 1.3.0 → 1.4.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 +4 -4
- data/lib/specinfra/backend/exec.rb +2 -0
- data/lib/specinfra/backend/ssh.rb +0 -1
- data/lib/specinfra/command/openbsd.rb +77 -0
- data/lib/specinfra/command.rb +1 -0
- data/lib/specinfra/helper/os.rb +1 -0
- data/lib/specinfra/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b548e8f643d9527287040b11a7599cc51c56d57f
|
4
|
+
data.tar.gz: b169d8328b68007758c12d6f8af34db7e98ed627
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a438b642d651c0d743cdcb8bb5f6a220610ee83021a2b0e9dfc1d57294f235caf658cfec17dc645679d62c2c872f278576e3d8999dfac138676dfeb788f79386
|
7
|
+
data.tar.gz: ee4fcf7d5284b9fa305fa45e4c53e0c61ef372a6f57256417b7909111e9f73357546a746d8514c31bc8e6aa18e046b930281ee91443451ddc590e3f8b8de1574
|
@@ -235,6 +235,8 @@ module SpecInfra
|
|
235
235
|
end
|
236
236
|
elsif run_command('uname -sr').stdout =~ /Arch/i
|
237
237
|
{ :family => 'Arch', :release => nil }
|
238
|
+
elsif run_command('uname -s').stdout =~ /OpenBSD/i
|
239
|
+
{ :family => 'OpenBSD', :release => nil }
|
238
240
|
else
|
239
241
|
{ :family => 'Base', :release => nil }
|
240
242
|
end
|
@@ -78,7 +78,6 @@ module SpecInfra
|
|
78
78
|
|
79
79
|
channel.on_extended_data do |ch, type, data|
|
80
80
|
if data.match /you must have a tty to run sudo/
|
81
|
-
puts data
|
82
81
|
abort 'Please set "SpecInfra.configuration.request_pty = true" or "c.request_pty = true" in your spec_helper.rb or other appropreate file.'
|
83
82
|
end
|
84
83
|
|
@@ -0,0 +1,77 @@
|
|
1
|
+
module SpecInfra
|
2
|
+
module Command
|
3
|
+
class OpenBSD < Base
|
4
|
+
def check_enabled(service, level=3)
|
5
|
+
"egrep '(#{escape(service)}_flags=|^pkg_scripts=\"(.*)#{escape(service)}(.*)\")' /etc/rc.conf.local | grep -v \=NO"
|
6
|
+
end
|
7
|
+
|
8
|
+
def check_file_md5checksum(file, expected)
|
9
|
+
regexp = "^#{expected}"
|
10
|
+
"cksum -qa md5 #{escape(file)} | grep -w #{escape(regexp)}"
|
11
|
+
end
|
12
|
+
|
13
|
+
def check_file_sha256checksum(file, expected)
|
14
|
+
regexp = "^#{expected}"
|
15
|
+
"cksum -qa sha256 #{escape(file)} | grep -w #{escape(regexp)}"
|
16
|
+
end
|
17
|
+
|
18
|
+
def check_login_shell(user, path_to_shell)
|
19
|
+
"getent passwd #{escape(user)} | cut -f 7 -d ':' | grep #{escape(path_to_shell)}"
|
20
|
+
end
|
21
|
+
|
22
|
+
def check_home_directory(user, path_to_home)
|
23
|
+
"getent passwd #{escape(user)} | cut -f 6 -d ':' | grep #{escape(path_to_home)}"
|
24
|
+
end
|
25
|
+
|
26
|
+
def check_installed(package, version=nil)
|
27
|
+
if version
|
28
|
+
"pkg_info -a | cut -d ' ' -f 1 | grep #{escape(package)}-#{escape(version)}"
|
29
|
+
else
|
30
|
+
"pkg_info -a | cut -d ' ' -f 1 | grep #{escape(package)}"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def get_interface_speed_of(name)
|
35
|
+
"ifconfig #{name} | grep 'media\:' | perl -pe 's|.*media\:.*\\((.*?)\\)|\\1|'"
|
36
|
+
end
|
37
|
+
|
38
|
+
def check_ipv4_address(interface, ip_address)
|
39
|
+
"ifconfig #{interface} | grep -w inet | cut -d ' ' -f 2"
|
40
|
+
end
|
41
|
+
|
42
|
+
def check_listening(port)
|
43
|
+
"netstat -nat -f inet | egrep '((tcp|udp).*\.#{port}.*LISTEN$)'"
|
44
|
+
end
|
45
|
+
|
46
|
+
def check_mail_alias(recipient, target)
|
47
|
+
"egrep '^#{escape(recipient)}:.*#{escape(target)}' /etc/mail/aliases"
|
48
|
+
end
|
49
|
+
|
50
|
+
def check_mode(file, mode)
|
51
|
+
regexp = "^#{mode}$"
|
52
|
+
"stat -f%Lp #{escape(file)} | grep #{escape(regexp)}"
|
53
|
+
end
|
54
|
+
|
55
|
+
def check_mounted(path)
|
56
|
+
regexp = "on #{path} "
|
57
|
+
"mount | grep #{escape(regexp)}"
|
58
|
+
end
|
59
|
+
|
60
|
+
# def check_routing_table(destination)
|
61
|
+
# "route -n show -gateway | egrep '(^default|#{destination})' | head -1"
|
62
|
+
# end
|
63
|
+
|
64
|
+
def check_running(service)
|
65
|
+
"/etc/rc.d/#{escape(service)} status"
|
66
|
+
end
|
67
|
+
|
68
|
+
def get_mode(file)
|
69
|
+
"stat -f%Lp #{escape(file)}"
|
70
|
+
end
|
71
|
+
|
72
|
+
def install(package)
|
73
|
+
"pkg_add #{package}"
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
data/lib/specinfra/command.rb
CHANGED
data/lib/specinfra/helper/os.rb
CHANGED
data/lib/specinfra/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specinfra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- lib/specinfra/command/freebsd10.rb
|
129
129
|
- lib/specinfra/command/gentoo.rb
|
130
130
|
- lib/specinfra/command/linux.rb
|
131
|
+
- lib/specinfra/command/openbsd.rb
|
131
132
|
- lib/specinfra/command/plamo.rb
|
132
133
|
- lib/specinfra/command/redhat.rb
|
133
134
|
- lib/specinfra/command/smartos.rb
|