Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

Commit

Permalink
Fix test failure that related #38, #39
Browse files Browse the repository at this point in the history
- Update default mongodb version as 3.2.8
- Adding Kitchen testing platforms : ubuntu 15.04 and 16.04
! Some test cases are still failing !
  • Loading branch information
sunggun-yu committed Aug 4, 2016
1 parent 31cd5c3 commit 585f996
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 6 deletions.
19 changes: 18 additions & 1 deletion .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,25 @@ platforms:
attributes:
apt:
compile_time_update: true
- name: ubuntu-15.04
run_list:
- recipe[apt]
attributes:
apt:
compile_time_update: true
- name: ubuntu-16.04
run_list:
- recipe[apt]
attributes:
apt:
compile_time_update: true
- name: debian-7.8
run_list:
- recipe[apt]
attributes:
apt:
compile_time_update: true
- name: centos-6.6
- name: centos-6.8
- name: centos-7.2
- name: oel-6.6
driver:
Expand Down Expand Up @@ -89,6 +101,8 @@ suites:
- debian-7.8
- oel-6.6
- ami-2014.03
- ubuntu-15.04
- ubuntu-16.04

- name: default-30x
run_list:
Expand All @@ -97,6 +111,8 @@ suites:
excludes:
- oel-6.6
- ami-2014.03
- ubuntu-15.04
- ubuntu-16.04

- name: replica
driver:
Expand Down Expand Up @@ -175,6 +191,7 @@ suites:
excludes:
- oel-6.6
- ami-2014.03
- ubuntu-16.04

- name: mms-automation-agent
driver:
Expand Down
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#

# MongoDB version to install
default['mongodb3']['version'] = '3.2.4'
default['mongodb3']['version'] = '3.2.8'

# Please note : The default values for ['mongodb3']['package'] attributes will be set in `package_repo` recipe.
# but, You can set custom values for yum/apt repo url, yum package version or apt related in your wrapper
Expand Down
22 changes: 22 additions & 0 deletions files/default/disable-transparent-hugepages.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

# THIS FILE IS MAINTAINED BY CHEF. DO NOT MODIFY AS IT WILL BE OVERWRITTEN.

### BEGIN INIT INFO
# Provides: disable-transparent-hugepages
# Required-Start: $local_fs
# Required-Stop:
# X-Start-Before: mongod mongodb-mms-automation-agent
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Disable Linux transparent huge pages
# Description: Disable Linux transparent huge pages, to improve
# database performance.
### END INIT INFO

[Unit]
Description= disable-transparent-hugepages
SourcePath=/etc/init.d/disable-transparent-hugepages

[Service]
ExecStart=/etc/init.d/disable-transparent-hugepages start
24 changes: 23 additions & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,29 @@
}
end

case node['platform']
when 'ubuntu'
if node['platform_version'].to_f >= 15.04
cookbook_file '/lib/systemd/system/disable-transparent-hugepages.service' do
source 'disable-transparent-hugepages.service'
owner 'root'
group 'root'
mode '0655'
action :create
only_if {
node['mongodb3']['mongod']['disable-transparent-hugepages']
}
end
end
end

service 'disable-transparent-hugepages' do
case node['platform']
when 'ubuntu'
if node['platform_version'].to_f >= 15.04
provider Chef::Provider::Service::Systemd
end
end
action [ :enable, :start ]
only_if {
node['mongodb3']['mongod']['disable-transparent-hugepages']
Expand All @@ -105,7 +127,7 @@
# Create the mongod.service file
case node['platform']
when 'ubuntu'
if node['platform_version'].to_f >= 16.04
if node['platform_version'].to_f >= 15.04
template '/lib/systemd/system/mongod.service' do
source 'mongod.service.erb'
mode 0644
Expand Down
2 changes: 1 addition & 1 deletion test/integration/chef-client-11/serverspec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

# Test mongod process starts with expected mongodb config file
describe command('export LC_ALL="en_US.UTF-8"; mongo --eval "db.version()"') do
its(:stdout) { should contain('3.2.4') }
its(:stdout) { should contain('3.2.8') }
end

# Test chef client version
Expand Down
2 changes: 1 addition & 1 deletion test/integration/custom/serverspec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@

# Test mongod process starts with expected mongodb config file
describe command('export LC_ALL="en_US.UTF-8"; mongo --eval "db.version()"') do
its(:stdout) { should contain('3.2.4') }
its(:stdout) { should contain('3.2.8') }
end
2 changes: 1 addition & 1 deletion test/integration/default/serverspec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@

# Test mongod process starts with expected mongodb config file
describe command('export LC_ALL="en_US.UTF-8"; mongo --eval "db.version()"') do
its(:stdout) { should contain('3.2.4') }
its(:stdout) { should contain('3.2.8') }
end

0 comments on commit 585f996

Please sign in to comment.