ohai 6.24.2 → 7.0.0.rc.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ohai.rb +1 -1
- data/lib/ohai/application.rb +5 -12
- data/lib/ohai/common/dmi.rb +126 -0
- data/lib/ohai/config.rb +9 -9
- data/lib/ohai/{plugins/darwin/hostname.rb → dsl.rb} +7 -7
- data/lib/ohai/dsl/plugin.rb +186 -0
- data/lib/ohai/dsl/plugin/versionvi.rb +62 -0
- data/lib/ohai/dsl/plugin/versionvii.rb +106 -0
- data/lib/ohai/exception.rb +11 -2
- data/lib/ohai/hints.rb +48 -0
- data/lib/ohai/loader.rb +205 -0
- data/lib/ohai/mixin/command.rb +14 -18
- data/lib/ohai/mixin/constant_helper.rb +53 -0
- data/lib/ohai/mixin/gce_metadata.rb +0 -2
- data/lib/ohai/{plugins/freebsd/uptime.rb → mixin/network_constants.rb} +15 -13
- data/lib/ohai/mixin/os.rb +59 -0
- data/lib/ohai/mixin/seconds_to_human.rb +48 -0
- data/lib/ohai/plugins/aix/cpu.rb +26 -22
- data/lib/ohai/plugins/aix/filesystem.rb +47 -48
- data/lib/ohai/plugins/aix/kernel.rb +11 -7
- data/lib/ohai/plugins/aix/memory.rb +8 -4
- data/lib/ohai/plugins/aix/network.rb +73 -82
- data/lib/ohai/plugins/aix/platform.rb +9 -6
- data/lib/ohai/plugins/aix/uptime.rb +14 -12
- data/lib/ohai/plugins/azure.rb +33 -11
- data/lib/ohai/plugins/c.rb +103 -78
- data/lib/ohai/plugins/chef.rb +20 -8
- data/lib/ohai/plugins/cloud.rb +234 -230
- data/lib/ohai/plugins/command.rb +6 -2
- data/lib/ohai/plugins/darwin/cpu.rb +10 -4
- data/lib/ohai/plugins/darwin/filesystem.rb +32 -32
- data/lib/ohai/plugins/darwin/network.rb +157 -154
- data/lib/ohai/plugins/darwin/platform.rb +18 -16
- data/lib/ohai/plugins/darwin/system_profiler.rb +49 -46
- data/lib/ohai/plugins/dmi.rb +102 -102
- data/lib/ohai/plugins/ec2.rb +30 -28
- data/lib/ohai/plugins/erlang.rb +19 -16
- data/lib/ohai/plugins/eucalyptus.rb +37 -36
- data/lib/ohai/plugins/freebsd/cpu.rb +34 -29
- data/lib/ohai/plugins/freebsd/filesystem.rb +32 -32
- data/lib/ohai/plugins/freebsd/memory.rb +35 -25
- data/lib/ohai/plugins/freebsd/network.rb +94 -89
- data/lib/ohai/plugins/freebsd/platform.rb +10 -4
- data/lib/ohai/plugins/freebsd/virtualization.rb +62 -61
- data/lib/ohai/plugins/gce.rb +30 -36
- data/lib/ohai/plugins/groovy.rb +14 -11
- data/lib/ohai/plugins/hostname.rb +132 -10
- data/lib/ohai/plugins/ip_scopes.rb +31 -16
- data/lib/ohai/plugins/java.rb +45 -21
- data/lib/ohai/plugins/kernel.rb +186 -19
- data/lib/ohai/plugins/keys.rb +6 -2
- data/lib/ohai/plugins/languages.rb +6 -2
- data/lib/ohai/plugins/linode.rb +38 -30
- data/lib/ohai/plugins/linux/block_device.rb +19 -15
- data/lib/ohai/plugins/linux/cpu.rb +42 -38
- data/lib/ohai/plugins/linux/filesystem.rb +70 -130
- data/lib/ohai/plugins/linux/lsb.rb +35 -35
- data/lib/ohai/plugins/linux/memory.rb +65 -61
- data/lib/ohai/plugins/linux/network.rb +343 -362
- data/lib/ohai/plugins/linux/platform.rb +90 -88
- data/lib/ohai/plugins/linux/virtualization.rb +95 -90
- data/lib/ohai/plugins/lua.rb +14 -10
- data/lib/ohai/plugins/mono.rb +17 -13
- data/lib/ohai/plugins/netbsd/cpu.rb +25 -23
- data/lib/ohai/plugins/netbsd/filesystem.rb +32 -32
- data/lib/ohai/plugins/netbsd/memory.rb +59 -59
- data/lib/ohai/plugins/netbsd/network.rb +92 -88
- data/lib/ohai/plugins/netbsd/platform.rb +10 -3
- data/lib/ohai/plugins/netbsd/virtualization.rb +41 -38
- data/lib/ohai/plugins/network.rb +131 -130
- data/lib/ohai/plugins/network_listeners.rb +26 -22
- data/lib/ohai/plugins/nodejs.rb +14 -10
- data/lib/ohai/plugins/ohai.rb +11 -6
- data/lib/ohai/plugins/ohai_time.rb +6 -2
- data/lib/ohai/plugins/openbsd/cpu.rb +20 -15
- data/lib/ohai/plugins/openbsd/filesystem.rb +32 -32
- data/lib/ohai/plugins/openbsd/memory.rb +59 -59
- data/lib/ohai/plugins/openbsd/network.rb +92 -88
- data/lib/ohai/plugins/openbsd/platform.rb +10 -4
- data/lib/ohai/plugins/openbsd/virtualization.rb +41 -39
- data/lib/ohai/plugins/openstack.rb +23 -21
- data/lib/ohai/plugins/os.rb +8 -32
- data/lib/ohai/plugins/passwd.rb +27 -22
- data/lib/ohai/plugins/perl.rb +21 -16
- data/lib/ohai/plugins/php.rb +15 -12
- data/lib/ohai/plugins/platform.rb +9 -9
- data/lib/ohai/plugins/{linux/kernel.rb → ps.rb} +13 -12
- data/lib/ohai/plugins/python.rb +16 -12
- data/lib/ohai/plugins/rackspace.rb +82 -77
- data/lib/ohai/plugins/root_group.rb +13 -9
- data/lib/ohai/plugins/ruby.rb +50 -48
- data/lib/ohai/plugins/sigar/cpu.rb +21 -17
- data/lib/ohai/plugins/sigar/filesystem.rb +26 -23
- data/lib/ohai/plugins/sigar/memory.rb +17 -14
- data/lib/ohai/plugins/sigar/network.rb +133 -67
- data/lib/ohai/plugins/sigar/network_route.rb +33 -28
- data/lib/ohai/plugins/sigar/platform.rb +10 -6
- data/lib/ohai/plugins/solaris2/cpu.rb +41 -33
- data/lib/ohai/plugins/solaris2/dmi.rb +146 -146
- data/lib/ohai/plugins/solaris2/filesystem.rb +74 -77
- data/lib/ohai/plugins/{aix/hostname.rb → solaris2/memory.rb} +7 -4
- data/lib/ohai/plugins/solaris2/network.rb +91 -86
- data/lib/ohai/plugins/solaris2/platform.rb +40 -36
- data/lib/ohai/plugins/solaris2/virtualization.rb +54 -59
- data/lib/ohai/plugins/solaris2/zpools.rb +38 -38
- data/lib/ohai/plugins/ssh_host_key.rb +49 -45
- data/lib/ohai/plugins/uptime.rb +87 -25
- data/lib/ohai/plugins/virtualization.rb +59 -55
- data/lib/ohai/plugins/windows/cpu.rb +44 -40
- data/lib/ohai/plugins/windows/filesystem.rb +28 -22
- data/lib/ohai/plugins/windows/network.rb +88 -79
- data/lib/ohai/plugins/windows/platform.rb +10 -3
- data/lib/ohai/provides_map.rb +184 -0
- data/lib/ohai/runner.rb +109 -0
- data/lib/ohai/system.rb +103 -184
- data/lib/ohai/version.rb +4 -3
- data/spec/data/plugins/___lib64___libc.so.6.output +135 -0
- data/spec/data/plugins/___lib___libc.so.6.output +135 -0
- data/spec/data/plugins/cc.output +135 -0
- data/spec/data/plugins/cl.output +135 -0
- data/spec/data/plugins/devenv.com.output +135 -0
- data/spec/data/plugins/env.output +71 -0
- data/spec/data/plugins/erl.output +144 -0
- data/spec/data/plugins/gcc.output +135 -0
- data/spec/data/plugins/groovy.output +159 -0
- data/spec/data/plugins/java.output +143 -0
- data/spec/data/plugins/lua.output +143 -0
- data/spec/data/plugins/messages.rb +8 -0
- data/spec/data/plugins/node.output +143 -0
- data/spec/data/plugins/perl.output +143 -0
- data/spec/data/plugins/php.output +143 -0
- data/spec/data/plugins/python.output +143 -0
- data/spec/data/plugins/uname.output +71 -0
- data/spec/data/plugins/v6message.rb +2 -0
- data/spec/data/plugins/v7message.rb +7 -0
- data/spec/data/plugins/what.output +135 -0
- data/spec/data/plugins/xlc.output +135 -0
- data/spec/spec_helper.rb +52 -18
- data/spec/support/integration_helper.rb +44 -0
- data/spec/unit/dsl/plugin_spec.rb +298 -0
- data/spec/unit/hints_spec.rb +65 -0
- data/spec/unit/loader_spec.rb +226 -0
- data/spec/unit/mixin/ec2_metadata_spec.rb +9 -9
- data/spec/unit/plugins/aix/cpu_spec.rb +17 -18
- data/spec/unit/plugins/aix/filesystem_spec.rb +20 -18
- data/spec/unit/plugins/aix/hostname_spec.rb +8 -4
- data/spec/unit/plugins/aix/kernel_spec.rb +13 -12
- data/spec/unit/plugins/aix/network_spec.rb +66 -45
- data/spec/unit/plugins/aix/platform_spec.rb +11 -10
- data/spec/unit/plugins/aix/uptime_spec.rb +7 -8
- data/spec/unit/plugins/azure_spec.rb +20 -21
- data/spec/unit/plugins/c_spec.rb +88 -87
- data/spec/unit/plugins/chef_spec.rb +5 -6
- data/spec/unit/plugins/cloud_spec.rb +81 -82
- data/spec/unit/plugins/darwin/cpu_spec.rb +8 -9
- data/spec/unit/plugins/darwin/hostname_spec.rb +23 -11
- data/spec/unit/plugins/darwin/kernel_spec.rb +39 -16
- data/spec/unit/plugins/darwin/network_spec.rb +375 -378
- data/spec/unit/plugins/darwin/platform_spec.rb +23 -50
- data/spec/unit/plugins/darwin/system_profiler_spec.rb +7 -8
- data/spec/unit/plugins/dmi_spec.rb +7 -12
- data/spec/unit/plugins/ec2_spec.rb +70 -59
- data/spec/unit/plugins/erlang_spec.rb +18 -20
- data/spec/unit/plugins/eucalyptus_spec.rb +37 -33
- data/spec/unit/plugins/fail_spec.rb +276 -23
- data/spec/unit/plugins/freebsd/hostname_spec.rb +11 -9
- data/spec/unit/plugins/freebsd/kernel_spec.rb +8 -8
- data/spec/unit/plugins/freebsd/platform_spec.rb +9 -10
- data/spec/unit/plugins/freebsd/virtualization_spec.rb +32 -32
- data/spec/unit/plugins/gce_spec.rb +19 -25
- data/spec/unit/plugins/groovy_spec.rb +10 -16
- data/spec/unit/plugins/hostname_spec.rb +45 -20
- data/spec/unit/plugins/ip_scopes_spec.rb +97 -0
- data/spec/unit/plugins/java_spec.rb +145 -99
- data/spec/unit/plugins/kernel_spec.rb +51 -15
- data/spec/unit/plugins/linode_spec.rb +31 -29
- data/spec/unit/plugins/linux/cpu_spec.rb +42 -43
- data/spec/unit/plugins/linux/filesystem_spec.rb +143 -324
- data/spec/unit/plugins/linux/hostname_spec.rb +16 -23
- data/spec/unit/plugins/linux/kernel_spec.rb +22 -8
- data/spec/unit/plugins/linux/lsb_spec.rb +54 -56
- data/spec/unit/plugins/linux/network_spec.rb +196 -238
- data/spec/unit/plugins/linux/platform_spec.rb +186 -205
- data/spec/unit/plugins/linux/uptime_spec.rb +13 -25
- data/spec/unit/plugins/linux/virtualization_spec.rb +149 -129
- data/spec/unit/plugins/lua_spec.rb +12 -15
- data/spec/unit/plugins/mono_spec.rb +10 -15
- data/spec/unit/plugins/netbsd/hostname_spec.rb +17 -7
- data/spec/unit/plugins/netbsd/kernel_spec.rb +8 -8
- data/spec/unit/plugins/netbsd/platform_spec.rb +8 -10
- data/spec/unit/plugins/network_spec.rb +358 -235
- data/spec/unit/plugins/nodejs_spec.rb +13 -15
- data/spec/unit/plugins/ohai_spec.rb +3 -4
- data/spec/unit/plugins/ohai_time_spec.rb +8 -9
- data/spec/unit/plugins/openbsd/hostname_spec.rb +21 -11
- data/spec/unit/plugins/openbsd/kernel_spec.rb +8 -8
- data/spec/unit/plugins/openbsd/platform_spec.rb +6 -12
- data/spec/unit/plugins/openstack_spec.rb +214 -0
- data/spec/unit/plugins/os_spec.rb +13 -16
- data/spec/unit/plugins/passwd_spec.rb +12 -13
- data/spec/unit/plugins/perl_spec.rb +20 -44
- data/spec/unit/plugins/php_spec.rb +20 -15
- data/spec/unit/plugins/platform_spec.rb +24 -29
- data/spec/unit/plugins/python_spec.rb +13 -17
- data/spec/unit/plugins/rackspace_spec.rb +90 -57
- data/spec/unit/plugins/root_group_spec.rb +17 -19
- data/spec/unit/plugins/ruby_spec.rb +15 -16
- data/spec/unit/plugins/sigar/network_route_spec.rb +12 -13
- data/spec/unit/plugins/solaris2/cpu_spec.rb +82 -0
- data/spec/unit/plugins/solaris2/hostname_spec.rb +12 -13
- data/spec/unit/plugins/solaris2/kernel_spec.rb +11 -15
- data/{lib/ohai/plugins/openbsd/uptime.rb → spec/unit/plugins/solaris2/memory_spec.rb} +10 -12
- data/spec/unit/plugins/solaris2/network_spec.rb +44 -20
- data/spec/unit/plugins/solaris2/platform_spec.rb +13 -22
- data/spec/unit/plugins/solaris2/virtualization_spec.rb +37 -45
- data/spec/unit/plugins/ssh_host_keys_spec.rb +11 -15
- data/spec/unit/provides_map_spec.rb +208 -0
- data/spec/unit/runner_spec.rb +488 -0
- data/spec/unit/system_spec.rb +639 -104
- metadata +151 -87
- checksums.yaml +0 -7
- data/lib/ohai/mixin/from_file.rb +0 -36
- data/lib/ohai/plugins/aix/ps.rb +0 -23
- data/lib/ohai/plugins/darwin/kernel.rb +0 -37
- data/lib/ohai/plugins/darwin/ps.rb +0 -23
- data/lib/ohai/plugins/darwin/uptime.rb +0 -32
- data/lib/ohai/plugins/dmi_common.rb +0 -121
- data/lib/ohai/plugins/freebsd/hostname.rb +0 -22
- data/lib/ohai/plugins/freebsd/kernel.rb +0 -37
- data/lib/ohai/plugins/freebsd/ps.rb +0 -24
- data/lib/ohai/plugins/hpux/cpu.rb +0 -19
- data/lib/ohai/plugins/hpux/filesystem.rb +0 -19
- data/lib/ohai/plugins/hpux/hostname.rb +0 -19
- data/lib/ohai/plugins/hpux/memory.rb +0 -19
- data/lib/ohai/plugins/hpux/network.rb +0 -19
- data/lib/ohai/plugins/hpux/platform.rb +0 -19
- data/lib/ohai/plugins/hpux/ps.rb +0 -23
- data/lib/ohai/plugins/hpux/uptime.rb +0 -19
- data/lib/ohai/plugins/linux/hostname.rb +0 -40
- data/lib/ohai/plugins/linux/ps.rb +0 -23
- data/lib/ohai/plugins/linux/uptime.rb +0 -28
- data/lib/ohai/plugins/netbsd/hostname.rb +0 -22
- data/lib/ohai/plugins/netbsd/kernel.rb +0 -35
- data/lib/ohai/plugins/netbsd/ps.rb +0 -24
- data/lib/ohai/plugins/netbsd/uptime.rb +0 -31
- data/lib/ohai/plugins/openbsd/hostname.rb +0 -22
- data/lib/ohai/plugins/openbsd/kernel.rb +0 -35
- data/lib/ohai/plugins/openbsd/ps.rb +0 -24
- data/lib/ohai/plugins/sigar/hostname.rb +0 -28
- data/lib/ohai/plugins/sigar/uptime.rb +0 -27
- data/lib/ohai/plugins/solaris2/hostname.rb +0 -34
- data/lib/ohai/plugins/solaris2/kernel.rb +0 -40
- data/lib/ohai/plugins/solaris2/ps.rb +0 -23
- data/lib/ohai/plugins/solaris2/uptime.rb +0 -36
- data/lib/ohai/plugins/windows/hostname.rb +0 -33
- data/lib/ohai/plugins/windows/kernel.rb +0 -58
- data/lib/ohai/plugins/windows/kernel_devices.rb +0 -39
- data/lib/ohai/plugins/windows/uptime.rb +0 -23
- data/spec/unit/mixin/from_file_spec.rb +0 -53
@@ -0,0 +1,71 @@
|
|
1
|
+
platform "centos-5.9"
|
2
|
+
arch "x86"
|
3
|
+
env []
|
4
|
+
params "-o"
|
5
|
+
stdout "GNU/Linux\n"
|
6
|
+
stderr ""
|
7
|
+
exit_status 0
|
8
|
+
|
9
|
+
platform "centos-5.9"
|
10
|
+
arch "x64"
|
11
|
+
env []
|
12
|
+
params "-o"
|
13
|
+
stdout "GNU/Linux\n"
|
14
|
+
stderr ""
|
15
|
+
exit_status 0
|
16
|
+
|
17
|
+
platform "centos-6.4"
|
18
|
+
arch "x86"
|
19
|
+
env []
|
20
|
+
params "-o"
|
21
|
+
stdout "GNU/Linux\n"
|
22
|
+
stderr ""
|
23
|
+
exit_status 0
|
24
|
+
|
25
|
+
platform "centos-6.4"
|
26
|
+
arch "x64"
|
27
|
+
env []
|
28
|
+
params "-o"
|
29
|
+
stdout "GNU/Linux\n"
|
30
|
+
stderr ""
|
31
|
+
exit_status 0
|
32
|
+
|
33
|
+
platform "ubuntu-10.04"
|
34
|
+
arch "x86"
|
35
|
+
env []
|
36
|
+
params "-o"
|
37
|
+
stdout "GNU/Linux\n"
|
38
|
+
stderr ""
|
39
|
+
exit_status 0
|
40
|
+
|
41
|
+
platform "ubuntu-10.04"
|
42
|
+
arch "x64"
|
43
|
+
env []
|
44
|
+
params "-o"
|
45
|
+
stdout "GNU/Linux\n"
|
46
|
+
stderr ""
|
47
|
+
exit_status 0
|
48
|
+
|
49
|
+
platform "ubuntu-12.04"
|
50
|
+
arch "x86"
|
51
|
+
env []
|
52
|
+
params "-o"
|
53
|
+
stdout "GNU/Linux\n"
|
54
|
+
stderr ""
|
55
|
+
exit_status 0
|
56
|
+
|
57
|
+
platform "ubuntu-12.04"
|
58
|
+
arch "x64"
|
59
|
+
env []
|
60
|
+
params "-o"
|
61
|
+
stdout "GNU/Linux\n"
|
62
|
+
stderr ""
|
63
|
+
exit_status 0
|
64
|
+
|
65
|
+
platform "ubuntu-13.04"
|
66
|
+
arch "x64"
|
67
|
+
env []
|
68
|
+
params "-o"
|
69
|
+
stdout "GNU/Linux\n"
|
70
|
+
stderr ""
|
71
|
+
exit_status 0
|
@@ -0,0 +1,135 @@
|
|
1
|
+
platform "centos-5.5"
|
2
|
+
arch "x64"
|
3
|
+
env []
|
4
|
+
params "/opt/ansic/bin/cc"
|
5
|
+
stdout ""
|
6
|
+
stderr "command not found"
|
7
|
+
exit_status 127
|
8
|
+
|
9
|
+
platform "centos-6.2"
|
10
|
+
arch "x86"
|
11
|
+
env []
|
12
|
+
params "/opt/ansic/bin/cc"
|
13
|
+
stdout ""
|
14
|
+
stderr "command not found"
|
15
|
+
exit_status 127
|
16
|
+
|
17
|
+
platform "centos-6.2"
|
18
|
+
arch "x64"
|
19
|
+
env []
|
20
|
+
params "/opt/ansic/bin/cc"
|
21
|
+
stdout ""
|
22
|
+
stderr "command not found"
|
23
|
+
exit_status 127
|
24
|
+
|
25
|
+
platform "ubuntu-10.04"
|
26
|
+
arch "x86"
|
27
|
+
env []
|
28
|
+
params "/opt/ansic/bin/cc"
|
29
|
+
stdout ""
|
30
|
+
stderr "command not found"
|
31
|
+
exit_status 127
|
32
|
+
|
33
|
+
platform "ubuntu-10.04"
|
34
|
+
arch "x64"
|
35
|
+
env []
|
36
|
+
params "/opt/ansic/bin/cc"
|
37
|
+
stdout ""
|
38
|
+
stderr "command not found"
|
39
|
+
exit_status 127
|
40
|
+
|
41
|
+
platform "ubuntu-12.04"
|
42
|
+
arch "x86"
|
43
|
+
env []
|
44
|
+
params "/opt/ansic/bin/cc"
|
45
|
+
stdout ""
|
46
|
+
stderr "command not found"
|
47
|
+
exit_status 127
|
48
|
+
|
49
|
+
platform "ubuntu-12.04"
|
50
|
+
arch "x64"
|
51
|
+
env []
|
52
|
+
params "/opt/ansic/bin/cc"
|
53
|
+
stdout ""
|
54
|
+
stderr "command not found"
|
55
|
+
exit_status 127
|
56
|
+
|
57
|
+
platform "ubuntu-12.10"
|
58
|
+
arch "x64"
|
59
|
+
env []
|
60
|
+
params "/opt/ansic/bin/cc"
|
61
|
+
stdout ""
|
62
|
+
stderr "command not found"
|
63
|
+
exit_status 127
|
64
|
+
|
65
|
+
platform "ubuntu-13.04"
|
66
|
+
arch "x86"
|
67
|
+
env []
|
68
|
+
params "/opt/ansic/bin/cc"
|
69
|
+
stdout ""
|
70
|
+
stderr "command not found"
|
71
|
+
exit_status 127
|
72
|
+
|
73
|
+
platform "ubuntu-13.04"
|
74
|
+
arch "x64"
|
75
|
+
env []
|
76
|
+
params "/opt/ansic/bin/cc"
|
77
|
+
stdout ""
|
78
|
+
stderr "command not found"
|
79
|
+
exit_status 127
|
80
|
+
|
81
|
+
platform "centos-5.5"
|
82
|
+
arch "x64"
|
83
|
+
env ["gcc"]
|
84
|
+
params "/opt/ansic/bin/cc"
|
85
|
+
stdout ""
|
86
|
+
stderr "command not found"
|
87
|
+
exit_status 127
|
88
|
+
|
89
|
+
platform "centos-6.2"
|
90
|
+
arch "x86"
|
91
|
+
env ["gcc"]
|
92
|
+
params "/opt/ansic/bin/cc"
|
93
|
+
stdout ""
|
94
|
+
stderr "command not found"
|
95
|
+
exit_status 127
|
96
|
+
|
97
|
+
platform "centos-6.2"
|
98
|
+
arch "x64"
|
99
|
+
env ["gcc"]
|
100
|
+
params "/opt/ansic/bin/cc"
|
101
|
+
stdout ""
|
102
|
+
stderr "command not found"
|
103
|
+
exit_status 127
|
104
|
+
|
105
|
+
platform "ubuntu-10.04"
|
106
|
+
arch "x86"
|
107
|
+
env ["gcc"]
|
108
|
+
params "/opt/ansic/bin/cc"
|
109
|
+
stdout ""
|
110
|
+
stderr "command not found"
|
111
|
+
exit_status 127
|
112
|
+
|
113
|
+
platform "ubuntu-10.04"
|
114
|
+
arch "x64"
|
115
|
+
env ["gcc"]
|
116
|
+
params "/opt/ansic/bin/cc"
|
117
|
+
stdout ""
|
118
|
+
stderr "command not found"
|
119
|
+
exit_status 127
|
120
|
+
|
121
|
+
platform "ubuntu-12.04"
|
122
|
+
arch "x86"
|
123
|
+
env ["gcc"]
|
124
|
+
params "/opt/ansic/bin/cc"
|
125
|
+
stdout ""
|
126
|
+
stderr "command not found"
|
127
|
+
exit_status 127
|
128
|
+
|
129
|
+
platform "ubuntu-12.04"
|
130
|
+
arch "x64"
|
131
|
+
env ["gcc"]
|
132
|
+
params "/opt/ansic/bin/cc"
|
133
|
+
stdout ""
|
134
|
+
stderr "command not found"
|
135
|
+
exit_status 127
|
@@ -0,0 +1,135 @@
|
|
1
|
+
platform "centos-5.5"
|
2
|
+
arch "x64"
|
3
|
+
env []
|
4
|
+
params "-qversion"
|
5
|
+
stdout ""
|
6
|
+
stderr "command not found"
|
7
|
+
exit_status 127
|
8
|
+
|
9
|
+
platform "centos-6.2"
|
10
|
+
arch "x86"
|
11
|
+
env []
|
12
|
+
params "-qversion"
|
13
|
+
stdout ""
|
14
|
+
stderr "command not found"
|
15
|
+
exit_status 127
|
16
|
+
|
17
|
+
platform "centos-6.2"
|
18
|
+
arch "x64"
|
19
|
+
env []
|
20
|
+
params "-qversion"
|
21
|
+
stdout ""
|
22
|
+
stderr "command not found"
|
23
|
+
exit_status 127
|
24
|
+
|
25
|
+
platform "ubuntu-10.04"
|
26
|
+
arch "x86"
|
27
|
+
env []
|
28
|
+
params "-qversion"
|
29
|
+
stdout ""
|
30
|
+
stderr "command not found"
|
31
|
+
exit_status 127
|
32
|
+
|
33
|
+
platform "ubuntu-10.04"
|
34
|
+
arch "x64"
|
35
|
+
env []
|
36
|
+
params "-qversion"
|
37
|
+
stdout ""
|
38
|
+
stderr "command not found"
|
39
|
+
exit_status 127
|
40
|
+
|
41
|
+
platform "ubuntu-12.04"
|
42
|
+
arch "x86"
|
43
|
+
env []
|
44
|
+
params "-qversion"
|
45
|
+
stdout ""
|
46
|
+
stderr "command not found"
|
47
|
+
exit_status 127
|
48
|
+
|
49
|
+
platform "ubuntu-12.04"
|
50
|
+
arch "x64"
|
51
|
+
env []
|
52
|
+
params "-qversion"
|
53
|
+
stdout ""
|
54
|
+
stderr "command not found"
|
55
|
+
exit_status 127
|
56
|
+
|
57
|
+
platform "ubuntu-12.10"
|
58
|
+
arch "x64"
|
59
|
+
env []
|
60
|
+
params "-qversion"
|
61
|
+
stdout ""
|
62
|
+
stderr "command not found"
|
63
|
+
exit_status 127
|
64
|
+
|
65
|
+
platform "ubuntu-13.04"
|
66
|
+
arch "x86"
|
67
|
+
env []
|
68
|
+
params "-qversion"
|
69
|
+
stdout ""
|
70
|
+
stderr "command not found"
|
71
|
+
exit_status 127
|
72
|
+
|
73
|
+
platform "ubuntu-13.04"
|
74
|
+
arch "x64"
|
75
|
+
env []
|
76
|
+
params "-qversion"
|
77
|
+
stdout ""
|
78
|
+
stderr "command not found"
|
79
|
+
exit_status 127
|
80
|
+
|
81
|
+
platform "centos-5.5"
|
82
|
+
arch "x64"
|
83
|
+
env ["gcc"]
|
84
|
+
params "-qversion"
|
85
|
+
stdout ""
|
86
|
+
stderr "command not found"
|
87
|
+
exit_status 127
|
88
|
+
|
89
|
+
platform "centos-6.2"
|
90
|
+
arch "x86"
|
91
|
+
env ["gcc"]
|
92
|
+
params "-qversion"
|
93
|
+
stdout ""
|
94
|
+
stderr "command not found"
|
95
|
+
exit_status 127
|
96
|
+
|
97
|
+
platform "centos-6.2"
|
98
|
+
arch "x64"
|
99
|
+
env ["gcc"]
|
100
|
+
params "-qversion"
|
101
|
+
stdout ""
|
102
|
+
stderr "command not found"
|
103
|
+
exit_status 127
|
104
|
+
|
105
|
+
platform "ubuntu-10.04"
|
106
|
+
arch "x86"
|
107
|
+
env ["gcc"]
|
108
|
+
params "-qversion"
|
109
|
+
stdout ""
|
110
|
+
stderr "command not found"
|
111
|
+
exit_status 127
|
112
|
+
|
113
|
+
platform "ubuntu-10.04"
|
114
|
+
arch "x64"
|
115
|
+
env ["gcc"]
|
116
|
+
params "-qversion"
|
117
|
+
stdout ""
|
118
|
+
stderr "command not found"
|
119
|
+
exit_status 127
|
120
|
+
|
121
|
+
platform "ubuntu-12.04"
|
122
|
+
arch "x86"
|
123
|
+
env ["gcc"]
|
124
|
+
params "-qversion"
|
125
|
+
stdout ""
|
126
|
+
stderr "command not found"
|
127
|
+
exit_status 127
|
128
|
+
|
129
|
+
platform "ubuntu-12.04"
|
130
|
+
arch "x64"
|
131
|
+
env ["gcc"]
|
132
|
+
params "-qversion"
|
133
|
+
stdout ""
|
134
|
+
stderr "command not found"
|
135
|
+
exit_status 127
|
data/spec/spec_helper.rb
CHANGED
@@ -1,47 +1,79 @@
|
|
1
1
|
require 'rspec'
|
2
2
|
|
3
|
+
# require 'pry-debugger'
|
4
|
+
# require 'pry-stack_explorer'
|
5
|
+
|
3
6
|
$:.unshift(File.expand_path("../..", __FILE__))
|
4
7
|
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
5
8
|
|
6
9
|
require 'spec/support/platform_helpers'
|
10
|
+
require 'spec/support/integration_helper'
|
7
11
|
require 'ohai'
|
8
12
|
Ohai::Config[:log_level] = :error
|
9
13
|
|
14
|
+
PLUGIN_PATH = File.expand_path("../../lib/ohai/plugins", __FILE__)
|
15
|
+
SPEC_PLUGIN_PATH = File.expand_path("../data/plugins", __FILE__)
|
16
|
+
|
17
|
+
RSpec.configure do |config|
|
18
|
+
config.before(:each) { @object_pristine = Object.clone }
|
19
|
+
config.after(:each) { remove_constants }
|
20
|
+
end
|
21
|
+
|
22
|
+
include Ohai::Mixin::ConstantHelper
|
23
|
+
|
24
|
+
if Ohai::Mixin::OS.collect_os == /mswin|mingw32|windows/
|
25
|
+
ENV["PATH"] = ""
|
26
|
+
end
|
27
|
+
|
28
|
+
def get_plugin(plugin, ohai = Ohai::System.new, path = PLUGIN_PATH)
|
29
|
+
loader = Ohai::Loader.new(ohai)
|
30
|
+
loader.load_plugin(File.join(path, "#{plugin}.rb"))
|
31
|
+
end
|
32
|
+
|
10
33
|
def it_should_check_from(plugin, attribute, from, value)
|
11
34
|
it "should set the #{attribute} to the value from '#{from}'" do
|
12
|
-
@
|
13
|
-
@
|
35
|
+
@plugin.run
|
36
|
+
@plugin[attribute].should == value
|
14
37
|
end
|
15
38
|
end
|
16
39
|
|
17
40
|
def it_should_check_from_mash(plugin, attribute, from, value)
|
18
41
|
it "should get the #{plugin}[:#{attribute}] value from '#{from}'" do
|
19
|
-
@
|
20
|
-
@
|
42
|
+
@plugin.should_receive(:shell_out).with(from).and_return(mock_shell_out(value[0], value[1], value[2]))
|
43
|
+
@plugin.run
|
21
44
|
end
|
22
45
|
|
23
46
|
it "should set the #{plugin}[:#{attribute}] to the value from '#{from}'" do
|
24
|
-
@
|
25
|
-
@
|
47
|
+
@plugin.run
|
48
|
+
@plugin[plugin][attribute].should == value[1].split($/)[0]
|
26
49
|
end
|
27
50
|
end
|
28
51
|
|
52
|
+
def mock_shell_out(exitstatus, stdout, stderr)
|
53
|
+
shell_out = double("mixlib_shell_out")
|
54
|
+
shell_out.stub(:exitstatus).and_return(exitstatus)
|
55
|
+
shell_out.stub(:stdout).and_return(stdout)
|
56
|
+
shell_out.stub(:stderr).and_return(stderr)
|
57
|
+
shell_out
|
58
|
+
end
|
59
|
+
|
29
60
|
# the mash variable may be an array listing multiple levels of Mash hierarchy
|
30
61
|
def it_should_check_from_deep_mash(plugin, mash, attribute, from, value)
|
31
62
|
it "should get the #{mash.inspect}[:#{attribute}] value from '#{from}'" do
|
32
|
-
@
|
33
|
-
@
|
63
|
+
@plugin.should_receive(:shell_out).with(from).and_return(mock_shell_out(value[0], value[1], value[2]))
|
64
|
+
@plugin.run
|
34
65
|
end
|
35
66
|
|
36
67
|
it "should set the #{mash.inspect}[:#{attribute}] to the value from '#{from}'" do
|
37
|
-
@
|
68
|
+
@plugin.run
|
69
|
+
value = value[1].split($/)[0]
|
38
70
|
if mash.is_a?(String)
|
39
|
-
@
|
71
|
+
@plugin[mash][attribute].should == value
|
40
72
|
elsif mash.is_a?(Array)
|
41
73
|
if mash.length == 2
|
42
|
-
@
|
74
|
+
@plugin[mash[0]][mash[1]][attribute].should == value
|
43
75
|
elsif mash.length == 3
|
44
|
-
@
|
76
|
+
@plugin[mash[0]][mash[1]][mash[2]][attribute].should == value
|
45
77
|
else
|
46
78
|
return nil
|
47
79
|
end
|
@@ -51,19 +83,21 @@ def it_should_check_from_deep_mash(plugin, mash, attribute, from, value)
|
|
51
83
|
end
|
52
84
|
end
|
53
85
|
|
54
|
-
module SimpleFromFile
|
55
|
-
def from_file(filename)
|
56
|
-
self.instance_eval(IO.read(filename), filename, 1)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
86
|
RSpec.configure do |config|
|
61
87
|
config.treat_symbols_as_metadata_keys_with_true_values = true
|
62
88
|
|
89
|
+
config.filter_run :focus => true
|
90
|
+
|
63
91
|
config.filter_run_excluding :windows_only => true unless windows?
|
64
92
|
config.filter_run_excluding :unix_only => true unless unix?
|
65
93
|
config.filter_run_excluding :ruby_18_only => true unless ruby_18?
|
66
94
|
config.filter_run_excluding :ruby_19_only => true unless ruby_19?
|
67
95
|
config.filter_run_excluding :requires_root => true unless ENV['USER'] == 'root'
|
68
96
|
config.filter_run_excluding :requires_unprivileged_user => true if ENV['USER'] == 'root'
|
97
|
+
|
98
|
+
config.run_all_when_everything_filtered = true
|
99
|
+
|
100
|
+
config.before :each do
|
101
|
+
Ohai::Config.reset
|
102
|
+
end
|
69
103
|
end
|