|
218 | 218 | 'content' => /^dd_url: https:\/\/notaurl.datadoghq.com\n/, |
219 | 219 | )} |
220 | 220 | end |
221 | | - |
222 | 221 | context 'with a custom proxy_host' do |
223 | 222 | let(:params) {{:proxy_host => 'localhost'}} |
224 | 223 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
225 | 224 | 'content' => /^proxy_host: localhost\n/, |
226 | 225 | )} |
227 | 226 | end |
228 | | - |
229 | 227 | context 'with a custom proxy_port' do |
230 | 228 | let(:params) {{:proxy_port => '1234'}} |
231 | 229 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
232 | 230 | 'content' => /^proxy_port: 1234\n/, |
233 | 231 | )} |
234 | 232 | end |
235 | | - |
| 233 | + context 'with a custom proxy_port, specified as an integer' do |
| 234 | + let(:params) {{:proxy_port => 1234}} |
| 235 | + it { should contain_file('/etc/dd-agent/datadog.conf').with( |
| 236 | + 'content' => /^proxy_port: 1234\n/, |
| 237 | + )} |
| 238 | + end |
236 | 239 | context 'with a custom proxy_user' do |
237 | 240 | let(:params) {{:proxy_user => 'notauser'}} |
238 | 241 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
|
245 | 248 | 'content' => /^api_key: notakey\n/, |
246 | 249 | )} |
247 | 250 | end |
248 | | - |
249 | 251 | context 'with a custom hostname' do |
250 | 252 | let(:params) {{:host => 'notahost'}} |
251 | 253 |
|
|
259 | 261 | 'content' => /^non_local_traffic: true\n/, |
260 | 262 | )} |
261 | 263 | end |
262 | | - #Should expand testing to cover changes to the case upcase |
| 264 | + #Should expand testing to cover changes to the case upcase |
263 | 265 | context 'with log level set to critical' do |
264 | 266 | let(:params) {{:log_level => 'critical'}} |
265 | 267 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
|
279 | 281 | )} |
280 | 282 | end |
281 | 283 | context 'with skip_ssl_validation set to true' do |
282 | | - let(:params) {{:skip_ssl_validation => true }} |
| 284 | + let(:params) {{:skip_ssl_validation => true }} |
283 | 285 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
284 | 286 | 'content' => /^skip_ssl_validation: true\n/, |
285 | 287 | )} |
286 | 288 | end |
287 | 289 | context 'with collect_ec2_tags set to yes' do |
288 | | - let(:params) {{:collect_ec2_tags => true }} |
| 290 | + let(:params) {{:collect_ec2_tags => true }} |
289 | 291 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
290 | 292 | 'content' => /^collect_ec2_tags: true\n/, |
291 | 293 | )} |
292 | 294 | end |
293 | 295 | context 'with collect_instance_metadata set to no' do |
294 | | - let(:params) {{:collect_instance_metadata => false }} |
| 296 | + let(:params) {{:collect_instance_metadata => false }} |
295 | 297 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
296 | 298 | 'content' => /^collect_instance_metadata: false\n/, |
297 | 299 | )} |
298 | 300 | end |
299 | 301 | context 'with recent_point_threshold set to 60' do |
300 | | - let(:params) {{:recent_point_threshold => '60' }} |
| 302 | + let(:params) {{:recent_point_threshold => '60' }} |
301 | 303 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
302 | 304 | 'content' => /^recent_point_threshold: 60\n/, |
303 | 305 | )} |
304 | 306 | end |
305 | 307 | context 'with a custom port set to 17125' do |
306 | | - let(:params) {{:listen_port => '17125' }} |
| 308 | + let(:params) {{:listen_port => '17125' }} |
307 | 309 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
308 | 310 | 'content' => /^listen_port: 17125\n/, |
309 | 311 | )} |
310 | 312 | end |
311 | | - context 'litstening for graphite data on port 17124' do |
312 | | - let(:params) {{:graphite_listen_port => '17124' }} |
| 313 | + context 'with a custom port set to 17125, specified as an integer' do |
| 314 | + let(:params) {{:listen_port => 17125 }} |
| 315 | + it { should contain_file('/etc/dd-agent/datadog.conf').with( |
| 316 | + 'content' => /^listen_port: 17125\n/, |
| 317 | + )} |
| 318 | + end |
| 319 | + context 'listening for graphite data on port 17124' do |
| 320 | + let(:params) {{:graphite_listen_port => '17124' }} |
| 321 | + it { should contain_file('/etc/dd-agent/datadog.conf').with( |
| 322 | + 'content' => /^graphite_listen_port: 17124\n/, |
| 323 | + )} |
| 324 | + end |
| 325 | + context 'listening for graphite data on port 17124, port specified as an integer' do |
| 326 | + let(:params) {{:graphite_listen_port => 17124 }} |
313 | 327 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
314 | 328 | 'content' => /^graphite_listen_port: 17124\n/, |
315 | 329 | )} |
316 | 330 | end |
317 | 331 | context 'with configuration for a custom checks.d' do |
318 | | - let(:params) {{:additional_checksd => '/etc/dd-agent/checks_custom.d' }} |
| 332 | + let(:params) {{:additional_checksd => '/etc/dd-agent/checks_custom.d' }} |
319 | 333 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
320 | 334 | 'content' => /^additional_checksd: \/etc\/dd-agent\/checks_custom.d\n/, |
321 | 335 | )} |
322 | 336 | end |
323 | 337 | context 'with configuration for a custom checks.d' do |
324 | | - let(:params) {{:additional_checksd => '/etc/dd-agent/checks_custom.d' }} |
| 338 | + let(:params) {{:additional_checksd => '/etc/dd-agent/checks_custom.d' }} |
325 | 339 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
326 | 340 | 'content' => /^additional_checksd: \/etc\/dd-agent\/checks_custom.d\n/, |
327 | 341 | )} |
328 | 342 | end |
329 | | - |
330 | 343 | context 'with configuration for a custom checks.d' do |
331 | | - let(:params) {{:additional_checksd => '/etc/dd-agent/checks_custom.d' }} |
| 344 | + let(:params) {{:additional_checksd => '/etc/dd-agent/checks_custom.d' }} |
332 | 345 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
333 | 346 | 'content' => /^additional_checksd: \/etc\/dd-agent\/checks_custom.d\n/, |
334 | 347 | )} |
|
357 | 370 | 'content' => /^pup_port: 17126\n/, |
358 | 371 | )} |
359 | 372 | end |
| 373 | + context 'with a custom pup_port, specified as an integer' do |
| 374 | + let(:params) {{:pup_port => 17126 }} |
| 375 | + it { should contain_file('/etc/dd-agent/datadog.conf').with( |
| 376 | + 'content' => /^pup_port: 17126\n/, |
| 377 | + )} |
| 378 | + end |
360 | 379 | context 'with a custom pup_interface' do |
361 | 380 | let(:params) {{:pup_interface => 'notalocalhost' }} |
362 | 381 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
363 | 382 | 'content' => /^pup_interface: notalocalhost\n/, |
364 | 383 | )} |
365 | 384 | end |
366 | | - |
367 | 385 | context 'with a custom pup_url' do |
368 | 386 | let(:params) {{:pup_url => 'http://localhost:17126' }} |
369 | 387 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
370 | 388 | 'content' => /^pup_url: http:\/\/localhost:17126\n/, |
371 | 389 | )} |
372 | 390 | end |
373 | | - |
374 | 391 | context 'with use_dogstatsd set to no' do |
375 | 392 | let(:params) {{:use_dogstatsd => false}} |
376 | 393 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
377 | 394 | 'content' => /^use_dogstatsd: no\n/, |
378 | 395 | )} |
379 | 396 | end |
380 | | - context 'with dogstatsd_port set to 8126' do |
381 | | - let(:params) {{:dogstatsd_port => 8126}} |
| 397 | + context 'with dogstatsd_port set to 8126 - must be specified as an integer!' do |
| 398 | + let(:params) {{:dogstatsd_port => 8126 }} |
382 | 399 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
383 | 400 | 'content' => /^dogstatsd_port: 8126\n/, |
384 | 401 | )} |
|
414 | 431 | )} |
415 | 432 | end |
416 | 433 | context 'with statsd_forward_port set to 8126' do |
417 | | - let(:params) {{:statsd_forward_port => '8126' }} |
| 434 | + let(:params) {{:statsd_forward_port => '8126' }} |
418 | 435 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
419 | 436 | 'content' => /^statsd_forward_port: 8126\n/, |
420 | 437 | )} |
421 | 438 | end |
422 | | - context 'with statsd_forward_port set to 8126' do |
423 | | - let(:params) {{:statsd_forward_port => '8126' }} |
| 439 | + context 'with statsd_forward_port set to 8126, specified as an integer' do |
| 440 | + let(:params) {{:statsd_forward_port => 8126 }} |
424 | 441 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
425 | 442 | 'content' => /^statsd_forward_port: 8126\n/, |
426 | 443 | )} |
|
438 | 455 | )} |
439 | 456 | end |
440 | 457 | context 'with ganglia_host set to localhost and ganglia_port set to 12345' do |
441 | | - let(:params) {{:ganglia_host => 'testhost', :ganglia_port => '12345' }} |
| 458 | + let(:params) {{:ganglia_host => 'testhost', :ganglia_port => '12345' }} |
442 | 459 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
443 | 460 | 'content' => /^ganglia_port: 12345\n/, |
444 | 461 | )} |
445 | 462 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
446 | 463 | 'content' => /^ganglia_host: testhost\n/, |
447 | 464 | )} |
448 | 465 | end |
| 466 | + context 'with ganglia_host set to localhost and ganglia_port set to 12345, port specified as an integer' do |
| 467 | + let(:params) {{:ganglia_host => 'testhost', :ganglia_port => 12345 }} |
| 468 | + it { should contain_file('/etc/dd-agent/datadog.conf').with( |
| 469 | + 'content' => /^ganglia_port: 12345\n/, |
| 470 | + )} |
| 471 | + end |
449 | 472 | context 'with dogstreams set to /path/to/log1:/path/to/parser' do |
450 | 473 | let(:params) {{:dogstreams => ['/path/to/log1:/path/to/parser'] }} |
451 | 474 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
|
501 | 524 | )} |
502 | 525 | end |
503 | 526 | context 'with syslog port set to 8080' do |
504 | | - let(:params) {{:syslog_port => '8080' }} |
| 527 | + let(:params) {{:syslog_port => '8080' }} |
| 528 | + it { should contain_file('/etc/dd-agent/datadog.conf').with( |
| 529 | + 'content' => /^syslog_port: 8080\n/, |
| 530 | + )} |
| 531 | + end |
| 532 | + context 'with syslog port set to 8080, specified as an integer' do |
| 533 | + let(:params) {{:syslog_port => 8080 }} |
505 | 534 | it { should contain_file('/etc/dd-agent/datadog.conf').with( |
506 | 535 | 'content' => /^syslog_port: 8080\n/, |
507 | 536 | )} |
|
0 commit comments