Browse Source

test(ubuntu): fix tests on Ubuntu distro

tags/v1.1.0
Nicolas Rodriguez 5 years ago
parent
commit
b13bed2a48
5 changed files with 14 additions and 35 deletions
  1. +2
    -1
      php/map.jinja
  2. +1
    -9
      test/integration/default/controls/config_spec.rb
  3. +1
    -12
      test/integration/default/controls/package_spec.rb
  4. +1
    -13
      test/integration/default/controls/service_spec.rb
  5. +9
    -0
      test/salt/pillar/debian.sls

+ 2
- 1
php/map.jinja View File

'php': 'php' + php_version, 'php': 'php' + php_version,
'phpenmod_command': 'phpenmod -v' + php_version, 'phpenmod_command': 'phpenmod -v' + php_version,
'pspell': 'php' + php_version + '-pspell', 'pspell': 'php' + php_version + '-pspell',
'redis': 'php' + php_version + '-redis',
'readline': 'php' + php_version + '-readline',
'redis': 'php-redis',
'seclib': ['php-phpseclib', 'php-seclib'], 'seclib': ['php-phpseclib', 'php-seclib'],
'snmp': 'php' + php_version + '-snmp', 'snmp': 'php' + php_version + '-snmp',
'soap': 'php' + php_version + '-soap', 'soap': 'php' + php_version + '-soap',

+ 1
- 9
test/integration/default/controls/config_spec.rb View File

end end
end end


def test_ubuntu
end

def test_redhat def test_redhat
end end




case os[:family] case os[:family]
when 'debian' when 'debian'
case os[:name]
when 'ubuntu'
test_ubuntu
when 'debian'
test_debian
end
test_debian
when 'redhat', 'fedora' when 'redhat', 'fedora'
test_redhat test_redhat
when 'suse' when 'suse'

+ 1
- 12
test/integration/default/controls/package_spec.rb View File

end end
end end


def test_ubuntu
describe package(pkg_name) do
it { should be_installed }
end
end

def test_redhat def test_redhat
describe package('php') do describe package('php') do
it { should be_installed } it { should be_installed }


case os[:family] case os[:family]
when 'debian' when 'debian'
case os[:name]
when 'ubuntu'
test_ubuntu
when 'debian'
test_debian
end
test_debian
when 'redhat', 'fedora' when 'redhat', 'fedora'
test_redhat test_redhat
when 'suse' when 'suse'

+ 1
- 13
test/integration/default/controls/service_spec.rb View File

end end
end end


def test_ubuntu
describe service(pkg_name) do
it { should be_enabled }
it { should be_running }
end
end

def test_redhat def test_redhat
end end




case os[:family] case os[:family]
when 'debian' when 'debian'
case os[:name]
when 'ubuntu'
test_ubuntu
when 'debian'
test_debian
end
test_debian
when 'redhat', 'fedora' when 'redhat', 'fedora'
test_redhat test_redhat
when 'suse' when 'suse'

+ 9
- 0
test/salt/pillar/debian.sls View File

# vim: ft=yaml # vim: ft=yaml
--- ---
php: php:
{% if salt['grains.get']('os') == 'Ubuntu' %}
use_external_repo: true
repo:
humanname: php-sury ppa
name: "deb http://ppa.launchpad.net/ondrej/php/ubuntu {{ salt['grains.get']('oscodename') }} main"
file: /etc/apt/sources.list.d/php-sury.list
key_url: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c
{% else %}
repo: repo:
humanname: php-sury repo humanname: php-sury repo
name: "deb https://packages.sury.org/php/ {{ salt['grains.get']('oscodename') }} main" name: "deb https://packages.sury.org/php/ {{ salt['grains.get']('oscodename') }} main"
file: /etc/apt/sources.list.d/php-sury.list file: /etc/apt/sources.list.d/php-sury.list
key_url: https://packages.sury.org/php/apt.gpg key_url: https://packages.sury.org/php/apt.gpg
{% endif %}


version: version:
- '5.6' - '5.6'

Loading…
Cancel
Save