chef-zero 1.4.0.alpha-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/LICENSE +201 -0
  2. data/README.md +145 -0
  3. data/Rakefile +11 -0
  4. data/bin/chef-zero +43 -0
  5. data/lib/chef_zero.rb +7 -0
  6. data/lib/chef_zero/cookbook_data.rb +223 -0
  7. data/lib/chef_zero/data_normalizer.rb +142 -0
  8. data/lib/chef_zero/data_store/data_already_exists_error.rb +29 -0
  9. data/lib/chef_zero/data_store/data_error.rb +31 -0
  10. data/lib/chef_zero/data_store/data_not_found_error.rb +29 -0
  11. data/lib/chef_zero/data_store/memory_store.rb +167 -0
  12. data/lib/chef_zero/endpoints/actor_endpoint.rb +68 -0
  13. data/lib/chef_zero/endpoints/actors_endpoint.rb +32 -0
  14. data/lib/chef_zero/endpoints/authenticate_user_endpoint.rb +25 -0
  15. data/lib/chef_zero/endpoints/cookbook_endpoint.rb +39 -0
  16. data/lib/chef_zero/endpoints/cookbook_version_endpoint.rb +110 -0
  17. data/lib/chef_zero/endpoints/cookbooks_base.rb +65 -0
  18. data/lib/chef_zero/endpoints/cookbooks_endpoint.rb +19 -0
  19. data/lib/chef_zero/endpoints/data_bag_endpoint.rb +45 -0
  20. data/lib/chef_zero/endpoints/data_bag_item_endpoint.rb +25 -0
  21. data/lib/chef_zero/endpoints/data_bags_endpoint.rb +22 -0
  22. data/lib/chef_zero/endpoints/environment_cookbook_endpoint.rb +24 -0
  23. data/lib/chef_zero/endpoints/environment_cookbook_versions_endpoint.rb +109 -0
  24. data/lib/chef_zero/endpoints/environment_cookbooks_endpoint.rb +22 -0
  25. data/lib/chef_zero/endpoints/environment_endpoint.rb +33 -0
  26. data/lib/chef_zero/endpoints/environment_nodes_endpoint.rb +23 -0
  27. data/lib/chef_zero/endpoints/environment_recipes_endpoint.rb +22 -0
  28. data/lib/chef_zero/endpoints/environment_role_endpoint.rb +36 -0
  29. data/lib/chef_zero/endpoints/file_store_file_endpoint.rb +22 -0
  30. data/lib/chef_zero/endpoints/node_endpoint.rb +17 -0
  31. data/lib/chef_zero/endpoints/not_found_endpoint.rb +11 -0
  32. data/lib/chef_zero/endpoints/principal_endpoint.rb +30 -0
  33. data/lib/chef_zero/endpoints/rest_list_endpoint.rb +40 -0
  34. data/lib/chef_zero/endpoints/rest_object_endpoint.rb +61 -0
  35. data/lib/chef_zero/endpoints/role_endpoint.rb +16 -0
  36. data/lib/chef_zero/endpoints/role_environments_endpoint.rb +14 -0
  37. data/lib/chef_zero/endpoints/sandbox_endpoint.rb +27 -0
  38. data/lib/chef_zero/endpoints/sandboxes_endpoint.rb +51 -0
  39. data/lib/chef_zero/endpoints/search_endpoint.rb +188 -0
  40. data/lib/chef_zero/endpoints/searches_endpoint.rb +18 -0
  41. data/lib/chef_zero/log.rb +7 -0
  42. data/lib/chef_zero/rest_base.rb +133 -0
  43. data/lib/chef_zero/rest_error_response.rb +11 -0
  44. data/lib/chef_zero/rest_request.rb +56 -0
  45. data/lib/chef_zero/rest_router.rb +44 -0
  46. data/lib/chef_zero/rspec.rb +107 -0
  47. data/lib/chef_zero/server.rb +309 -0
  48. data/lib/chef_zero/solr/query/binary_operator.rb +53 -0
  49. data/lib/chef_zero/solr/query/phrase.rb +23 -0
  50. data/lib/chef_zero/solr/query/range_query.rb +34 -0
  51. data/lib/chef_zero/solr/query/regexpable_query.rb +29 -0
  52. data/lib/chef_zero/solr/query/subquery.rb +35 -0
  53. data/lib/chef_zero/solr/query/term.rb +45 -0
  54. data/lib/chef_zero/solr/query/unary_operator.rb +43 -0
  55. data/lib/chef_zero/solr/solr_doc.rb +62 -0
  56. data/lib/chef_zero/solr/solr_parser.rb +193 -0
  57. data/lib/chef_zero/version.rb +3 -0
  58. data/spec/run.rb +25 -0
  59. data/spec/support/pedant.rb +117 -0
  60. data/spec/support/stickywicket.pem +27 -0
  61. metadata +204 -0
