inspec/test/unit
eramoto c7e87ca3e3 Unify method in which file content is read across all resources (#2359)
* Create file-check functionality into utility file

There are the similar issues as PR #2302. Almost resources return false
positives when a file does not exist or is not read.

* Replace to file-check functionality
* Fix dh_params and x509_certificate resources

If a file is empty, OpenSSL::PKey::DH and OpenSSL::X509::Certificate have
raised an exception and have skipped the inspection. Thus x509_certificate
and dh_params resources are not allowed to read a empty file.

* to_s of shadow expects filters is not nil
* Remove workaround of sshd_config

Removes the workaround of sshd_config since Travis CI fails due to a bug
of dev-sec/ssh-baseline and the PR #100 will fix it.

* Use init block variable in methods

Signed-off-by: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
2018-03-22 08:25:45 -04:00
..
bundles Fix OWCA detection for compliance login (#2401) 2017-12-22 15:01:18 +01:00
dependencies Write version_constraints as an array for inspec.lock (#2619) 2018-03-12 09:02:37 -04:00
dsl Sort gotten file list on test (#2812) 2018-03-14 09:35:43 -04:00
fetchers Don't send HTTP headers that have nil values (#1948) 2017-06-21 19:09:13 -05:00
mock Host resource: use bash over netcat in Linux (#2607) 2018-03-07 08:39:27 -05:00
objects bugfix: default attributes for nil and false (#2410) 2017-12-21 14:20:59 +01:00
plugins Prevent resources from loading if supports check fails (#2665) 2018-02-16 15:15:53 -05:00
profiles Remove deprecations for InSpec 2.0 (#2506) 2018-02-08 11:05:21 +01:00
reporters Update reporter with breaking inspec 2.0 changes. (#2487) 2018-02-14 11:54:20 -05:00
resource_supports/aws Capture ArgumentErrors from aws. (#2673) 2018-02-17 16:50:35 +01:00
resources Unify method in which file content is read across all resources (#2359) 2018-03-22 08:25:45 -04:00
source_readers Sort gotten file list on test (#2812) 2018-03-14 09:35:43 -04:00
utils mssql_session - Handling cases where the data is nil (#2752) 2018-03-01 14:30:07 -05:00
base_cli_test.rb Update shell detect to work with platforms (#2712) 2018-02-20 07:37:23 -05:00
file_provider_test.rb Remove meaningless stdout message (#2313) 2017-11-17 15:56:36 -05:00
helper.rb Rely on unit test helper to load resources, not individual AWS tests 2018-02-07 12:09:08 -05:00
runner_test.rb Allow ad-hoc runners to use rspec formats. (#2621) 2018-02-12 19:29:54 +01:00
shell_detector_test.rb Corrected some unit test warnings (#2242) 2017-10-17 14:49:26 +02:00