Sha256: ce3bfea82e38b791609f8365d4a5123a01c5c8842e5fb81b80e3101da121211d
Contents?: true
Size: 999 Bytes
Versions: 13
Compression:
Stored size: 999 Bytes
Contents
require "inspec/resources/sybase_session" module Inspec::Resources class SybaseConf < Inspec.resource(1) name "sybase_conf" supports platform: "unix" # supports platform: "windows" # TODO desc "Use the sybase_conf InSpec resource to test Sybase config settings" example <<~EXAMPLE describe sybase_conf("max memory", password: 'password', server: 'SYBASE') do its("run_value") { should cmp 180224 } end EXAMPLE attr_reader :conf_param, :sql_query def initialize(conf_param_name, opts = {}) @conf_param = conf_param_name opts[:username] ||= "sa" opts[:database] ||= "master" sql_session = inspec.sybase_session(opts) @sql_query = sql_session.query("sp_configure \"#{conf_param}\"") end def run_value sql_query.row(0).column("Run Value").value end def config_value sql_query.row(0).column("Config Value").value end def to_s "Sybase Conf #{conf_param}" end end end
Version data entries
13 entries across 13 versions & 1 rubygems