2015年1月1日木曜日

server spec2 で LDAPのテスト

今更LDAPとかないわー。とは思ったんですが、せっかく構築したのでserver specでテストも書きました。今後も使いまわせそうな箇所をメモ

環境

  • ruby 2.1.5
  • serverspec 2.7.1
 

    require 'spec_helper'

    // デーモン
    describe service('slapd') do
      it { should be_enabled }
      it { should be_running }
    end

    // port番号
    describe port(389) do
      it { should be_listening }
    end

    // directory
    describe file('/var/lib/ldap') do
      it { should be_directory }
      it { should be_owned_by 'ldap' }
      it { should be_grouped_into 'ldap' }
    end

    // postfix連携
    describe file('/etc/openldap/schema/postfix.schema') do
      it { should be_file }
    end

    // ログ設定ファイル
    describe file('/etc/rsyslog.d/ldap.conf') do
      it { should contain 'local4' }
    end

    // ログローテーション設定ファイル
    describe file('/etc/logrotate.d/syslog') do
      it { should contain 'ldap' }
    end


    

以上

この記事がお役にたちましたらシェアをお願いします

このエントリーをはてなブックマークに追加

0 件のコメント:

コメントを投稿

Related Posts Plugin for WordPress, Blogger...