forked from puppetlabs/puppetlabs-mysql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql_task_spec.rb
More file actions
23 lines (20 loc) · 750 Bytes
/
sql_task_spec.rb
File metadata and controls
23 lines (20 loc) · 750 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# run a test task
require 'spec_helper_acceptance'
describe 'mysql tasks', if: puppet_version =~ %r{(5\.\d\.\d)} && fact('operatingsystem') != 'SLES' do
describe 'execute some sql' do
pp = <<-MANIFEST
class { 'mysql::server': root_password => 'password' }
mysql::db { 'spec1':
user => 'root1',
password => 'password',
}
MANIFEST
it 'sets up a mysql instance' do
apply_manifest_on(hosts, pp, catch_failures: true)
end
it 'execute arbitary sql' do
result = run_task(task_name: 'mysql::sql', params: 'sql="show databases;" password=password')
expect_multiple_regexes(result: result, regexes: [%r{information_schema}, %r{#{task_summary_line}}])
end
end
end