Use constants when possible.
MODIFY
test/integration/datadog_consul/serverspec/consul_spec.rb
test/integration/datadog_consul/serverspec/consul_spec.rb
# Encoding: utf-8
+require 'spec_helper'
require 'json_spec'
require 'serverspec'
require 'yaml'
@@ -7,9 +8,9 @@ require 'yaml'
set :backend, :exec
set :path, '/sbin:/usr/local/sbin:$PATH'
-AGENT_CONFIG = '/etc/datadog-agent/conf.d/consul.yaml'.freeze
+AGENT_CONFIG = File.join(@agent_config_dir, 'conf.d/consul.yaml')
-describe service('datadog-agent') do
+describe service(@agent_service_name) do
it { should be_running }
end

MODIFY
test/integration/datadog_etcd/serverspec/etcd_spec.rb
test/integration/datadog_etcd/serverspec/etcd_spec.rb
# Encoding: utf-8
+require 'spec_helper'
require 'json_spec'
require 'serverspec'
require 'yaml'
@@ -7,9 +8,9 @@ require 'yaml'
set :backend, :exec
set :path, '/sbin:/usr/local/sbin:$PATH'
-AGENT_CONFIG = '/etc/dd-agent/conf.d/etcd.yaml'.freeze
+AGENT_CONFIG = File.join(@agent_config_dir, 'conf.d/etcd.yaml')
-describe service('datadog-agent') do
+describe service(@agent_service_name) do
it { should be_running }
end

MODIFY
test/integration/datadog_mysql/serverspec/mysql_spec.rb
test/integration/datadog_mysql/serverspec/mysql_spec.rb
# Encoding: utf-8
+require 'spec_helper'
require 'json_spec'
require 'serverspec'
require 'yaml'
@@ -7,9 +8,9 @@ require 'yaml'
set :backend, :exec
set :path, '/sbin:/usr/local/sbin:$PATH'
-AGENT_CONFIG = '/etc/datadog-agent/conf.d/mysql.yaml'.freeze
+AGENT_CONFIG = File.join(@agent_config_dir, 'conf.d/mysql.yaml')
-describe service('datadog-agent') do
+describe service(@agent_service_name) do
it { should be_running }
end

MODIFY
test/integration/datadog_pgbouncer/serverspec/pgbouncer_spec.rb
test/integration/datadog_pgbouncer/serverspec/pgbouncer_spec.rb
# Encoding: utf-8
+require 'spec_helper'
require 'json_spec'
require 'serverspec'
require 'yaml'
@@ -7,9 +8,9 @@ require 'yaml'
set :backend, :exec
set :path, '/sbin:/usr/local/sbin:$PATH'
-AGENT_CONFIG = '/etc/datadog-agent/conf.d/pgbouncer.yaml'.freeze
+AGENT_CONFIG = File.join(@agent_config_dir, 'conf.d/pgbouncer.yaml')
-describe service('datadog-agent') do
+describe service(@agent_service_name) do
it { should be_running }
end

MODIFY
test/integration/datadog_postfix/serverspec/postfix_spec.rb
test/integration/datadog_postfix/serverspec/postfix_spec.rb
# Encoding: utf-8
+require 'spec_helper'
require 'json_spec'
require 'serverspec'
require 'yaml'
@@ -7,9 +8,9 @@ require 'yaml'
set :backend, :exec
set :path, '/sbin:/usr/local/sbin:$PATH'
-AGENT_CONFIG = '/etc/datadog-agent/conf.d/postfix.yaml'.freeze
+AGENT_CONFIG = File.join(@agent_config_dir, 'conf.d/postfix.yaml')
-describe service('datadog-agent') do
+describe service(@agent_service_name) do
it { should be_running }
end

MODIFY
test/integration/datadog_ssh_check/serverspec/ssh_check_spec.rb
test/integration/datadog_ssh_check/serverspec/ssh_check_spec.rb
# Encoding: utf-8
+require 'spec_helper'
require 'json_spec'
require 'serverspec'
require 'yaml'
@@ -7,9 +8,9 @@ require 'yaml'
set :backend, :exec
set :path, '/sbin:/usr/local/sbin:$PATH'
-AGENT_CONFIG = '/etc/datadog-agent/conf.d/ssh_check.yaml'.freeze
+AGENT_CONFIG = File.join(@agent_config_dir, 'conf.d/ssh_check.yaml')
-describe service('datadog-agent') do
+describe service(@agent_service_name) do
it { should be_running }
end

MODIFY
test/integration/datadog_supervisord/serverspec/supervisord_spec.rb
test/integration/datadog_supervisord/serverspec/supervisord_spec.rb
# Encoding: utf-8
+require 'spec_helper'
require 'json_spec'
require 'serverspec'
require 'yaml'
@@ -7,9 +8,9 @@ require 'yaml'
set :backend, :exec
set :path, '/sbin:/usr/local/sbin:$PATH'
-AGENT_CONFIG = '/etc/datadog-agent/conf.d/supervisord.yaml'.freeze
+AGENT_CONFIG = File.join(@agent_config_dir, 'conf.d/supervisord.yaml')
-describe service('datadog-agent') do
+describe service(@agent_service_name) do
it { should be_running }
end

MODIFY
test/integration/datadog_vault/serverspec/vault_spec.rb
test/integration/datadog_vault/serverspec/vault_spec.rb
# Encoding: utf-8
+require 'spec_helper'
require 'json_spec'
require 'serverspec'
require 'yaml'
@@ -7,9 +8,9 @@ require 'yaml'
set :backend, :exec
set :path, '/sbin:/usr/local/sbin:$PATH'
-AGENT_CONFIG = '/etc/datadog-agent/conf.d/vault.yaml'.freeze
+AGENT_CONFIG = File.join(@agent_config_dir, 'conf.d/vault.yaml')
-describe service('datadog-agent') do
+describe service(@agent_service_name) do
it { should be_running }
end

Use constants when possible.