@@ -0,0 +1,3 @@
1
+ module ChefZero
2
+ VERSION = '1.4.0.alpha'
3
+ end
data/spec/run.rb ADDED
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env ruby
2
+ require 'bundler'
3
+ require 'bundler/setup'
4
+
5
+ require 'chef_zero/server'
6
+ require 'rspec/core'
7
+
8
+ require 'pedant'
9
+ require 'pedant/opensource'
10
+
11
+ server = ChefZero::Server.new(:port => 8889)
12
+ server.start_background
13
+
14
+ Pedant.config.suite = 'api'
15
+ Pedant.config[:config_file] = 'spec/support/pedant.rb'
16
+ Pedant.setup([
17
+ '--skip-validation',
18
+ '--skip-authentication',
19
+ '--skip-authorization'
20
+ ])
21
+
22
+ result = RSpec::Core::Runner.run(Pedant.config.rspec_args)
23
+
24
+ server.stop
25
+ exit(result)
@@ -0,0 +1,117 @@
1
+ # Copyright: Copyright (c) 2012 Opscode, Inc.
2
+ # License: Apache License, Version 2.0
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ # This annotated Pedant configuration file details the various
17
+ # configuration settings available to you. It is separate from the
18
+ # actual Pedant::Config class because not all settings have sane
19
+ # defaults, and not all settings are appropriate in all settings.
20
+
21
+ ################################################################################
22
+ # You MUST specify the address of the server the API requests will be
23
+ # sent to. Only specify protocol, hostname, and port.
24
+ chef_server 'http://127.0.0.1:8889'
25
+
26
+ # If you are doing development testing, you can specify the address of
27
+ # the Solr server. The presence of this parameter will enable tests
28
+ # to force commits to Solr, greatly decreasing the amout of time
29
+ # needed for testing the search endpoint. This is only an
30
+ # optimization for development! If you are testing a "live" Chef
31
+ # Server, or otherwise do not have access to the Solr server from your
32
+ # testing location, you should not specify a value for this parameter.
33
+ # The tests will still run, albeit slower, as they will now need to
34
+ # poll for a period to ensure they are querying committed results.
35
+ #search_server "http://localhost:8983"
36
+
37
+ # Related to the 'search_server' parameter, this specifies the maximum
38
+ # amout of time (in seconds) that search endpoint requests should be
39
+ # retried before giving up. If not explicitly set, it will default to
40
+ # 65 seconds; only set it if you know that your Solr commit interval
41
+ # differs significantly from this.
42
+ maximum_search_time 0
43
+
44
+ # We're starting to break tests up into groups based on different
45
+ # criteria. The proper API tests (the results of which are viewable
46
+ # to OPC customers) should be the only ones run by Pedant embedded in
47
+ # OPC installs. There are other specs that help us keep track of API
48
+ # cruft that we want to come back and fix later; these shouldn't be
49
+ # viewable to customers, but we should be able to run them in
50
+ # development and CI environments. If this parameter is missing or
51
+ # explicitly `false` only the customer-friendly tests will be run.
52
+ #
53
+ # This is mainly here for documentation purposes, since the
54
+ # command-line `opscode-pedant` utility ultimately determines this
55
+ # value.
56
+ include_internal false
57
+
58
+ # Test users. The five users specified below are required; their
59
+ # names (:user, :non_org_user, etc.) are indicative of their role
60
+ # within the tests. All users must have a ':name' key. If they have
61
+ # a ':create_me' key, Pedant will create these users for you. If you
62
+ # are using pre-existing users, you must supply a ':key_file' key,
63
+ # which should be the fully-qualified path /on the machine Pedant is
64
+ # running on/ to a private key for that user.
65
+ key = 'spec/support/stickywicket.pem'
66
+ superuser_name 'admin'
67
+ superuser_key key
68
+ webui_key key
69
+
70
+ # Set the platform_class
71
+ platform_class Pedant::OpenSourcePlatform
72
+
73
+ requestors({
74
+ :clients => {
75
+ # The the admin user, for the purposes of getting things rolling
76
+ :admin => {
77
+ :name => "pedant_admin_client",
78
+ :create_me => true,
79
+ :create_knife => true,
80
+ :admin => true
81
+ },
82
+ :non_admin => {
83
+ :name => 'pedant_client',
84
+ :create_me => true,
85
+ :create_knife => true
86
+ },
87
+ :bad => {
88
+ :name => 'bad_client',
89
+ :bogus => true
90
+ }
91
+ },
92
+ :users => {
93
+ :admin => {
94
+ :name => "admin",
95
+ :key_file => key,
96
+ :create_me => false,
97
+ :create_knife => false,
98
+ :admin => true
99
+ },
100
+ :non_admin => {
101
+ :name => "pedant_non_admin_user",
102
+ :create_me => true,
103
+ :create_knife => true,
104
+ :admin => false
105
+ },
106
+ # A user for Knife tests. A knife.rb and key files will be set up
107
+ # for this user
108
+ :knife_user => {
109
+ :name => "knifey",
110
+ :create_me => true,
111
+ :create_knife => true
112
+ }
113
+ }
114
+ })
115
+
116
+ self[:tags] = [:validation, :authentication, :authorization]
117
+ verify_error_messages false
@@ -0,0 +1,27 @@
1
+ -----BEGIN RSA PRIVATE KEY-----
2
+ MIIEpQIBAAKCAQEApNCkX2k+lFGDWRVhX4uClaVQrumG9XXvk6X7M2izrIg7RzMP
3
+ Dk4thhZkpx5gr22By7PZQdMEjWC/Zo8MBjtoJ0GV0jw8npefbU1MGKs2dtpYgo0N
4
+ Fq8fX8MdFPu4h2W3g0dMEdhT8icc2H4EjhZmdeUhUn3RIEt2duCgp3YDYnUUZx3j
5
+ N7MHcTIdzD58ikr6zQrZzHOv+OOI86Xk9EpyEEQizOLoQxkICNrhqN7ElQDuvXaX
6
+ BSBrYDRKH2umBMMcXzvsR/SvkmqxoEESSpIlW8zeKAWQ+znNjDC0tmTg7jZmgSP7
7
+ siKrwo4t4ebjcmjpIoi/JKww/nGN3Uhz1ZOZuwIDAQABAoIBAQCaJQD2s0nyEeKU
8
+ uKhfYe155Cl3zbWJcQnmv4AXbr9MiAVY6+oS6Q8ur1bn7kNjDzoruENjiuZhC7E3
9
+ TGZklb8tp+tluyy+7vQOmBKpp8fClSfewekR5CultqhGbb8B8yIVR+NfdUHd4rLZ
10
+ z9KWyWB+txPZQQ8L80gSmrfmpzs3IuT7oPvmtBU1Wq9QapC4n/rUohHUpUV1du4G
11
+ 0wCIF4zQTg6cbYW2YXozwVQvw+P7P3RVEqZt+aZlbVcy0fNr6jNao0hi1KFC9OH2
12
+ VjjU+PioreoA/NU3aZPIUzmJpWtsu31yuOZxXmytAkYooCZgiEQNEHnJlNPv0RmC
13
+ 6BPMzVoBAoGBAM7yZoSNJpzdP/q1/4+H3zyy7o4I0VTW9u/GqUzhnbjm5poK30X9
14
+ YXh/7WOVV0OoVqdO6ljRKygP3Oggf41ZEbi1C6bbsO57pksBWgx9bD9V35XscZ0J
15
+ F1ERe//kMHwVQy74R8/cIuRwm75haLSBj5/fwGbLeeVDglJkCVqPjtuBAoGBAMvh
16
+ qsAGG5k9u6voTcXlFwS+B5YjULhK4NSxdJ2BnOxzYzxQ3IYQZMlb2xt8yZYx/ZZK
17
+ wjkr9rcAPEQIQZ2A6NUbGq6qCD7sSmg6UAi0CgiqTokQ/Wtag0UDvFMzwerdg/On
18
+ 37uxffpxpte8z1jYi/MxRaoTYueuc1UVnqofVIM7AoGBALZJzwPzUY/bVAADUJmd
19
+ lYZiFsAGBF42/E05MOgH1GaK/ZWy/fkouDLsfK67XaK7JZk6ajLSDLG9R1kxRym6
20
+ y2FoGFtiKPfo8xIenrNhx3gCrG/jVjB9UYyXWiKNXifukr9M8/SkdBfFGWsZYqGd
21
+ fmXVMiVaFoVcce8hLxwWWEABAoGBAKcyhKX/HEj6YFqlIoqkydDAylXs1jicZ27l
22
+ rF2yum8KXZpMMdzbutuKsdAD8Ql0K6NB4a+jByuiTMn5/11cJxUEqkgM9sArZQW+
23
+ tH2+r+/VQpyTS0/rpXVGj/2nl2K1kI2T4R36e/aTl6CanWweAf9JK/lC9rxKyxg+
24
+ p6SaFuObAoGACP6TKCkp2oymXlKgdUUgPrnsaz2VAw8jD5QHtx10U4wty0C8gxsk
25
+ MLe00h09iLPyFmvJpD+MgbxV/r6RrZeVdsKdU/5LG52YgiVSTaizyy+ciEfW7xoQ
26
+ CL5EtZd8Cn5OKinBEzzFpELqunlqepIKCIDOcLKz/cjR+3a+E6Zx5Wo=
27
+ -----END RSA PRIVATE KEY-----
metadata ADDED
@@ -0,0 +1,204 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: chef-zero
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.4.0.alpha
5
+ prerelease: 6
6
+ platform: x86-mingw32
7
+ authors:
8
+ - John Keiser
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-06-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: puma
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 1.6.3
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.6.3
30
+ - !ruby/object:Gem::Dependency
31
+ name: mixlib-log
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '1.3'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '1.3'
46
+ - !ruby/object:Gem::Dependency
47
+ name: hashie
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: '2.0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: moneta
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - <
68
+ - !ruby/object:Gem::Version
69
+ version: 0.7.0
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - <
76
+ - !ruby/object:Gem::Version
77
+ version: 0.7.0
78
+ - !ruby/object:Gem::Dependency
79
+ name: rake
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: puma
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: '1.6'
102
+ type: :runtime
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: '1.6'
110
+ description: Self-contained, easy-setup, fast-start in-memory Chef server for testing
111
+ and solo setup purposes
112
+ email: jkeiser@opscode.com
113
+ executables:
114
+ - chef-zero
115
+ extensions: []
116
+ extra_rdoc_files: []
117
+ files:
118
+ - LICENSE
119
+ - README.md
120
+ - Rakefile
121
+ - lib/chef_zero/cookbook_data.rb
122
+ - lib/chef_zero/data_normalizer.rb
123
+ - lib/chef_zero/data_store/data_already_exists_error.rb
124
+ - lib/chef_zero/data_store/data_error.rb
125
+ - lib/chef_zero/data_store/data_not_found_error.rb
126
+ - lib/chef_zero/data_store/memory_store.rb
127
+ - lib/chef_zero/endpoints/actor_endpoint.rb
128
+ - lib/chef_zero/endpoints/actors_endpoint.rb
129
+ - lib/chef_zero/endpoints/authenticate_user_endpoint.rb
130
+ - lib/chef_zero/endpoints/cookbook_endpoint.rb
131
+ - lib/chef_zero/endpoints/cookbook_version_endpoint.rb
132
+ - lib/chef_zero/endpoints/cookbooks_base.rb
133
+ - lib/chef_zero/endpoints/cookbooks_endpoint.rb
134
+ - lib/chef_zero/endpoints/data_bag_endpoint.rb
135
+ - lib/chef_zero/endpoints/data_bag_item_endpoint.rb
136
+ - lib/chef_zero/endpoints/data_bags_endpoint.rb
137
+ - lib/chef_zero/endpoints/environment_cookbook_endpoint.rb
138
+ - lib/chef_zero/endpoints/environment_cookbook_versions_endpoint.rb
139
+ - lib/chef_zero/endpoints/environment_cookbooks_endpoint.rb
140
+ - lib/chef_zero/endpoints/environment_endpoint.rb
141
+ - lib/chef_zero/endpoints/environment_nodes_endpoint.rb
142
+ - lib/chef_zero/endpoints/environment_recipes_endpoint.rb
143
+ - lib/chef_zero/endpoints/environment_role_endpoint.rb
144
+ - lib/chef_zero/endpoints/file_store_file_endpoint.rb
145
+ - lib/chef_zero/endpoints/node_endpoint.rb
146
+ - lib/chef_zero/endpoints/not_found_endpoint.rb
147
+ - lib/chef_zero/endpoints/principal_endpoint.rb
148
+ - lib/chef_zero/endpoints/rest_list_endpoint.rb
149
+ - lib/chef_zero/endpoints/rest_object_endpoint.rb
150
+ - lib/chef_zero/endpoints/role_endpoint.rb
151
+ - lib/chef_zero/endpoints/role_environments_endpoint.rb
152
+ - lib/chef_zero/endpoints/sandbox_endpoint.rb
153
+ - lib/chef_zero/endpoints/sandboxes_endpoint.rb
154
+ - lib/chef_zero/endpoints/search_endpoint.rb
155
+ - lib/chef_zero/endpoints/searches_endpoint.rb
156
+ - lib/chef_zero/log.rb
157
+ - lib/chef_zero/rest_base.rb
158
+ - lib/chef_zero/rest_error_response.rb
159
+ - lib/chef_zero/rest_request.rb
160
+ - lib/chef_zero/rest_router.rb
161
+ - lib/chef_zero/rspec.rb
162
+ - lib/chef_zero/server.rb
163
+ - lib/chef_zero/solr/query/binary_operator.rb
164
+ - lib/chef_zero/solr/query/phrase.rb
165
+ - lib/chef_zero/solr/query/range_query.rb
166
+ - lib/chef_zero/solr/query/regexpable_query.rb
167
+ - lib/chef_zero/solr/query/subquery.rb
168
+ - lib/chef_zero/solr/query/term.rb
169
+ - lib/chef_zero/solr/query/unary_operator.rb
170
+ - lib/chef_zero/solr/solr_doc.rb
171
+ - lib/chef_zero/solr/solr_parser.rb
172
+ - lib/chef_zero/version.rb
173
+ - lib/chef_zero.rb
174
+ - spec/run.rb
175
+ - spec/support/pedant.rb
176
+ - spec/support/stickywicket.pem
177
+ - bin/chef-zero
178
+ homepage: http://www.opscode.com
179
+ licenses: []
180
+ post_install_message:
181
+ rdoc_options: []
182
+ require_paths:
183
+ - lib
184
+ required_ruby_version: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
190
+ required_rubygems_version: !ruby/object:Gem::Requirement
191
+ none: false
192
+ requirements:
193
+ - - ! '>'
194
+ - !ruby/object:Gem::Version
195
+ version: 1.3.1
196
+ requirements: []
197
+ rubyforge_project:
198
+ rubygems_version: 1.8.23
199
+ signing_key:
200
+ specification_version: 3
201
+ summary: Self-contained, easy-setup, fast-start in-memory Chef server for testing
202
+ and solo setup purposes
203
+ test_files: []
204
+ has_rdoc: