File: puppetlabs-mysql_spec.rb

package info (click to toggle)
puppet-module-puppetlabs-mysql 15.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 968 kB
  • sloc: ruby: 1,648; sh: 43; makefile: 5
file content (52 lines) | stat: -rw-r--r-- 1,298 bytes parent folder | download
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
43
44
45
46
47
48
49
50
51
52
require 'spec_helper'

describe "mariadb is not installed" do
  describe package('mariadb') do
    it { should_not be_installed }
  end
  describe service('mariadb') do
    it { should_not be_running }
  end
end

describe "mysql::client class applies successfully" do
  describe command("puppet apply --logdest /var/log/puppet-apply.log --test -e 'include mysql::client'") do
    its(:exit_status) { should eq 2 }
  end
end

describe "mariadb-client is installed" do
  describe package('mariadb-client') do
    it { should be_installed }
  end
end

describe "mysql::server class applies successfully" do
  describe command("puppet apply --logdest /var/log/puppet-apply.log --test -e 'include mysql::server'") do
    its(:exit_status) { should eq 2 }
  end
end

describe "mariadb-server is installed" do
  describe package('mariadb-server') do
    it { should be_installed }
  end
end

describe "mariadb service is started" do
  # allow time for the service to start
  before(:all) do
    sleep 5
  end
  describe service('mariadb') do
    it { should be_enabled }
    it { should be_running }
  end
end

describe "mariadb is responsive" do
  describe command("echo '\\s' | mysql --ssl=off") do
    its(:exit_status) { should eq 0 }
    its(:stdout) { should match (/Server:\s+MariaDB/) }
  end
end