mirror of
https://github.com/inspec/inspec
synced 2024-11-30 16:39:20 +00:00
0839be50d6
* improve database parsing * support sqlcli * ensure headers are downcast * externalize database helper * use password as argument * feedback from @adamleff * inline docs update + linting * stay backwards compatible * implement tests
22 lines
879 B
Ruby
22 lines
879 B
Ruby
# encoding: utf-8
|
|
# author: Nolan Davidson
|
|
# author: Christoph Hartmann
|
|
|
|
require 'helper'
|
|
|
|
describe 'Inspec::Resources::OracledbSession' do
|
|
it 'verify oracledb_session configuration' do
|
|
resource = load_resource('oracledb_session', user: 'SYSTEM', password: 'supersecurepass', host: 'localhost', service: 'ORCL.localdomain')
|
|
_(resource.user).must_equal 'SYSTEM'
|
|
_(resource.password).must_equal 'supersecurepass'
|
|
_(resource.host).must_equal 'localhost'
|
|
_(resource.service).must_equal 'ORCL.localdomain'
|
|
end
|
|
|
|
it 'run a SQL query' do
|
|
resource = load_resource('oracledb_session', user: 'SYSTEM', password: 'supersecurepass', host: '127.0.0.1', service: 'ORCL.localdomain', port: 1527)
|
|
query = resource.query('SELECT NAME AS VALUE FROM v$database;')
|
|
_(query.size).must_equal 1
|
|
_(query.row(0).column('value').value).must_equal 'ORCL'
|
|
end
|
|
end
|