Skip to content

Commit b13bed2

Browse files
committed
test(ubuntu): fix tests on Ubuntu distro
1 parent 23214bf commit b13bed2

File tree

5 files changed

+14
-35
lines changed

5 files changed

+14
-35
lines changed

php/map.jinja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
'php': 'php' + php_version,
6868
'phpenmod_command': 'phpenmod -v' + php_version,
6969
'pspell': 'php' + php_version + '-pspell',
70-
'redis': 'php' + php_version + '-redis',
70+
'readline': 'php' + php_version + '-readline',
71+
'redis': 'php-redis',
7172
'seclib': ['php-phpseclib', 'php-seclib'],
7273
'snmp': 'php' + php_version + '-snmp',
7374
'soap': 'php' + php_version + '-soap',

test/integration/default/controls/config_spec.rb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ def test_debian
2121
end
2222
end
2323

24-
def test_ubuntu
25-
end
26-
2724
def test_redhat
2825
end
2926

@@ -32,12 +29,7 @@ def test_suse
3229

3330
case os[:family]
3431
when 'debian'
35-
case os[:name]
36-
when 'ubuntu'
37-
test_ubuntu
38-
when 'debian'
39-
test_debian
40-
end
32+
test_debian
4133
when 'redhat', 'fedora'
4234
test_redhat
4335
when 'suse'

test/integration/default/controls/package_spec.rb

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ def test_debian
2525
end
2626
end
2727

28-
def test_ubuntu
29-
describe package(pkg_name) do
30-
it { should be_installed }
31-
end
32-
end
33-
3428
def test_redhat
3529
describe package('php') do
3630
it { should be_installed }
@@ -45,12 +39,7 @@ def test_suse
4539

4640
case os[:family]
4741
when 'debian'
48-
case os[:name]
49-
when 'ubuntu'
50-
test_ubuntu
51-
when 'debian'
52-
test_debian
53-
end
42+
test_debian
5443
when 'redhat', 'fedora'
5544
test_redhat
5645
when 'suse'

test/integration/default/controls/service_spec.rb

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ def test_debian
1313
end
1414
end
1515

16-
def test_ubuntu
17-
describe service(pkg_name) do
18-
it { should be_enabled }
19-
it { should be_running }
20-
end
21-
end
22-
2316
def test_redhat
2417
end
2518

@@ -28,12 +21,7 @@ def test_suse
2821

2922
case os[:family]
3023
when 'debian'
31-
case os[:name]
32-
when 'ubuntu'
33-
test_ubuntu
34-
when 'debian'
35-
test_debian
36-
end
24+
test_debian
3725
when 'redhat', 'fedora'
3826
test_redhat
3927
when 'suse'

test/salt/pillar/debian.sls

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,20 @@
22
# vim: ft=yaml
33
---
44
php:
5+
{% if salt['grains.get']('os') == 'Ubuntu' %}
6+
use_external_repo: true
7+
repo:
8+
humanname: php-sury ppa
9+
name: "deb http://ppa.launchpad.net/ondrej/php/ubuntu {{ salt['grains.get']('oscodename') }} main"
10+
file: /etc/apt/sources.list.d/php-sury.list
11+
key_url: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c
12+
{% else %}
513
repo:
614
humanname: php-sury repo
715
name: "deb https://packages.sury.org/php/ {{ salt['grains.get']('oscodename') }} main"
816
file: /etc/apt/sources.list.d/php-sury.list
917
key_url: https://packages.sury.org/php/apt.gpg
18+
{% endif %}
1019

1120
version:
1221
- '5.6'

0 commit comments

Comments
 (0)