File: mysql_spec.rb

package info (click to toggle)
puppet-module-openstacklib 25.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 968 kB
  • sloc: ruby: 4,500; python: 38; sh: 22; makefile: 10
file content (42 lines) | stat: -rw-r--r-- 985 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
require 'spec_helper_acceptance'

describe 'openstacklib mysql' do

  context 'default parameters' do

    it 'should work with no errors' do
      pp= <<-EOS
      Exec { logoutput => 'on_failure' }

      class { 'mysql::server': }

      $charset = $::operatingsystem ? {
        'Ubuntu' => 'utf8mb3',
        default  => 'utf8',
      }

      openstacklib::db::mysql { 'ci':
        charset       => $charset,
        collate       => "${charset}_general_ci",
        password_hash => mysql::password('keystone'),
        allowed_hosts => '127.0.0.1',
      }
      EOS

      # Run it twice and test for idempotency
      apply_manifest(pp, :catch_failures => true)
      apply_manifest(pp, :catch_changes => true)
    end

    describe port(3306) do
      it { is_expected.to be_listening.with('tcp') }
    end

    it 'should have ci database' do
      command("mysql -e 'show databases;' | grep -q ci") do |r|
        expect(r.exit_code).to eq 0
      end
    end

  end
end