diff --git a/lib/inspec.rb b/lib/inspec.rb index 847a7f5a6..c6a84673c 100644 --- a/lib/inspec.rb +++ b/lib/inspec.rb @@ -28,3 +28,4 @@ require 'inspec/base_cli' require 'inspec/fetcher' require 'inspec/source_reader' require 'inspec/resource' +require 'inspec/resources' diff --git a/lib/inspec/config.rb b/lib/inspec/config.rb index 23b504583..330d3b47a 100644 --- a/lib/inspec/config.rb +++ b/lib/inspec/config.rb @@ -4,6 +4,9 @@ require 'pp' require 'stringio' require 'forwardable' +require 'thor' +require 'base64' +require 'inspec/base_cli' module Inspec class Config diff --git a/lib/inspec/resource.rb b/lib/inspec/resource.rb index 10411b625..1f3ea54d1 100644 --- a/lib/inspec/resource.rb +++ b/lib/inspec/resource.rb @@ -81,121 +81,3 @@ end # Many resources use FilterTable. require 'inspec/utils/filter' - -# Detect if we are running the stripped-down inspec-core -# This relies on AWS being stripped from the inspec-core gem -inspec_core_only = !File.exist?(File.join(File.dirname(__FILE__), '..', 'resource_support', 'aws.rb')) - -# Do not attempt to load cloud resources if we are in inspec-core mode -unless inspec_core_only - require 'resource_support/aws' - require 'resources/azure/azure_backend.rb' - require 'resources/azure/azure_generic_resource.rb' - require 'resources/azure/azure_resource_group.rb' - require 'resources/azure/azure_virtual_machine.rb' - require 'resources/azure/azure_virtual_machine_data_disk.rb' -end - -require 'inspec/resources/aide_conf' -require 'inspec/resources/apache' -require 'inspec/resources/apache_conf' -require 'inspec/resources/apt' -require 'inspec/resources/audit_policy' -require 'inspec/resources/auditd' -require 'inspec/resources/auditd_conf' -require 'inspec/resources/bash' -require 'inspec/resources/bond' -require 'inspec/resources/bridge' -require 'inspec/resources/chocolatey_package' -require 'inspec/resources/command' -require 'inspec/resources/cran' -require 'inspec/resources/cpan' -require 'inspec/resources/crontab' -require 'inspec/resources/dh_params' -require 'inspec/resources/directory' -require 'inspec/resources/docker' -require 'inspec/resources/docker_container' -require 'inspec/resources/docker_image' -require 'inspec/resources/docker_plugin' -require 'inspec/resources/docker_service' -require 'inspec/resources/elasticsearch' -require 'inspec/resources/etc_fstab' -require 'inspec/resources/etc_group' -require 'inspec/resources/etc_hosts_allow_deny' -require 'inspec/resources/etc_hosts' -require 'inspec/resources/file' -require 'inspec/resources/filesystem' -require 'inspec/resources/firewalld' -require 'inspec/resources/gem' -require 'inspec/resources/groups' -require 'inspec/resources/grub_conf' -require 'inspec/resources/host' -require 'inspec/resources/http' -require 'inspec/resources/iis_app' -require 'inspec/resources/iis_app_pool' -require 'inspec/resources/iis_site' -require 'inspec/resources/inetd_conf' -require 'inspec/resources/interface' -require 'inspec/resources/iptables' -require 'inspec/resources/kernel_module' -require 'inspec/resources/kernel_parameter' -require 'inspec/resources/key_rsa' -require 'inspec/resources/ksh' -require 'inspec/resources/limits_conf' -require 'inspec/resources/login_def' -require 'inspec/resources/mount' -require 'inspec/resources/mssql_session' -require 'inspec/resources/mysql' -require 'inspec/resources/mysql_conf' -require 'inspec/resources/mysql_session' -require 'inspec/resources/nginx' -require 'inspec/resources/nginx_conf' -require 'inspec/resources/npm' -require 'inspec/resources/ntp_conf' -require 'inspec/resources/oneget' -require 'inspec/resources/oracledb_session' -require 'inspec/resources/os' -require 'inspec/resources/os_env' -require 'inspec/resources/package' -require 'inspec/resources/packages' -require 'inspec/resources/parse_config' -require 'inspec/resources/passwd' -require 'inspec/resources/pip' -require 'inspec/resources/platform' -require 'inspec/resources/port' -require 'inspec/resources/postgres' -require 'inspec/resources/postgres_conf' -require 'inspec/resources/postgres_hba_conf' -require 'inspec/resources/postgres_ident_conf' -require 'inspec/resources/postgres_session' -require 'inspec/resources/powershell' -require 'inspec/resources/processes' -require 'inspec/resources/rabbitmq_conf' -require 'inspec/resources/registry_key' -require 'inspec/resources/security_identifier' -require 'inspec/resources/security_policy' -require 'inspec/resources/service' -require 'inspec/resources/shadow' -require 'inspec/resources/ssh_conf' -require 'inspec/resources/ssl' -require 'inspec/resources/sys_info' -require 'inspec/resources/toml' -require 'inspec/resources/users' -require 'inspec/resources/vbscript' -require 'inspec/resources/virtualization' -require 'inspec/resources/windows_feature' -require 'inspec/resources/windows_hotfix' -require 'inspec/resources/windows_task' -require 'inspec/resources/wmi' -require 'inspec/resources/x509_certificate' -require 'inspec/resources/xinetd' -require 'inspec/resources/yum' -require 'inspec/resources/zfs_dataset' -require 'inspec/resources/zfs_pool' - -# file formats, depend on json implementation -require 'inspec/resources/json' -require 'inspec/resources/yaml' -require 'inspec/resources/csv' -require 'inspec/resources/ini' -require 'inspec/resources/xml' diff --git a/lib/inspec/resources.rb b/lib/inspec/resources.rb new file mode 100644 index 000000000..d7c59f3f9 --- /dev/null +++ b/lib/inspec/resources.rb @@ -0,0 +1,119 @@ +require 'inspec/resource' + +# Detect if we are running the stripped-down inspec-core +# This relies on AWS being stripped from the inspec-core gem +inspec_core_only = !File.exist?(File.join(File.dirname(__FILE__), '..', 'resource_support', 'aws.rb')) + +# Do not attempt to load cloud resources if we are in inspec-core mode +unless inspec_core_only + require 'resource_support/aws' + require 'resources/azure/azure_backend.rb' + require 'resources/azure/azure_generic_resource.rb' + require 'resources/azure/azure_resource_group.rb' + require 'resources/azure/azure_virtual_machine.rb' + require 'resources/azure/azure_virtual_machine_data_disk.rb' +end + +require 'inspec/resources/aide_conf' +require 'inspec/resources/apache' +require 'inspec/resources/apache_conf' +require 'inspec/resources/apt' +require 'inspec/resources/audit_policy' +require 'inspec/resources/auditd' +require 'inspec/resources/auditd_conf' +require 'inspec/resources/bash' +require 'inspec/resources/bond' +require 'inspec/resources/bridge' +require 'inspec/resources/chocolatey_package' +require 'inspec/resources/command' +require 'inspec/resources/cran' +require 'inspec/resources/cpan' +require 'inspec/resources/crontab' +require 'inspec/resources/dh_params' +require 'inspec/resources/directory' +require 'inspec/resources/docker' +require 'inspec/resources/docker_container' +require 'inspec/resources/docker_image' +require 'inspec/resources/docker_plugin' +require 'inspec/resources/docker_service' +require 'inspec/resources/elasticsearch' +require 'inspec/resources/etc_fstab' +require 'inspec/resources/etc_group' +require 'inspec/resources/etc_hosts_allow_deny' +require 'inspec/resources/etc_hosts' +require 'inspec/resources/file' +require 'inspec/resources/filesystem' +require 'inspec/resources/firewalld' +require 'inspec/resources/gem' +require 'inspec/resources/groups' +require 'inspec/resources/grub_conf' +require 'inspec/resources/host' +require 'inspec/resources/http' +require 'inspec/resources/iis_app' +require 'inspec/resources/iis_app_pool' +require 'inspec/resources/iis_site' +require 'inspec/resources/inetd_conf' +require 'inspec/resources/interface' +require 'inspec/resources/iptables' +require 'inspec/resources/kernel_module' +require 'inspec/resources/kernel_parameter' +require 'inspec/resources/key_rsa' +require 'inspec/resources/ksh' +require 'inspec/resources/limits_conf' +require 'inspec/resources/login_defs' +require 'inspec/resources/mount' +require 'inspec/resources/mssql_session' +require 'inspec/resources/mysql' +require 'inspec/resources/mysql_conf' +require 'inspec/resources/mysql_session' +require 'inspec/resources/nginx' +require 'inspec/resources/nginx_conf' +require 'inspec/resources/npm' +require 'inspec/resources/ntp_conf' +require 'inspec/resources/oneget' +require 'inspec/resources/oracledb_session' +require 'inspec/resources/os' +require 'inspec/resources/os_env' +require 'inspec/resources/package' +require 'inspec/resources/packages' +require 'inspec/resources/parse_config' +require 'inspec/resources/passwd' +require 'inspec/resources/pip' +require 'inspec/resources/platform' +require 'inspec/resources/port' +require 'inspec/resources/postgres' +require 'inspec/resources/postgres_conf' +require 'inspec/resources/postgres_hba_conf' +require 'inspec/resources/postgres_ident_conf' +require 'inspec/resources/postgres_session' +require 'inspec/resources/powershell' +require 'inspec/resources/processes' +require 'inspec/resources/rabbitmq_config' +require 'inspec/resources/registry_key' +require 'inspec/resources/security_identifier' +require 'inspec/resources/security_policy' +require 'inspec/resources/service' +require 'inspec/resources/shadow' +require 'inspec/resources/ssh_config' +require 'inspec/resources/ssl' +require 'inspec/resources/sys_info' +require 'inspec/resources/toml' +require 'inspec/resources/users' +require 'inspec/resources/vbscript' +require 'inspec/resources/virtualization' +require 'inspec/resources/windows_feature' +require 'inspec/resources/windows_hotfix' +require 'inspec/resources/windows_task' +require 'inspec/resources/wmi' +require 'inspec/resources/x509_certificate' +require 'inspec/resources/xinetd_conf' +require 'inspec/resources/yum' +require 'inspec/resources/zfs_dataset' +require 'inspec/resources/zfs_pool' + +# file formats, depend on json implementation +require 'inspec/resources/json' +require 'inspec/resources/yaml' +require 'inspec/resources/csv' +require 'inspec/resources/ini' +require 'inspec/resources/xml' diff --git a/lib/inspec/resources/apt.rb b/lib/inspec/resources/apt.rb index f99d2f0f3..7cd17ebce 100644 --- a/lib/inspec/resources/apt.rb +++ b/lib/inspec/resources/apt.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/command' # Verifies apt and ppa repositories # diff --git a/lib/inspec/resources/audit_policy.rb b/lib/inspec/resources/audit_policy.rb index 43ba7c49c..54a397e06 100644 --- a/lib/inspec/resources/audit_policy.rb +++ b/lib/inspec/resources/audit_policy.rb @@ -1,3 +1,5 @@ +require 'inspec/resources/command' + # copyright: 2015, Vulcano Security GmbH # Advanced Auditing: diff --git a/lib/inspec/resources/bond.rb b/lib/inspec/resources/bond.rb index 47d2464f0..11a54ff1d 100644 --- a/lib/inspec/resources/bond.rb +++ b/lib/inspec/resources/bond.rb @@ -1,6 +1,6 @@ - require 'inspec/resources/file' require 'inspec/utils/file_reader' +require 'inspec/utils/simpleconfig' module Inspec::Resources class Bond < FileResource diff --git a/lib/inspec/resources/bridge.rb b/lib/inspec/resources/bridge.rb index 82fc37f78..e5901785b 100644 --- a/lib/inspec/resources/bridge.rb +++ b/lib/inspec/resources/bridge.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/file' # Usage: # describe bridge('br0') do diff --git a/lib/inspec/resources/chocolatey_package.rb b/lib/inspec/resources/chocolatey_package.rb index a8924d915..c717087c2 100644 --- a/lib/inspec/resources/chocolatey_package.rb +++ b/lib/inspec/resources/chocolatey_package.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +require 'inspec/resources/command' +require 'inspec/resources/powershell' + # Check for Chocolatey packages to be installed module Inspec::Resources class ChocoPkg < Inspec.resource(1) diff --git a/lib/inspec/resources/cpan.rb b/lib/inspec/resources/cpan.rb index 02fcb3ac0..d235a65d5 100644 --- a/lib/inspec/resources/cpan.rb +++ b/lib/inspec/resources/cpan.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/command' # Usage: # describe cpan('DBD::Pg') do diff --git a/lib/inspec/resources/cran.rb b/lib/inspec/resources/cran.rb index a2bd54ad2..6194a12a6 100644 --- a/lib/inspec/resources/cran.rb +++ b/lib/inspec/resources/cran.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/command' # Usage: # describe cran('DBI') do diff --git a/lib/inspec/resources/crontab.rb b/lib/inspec/resources/crontab.rb index daf62f622..479e3175e 100644 --- a/lib/inspec/resources/crontab.rb +++ b/lib/inspec/resources/crontab.rb @@ -1,4 +1,4 @@ - +require 'inspec/resources/file' require 'inspec/utils/parser' require 'inspec/utils/filter' diff --git a/lib/inspec/resources/csv.rb b/lib/inspec/resources/csv.rb index 3d2a4b75b..345a57db5 100644 --- a/lib/inspec/resources/csv.rb +++ b/lib/inspec/resources/csv.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/json' # Parses a csv document # This implementation was inspired by a blog post diff --git a/lib/inspec/resources/docker.rb b/lib/inspec/resources/docker.rb index a4bdf547c..b7a0e9f4a 100644 --- a/lib/inspec/resources/docker.rb +++ b/lib/inspec/resources/docker.rb @@ -2,6 +2,7 @@ # Copyright 2017, Christoph Hartmann # +require 'inspec/resources/command' require 'inspec/utils/filter' require 'hashie/mash' diff --git a/lib/inspec/resources/docker_container.rb b/lib/inspec/resources/docker_container.rb index 1e57b79a3..ee2df90ee 100644 --- a/lib/inspec/resources/docker_container.rb +++ b/lib/inspec/resources/docker_container.rb @@ -1,6 +1,7 @@ # # Copyright 2017, Christoph Hartmann +require 'inspec/resources/docker' require_relative 'docker_object' module Inspec::Resources diff --git a/lib/inspec/resources/docker_image.rb b/lib/inspec/resources/docker_image.rb index f05f631ed..b19d660f9 100644 --- a/lib/inspec/resources/docker_image.rb +++ b/lib/inspec/resources/docker_image.rb @@ -1,6 +1,7 @@ # # Copyright 2017, Christoph Hartmann +require 'inspec/resources/docker' require_relative 'docker_object' module Inspec::Resources diff --git a/lib/inspec/resources/docker_plugin.rb b/lib/inspec/resources/docker_plugin.rb index f5ce8dd46..dc2fbbe4a 100644 --- a/lib/inspec/resources/docker_plugin.rb +++ b/lib/inspec/resources/docker_plugin.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/docker' module Inspec::Resources class DockerPlugin < Inspec.resource(1) diff --git a/lib/inspec/resources/docker_service.rb b/lib/inspec/resources/docker_service.rb index 7594235dc..1d77a3ff5 100644 --- a/lib/inspec/resources/docker_service.rb +++ b/lib/inspec/resources/docker_service.rb @@ -1,6 +1,7 @@ # # Copyright 2017, Christoph Hartmann +require 'inspec/resources/docker' require_relative 'docker_object' module Inspec::Resources diff --git a/lib/inspec/resources/file.rb b/lib/inspec/resources/file.rb index 180258826..d7e763732 100644 --- a/lib/inspec/resources/file.rb +++ b/lib/inspec/resources/file.rb @@ -1,6 +1,7 @@ # copyright: 2015, Vulcano Security GmbH require 'shellwords' +require 'inspec/utils/parser' module Inspec::Resources module FilePermissionsSelector @@ -13,6 +14,7 @@ module Inspec::Resources end end + # TODO: rename file_resource.rb class FileResource < Inspec.resource(1) include FilePermissionsSelector include LinuxMountParser diff --git a/lib/inspec/resources/filesystem.rb b/lib/inspec/resources/filesystem.rb index 02c8575e8..61dd0458e 100644 --- a/lib/inspec/resources/filesystem.rb +++ b/lib/inspec/resources/filesystem.rb @@ -1,3 +1,5 @@ +require 'inspec/resources/command' + module Inspec::Resources class FileSystemResource < Inspec.resource(1) name 'filesystem' diff --git a/lib/inspec/resources/firewalld.rb b/lib/inspec/resources/firewalld.rb index 5aacc6975..7f4b10557 100644 --- a/lib/inspec/resources/firewalld.rb +++ b/lib/inspec/resources/firewalld.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/command' module Inspec::Resources class FirewallD < Inspec.resource(1) diff --git a/lib/inspec/resources/gem.rb b/lib/inspec/resources/gem.rb index 2f04ef8c0..6d5d93cc1 100644 --- a/lib/inspec/resources/gem.rb +++ b/lib/inspec/resources/gem.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/command' module Inspec::Resources class GemPackage < Inspec.resource(1) diff --git a/lib/inspec/resources/groups.rb b/lib/inspec/resources/groups.rb index c738a9623..b7f1197fd 100644 --- a/lib/inspec/resources/groups.rb +++ b/lib/inspec/resources/groups.rb @@ -1,4 +1,6 @@ - +require 'inspec/resources/etc_group' +require 'inspec/resources/powershell' +require 'inspec/resources/parse_config' require 'inspec/utils/filter' module Inspec::Resources diff --git a/lib/inspec/resources/host.rb b/lib/inspec/resources/host.rb index 33cb49ce7..2f27fb9c1 100644 --- a/lib/inspec/resources/host.rb +++ b/lib/inspec/resources/host.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/command' # Usage: # describe host('example.com') do diff --git a/lib/inspec/resources/http.rb b/lib/inspec/resources/http.rb index f1755144f..21538dd82 100644 --- a/lib/inspec/resources/http.rb +++ b/lib/inspec/resources/http.rb @@ -2,6 +2,7 @@ # copyright: 2017, Chef Software Inc # license: Apache v2 +require 'inspec/resources/command' require 'faraday' require 'faraday_middleware' require 'hashie' diff --git a/lib/inspec/resources/iis_app_pool.rb b/lib/inspec/resources/iis_app_pool.rb index a51914c95..34e789cd4 100644 --- a/lib/inspec/resources/iis_app_pool.rb +++ b/lib/inspec/resources/iis_app_pool.rb @@ -1,4 +1,7 @@ # frozen_string_literal: true + +require 'inspec/resources/powershell' + # check for web applications in IIS # Note: this is only supported in windows 2012 and later diff --git a/lib/inspec/resources/iis_site.rb b/lib/inspec/resources/iis_site.rb index 0999a3cff..cd003ab81 100644 --- a/lib/inspec/resources/iis_site.rb +++ b/lib/inspec/resources/iis_site.rb @@ -1,4 +1,7 @@ # frozen_string_literal: true + +require 'inspec/resources/command' + # check for site in IIS # Usage: # describe iis_site('Default Web Site') do diff --git a/lib/inspec/resources/ini.rb b/lib/inspec/resources/ini.rb index 5061bac84..97f246ea7 100644 --- a/lib/inspec/resources/ini.rb +++ b/lib/inspec/resources/ini.rb @@ -1,4 +1,4 @@ - +require 'inspec/resources/json' require 'inspec/utils/simpleconfig' module Inspec::Resources diff --git a/lib/inspec/resources/interface.rb b/lib/inspec/resources/interface.rb index c817f4d26..fc7c68aaf 100644 --- a/lib/inspec/resources/interface.rb +++ b/lib/inspec/resources/interface.rb @@ -1,5 +1,6 @@ - +require 'inspec/resources/command' require 'inspec/utils/convert' +require 'inspec/utils/simpleconfig' module Inspec::Resources class NetworkInterface < Inspec.resource(1) diff --git a/lib/inspec/resources/iptables.rb b/lib/inspec/resources/iptables.rb index 6c51615b9..c15dbe056 100644 --- a/lib/inspec/resources/iptables.rb +++ b/lib/inspec/resources/iptables.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/command' # Usage: # describe iptables do diff --git a/lib/inspec/resources/kernel_module.rb b/lib/inspec/resources/kernel_module.rb index 9816746fc..adc7ddfb1 100644 --- a/lib/inspec/resources/kernel_module.rb +++ b/lib/inspec/resources/kernel_module.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/command' module Inspec::Resources class KernelModule < Inspec.resource(1) diff --git a/lib/inspec/resources/kernel_parameter.rb b/lib/inspec/resources/kernel_parameter.rb index ad179565b..51f57373c 100644 --- a/lib/inspec/resources/kernel_parameter.rb +++ b/lib/inspec/resources/kernel_parameter.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/command' module Inspec::Resources class KernelParameter < Inspec.resource(1) diff --git a/lib/inspec/resources/login_def.rb b/lib/inspec/resources/login_defs.rb similarity index 97% rename from lib/inspec/resources/login_def.rb rename to lib/inspec/resources/login_defs.rb index bb9a3f19c..d8f771690 100644 --- a/lib/inspec/resources/login_def.rb +++ b/lib/inspec/resources/login_defs.rb @@ -16,7 +16,7 @@ require 'inspec/utils/file_reader' # end module Inspec::Resources - class LoginDef < Inspec.resource(1) + class LoginDefs < Inspec.resource(1) name 'login_defs' supports platform: 'unix' desc 'Use the login_defs InSpec audit resource to test configuration settings in the /etc/login.defs file. The logins.defs file defines site-specific configuration for the shadow password suite on Linux and UNIX platforms, such as password expiration ranges, minimum/maximum values for automatic selection of user and group identifiers, or the method with which passwords are encrypted.' diff --git a/lib/inspec/resources/mount.rb b/lib/inspec/resources/mount.rb index a52a6f6fb..ae6d3a448 100644 --- a/lib/inspec/resources/mount.rb +++ b/lib/inspec/resources/mount.rb @@ -1,6 +1,3 @@ - -require 'inspec/utils/simpleconfig' - module Inspec::Resources class Mount < Inspec.resource(1) name 'mount' diff --git a/lib/inspec/resources/mssql_session.rb b/lib/inspec/resources/mssql_session.rb index 8bd68e091..05cbfc5db 100644 --- a/lib/inspec/resources/mssql_session.rb +++ b/lib/inspec/resources/mssql_session.rb @@ -1,4 +1,4 @@ - +require 'inspec/resources/command' require 'hashie/mash' require 'inspec/utils/database_helpers' diff --git a/lib/inspec/resources/mysql_session.rb b/lib/inspec/resources/mysql_session.rb index dbd160db1..fd3bb6c86 100644 --- a/lib/inspec/resources/mysql_session.rb +++ b/lib/inspec/resources/mysql_session.rb @@ -1,5 +1,6 @@ # copyright: 2015, Vulcano Security GmbH +require 'inspec/resources/command' require 'shellwords' module Inspec::Resources diff --git a/lib/inspec/resources/nginx.rb b/lib/inspec/resources/nginx.rb index 0e3df9858..3bb91a63c 100644 --- a/lib/inspec/resources/nginx.rb +++ b/lib/inspec/resources/nginx.rb @@ -1,6 +1,7 @@ require 'pathname' require 'hashie/mash' +require 'inspec/resources/command' module Inspec::Resources class Nginx < Inspec.resource(1) diff --git a/lib/inspec/resources/nginx_conf.rb b/lib/inspec/resources/nginx_conf.rb index c209d9379..ad17b3ab6 100644 --- a/lib/inspec/resources/nginx_conf.rb +++ b/lib/inspec/resources/nginx_conf.rb @@ -174,7 +174,7 @@ module Inspec::Resources end end - class NginxConfServer + class NginxConfServer # TODO: rename NginxServer attr_reader :params, :parent def initialize(params, parent) @parent = parent @@ -216,6 +216,7 @@ module Inspec::Resources def to_s location = Array(params['_']).join(' ') # go three levels up: 1. to the server entry, 2. http entry and 3. to the root nginx conf + # TODO: fix parent.parent.parent @parent.parent.parent.to_s + ", location #{location.inspect}" end alias inspect to_s diff --git a/lib/inspec/resources/npm.rb b/lib/inspec/resources/npm.rb index 631d41db8..812151c56 100644 --- a/lib/inspec/resources/npm.rb +++ b/lib/inspec/resources/npm.rb @@ -1,4 +1,4 @@ - +require 'inspec/resources/command' require 'shellwords' module Inspec::Resources diff --git a/lib/inspec/resources/oneget.rb b/lib/inspec/resources/oneget.rb index ee4718273..c83600255 100644 --- a/lib/inspec/resources/oneget.rb +++ b/lib/inspec/resources/oneget.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/command' # This resource talks with OneGet (https://github.com/OneGet/oneget) # Its part of Windows Management Framework 5.0 and part of Windows 10 diff --git a/lib/inspec/resources/oracledb_session.rb b/lib/inspec/resources/oracledb_session.rb index defe0fd26..c251d63b5 100644 --- a/lib/inspec/resources/oracledb_session.rb +++ b/lib/inspec/resources/oracledb_session.rb @@ -1,4 +1,4 @@ - +require 'inspec/resources/command' require 'hashie/mash' require 'inspec/utils/database_helpers' require 'htmlentities' diff --git a/lib/inspec/resources/os.rb b/lib/inspec/resources/os.rb index 8d8f0ce5b..d721941fa 100644 --- a/lib/inspec/resources/os.rb +++ b/lib/inspec/resources/os.rb @@ -1,4 +1,3 @@ - require 'inspec/resources/platform' module Inspec::Resources diff --git a/lib/inspec/resources/package.rb b/lib/inspec/resources/package.rb index be46d5023..6fbdc5a1a 100644 --- a/lib/inspec/resources/package.rb +++ b/lib/inspec/resources/package.rb @@ -1,3 +1,5 @@ +require 'inspec/resources/directory' +require 'inspec/utils/simpleconfig' # Resource to determine package information # diff --git a/lib/inspec/resources/packages.rb b/lib/inspec/resources/packages.rb index 24a9ecfb2..26842ffd5 100644 --- a/lib/inspec/resources/packages.rb +++ b/lib/inspec/resources/packages.rb @@ -1,6 +1,7 @@ # copyright: 2017, Chef Software, Inc. require 'inspec/utils/filter' +require 'inspec/resources/command' module Inspec::Resources class Packages < Inspec.resource(1) diff --git a/lib/inspec/resources/parse_config.rb b/lib/inspec/resources/parse_config.rb index 2b457562b..ec9698d41 100644 --- a/lib/inspec/resources/parse_config.rb +++ b/lib/inspec/resources/parse_config.rb @@ -10,6 +10,7 @@ # describe parse_config(audit, options ) do require 'inspec/utils/file_reader' +require 'inspec/utils/simpleconfig' module Inspec::Resources class PConfig < Inspec.resource(1) diff --git a/lib/inspec/resources/pip.rb b/lib/inspec/resources/pip.rb index 1a381adff..bd6533c8d 100644 --- a/lib/inspec/resources/pip.rb +++ b/lib/inspec/resources/pip.rb @@ -1,9 +1,10 @@ +require 'inspec/resources/command' +require 'inspec/utils/simpleconfig' # Usage: # describe pip('Jinja2') do # it { should be_installed } # end -# module Inspec::Resources class PipPackage < Inspec.resource(1) diff --git a/lib/inspec/resources/powershell.rb b/lib/inspec/resources/powershell.rb index cc9372930..26bb9aa8f 100644 --- a/lib/inspec/resources/powershell.rb +++ b/lib/inspec/resources/powershell.rb @@ -1,7 +1,8 @@ # copyright: 2015, Vulcano Security GmbH +require 'inspec/resources/command' module Inspec::Resources - class PowershellScript < Cmd + class Powershell < Cmd name 'powershell' supports platform: 'windows' supports platform: 'unix' @@ -50,8 +51,10 @@ module Inspec::Resources end end + PowershellScript = Powershell + # this is deprecated syntax and will be removed in future versions - class LegacyPowershellScript < PowershellScript + class LegacyPowershell < Powershell name 'script' def initialize(script) @@ -59,4 +62,6 @@ module Inspec::Resources super(script) end end + + LegacyPowershellScript = LegacyPowershell end diff --git a/lib/inspec/resources/processes.rb b/lib/inspec/resources/processes.rb index 1957f6ee5..741dae8bf 100644 --- a/lib/inspec/resources/processes.rb +++ b/lib/inspec/resources/processes.rb @@ -2,6 +2,7 @@ require 'inspec/utils/filter' require 'ostruct' +require 'inspec/resources/command' module Inspec::Resources class Processes < Inspec.resource(1) diff --git a/lib/inspec/resources/rabbitmq_conf.rb b/lib/inspec/resources/rabbitmq_config.rb similarity index 92% rename from lib/inspec/resources/rabbitmq_conf.rb rename to lib/inspec/resources/rabbitmq_config.rb index 6149ed637..a6c98f07e 100644 --- a/lib/inspec/resources/rabbitmq_conf.rb +++ b/lib/inspec/resources/rabbitmq_config.rb @@ -1,9 +1,9 @@ - require 'inspec/utils/erlang_parser' require 'inspec/utils/file_reader' module Inspec::Resources - class RabbitmqConf < Inspec.resource(1) + class RabbitmqConfig < Inspec.resource(1) + name 'rabbitmq_conf' # TODO: this is an alias. do we want this? name 'rabbitmq_config' supports platform: 'unix' desc 'Use the rabbitmq_config InSpec resource to test configuration data '\ diff --git a/lib/inspec/resources/registry_key.rb b/lib/inspec/resources/registry_key.rb index 249482064..2386afded 100644 --- a/lib/inspec/resources/registry_key.rb +++ b/lib/inspec/resources/registry_key.rb @@ -1,6 +1,7 @@ # copyright: 2015, Vulcano Security GmbH require 'json' +require 'inspec/resources/powershell' # Three constructor methods are available: # 1. resistry_key(path'): diff --git a/lib/inspec/resources/script.rb b/lib/inspec/resources/script.rb new file mode 100644 index 000000000..252bfd6aa --- /dev/null +++ b/lib/inspec/resources/script.rb @@ -0,0 +1 @@ +require 'inspec/resources/powershell' diff --git a/lib/inspec/resources/security_identifier.rb b/lib/inspec/resources/security_identifier.rb index f5d7fca30..8b24c3d49 100644 --- a/lib/inspec/resources/security_identifier.rb +++ b/lib/inspec/resources/security_identifier.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'inspec/resources/command' + module Inspec::Resources class SecurityIdentifier < Inspec.resource(1) name 'security_identifier' diff --git a/lib/inspec/resources/security_policy.rb b/lib/inspec/resources/security_policy.rb index 49bb66c17..214ab0a5d 100644 --- a/lib/inspec/resources/security_policy.rb +++ b/lib/inspec/resources/security_policy.rb @@ -11,6 +11,8 @@ # parameters. Therefore we need a combination of Registry and secedit output require 'hashie' +require 'inspec/resources/command' +require 'inspec/utils/simpleconfig' module Inspec::Resources # known and supported MS privilege rights diff --git a/lib/inspec/resources/service.rb b/lib/inspec/resources/service.rb index d64b9b9ad..74908f0ff 100644 --- a/lib/inspec/resources/service.rb +++ b/lib/inspec/resources/service.rb @@ -1,6 +1,6 @@ - require 'hashie' require 'inspec/utils/file_reader' +require 'inspec/utils/simpleconfig' module Inspec::Resources class Runlevels < Hash diff --git a/lib/inspec/resources/ssh_conf.rb b/lib/inspec/resources/ssh_config.rb similarity index 97% rename from lib/inspec/resources/ssh_conf.rb rename to lib/inspec/resources/ssh_config.rb index 3e8854cb9..184ccefc9 100644 --- a/lib/inspec/resources/ssh_conf.rb +++ b/lib/inspec/resources/ssh_config.rb @@ -4,7 +4,7 @@ require 'inspec/utils/simpleconfig' require 'inspec/utils/file_reader' module Inspec::Resources - class SshConf < Inspec.resource(1) + class SshConfig < Inspec.resource(1) name 'ssh_config' supports platform: 'unix' desc 'Use the `ssh_config` InSpec audit resource to test OpenSSH client configuration data located at `/etc/ssh/ssh_config` on Linux and Unix platforms.' @@ -75,7 +75,7 @@ module Inspec::Resources end end - class SshdConf < SshConf + class SshdConfig < SshConfig name 'sshd_config' supports platform: 'unix' desc 'Use the sshd_config InSpec audit resource to test configuration data for the Open SSH daemon located at /etc/ssh/sshd_config on Linux and UNIX platforms. sshd---the Open SSH daemon---listens on dedicated ports, starts a daemon for each incoming connection, and then handles encryption, authentication, key exchanges, command execution, and data exchanges.' diff --git a/lib/inspec/resources/sys_info.rb b/lib/inspec/resources/sys_info.rb index 9867127e1..c461bd26f 100644 --- a/lib/inspec/resources/sys_info.rb +++ b/lib/inspec/resources/sys_info.rb @@ -1,3 +1,6 @@ +require 'inspec/resources/command' +require 'inspec/resources/powershell' + module Inspec::Resources # this resource returns additional system informatio class System < Inspec.resource(1) diff --git a/lib/inspec/resources/users.rb b/lib/inspec/resources/users.rb index ffa977458..a9d8c601e 100644 --- a/lib/inspec/resources/users.rb +++ b/lib/inspec/resources/users.rb @@ -1,7 +1,8 @@ - require 'inspec/utils/parser' require 'inspec/utils/convert' require 'inspec/utils/filter' +require 'inspec/utils/simpleconfig' +require 'inspec/resources/powershell' module Inspec::Resources # This file contains two resources, the `user` and `users` resource. diff --git a/lib/inspec/resources/vbscript.rb b/lib/inspec/resources/vbscript.rb index c21bcdb7d..fea794ee5 100644 --- a/lib/inspec/resources/vbscript.rb +++ b/lib/inspec/resources/vbscript.rb @@ -1,4 +1,4 @@ - +require 'inspec/resources/powershell' require 'securerandom' module Inspec::Resources @@ -18,7 +18,7 @@ module Inspec::Resources # Since Windows does not delete tmp files automatically, we remove the VBScript # after we executed it # @see https://msdn.microsoft.com/en-us/library/aa364991.aspx - class VBScript < PowershellScript + class VBScript < Powershell name 'vbscript' supports platform: 'windows' desc '' diff --git a/lib/inspec/resources/windows_feature.rb b/lib/inspec/resources/windows_feature.rb index 38034613e..3bc2022ba 100644 --- a/lib/inspec/resources/windows_feature.rb +++ b/lib/inspec/resources/windows_feature.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/command' module Inspec::Resources class WindowsFeature < Inspec.resource(1) diff --git a/lib/inspec/resources/windows_hotfix.rb b/lib/inspec/resources/windows_hotfix.rb index 8b9719b5b..72e449ca1 100644 --- a/lib/inspec/resources/windows_hotfix.rb +++ b/lib/inspec/resources/windows_hotfix.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/powershell' module Inspec::Resources class WindowsHotfix < Inspec.resource(1) diff --git a/lib/inspec/resources/windows_task.rb b/lib/inspec/resources/windows_task.rb index a4a70fddc..5d9085c1a 100644 --- a/lib/inspec/resources/windows_task.rb +++ b/lib/inspec/resources/windows_task.rb @@ -1,5 +1,7 @@ +require 'inspec/resources/powershell' + module Inspec::Resources - class WindowsTasks < Inspec.resource(1) + class WindowsTasks < Inspec.resource(1) # TODO: rename singular name 'windows_task' supports platform: 'windows' desc 'Use the windows_task InSpec audit resource to test task schedules on Microsoft Windows.' diff --git a/lib/inspec/resources/wmi.rb b/lib/inspec/resources/wmi.rb index f29e7326c..6ed81de8a 100644 --- a/lib/inspec/resources/wmi.rb +++ b/lib/inspec/resources/wmi.rb @@ -1,4 +1,4 @@ - +require 'inspec/resources/powershell' require 'inspec/utils/object_traversal' module Inspec::Resources diff --git a/lib/inspec/resources/xinetd.rb b/lib/inspec/resources/xinetd_conf.rb similarity index 100% rename from lib/inspec/resources/xinetd.rb rename to lib/inspec/resources/xinetd_conf.rb diff --git a/lib/inspec/resources/xml.rb b/lib/inspec/resources/xml.rb index f2ce317be..c7537f0d1 100644 --- a/lib/inspec/resources/xml.rb +++ b/lib/inspec/resources/xml.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/json' module Inspec::Resources class XmlConfig < JsonConfig diff --git a/lib/inspec/resources/yaml.rb b/lib/inspec/resources/yaml.rb index 164b83d3e..55ab1307f 100644 --- a/lib/inspec/resources/yaml.rb +++ b/lib/inspec/resources/yaml.rb @@ -1,5 +1,6 @@ require 'yaml' +require 'inspec/resources/json' # Parses a yaml document # Usage: diff --git a/lib/inspec/resources/yum.rb b/lib/inspec/resources/yum.rb index fcf4d044b..20f96d971 100644 --- a/lib/inspec/resources/yum.rb +++ b/lib/inspec/resources/yum.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/command' # Usage: # describe yum do diff --git a/lib/inspec/resources/zfs_dataset.rb b/lib/inspec/resources/zfs_dataset.rb index 5eb11d083..ea840116f 100644 --- a/lib/inspec/resources/zfs_dataset.rb +++ b/lib/inspec/resources/zfs_dataset.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/command' module Inspec::Resources class ZfsDataset < Inspec.resource(1) diff --git a/lib/inspec/resources/zfs_pool.rb b/lib/inspec/resources/zfs_pool.rb index bed9c7bc9..d9b99f77f 100644 --- a/lib/inspec/resources/zfs_pool.rb +++ b/lib/inspec/resources/zfs_pool.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/command' module Inspec::Resources class ZfsPool < Inspec.resource(1) diff --git a/lib/inspec/rule.rb b/lib/inspec/rule.rb index b17c54605..e678de7d7 100644 --- a/lib/inspec/rule.rb +++ b/lib/inspec/rule.rb @@ -3,6 +3,8 @@ require 'method_source' require 'inspec/describe' require 'inspec/expect' +require 'inspec/resource' +require 'inspec/resources/os' module Inspec class Rule diff --git a/lib/inspec/runner.rb b/lib/inspec/runner.rb index 15487f8f4..5c06c9293 100644 --- a/lib/inspec/runner.rb +++ b/lib/inspec/runner.rb @@ -9,6 +9,7 @@ require 'inspec/metadata' require 'inspec/config' require 'inspec/dependencies/cache' require 'inspec/dist' +require 'inspec/reporters' require 'inspec/runner_rspec' # spec requirements diff --git a/lib/inspec/shell.rb b/lib/inspec/shell.rb index 027dd38c3..76ed9b8a0 100644 --- a/lib/inspec/shell.rb +++ b/lib/inspec/shell.rb @@ -117,7 +117,7 @@ module Inspec end elsif topic == 'matchers' print_matchers_help - elsif !Inspec::Resource.registry[topic].nil? + elsif !Inspec::Resource.registry[topic].nil? # TODO: fix unnecessary logic topic_info = Inspec::Resource.registry[topic] info = "#{mark 'Name:'} #{topic}\n\n" unless topic_info.desc.nil? diff --git a/lib/inspec/utils/file_reader.rb b/lib/inspec/utils/file_reader.rb index 2621865b2..32d43f2e6 100644 --- a/lib/inspec/utils/file_reader.rb +++ b/lib/inspec/utils/file_reader.rb @@ -1,3 +1,4 @@ +require 'inspec/resources/file' module FileReader def read_file_content(path, allow_empty = false) diff --git a/lib/inspec/utils/parser.rb b/lib/inspec/utils/parser.rb index 8b57d147d..6cc540136 100644 --- a/lib/inspec/utils/parser.rb +++ b/lib/inspec/utils/parser.rb @@ -1,4 +1,6 @@ +require 'inspec/resources/command' + module PasswdParser # Parse /etc/passwd files. # @@ -269,3 +271,5 @@ module XinetdParser res end end + +require 'inspec/utils/simpleconfig' diff --git a/lib/inspec/utils/simpleconfig.rb b/lib/inspec/utils/simpleconfig.rb index 045cdebd5..f1eaed9e1 100644 --- a/lib/inspec/utils/simpleconfig.rb +++ b/lib/inspec/utils/simpleconfig.rb @@ -1,6 +1,7 @@ # copyright: 2015, Dominik Richter require 'inspec/utils/parser' +require 'hashie' class SimpleConfig include CommentParser diff --git a/lib/plugins/inspec-compliance/lib/inspec-compliance/api.rb b/lib/plugins/inspec-compliance/lib/inspec-compliance/api.rb index bc30b7e46..7cb3ed470 100644 --- a/lib/plugins/inspec-compliance/lib/inspec-compliance/api.rb +++ b/lib/plugins/inspec-compliance/lib/inspec-compliance/api.rb @@ -1,4 +1,3 @@ - require 'net/http' require 'uri' require 'json' diff --git a/lib/plugins/inspec-compliance/lib/inspec-compliance/cli.rb b/lib/plugins/inspec-compliance/lib/inspec-compliance/cli.rb index cbe849471..41a79d601 100644 --- a/lib/plugins/inspec-compliance/lib/inspec-compliance/cli.rb +++ b/lib/plugins/inspec-compliance/lib/inspec-compliance/cli.rb @@ -1,4 +1,3 @@ - require 'inspec/dist' require_relative 'api' diff --git a/lib/resource_support/aws/aws_plural_resource_mixin.rb b/lib/resource_support/aws/aws_plural_resource_mixin.rb index 1c44746c6..c8f588971 100644 --- a/lib/resource_support/aws/aws_plural_resource_mixin.rb +++ b/lib/resource_support/aws/aws_plural_resource_mixin.rb @@ -1,3 +1,6 @@ +require 'resource_support/aws/aws_resource_mixin' +require 'resource_support/aws/aws_backend_factory_mixin' + module AwsPluralResourceMixin include AwsResourceMixin attr_reader :table diff --git a/lib/resource_support/aws/aws_singular_resource_mixin.rb b/lib/resource_support/aws/aws_singular_resource_mixin.rb index a34556f88..accf71f60 100644 --- a/lib/resource_support/aws/aws_singular_resource_mixin.rb +++ b/lib/resource_support/aws/aws_singular_resource_mixin.rb @@ -1,3 +1,6 @@ +require 'resource_support/aws/aws_resource_mixin' +require 'resource_support/aws/aws_backend_factory_mixin' + module AwsSingularResourceMixin include AwsResourceMixin diff --git a/lib/resources/aws/aws_billing_report.rb b/lib/resources/aws/aws_billing_report.rb index 865812a90..5beb4bdd7 100644 --- a/lib/resources/aws/aws_billing_report.rb +++ b/lib/resources/aws/aws_billing_report.rb @@ -1,3 +1,10 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' + +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-costandusagereportservice.rb' + class AwsBillingReport < Inspec.resource(1) name 'aws_billing_report' supports platform: 'aws' diff --git a/lib/resources/aws/aws_billing_reports.rb b/lib/resources/aws/aws_billing_reports.rb index d6da2b234..97696232c 100644 --- a/lib/resources/aws/aws_billing_reports.rb +++ b/lib/resources/aws/aws_billing_reports.rb @@ -1,4 +1,7 @@ require 'inspec/utils/filter' +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-costandusagereportservice' class AwsBillingReports < Inspec.resource(1) name 'aws_billing_reports' diff --git a/lib/resources/aws/aws_cloudtrail_trail.rb b/lib/resources/aws/aws_cloudtrail_trail.rb index a3ac6e73c..57a437208 100644 --- a/lib/resources/aws/aws_cloudtrail_trail.rb +++ b/lib/resources/aws/aws_cloudtrail_trail.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-cloudtrail' + class AwsCloudTrailTrail < Inspec.resource(1) name 'aws_cloudtrail_trail' desc 'Verifies settings for an individual AWS CloudTrail Trail' diff --git a/lib/resources/aws/aws_cloudtrail_trails.rb b/lib/resources/aws/aws_cloudtrail_trails.rb index bc5c4e309..d6d3d96d9 100644 --- a/lib/resources/aws/aws_cloudtrail_trails.rb +++ b/lib/resources/aws/aws_cloudtrail_trails.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-cloudtrail' + class AwsCloudTrailTrails < Inspec.resource(1) name 'aws_cloudtrail_trails' desc 'Verifies settings for AWS CloudTrail Trails in bulk' diff --git a/lib/resources/aws/aws_cloudwatch_alarm.rb b/lib/resources/aws/aws_cloudwatch_alarm.rb index 92a93ea26..72b89be80 100644 --- a/lib/resources/aws/aws_cloudwatch_alarm.rb +++ b/lib/resources/aws/aws_cloudwatch_alarm.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-cloudwatch' + class AwsCloudwatchAlarm < Inspec.resource(1) name 'aws_cloudwatch_alarm' desc <<~EXAMPLE diff --git a/lib/resources/aws/aws_cloudwatch_log_metric_filter.rb b/lib/resources/aws/aws_cloudwatch_log_metric_filter.rb index bb2b5ff34..663908946 100644 --- a/lib/resources/aws/aws_cloudwatch_log_metric_filter.rb +++ b/lib/resources/aws/aws_cloudwatch_log_metric_filter.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-cloudwatchlogs' + class AwsCloudwatchLogMetricFilter < Inspec.resource(1) name 'aws_cloudwatch_log_metric_filter' desc 'Verifies individual Cloudwatch Log Metric Filters' diff --git a/lib/resources/aws/aws_config_delivery_channel.rb b/lib/resources/aws/aws_config_delivery_channel.rb index 5ebf420b2..912693f01 100644 --- a/lib/resources/aws/aws_config_delivery_channel.rb +++ b/lib/resources/aws/aws_config_delivery_channel.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-configservice' + class AwsConfigDeliveryChannel < Inspec.resource(1) name 'aws_config_delivery_channel' desc 'Verifies settings for AWS Config Delivery Channel' diff --git a/lib/resources/aws/aws_config_recorder.rb b/lib/resources/aws/aws_config_recorder.rb index 4ebf3b71b..56f794c4a 100644 --- a/lib/resources/aws/aws_config_recorder.rb +++ b/lib/resources/aws/aws_config_recorder.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-configservice' + class AwsConfigurationRecorder < Inspec.resource(1) name 'aws_config_recorder' desc 'Verifies settings for AWS Configuration Recorder' diff --git a/lib/resources/aws/aws_ebs_volume.rb b/lib/resources/aws/aws_ebs_volume.rb index 842183909..85be0439d 100644 --- a/lib/resources/aws/aws_ebs_volume.rb +++ b/lib/resources/aws/aws_ebs_volume.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-ec2' + class AwsEbsVolume < Inspec.resource(1) name 'aws_ebs_volume' desc 'Verifies settings for an EBS volume' diff --git a/lib/resources/aws/aws_ebs_volumes.rb b/lib/resources/aws/aws_ebs_volumes.rb index dca0ff9d8..5fd1c2d5c 100644 --- a/lib/resources/aws/aws_ebs_volumes.rb +++ b/lib/resources/aws/aws_ebs_volumes.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-ec2' + class AwsEbsVolumes < Inspec.resource(1) name 'aws_ebs_volumes' desc 'Verifies settings for AWS EBS Volumes in bulk' diff --git a/lib/resources/aws/aws_ec2_instance.rb b/lib/resources/aws/aws_ec2_instance.rb index e638e3e1a..6539ea09b 100644 --- a/lib/resources/aws/aws_ec2_instance.rb +++ b/lib/resources/aws/aws_ec2_instance.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-ec2' + class AwsEc2Instance < Inspec.resource(1) name 'aws_ec2_instance' desc 'Verifies settings for an EC2 instance' diff --git a/lib/resources/aws/aws_ec2_instances.rb b/lib/resources/aws/aws_ec2_instances.rb index 3f819db95..fa2e64a85 100644 --- a/lib/resources/aws/aws_ec2_instances.rb +++ b/lib/resources/aws/aws_ec2_instances.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-ec2' + class AwsEc2Instances < Inspec.resource(1) name 'aws_ec2_instances' desc 'Verifies settings for AWS EC2 Instances in bulk' diff --git a/lib/resources/aws/aws_ecs_cluster.rb b/lib/resources/aws/aws_ecs_cluster.rb index 0ffdf7e38..cc294562c 100644 --- a/lib/resources/aws/aws_ecs_cluster.rb +++ b/lib/resources/aws/aws_ecs_cluster.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-ecs' + class AwsEcsCluster < Inspec.resource(1) name 'aws_ecs_cluster' desc 'Verifies settings for an ECS cluster' diff --git a/lib/resources/aws/aws_eks_cluster.rb b/lib/resources/aws/aws_eks_cluster.rb index 737f50374..e91c5c478 100644 --- a/lib/resources/aws/aws_eks_cluster.rb +++ b/lib/resources/aws/aws_eks_cluster.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-eks' + class AwsEksCluster < Inspec.resource(1) name 'aws_eks_cluster' desc 'Verifies settings for an EKS cluster' diff --git a/lib/resources/aws/aws_elb.rb b/lib/resources/aws/aws_elb.rb index 40d60a6fc..34694d1cd 100644 --- a/lib/resources/aws/aws_elb.rb +++ b/lib/resources/aws/aws_elb.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-elasticloadbalancing' + class AwsElb < Inspec.resource(1) name 'aws_elb' desc 'Verifies settings for AWS Elastic Load Balancer' diff --git a/lib/resources/aws/aws_elbs.rb b/lib/resources/aws/aws_elbs.rb index 34e9299b2..628df1620 100644 --- a/lib/resources/aws/aws_elbs.rb +++ b/lib/resources/aws/aws_elbs.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-elasticloadbalancing' + class AwsElbs < Inspec.resource(1) name 'aws_elbs' desc 'Verifies settings for AWS ELBs (classic Elastic Load Balancers) in bulk' diff --git a/lib/resources/aws/aws_flow_log.rb b/lib/resources/aws/aws_flow_log.rb index b97f97337..43b802a5a 100644 --- a/lib/resources/aws/aws_flow_log.rb +++ b/lib/resources/aws/aws_flow_log.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-ec2' + class AwsFlowLog < Inspec.resource(1) name 'aws_flow_log' supports platform: 'aws' diff --git a/lib/resources/aws/aws_iam_access_key.rb b/lib/resources/aws/aws_iam_access_key.rb index 3b13786ea..eeb7387d2 100644 --- a/lib/resources/aws/aws_iam_access_key.rb +++ b/lib/resources/aws/aws_iam_access_key.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-iam' + class AwsIamAccessKey < Inspec.resource(1) name 'aws_iam_access_key' desc 'Verifies settings for an individual IAM access key' diff --git a/lib/resources/aws/aws_iam_access_keys.rb b/lib/resources/aws/aws_iam_access_keys.rb index a25cc0738..81c428a7a 100644 --- a/lib/resources/aws/aws_iam_access_keys.rb +++ b/lib/resources/aws/aws_iam_access_keys.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-iam' + class AwsIamAccessKeys < Inspec.resource(1) name 'aws_iam_access_keys' desc 'Verifies settings for AWS IAM Access Keys in bulk' diff --git a/lib/resources/aws/aws_iam_group.rb b/lib/resources/aws/aws_iam_group.rb index e7387bcc7..99c654d75 100644 --- a/lib/resources/aws/aws_iam_group.rb +++ b/lib/resources/aws/aws_iam_group.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-iam' + class AwsIamGroup < Inspec.resource(1) name 'aws_iam_group' desc 'Verifies settings for AWS IAM Group' diff --git a/lib/resources/aws/aws_iam_groups.rb b/lib/resources/aws/aws_iam_groups.rb index 2c2ce56ea..ba4d19b4c 100644 --- a/lib/resources/aws/aws_iam_groups.rb +++ b/lib/resources/aws/aws_iam_groups.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-iam' + class AwsIamGroups < Inspec.resource(1) name 'aws_iam_groups' desc 'Verifies settings for AWS IAM groups in bulk' diff --git a/lib/resources/aws/aws_iam_password_policy.rb b/lib/resources/aws/aws_iam_password_policy.rb index 82ce5ae62..189275275 100644 --- a/lib/resources/aws/aws_iam_password_policy.rb +++ b/lib/resources/aws/aws_iam_password_policy.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-iam' + class AwsIamPasswordPolicy < Inspec.resource(1) name 'aws_iam_password_policy' desc 'Verifies iam password policy' diff --git a/lib/resources/aws/aws_iam_policies.rb b/lib/resources/aws/aws_iam_policies.rb index 7f2ea8ad1..ecf89d3c2 100644 --- a/lib/resources/aws/aws_iam_policies.rb +++ b/lib/resources/aws/aws_iam_policies.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-iam' + class AwsIamPolicies < Inspec.resource(1) name 'aws_iam_policies' desc 'Verifies settings for AWS IAM Policies in bulk' diff --git a/lib/resources/aws/aws_iam_policy.rb b/lib/resources/aws/aws_iam_policy.rb index 2fc041194..f7062322b 100644 --- a/lib/resources/aws/aws_iam_policy.rb +++ b/lib/resources/aws/aws_iam_policy.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-iam' + require 'json' require 'set' require 'uri' diff --git a/lib/resources/aws/aws_iam_role.rb b/lib/resources/aws/aws_iam_role.rb index 2b29d4224..4dfa8b923 100644 --- a/lib/resources/aws/aws_iam_role.rb +++ b/lib/resources/aws/aws_iam_role.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-iam' + class AwsIamRole < Inspec.resource(1) name 'aws_iam_role' desc 'Verifies settings for an IAM Role' diff --git a/lib/resources/aws/aws_iam_root_user.rb b/lib/resources/aws/aws_iam_root_user.rb index c4853082a..b5231be15 100644 --- a/lib/resources/aws/aws_iam_root_user.rb +++ b/lib/resources/aws/aws_iam_root_user.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-iam' + class AwsIamRootUser < Inspec.resource(1) name 'aws_iam_root_user' desc 'Verifies settings for AWS root account' diff --git a/lib/resources/aws/aws_iam_user.rb b/lib/resources/aws/aws_iam_user.rb index 92eade959..b817ebf30 100644 --- a/lib/resources/aws/aws_iam_user.rb +++ b/lib/resources/aws/aws_iam_user.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-iam' + class AwsIamUser < Inspec.resource(1) name 'aws_iam_user' desc 'Verifies settings for AWS IAM user' diff --git a/lib/resources/aws/aws_iam_users.rb b/lib/resources/aws/aws_iam_users.rb index 4572f3730..adc2f819f 100644 --- a/lib/resources/aws/aws_iam_users.rb +++ b/lib/resources/aws/aws_iam_users.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-iam' + class AwsIamUsers < Inspec.resource(1) name 'aws_iam_users' desc 'Verifies settings for AWS IAM users' diff --git a/lib/resources/aws/aws_kms_key.rb b/lib/resources/aws/aws_kms_key.rb index aeacce9c1..053f47414 100644 --- a/lib/resources/aws/aws_kms_key.rb +++ b/lib/resources/aws/aws_kms_key.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-kms' + class AwsKmsKey < Inspec.resource(1) name 'aws_kms_key' desc 'Verifies settings for an individual AWS KMS Key' diff --git a/lib/resources/aws/aws_kms_keys.rb b/lib/resources/aws/aws_kms_keys.rb index 570d5ada8..6de91650a 100644 --- a/lib/resources/aws/aws_kms_keys.rb +++ b/lib/resources/aws/aws_kms_keys.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-kms' + class AwsKmsKeys < Inspec.resource(1) name 'aws_kms_keys' desc 'Verifies settings for AWS KMS Keys in bulk' diff --git a/lib/resources/aws/aws_rds_instance.rb b/lib/resources/aws/aws_rds_instance.rb index 7db4e765f..26b5a68c9 100644 --- a/lib/resources/aws/aws_rds_instance.rb +++ b/lib/resources/aws/aws_rds_instance.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-rds' + class AwsRdsInstance < Inspec.resource(1) name 'aws_rds_instance' desc 'Verifies settings for an rds instance' diff --git a/lib/resources/aws/aws_route_table.rb b/lib/resources/aws/aws_route_table.rb index 81045166c..d67e1c8e1 100644 --- a/lib/resources/aws/aws_route_table.rb +++ b/lib/resources/aws/aws_route_table.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-ec2' + class AwsRouteTable < Inspec.resource(1) name 'aws_route_table' desc 'Verifies settings for an AWS Route Table' diff --git a/lib/resources/aws/aws_route_tables.rb b/lib/resources/aws/aws_route_tables.rb index 86cabb4e0..6d3a8f213 100644 --- a/lib/resources/aws/aws_route_tables.rb +++ b/lib/resources/aws/aws_route_tables.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-ec2' + class AwsRouteTables < Inspec.resource(1) name 'aws_route_tables' desc 'Verifies settings for AWS Route Tables in bulk' diff --git a/lib/resources/aws/aws_s3_bucket.rb b/lib/resources/aws/aws_s3_bucket.rb index 7d6316b6f..0a851f1f6 100644 --- a/lib/resources/aws/aws_s3_bucket.rb +++ b/lib/resources/aws/aws_s3_bucket.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-s3' + class AwsS3Bucket < Inspec.resource(1) name 'aws_s3_bucket' desc 'Verifies settings for a s3 bucket' diff --git a/lib/resources/aws/aws_s3_bucket_object.rb b/lib/resources/aws/aws_s3_bucket_object.rb index 1a0b5d568..d4c30872d 100644 --- a/lib/resources/aws/aws_s3_bucket_object.rb +++ b/lib/resources/aws/aws_s3_bucket_object.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-s3' + class AwsS3BucketObject < Inspec.resource(1) name 'aws_s3_bucket_object' desc 'Verifies settings for a s3 bucket object' diff --git a/lib/resources/aws/aws_s3_buckets.rb b/lib/resources/aws/aws_s3_buckets.rb index 417adf237..311d6d1a7 100644 --- a/lib/resources/aws/aws_s3_buckets.rb +++ b/lib/resources/aws/aws_s3_buckets.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-s3' + class AwsS3Buckets < Inspec.resource(1) name 'aws_s3_buckets' desc 'Verifies settings for AWS S3 Buckets in bulk' diff --git a/lib/resources/aws/aws_security_group.rb b/lib/resources/aws/aws_security_group.rb index fda46132b..667d3e635 100644 --- a/lib/resources/aws/aws_security_group.rb +++ b/lib/resources/aws/aws_security_group.rb @@ -1,6 +1,10 @@ require 'set' require 'ipaddr' +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-ec2' + class AwsSecurityGroup < Inspec.resource(1) name 'aws_security_group' desc 'Verifies settings for an individual AWS Security Group.' diff --git a/lib/resources/aws/aws_security_groups.rb b/lib/resources/aws/aws_security_groups.rb index 396db9333..f207507f9 100644 --- a/lib/resources/aws/aws_security_groups.rb +++ b/lib/resources/aws/aws_security_groups.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-ec2' + class AwsSecurityGroups < Inspec.resource(1) name 'aws_security_groups' desc 'Verifies settings for AWS Security Groups in bulk' diff --git a/lib/resources/aws/aws_sns_subscription.rb b/lib/resources/aws/aws_sns_subscription.rb index 4bf6852da..b76eed675 100644 --- a/lib/resources/aws/aws_sns_subscription.rb +++ b/lib/resources/aws/aws_sns_subscription.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-sns' + class AwsSnsSubscription < Inspec.resource(1) name 'aws_sns_subscription' desc 'Verifies settings for an SNS Subscription' diff --git a/lib/resources/aws/aws_sns_topic.rb b/lib/resources/aws/aws_sns_topic.rb index 34f70dff2..6097c9f09 100644 --- a/lib/resources/aws/aws_sns_topic.rb +++ b/lib/resources/aws/aws_sns_topic.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-sns' + class AwsSnsTopic < Inspec.resource(1) name 'aws_sns_topic' desc 'Verifies settings for an SNS Topic' diff --git a/lib/resources/aws/aws_sns_topics.rb b/lib/resources/aws/aws_sns_topics.rb index 559f87b10..3565f322e 100644 --- a/lib/resources/aws/aws_sns_topics.rb +++ b/lib/resources/aws/aws_sns_topics.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-sns' + class AwsSnsTopics < Inspec.resource(1) name 'aws_sns_topics' desc 'Verifies settings for SNS Topics in bulk' diff --git a/lib/resources/aws/aws_sqs_queue.rb b/lib/resources/aws/aws_sqs_queue.rb index 3ba76ba5d..cdc60736c 100644 --- a/lib/resources/aws/aws_sqs_queue.rb +++ b/lib/resources/aws/aws_sqs_queue.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-sqs' + require 'uri' class AwsSqsQueue < Inspec.resource(1) diff --git a/lib/resources/aws/aws_subnet.rb b/lib/resources/aws/aws_subnet.rb index fdd841d50..e5279e54a 100644 --- a/lib/resources/aws/aws_subnet.rb +++ b/lib/resources/aws/aws_subnet.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-ec2' + class AwsSubnet < Inspec.resource(1) name 'aws_subnet' desc 'This resource is used to test the attributes of a VPC subnet' diff --git a/lib/resources/aws/aws_subnets.rb b/lib/resources/aws/aws_subnets.rb index 2bda9d045..6750ff498 100644 --- a/lib/resources/aws/aws_subnets.rb +++ b/lib/resources/aws/aws_subnets.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-ec2' + class AwsSubnets < Inspec.resource(1) name 'aws_subnets' desc 'Verifies settings for VPC Subnets in bulk' diff --git a/lib/resources/aws/aws_vpc.rb b/lib/resources/aws/aws_vpc.rb index 17dbd48af..b1d1d85be 100644 --- a/lib/resources/aws/aws_vpc.rb +++ b/lib/resources/aws/aws_vpc.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_singular_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-ec2' + class AwsVpc < Inspec.resource(1) name 'aws_vpc' desc 'Verifies settings for AWS VPC' diff --git a/lib/resources/aws/aws_vpcs.rb b/lib/resources/aws/aws_vpcs.rb index 682b5fe27..887348f74 100644 --- a/lib/resources/aws/aws_vpcs.rb +++ b/lib/resources/aws/aws_vpcs.rb @@ -1,3 +1,7 @@ +require 'resource_support/aws/aws_plural_resource_mixin' +require 'resource_support/aws/aws_backend_base' +require 'aws-sdk-ec2' + class AwsVpcs < Inspec.resource(1) name 'aws_vpcs' desc 'Verifies settings for AWS VPCs in bulk' diff --git a/test/functional/helper.rb b/test/functional/helper.rb index 982008eaa..d69e56525 100644 --- a/test/functional/helper.rb +++ b/test/functional/helper.rb @@ -1,10 +1,5 @@ - require 'helper' -require 'rbconfig' -require 'json' -require 'fileutils' -require 'yaml' -require 'tmpdir' +require 'train' ENV["CHEF_LICENSE"] = "accept-no-persist" @@ -13,6 +8,8 @@ class Minitest::Test parallelize_me! end +CMD = Train.create('local', command_runner: :generic).connection + class Module include Minitest::Spec::DSL end diff --git a/test/functional/inspec_report_test.rb b/test/functional/inspec_report_test.rb index 8471a5a2d..6a395a963 100644 --- a/test/functional/inspec_report_test.rb +++ b/test/functional/inspec_report_test.rb @@ -1,5 +1,6 @@ - require 'functional/helper' +require 'inspec/runner' +require 'inspec/resources/file' describe 'inspec report tests' do include FunctionalHelper diff --git a/test/helper.rb b/test/helper.rb index 12770c713..bfe603510 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -75,40 +75,14 @@ end require 'webmock/minitest' require 'mocha/setup' -require 'fileutils' -require 'pathname' -require 'tempfile' -require 'tmpdir' -require 'zip' -require 'json' - -require 'inspec/base_cli' -require 'inspec/version' -require 'inspec/exceptions' -require 'inspec/fetcher' -require 'inspec/source_reader' -require 'inspec/resource' -require 'resource_support/aws' -require 'inspec/reporters' +require 'inspec/log' require 'inspec/backend' -require 'inspec/profile' -require 'inspec/runner' -require 'inspec/runner_mock' -require 'inspec/globals' -require 'inspec/impact' -require 'inspec/config' -require 'fetchers/mock' -require 'inspec/dependencies/cache' -require 'bundles/inspec-supermarket' -require 'train' +require "helpers/mock_loader" -CMD = Train.create('local', command_runner: :generic).connection TMP_CACHE = {} Inspec::Log.logger = Logger.new(nil) -require "helpers/mock_loader" - def load_resource(*args) m = MockLoader.new(:ubuntu1404) m.send('load_resource', *args) diff --git a/test/integration/find_files/libraries/find_files.rb b/test/integration/find_files/libraries/find_files.rb index 6b6761cfe..9ccb0b44f 100644 --- a/test/integration/find_files/libraries/find_files.rb +++ b/test/integration/find_files/libraries/find_files.rb @@ -12,7 +12,7 @@ class TestFindFiles < Inspec.resource(1) end " - require 'utils/find_files' + require 'inspec/utils/find_files' include FindFiles attr_reader :results diff --git a/test/unit/bundles/inspec-supermarket/api_test.rb b/test/unit/bundles/inspec-supermarket/api_test.rb index 91c56d5c4..2365386f1 100644 --- a/test/unit/bundles/inspec-supermarket/api_test.rb +++ b/test/unit/bundles/inspec-supermarket/api_test.rb @@ -1,5 +1,5 @@ require 'helper' -require 'inspec-supermarket/api' +require 'bundles/inspec-supermarket/api' def default_url?(supermarket_url) supermarket_url == Supermarket::API::SUPERMARKET_URL diff --git a/test/unit/dsl/control_test.rb b/test/unit/dsl/control_test.rb index 95ab77f67..99f93c45b 100644 --- a/test/unit/dsl/control_test.rb +++ b/test/unit/dsl/control_test.rb @@ -1,6 +1,8 @@ require 'helper' require 'inspec/config' +require 'inspec/runner_mock' +require 'fetchers/mock' describe 'controls' do def load(content) @@ -8,7 +10,11 @@ describe 'controls' do 'inspec.yml' => "name: mock", 'controls/mock.rb' => "control '1' do\n#{content}\nend\n", } - opts = { test_collector: Inspec::RunnerMock.new, backend: Inspec::Backend.create(Inspec::Config.mock) } + opts = { + test_collector: Inspec::RunnerMock.new, + backend: Inspec::Backend.create(Inspec::Config.mock) + } + Inspec::Profile.for_target(data, opts) .params[:controls]['1'] end diff --git a/test/unit/dsl/other_keywords_test.rb b/test/unit/dsl/other_keywords_test.rb index 2ab859f0a..bebcb01e9 100644 --- a/test/unit/dsl/other_keywords_test.rb +++ b/test/unit/dsl/other_keywords_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/runner_mock' +require 'inspec/runner' describe 'inspec keyword' do def load(content) diff --git a/test/unit/fetchers/mock_test.rb b/test/unit/fetchers/mock_test.rb index c3c059685..02eb8e5b8 100644 --- a/test/unit/fetchers/mock_test.rb +++ b/test/unit/fetchers/mock_test.rb @@ -1,5 +1,6 @@ require 'helper' +require 'fetchers/mock' describe Fetchers::Mock do let(:fetcher) { Fetchers::Mock } diff --git a/test/unit/impact_test.rb b/test/unit/impact_test.rb index 7cea7e1a2..fe193705d 100644 --- a/test/unit/impact_test.rb +++ b/test/unit/impact_test.rb @@ -1,6 +1,7 @@ # copyright: 2017, Chef Software Inc. require 'helper' +require 'inspec/impact' describe 'Impact' do let(:impact) { Inspec::Impact } diff --git a/test/unit/profiles/library_eval_context_test.rb b/test/unit/profiles/library_eval_context_test.rb index 520add193..cd469f4b6 100644 --- a/test/unit/profiles/library_eval_context_test.rb +++ b/test/unit/profiles/library_eval_context_test.rb @@ -1,6 +1,5 @@ require 'helper' -require 'inspec/resource' require 'inspec/library_eval_context' describe Inspec::LibraryEvalContext do diff --git a/test/unit/profiles/profile_context_test.rb b/test/unit/profiles/profile_context_test.rb index 48ff854d3..3eec09324 100644 --- a/test/unit/profiles/profile_context_test.rb +++ b/test/unit/profiles/profile_context_test.rb @@ -1,6 +1,8 @@ require 'helper' require 'inspec/profile_context' +require 'inspec/resources/file' +require 'inspec/resources/command' class Module include Minitest::Spec::DSL diff --git a/test/unit/profiles/profile_resource_exceptions_test.rb b/test/unit/profiles/profile_resource_exceptions_test.rb index f71b0b43b..3933f386e 100644 --- a/test/unit/profiles/profile_resource_exceptions_test.rb +++ b/test/unit/profiles/profile_resource_exceptions_test.rb @@ -2,6 +2,7 @@ require 'helper' require 'inspec/profile_context' +require 'inspec/runner_mock' describe 'resource exception' do let(:profile) do diff --git a/test/unit/profiles/profile_test.rb b/test/unit/profiles/profile_test.rb index 5224acd5e..190e8b3f2 100644 --- a/test/unit/profiles/profile_test.rb +++ b/test/unit/profiles/profile_test.rb @@ -1,6 +1,9 @@ - require 'helper' require 'inspec/profile_context' +require 'inspec/runner_mock' +require 'inspec/resource' +require 'inspec/resources/command' + describe Inspec::Profile do let(:logger) { Minitest::Mock.new } diff --git a/test/unit/reporters/automate_test.rb b/test/unit/reporters/automate_test.rb index 6f43596e7..fc182e101 100644 --- a/test/unit/reporters/automate_test.rb +++ b/test/unit/reporters/automate_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/reporters' describe Inspec::Reporters::Automate do let(:path) { File.expand_path(File.dirname(__FILE__)) } diff --git a/test/unit/reporters/base_test.rb b/test/unit/reporters/base_test.rb index 1d1806ba9..19e599278 100644 --- a/test/unit/reporters/base_test.rb +++ b/test/unit/reporters/base_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/reporters' describe Inspec::Reporters::Base do let(:path) { File.expand_path(File.dirname(__FILE__)) } diff --git a/test/unit/reporters/cli_test.rb b/test/unit/reporters/cli_test.rb index b205510e3..e185476e6 100644 --- a/test/unit/reporters/cli_test.rb +++ b/test/unit/reporters/cli_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/reporters' describe Inspec::Reporters::CLI do WINDOWS = RUBY_PLATFORM =~ /windows|mswin|msys|mingw|cygwin/ diff --git a/test/unit/reporters/json_automate_test.rb b/test/unit/reporters/json_automate_test.rb index 7555ca4dc..8c4fcaef9 100644 --- a/test/unit/reporters/json_automate_test.rb +++ b/test/unit/reporters/json_automate_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/reporters' describe Inspec::Reporters::JsonAutomate do let(:path) { File.expand_path(File.dirname(__FILE__)) } diff --git a/test/unit/reporters/json_min_test.rb b/test/unit/reporters/json_min_test.rb index 723264495..8da91dcb0 100644 --- a/test/unit/reporters/json_min_test.rb +++ b/test/unit/reporters/json_min_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/reporters' describe Inspec::Reporters::JsonMin do let(:path) { File.expand_path(File.dirname(__FILE__)) } diff --git a/test/unit/reporters/json_test.rb b/test/unit/reporters/json_test.rb index 3092e30b6..8f7038ead 100644 --- a/test/unit/reporters/json_test.rb +++ b/test/unit/reporters/json_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/reporters' describe Inspec::Reporters::Json do let(:path) { File.expand_path(File.dirname(__FILE__)) } diff --git a/test/unit/reporters/junit_test.rb b/test/unit/reporters/junit_test.rb index 6af05ba15..805626b75 100644 --- a/test/unit/reporters/junit_test.rb +++ b/test/unit/reporters/junit_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/reporters' describe Inspec::Reporters::Junit do let(:path) { File.expand_path(File.dirname(__FILE__)) } diff --git a/test/unit/reporters/yaml_test.rb b/test/unit/reporters/yaml_test.rb index a3b41b70d..06477b8e8 100644 --- a/test/unit/reporters/yaml_test.rb +++ b/test/unit/reporters/yaml_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/reporters' describe Inspec::Reporters::Yaml do let(:path) { File.expand_path(File.dirname(__FILE__)) } diff --git a/test/unit/resource_supports/aws/aws_resource_mixin_test.rb b/test/unit/resource_supports/aws/aws_resource_mixin_test.rb index 17902f175..4e1e88b0a 100644 --- a/test/unit/resource_supports/aws/aws_resource_mixin_test.rb +++ b/test/unit/resource_supports/aws/aws_resource_mixin_test.rb @@ -2,6 +2,9 @@ require 'helper' +require 'resource_support/aws' +require 'resource_support/aws/aws_resource_mixin' + describe 'AwsResourceMixin' do describe 'initialize' do class AwsResourceMixinError diff --git a/test/unit/resources/aide_conf_test.rb b/test/unit/resources/aide_conf_test.rb index a4600872e..2bc4dec74 100644 --- a/test/unit/resources/aide_conf_test.rb +++ b/test/unit/resources/aide_conf_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/aide_conf' describe 'Inspec::Resources::AideConf' do describe 'AideConf Parameters' do diff --git a/test/unit/resources/apache_conf_test.rb b/test/unit/resources/apache_conf_test.rb index eb762ab60..575a6e6fe 100644 --- a/test/unit/resources/apache_conf_test.rb +++ b/test/unit/resources/apache_conf_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/apache_conf' require 'hashie' describe 'Inspec::Resources::ApacheConf' do diff --git a/test/unit/resources/apt_test.rb b/test/unit/resources/apt_test.rb index 3f98f615e..6fd6601a5 100644 --- a/test/unit/resources/apt_test.rb +++ b/test/unit/resources/apt_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/apt' describe 'Inspec::Resources::AptRepo' do diff --git a/test/unit/resources/audit_policy_test.rb b/test/unit/resources/audit_policy_test.rb index 7253feba5..bba127205 100644 --- a/test/unit/resources/audit_policy_test.rb +++ b/test/unit/resources/audit_policy_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/audit_policy' describe 'Inspec::Resources::AuditPolicy' do it 'check audit policy parsing' do diff --git a/test/unit/resources/auditd_conf_test.rb b/test/unit/resources/auditd_conf_test.rb index 763afa994..d1dedb970 100644 --- a/test/unit/resources/auditd_conf_test.rb +++ b/test/unit/resources/auditd_conf_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/auditd_conf' describe 'Inspec::Resources::AuditDaemonConf' do it 'check audit daemon config parsing' do diff --git a/test/unit/resources/auditd_test.rb b/test/unit/resources/auditd_test.rb index d6c663633..6a8904852 100644 --- a/test/unit/resources/auditd_test.rb +++ b/test/unit/resources/auditd_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/auditd' describe 'Inspec::Resources::AuditDaemon' do it 'auditd interface' do diff --git a/test/unit/resources/aws_billing_backend.rb b/test/unit/resources/aws_billing_backend.rb index cd71032f7..38347f600 100644 --- a/test/unit/resources/aws_billing_backend.rb +++ b/test/unit/resources/aws_billing_backend.rb @@ -1,3 +1,5 @@ +require 'resource_support/aws' + module MockAwsBillingReports class Empty < AwsBackendBase def describe_report_definitions(_query) diff --git a/test/unit/resources/aws_billing_report_test.rb b/test/unit/resources/aws_billing_report_test.rb index 43b5d0e72..736d03b2f 100644 --- a/test/unit/resources/aws_billing_report_test.rb +++ b/test/unit/resources/aws_billing_report_test.rb @@ -1,5 +1,11 @@ require 'helper' -require_relative 'aws_billing_backend' +require 'inspec/resource' +require 'resources/aws/aws_billing_report' + +require_relative 'aws_billing_backend' # TODO: move this to mocks + +require 'resource_support/aws' +require 'resources/aws/aws_billing_report' class EmptyAwsBillingReportTest < Minitest::Test def setup diff --git a/test/unit/resources/aws_billing_reports_test.rb b/test/unit/resources/aws_billing_reports_test.rb index 8902b37c6..8f36e8ca4 100644 --- a/test/unit/resources/aws_billing_reports_test.rb +++ b/test/unit/resources/aws_billing_reports_test.rb @@ -1,6 +1,12 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_billing_reports' + require_relative 'aws_billing_backend' +require 'resource_support/aws' +require 'resources/aws/aws_billing_reports' + class ConstructorAwsBillingReportsTest < Minitest::Test def setup AwsBillingReports::BackendFactory.select(MockAwsBillingReports::Empty) diff --git a/test/unit/resources/aws_cloudtrail_trail_test.rb b/test/unit/resources/aws_cloudtrail_trail_test.rb index 3bd9476b3..065d08d41 100644 --- a/test/unit/resources/aws_cloudtrail_trail_test.rb +++ b/test/unit/resources/aws_cloudtrail_trail_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_cloudtrail_trail' + +require 'resource_support/aws' +require 'resources/aws/aws_cloudtrail_trail' # MACTTSB = MockAwsCloudTrailTrailSingularBackend # Abbreviation not used outside this file @@ -183,4 +188,4 @@ module MACTTSB fixtures.detect { |f| f.name == query[:name] } end end -end \ No newline at end of file +end diff --git a/test/unit/resources/aws_cloudtrail_trails_test.rb b/test/unit/resources/aws_cloudtrail_trails_test.rb index ce1678fb1..97a03333f 100644 --- a/test/unit/resources/aws_cloudtrail_trails_test.rb +++ b/test/unit/resources/aws_cloudtrail_trails_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_cloudtrail_trails' + +require 'resource_support/aws' +require 'resources/aws/aws_cloudtrail_trails' # MACTTPB = MockAwsCloudTrailTrailsPluralBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_cloudwatch_alarm_test.rb b/test/unit/resources/aws_cloudwatch_alarm_test.rb index 7032f1545..169d0946d 100644 --- a/test/unit/resources/aws_cloudwatch_alarm_test.rb +++ b/test/unit/resources/aws_cloudwatch_alarm_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_cloudwatch_alarm' + +require 'resource_support/aws' +require 'resources/aws/aws_cloudwatch_alarm' # MCWAB = MockCloudwatchAlarmBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_cloudwatch_log_metric_filter_test.rb b/test/unit/resources/aws_cloudwatch_log_metric_filter_test.rb index 86d3b8e82..2e87723b2 100644 --- a/test/unit/resources/aws_cloudwatch_log_metric_filter_test.rb +++ b/test/unit/resources/aws_cloudwatch_log_metric_filter_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_cloudwatch_log_metric_filter' + +require 'resource_support/aws' +require 'resources/aws/aws_cloudwatch_log_metric_filter' # CWLMF = CloudwatchLogMetricFilter # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_config_delivery_channel_test.rb b/test/unit/resources/aws_config_delivery_channel_test.rb index ce4746f7f..942fc76e0 100644 --- a/test/unit/resources/aws_config_delivery_channel_test.rb +++ b/test/unit/resources/aws_config_delivery_channel_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_config_delivery_channel' + +require 'resource_support/aws' +require 'resources/aws/aws_config_delivery_channel' # MDCSB = MockDeliveryChannelSingleBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_config_recorder_test.rb b/test/unit/resources/aws_config_recorder_test.rb index dba1cbe8c..c47473d19 100644 --- a/test/unit/resources/aws_config_recorder_test.rb +++ b/test/unit/resources/aws_config_recorder_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_config_recorder' + +require 'resource_support/aws' +require 'resources/aws/aws_config_recorder' # MCRSB = MockConfigRecorderSingleBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_ebs_volume_test.rb b/test/unit/resources/aws_ebs_volume_test.rb index 3a78ce5e6..e16153af8 100644 --- a/test/unit/resources/aws_ebs_volume_test.rb +++ b/test/unit/resources/aws_ebs_volume_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_ebs_volume' + +require 'resource_support/aws' +require 'resources/aws/aws_ebs_volume' class TestEbs < Minitest::Test Id = 'volume-id'.freeze diff --git a/test/unit/resources/aws_ebs_volumes_test.rb b/test/unit/resources/aws_ebs_volumes_test.rb index e08ec04a3..383a83745 100644 --- a/test/unit/resources/aws_ebs_volumes_test.rb +++ b/test/unit/resources/aws_ebs_volumes_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_ebs_volumes' + +require 'resource_support/aws' +require 'resources/aws/aws_ebs_volumes' # MAEIPB = MockAwsEbsVolumesPluralBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_ec2_instance_test.rb b/test/unit/resources/aws_ec2_instance_test.rb index 5cc65069e..7dafbf5cd 100644 --- a/test/unit/resources/aws_ec2_instance_test.rb +++ b/test/unit/resources/aws_ec2_instance_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_ec2_instance' + +require 'resource_support/aws' +require 'resources/aws/aws_ec2_instance' class TestEc2 < Minitest::Test Id = 'instance-id'.freeze diff --git a/test/unit/resources/aws_ec2_instances_test.rb b/test/unit/resources/aws_ec2_instances_test.rb index cb52b835a..335b72d7f 100644 --- a/test/unit/resources/aws_ec2_instances_test.rb +++ b/test/unit/resources/aws_ec2_instances_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_ec2_instances' + +require 'resource_support/aws' +require 'resources/aws/aws_ec2_instances' # MAEIPB = MockAwsEC2InstancesPluralBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_ecs_cluster_test.rb b/test/unit/resources/aws_ecs_cluster_test.rb index 5e625c2e6..feeecf6bf 100644 --- a/test/unit/resources/aws_ecs_cluster_test.rb +++ b/test/unit/resources/aws_ecs_cluster_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_ecs_cluster' + +require 'resource_support/aws' +require 'resources/aws/aws_ecs_cluster' # MAECSB = MockAwsEcsClusterSingularBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_eks_cluster_test.rb b/test/unit/resources/aws_eks_cluster_test.rb index 6c5e22e97..7554b313c 100644 --- a/test/unit/resources/aws_eks_cluster_test.rb +++ b/test/unit/resources/aws_eks_cluster_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_eks_cluster' + +require 'resource_support/aws' +require 'resources/aws/aws_eks_cluster' # MAEKSB = MockAwsEksClusterSingularBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_elb_test.rb b/test/unit/resources/aws_elb_test.rb index fc5994a63..0379618a7 100644 --- a/test/unit/resources/aws_elb_test.rb +++ b/test/unit/resources/aws_elb_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_elb' + +require 'resource_support/aws' +require 'resources/aws/aws_elb' # MAESB = MockAwsElbSingularBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_elbs_test.rb b/test/unit/resources/aws_elbs_test.rb index 16b71d722..c56462753 100644 --- a/test/unit/resources/aws_elbs_test.rb +++ b/test/unit/resources/aws_elbs_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_elbs' + +require 'resource_support/aws' +require 'resources/aws/aws_elbs' # MAEPB = MockAwsELBsPluralBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_flow_log_test.rb b/test/unit/resources/aws_flow_log_test.rb index 7743d005a..b36a58b6f 100644 --- a/test/unit/resources/aws_flow_log_test.rb +++ b/test/unit/resources/aws_flow_log_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_flow_log' + +require 'resource_support/aws' +require 'resources/aws/aws_flow_log' class EmptyAwsFlowLog < Minitest::Test def setup diff --git a/test/unit/resources/aws_iam_access_key_test.rb b/test/unit/resources/aws_iam_access_key_test.rb index 6343b10ce..9e60dbbbd 100644 --- a/test/unit/resources/aws_iam_access_key_test.rb +++ b/test/unit/resources/aws_iam_access_key_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_iam_access_key' + +require 'resource_support/aws' +require 'resources/aws/aws_iam_access_key' class AwsIamAccessKeyConstructorTest < Minitest::Test def setup @@ -205,4 +210,4 @@ class BasicMAIKSB < AwsBackendBase } fixtures[query[:access_key_id]] end -end \ No newline at end of file +end diff --git a/test/unit/resources/aws_iam_access_keys_test.rb b/test/unit/resources/aws_iam_access_keys_test.rb index a53b18678..d11364da7 100644 --- a/test/unit/resources/aws_iam_access_keys_test.rb +++ b/test/unit/resources/aws_iam_access_keys_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_iam_access_keys' + +require 'resource_support/aws' +require 'resources/aws/aws_iam_access_keys' #==========================================================# # Constructor Tests # diff --git a/test/unit/resources/aws_iam_group_test.rb b/test/unit/resources/aws_iam_group_test.rb index 51fe72cc4..dae9ab747 100644 --- a/test/unit/resources/aws_iam_group_test.rb +++ b/test/unit/resources/aws_iam_group_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_iam_group' + +require 'resource_support/aws' +require 'resources/aws/aws_iam_group' # MAIGSB = MockAwsIamGroupSingularBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_iam_groups_test.rb b/test/unit/resources/aws_iam_groups_test.rb index a67e8dafd..6acd082c0 100644 --- a/test/unit/resources/aws_iam_groups_test.rb +++ b/test/unit/resources/aws_iam_groups_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_iam_groups' + +require 'resource_support/aws' +require 'resources/aws/aws_iam_groups' # MAIGPB = MockAwsIamGroupsPluralBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_iam_password_policy_test.rb b/test/unit/resources/aws_iam_password_policy_test.rb index 1dcf25245..c301e7a14 100644 --- a/test/unit/resources/aws_iam_password_policy_test.rb +++ b/test/unit/resources/aws_iam_password_policy_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_iam_password_policy' + +require 'resource_support/aws' +require 'resources/aws/aws_iam_password_policy' class AwsIamPasswordPolicyTest < Minitest::Test def setup diff --git a/test/unit/resources/aws_iam_policies_test.rb b/test/unit/resources/aws_iam_policies_test.rb index 7e797e665..3651fb97f 100644 --- a/test/unit/resources/aws_iam_policies_test.rb +++ b/test/unit/resources/aws_iam_policies_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_iam_policies' + +require 'resource_support/aws' +require 'resources/aws/aws_iam_policies' # MAIPPB = MockAwsIamPoliciesPluralBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_iam_policy_test.rb b/test/unit/resources/aws_iam_policy_test.rb index 0ec0c009e..2b7e4aaa3 100644 --- a/test/unit/resources/aws_iam_policy_test.rb +++ b/test/unit/resources/aws_iam_policy_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_iam_policy' + +require 'resource_support/aws' +require 'resources/aws/aws_iam_policy' # MAIPSB = MockAwsIamPolicySingularBackend # Abbreviation not used outside this file @@ -449,4 +454,4 @@ module MAIPSB raise Aws::IAM::Errors::NoSuchEntity.new(nil, nil) end end -end \ No newline at end of file +end diff --git a/test/unit/resources/aws_iam_role_test.rb b/test/unit/resources/aws_iam_role_test.rb index 5cebd7365..975bb67af 100644 --- a/test/unit/resources/aws_iam_role_test.rb +++ b/test/unit/resources/aws_iam_role_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_iam_role' + +require 'resource_support/aws' +require 'resources/aws/aws_iam_role' # MIRB = MockIamRoleBackend # Abbreviation not used outside this file @@ -99,4 +104,4 @@ module AwsMIRB }) end end -end \ No newline at end of file +end diff --git a/test/unit/resources/aws_iam_root_user_test.rb b/test/unit/resources/aws_iam_root_user_test.rb index b56a83669..1dba746e5 100644 --- a/test/unit/resources/aws_iam_root_user_test.rb +++ b/test/unit/resources/aws_iam_root_user_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_iam_root_user' + +require 'resource_support/aws' +require 'resources/aws/aws_iam_root_user' class AwsIamRootUserTest < Minitest::Test def setup diff --git a/test/unit/resources/aws_iam_user_test.rb b/test/unit/resources/aws_iam_user_test.rb index 68f43c4fc..cb6956a7c 100644 --- a/test/unit/resources/aws_iam_user_test.rb +++ b/test/unit/resources/aws_iam_user_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_iam_user' + +require 'resource_support/aws' +require 'resources/aws/aws_iam_user' # MAUIB = MockAwsIamUserBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_iam_users_test.rb b/test/unit/resources/aws_iam_users_test.rb index 460e2dab8..bb9f02206 100644 --- a/test/unit/resources/aws_iam_users_test.rb +++ b/test/unit/resources/aws_iam_users_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_iam_users' + +require 'resource_support/aws' +require 'resources/aws/aws_iam_users' # Maiusb = Mock AwsIamUsers::BackendFactory # Abbreviation not used outside of this file diff --git a/test/unit/resources/aws_kms_key_test.rb b/test/unit/resources/aws_kms_key_test.rb index 0bc33fb20..ae31dcd49 100644 --- a/test/unit/resources/aws_kms_key_test.rb +++ b/test/unit/resources/aws_kms_key_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_kms_key' + +require 'resource_support/aws' +require 'resources/aws/aws_kms_key' # MAKKSB = MockAwsKmsKeyBackend # Abbreviation not used outside this file @@ -224,4 +229,4 @@ module MAKKSB raise Aws::KMS::Errors::NotFoundException.new(nil, nil) end end -end \ No newline at end of file +end diff --git a/test/unit/resources/aws_kms_keys_test.rb b/test/unit/resources/aws_kms_keys_test.rb index d3bcb3a84..33524d183 100644 --- a/test/unit/resources/aws_kms_keys_test.rb +++ b/test/unit/resources/aws_kms_keys_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_kms_keys' + +require 'resource_support/aws' +require 'resources/aws/aws_kms_keys' # MAKKPB = MockAwsKmsKeysPluralBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_rds_instance_test.rb b/test/unit/resources/aws_rds_instance_test.rb index 3ac646b58..f6788867b 100644 --- a/test/unit/resources/aws_rds_instance_test.rb +++ b/test/unit/resources/aws_rds_instance_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_rds_instance' + +require 'resource_support/aws' +require 'resources/aws/aws_rds_instance' # MRDSIB = MockRDSInstanceBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_route_table_test.rb b/test/unit/resources/aws_route_table_test.rb index dc9c9e1b3..604c5d5b9 100644 --- a/test/unit/resources/aws_route_table_test.rb +++ b/test/unit/resources/aws_route_table_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_route_table' + +require 'resource_support/aws' +require 'resources/aws/aws_route_table' class EmptyAwsRouteTableTest < Minitest::Test def setup diff --git a/test/unit/resources/aws_route_tables_test.rb b/test/unit/resources/aws_route_tables_test.rb index ab0942ff2..fedfd6c91 100644 --- a/test/unit/resources/aws_route_tables_test.rb +++ b/test/unit/resources/aws_route_tables_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_route_tables' + +require 'resource_support/aws' +require 'resources/aws/aws_route_tables' class EmptyAwsRouteTablesTest < Minitest::Test def setup diff --git a/test/unit/resources/aws_s3_bucket_object_test.rb b/test/unit/resources/aws_s3_bucket_object_test.rb index 35c6df72f..b360058a5 100644 --- a/test/unit/resources/aws_s3_bucket_object_test.rb +++ b/test/unit/resources/aws_s3_bucket_object_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_s3_bucket_object' + +require 'resource_support/aws' +require 'resources/aws/aws_s3_bucket_object' # MSBOSB = MockS3BucketObjectSingleBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_s3_bucket_test.rb b/test/unit/resources/aws_s3_bucket_test.rb index f99aadb1c..d9ad5db39 100644 --- a/test/unit/resources/aws_s3_bucket_test.rb +++ b/test/unit/resources/aws_s3_bucket_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_s3_bucket' + +require 'resource_support/aws' +require 'resources/aws/aws_s3_bucket' # MSBSB = MockS3BucketSingleBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_s3_buckets_test.rb b/test/unit/resources/aws_s3_buckets_test.rb index 6dbc07ac8..4d93bffc4 100644 --- a/test/unit/resources/aws_s3_buckets_test.rb +++ b/test/unit/resources/aws_s3_buckets_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_s3_buckets' + +require 'resource_support/aws' +require 'resources/aws/aws_s3_buckets' # MSBB = MockS3BucketsBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_security_group_test.rb b/test/unit/resources/aws_security_group_test.rb index 2cd4e3447..59fe536d6 100644 --- a/test/unit/resources/aws_security_group_test.rb +++ b/test/unit/resources/aws_security_group_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_security_group' + +require 'resource_support/aws' +require 'resources/aws/aws_security_group' # MESGSB = MockEc2SecurityGroupSingleBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_security_groups_test.rb b/test/unit/resources/aws_security_groups_test.rb index d401d8318..88500c6a8 100644 --- a/test/unit/resources/aws_security_groups_test.rb +++ b/test/unit/resources/aws_security_groups_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_security_groups' + +require 'resource_support/aws' +require 'resources/aws/aws_security_groups' # MESGB = MockSecurityGroupBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_sns_subscription_test.rb b/test/unit/resources/aws_sns_subscription_test.rb index 5286bd31a..7a1a268d6 100644 --- a/test/unit/resources/aws_sns_subscription_test.rb +++ b/test/unit/resources/aws_sns_subscription_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_sns_subscription' + +require 'resource_support/aws' +require 'resources/aws/aws_sns_subscription' # MASSSB = MockAwsSNSSubscriptionSingularBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_sns_topic_test.rb b/test/unit/resources/aws_sns_topic_test.rb index b1a0333d9..c7c4f8d83 100644 --- a/test/unit/resources/aws_sns_topic_test.rb +++ b/test/unit/resources/aws_sns_topic_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_sns_topic' + +require 'resource_support/aws' +require 'resources/aws/aws_sns_topic' # MSNB = MockSnsBackend # Abbreviation not used outside this file @@ -121,4 +126,4 @@ module AwsMSNB }) end end -end \ No newline at end of file +end diff --git a/test/unit/resources/aws_sns_topics_test.rb b/test/unit/resources/aws_sns_topics_test.rb index 3f5d69d86..29b5ce1bc 100644 --- a/test/unit/resources/aws_sns_topics_test.rb +++ b/test/unit/resources/aws_sns_topics_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_sns_topics' + +require 'resource_support/aws' +require 'resources/aws/aws_sns_topics' # MSTB = MockSnsTopicsBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_sqs_queue_test.rb b/test/unit/resources/aws_sqs_queue_test.rb index 874949738..fa44117f5 100644 --- a/test/unit/resources/aws_sqs_queue_test.rb +++ b/test/unit/resources/aws_sqs_queue_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_sqs_queue' + +require 'resource_support/aws' +require 'resources/aws/aws_sqs_queue' # MSQB = MockSQsBackend # Abbreviation not used outside this file @@ -123,4 +128,4 @@ module AwsMSQB }) end end -end \ No newline at end of file +end diff --git a/test/unit/resources/aws_subnet_test.rb b/test/unit/resources/aws_subnet_test.rb index 886992428..07158c7af 100644 --- a/test/unit/resources/aws_subnet_test.rb +++ b/test/unit/resources/aws_subnet_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_subnet' + +require 'resource_support/aws' +require 'resources/aws/aws_subnet' # MVSSB = MockVpcSubnetSingleBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_subnets_test.rb b/test/unit/resources/aws_subnets_test.rb index cedc8ed39..f1a10f7b1 100644 --- a/test/unit/resources/aws_subnets_test.rb +++ b/test/unit/resources/aws_subnets_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_subnets' + +require 'resource_support/aws' +require 'resources/aws/aws_subnets' # MVSB = MockVpcSubnetsBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_vpc_test.rb b/test/unit/resources/aws_vpc_test.rb index e763eb57b..84f6afcae 100644 --- a/test/unit/resources/aws_vpc_test.rb +++ b/test/unit/resources/aws_vpc_test.rb @@ -1,4 +1,9 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_vpc' + +require 'resource_support/aws' +require 'resources/aws/aws_vpc' # MAVSB = MockAwsVpcSingularBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/aws_vpcs_test.rb b/test/unit/resources/aws_vpcs_test.rb index b41e8bae3..d1f9414e3 100644 --- a/test/unit/resources/aws_vpcs_test.rb +++ b/test/unit/resources/aws_vpcs_test.rb @@ -1,6 +1,11 @@ require 'helper' +require 'inspec/resource' +require 'resources/aws/aws_vpcs' require 'ipaddr' +require 'resource_support/aws' +require 'resources/aws/aws_vpcs' + # MAVPB = MockAwsVpcsPluralBackend # Abbreviation not used outside this file diff --git a/test/unit/resources/bash_test.rb b/test/unit/resources/bash_test.rb index e6715e69e..ecdcae4a6 100644 --- a/test/unit/resources/bash_test.rb +++ b/test/unit/resources/bash_test.rb @@ -1,8 +1,9 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/bash' -describe Inspec::Resources::Bash do +describe "Inspec::Resources::Bash" do let(:x) { rand.to_s } let(:resource) { load_resource('bash', '$("'+x+'")') } diff --git a/test/unit/resources/bond_test.rb b/test/unit/resources/bond_test.rb index c211f279b..f8f46dbc6 100644 --- a/test/unit/resources/bond_test.rb +++ b/test/unit/resources/bond_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/bond' describe 'Inspec::Resources::Bond' do diff --git a/test/unit/resources/bridge_test.rb b/test/unit/resources/bridge_test.rb index 9bffaef7a..575822cb8 100644 --- a/test/unit/resources/bridge_test.rb +++ b/test/unit/resources/bridge_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/bridge' describe 'Inspec::Resources::Bridge' do diff --git a/test/unit/resources/chocolatey_package_test.rb b/test/unit/resources/chocolatey_package_test.rb index 81eb48a04..e69b4bea8 100644 --- a/test/unit/resources/chocolatey_package_test.rb +++ b/test/unit/resources/chocolatey_package_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/chocolatey_package' def skip(*args) # noop diff --git a/test/unit/resources/command_test.rb b/test/unit/resources/command_test.rb index aa41c8d79..843c2f12b 100644 --- a/test/unit/resources/command_test.rb +++ b/test/unit/resources/command_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/command' describe Inspec::Resources::Cmd do let(:x) { rand.to_s } diff --git a/test/unit/resources/cpan_test.rb b/test/unit/resources/cpan_test.rb index efb330bfd..a825a13e3 100644 --- a/test/unit/resources/cpan_test.rb +++ b/test/unit/resources/cpan_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/cpan' describe 'Inspec::Resources::Cpan' do it 'verify cpan package detail parsing' do diff --git a/test/unit/resources/cran_test.rb b/test/unit/resources/cran_test.rb index 71ccd60c8..26c54e737 100644 --- a/test/unit/resources/cran_test.rb +++ b/test/unit/resources/cran_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/cran' describe 'Inspec::Resources::Cran' do it 'verify cran package detail parsing' do diff --git a/test/unit/resources/crontab_test.rb b/test/unit/resources/crontab_test.rb index 6c5d22bde..3684c5254 100644 --- a/test/unit/resources/crontab_test.rb +++ b/test/unit/resources/crontab_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/crontab' describe 'Inspec::Resources::Crontab' do let(:crontab) { load_resource('crontab') } diff --git a/test/unit/resources/csv_test.rb b/test/unit/resources/csv_test.rb index fe64e2087..cdb77581f 100644 --- a/test/unit/resources/csv_test.rb +++ b/test/unit/resources/csv_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/csv' describe 'Inspec::Resources::CSV' do describe 'when loading a valid csv' do diff --git a/test/unit/resources/dh_params_test.rb b/test/unit/resources/dh_params_test.rb index c9c394d67..fe52f998d 100644 --- a/test/unit/resources/dh_params_test.rb +++ b/test/unit/resources/dh_params_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/dh_params' describe 'Inspec::Resources::DhParams' do let (:resource_dh_params) { load_resource('dh_params', 'dh_params.dh_pem')} diff --git a/test/unit/resources/docker_container_test.rb b/test/unit/resources/docker_container_test.rb index 4feb789b0..7fd146928 100644 --- a/test/unit/resources/docker_container_test.rb +++ b/test/unit/resources/docker_container_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/docker_container' describe 'Inspec::Resources::DockerContainer' do describe 'docker_container' do diff --git a/test/unit/resources/docker_image_test.rb b/test/unit/resources/docker_image_test.rb index 686d6b39d..35c4a597e 100644 --- a/test/unit/resources/docker_image_test.rb +++ b/test/unit/resources/docker_image_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/docker_image' describe 'Inspec::Resources::DockerImage' do describe 'docker_image' do diff --git a/test/unit/resources/docker_plugin_test.rb b/test/unit/resources/docker_plugin_test.rb index f45f6a536..3b526f611 100644 --- a/test/unit/resources/docker_plugin_test.rb +++ b/test/unit/resources/docker_plugin_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/docker_plugin' describe 'Inspec::Resources::DockerContainer' do describe 'docker_plugin' do diff --git a/test/unit/resources/docker_service_test.rb b/test/unit/resources/docker_service_test.rb index 8b554d1fa..3bebe7a32 100644 --- a/test/unit/resources/docker_service_test.rb +++ b/test/unit/resources/docker_service_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/docker_service' describe 'Inspec::Resources::DockerService' do describe 'docker_service' do diff --git a/test/unit/resources/docker_test.rb b/test/unit/resources/docker_test.rb index 99bd48e5c..36235a8ca 100644 --- a/test/unit/resources/docker_test.rb +++ b/test/unit/resources/docker_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/docker' describe 'Inspec::Resources::Docker' do describe 'docker' do diff --git a/test/unit/resources/elasticsearch_test.rb b/test/unit/resources/elasticsearch_test.rb index daf91214c..35c276bfb 100644 --- a/test/unit/resources/elasticsearch_test.rb +++ b/test/unit/resources/elasticsearch_test.rb @@ -1,5 +1,7 @@ require 'helper' +require 'inspec/resource' +require 'inspec/resources/elasticsearch' describe 'Inspec::Resources::Elasticsearch' do let(:resource) { load_resource('elasticsearch') } diff --git a/test/unit/resources/etc_fstab_test.rb b/test/unit/resources/etc_fstab_test.rb index cf4191139..f9735a836 100644 --- a/test/unit/resources/etc_fstab_test.rb +++ b/test/unit/resources/etc_fstab_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/etc_fstab' describe 'Inspec::Resources::Fstab' do let(:resource) { load_resource('etc_fstab') } diff --git a/test/unit/resources/etc_group_test.rb b/test/unit/resources/etc_group_test.rb index 96c956a83..5ca08faf7 100644 --- a/test/unit/resources/etc_group_test.rb +++ b/test/unit/resources/etc_group_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/etc_group' describe 'Inspec::Resources::EtcGroup' do let(:resource) { load_resource('etc_group') } diff --git a/test/unit/resources/etc_hosts_allow_deny_test.rb b/test/unit/resources/etc_hosts_allow_deny_test.rb index a7fa38474..8da60134a 100644 --- a/test/unit/resources/etc_hosts_allow_deny_test.rb +++ b/test/unit/resources/etc_hosts_allow_deny_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/etc_hosts_allow_deny' describe 'Inspec::Resources::EtcHostsAllow' do describe 'EtcHostsAllow Paramaters' do diff --git a/test/unit/resources/etc_hosts_test.rb b/test/unit/resources/etc_hosts_test.rb index 83e6d8776..f42a5357d 100644 --- a/test/unit/resources/etc_hosts_test.rb +++ b/test/unit/resources/etc_hosts_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/etc_hosts' describe 'Inspec::Resources::EtcHosts' do let(:resource) { load_resource('etc_hosts') } diff --git a/test/unit/resources/file_test.rb b/test/unit/resources/file_test.rb index 2ec833fda..d6bb7ac84 100644 --- a/test/unit/resources/file_test.rb +++ b/test/unit/resources/file_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/file' describe Inspec::Resources::FileResource do let(:file) { stub(unix_mode_mask: 000, mode: 000) } diff --git a/test/unit/resources/filesystem_test.rb b/test/unit/resources/filesystem_test.rb index 504270427..643b1e878 100644 --- a/test/unit/resources/filesystem_test.rb +++ b/test/unit/resources/filesystem_test.rb @@ -1,5 +1,6 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/filesystem' describe 'Inspec::Resources::FileSystemResource' do # arch linux diff --git a/test/unit/resources/firewalld_test.rb b/test/unit/resources/firewalld_test.rb index 35d7dc5fb..38ba5e7d1 100644 --- a/test/unit/resources/firewalld_test.rb +++ b/test/unit/resources/firewalld_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/firewalld' describe 'Inspec::Resources::FirewallD' do centResource = MockLoader.new(:centos7).load_resource('firewalld') diff --git a/test/unit/resources/gem_test.rb b/test/unit/resources/gem_test.rb index b3f03973e..13603eac8 100644 --- a/test/unit/resources/gem_test.rb +++ b/test/unit/resources/gem_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/gem' describe 'Inspec::Resources::Gem' do it 'verify gem is not installed' do diff --git a/test/unit/resources/group_test.rb b/test/unit/resources/group_test.rb index 4c9c63691..cb11bc01f 100644 --- a/test/unit/resources/group_test.rb +++ b/test/unit/resources/group_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/groups' describe 'Inspec::Resources::Group' do diff --git a/test/unit/resources/groups_test.rb b/test/unit/resources/groups_test.rb index 328cceff7..4295d3659 100644 --- a/test/unit/resources/groups_test.rb +++ b/test/unit/resources/groups_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/groups' describe 'groups resource on unix platform' do let(:resource) { MockLoader.new(:ubuntu1404).load_resource('groups') } diff --git a/test/unit/resources/grub_conf_test.rb b/test/unit/resources/grub_conf_test.rb index 64df67b5c..af97feace 100644 --- a/test/unit/resources/grub_conf_test.rb +++ b/test/unit/resources/grub_conf_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/grub_conf' describe 'Inspec::Resources::GrubConfig' do diff --git a/test/unit/resources/host_test.rb b/test/unit/resources/host_test.rb index e8773de9e..0198a156b 100644 --- a/test/unit/resources/host_test.rb +++ b/test/unit/resources/host_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/host' describe 'Inspec::Resources::Host' do diff --git a/test/unit/resources/http_test.rb b/test/unit/resources/http_test.rb index 201c8a22b..744fbdd5a 100644 --- a/test/unit/resources/http_test.rb +++ b/test/unit/resources/http_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/http' require "faraday_middleware/response/follow_redirects" describe 'Inspec::Resources::Http' do diff --git a/test/unit/resources/iis_app_pool_test.rb b/test/unit/resources/iis_app_pool_test.rb index f1a517141..e178c8307 100644 --- a/test/unit/resources/iis_app_pool_test.rb +++ b/test/unit/resources/iis_app_pool_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/iis_app_pool' describe 'Inspec::Resources::IisAppPool' do it 'verify default app pool settings' do diff --git a/test/unit/resources/iis_site_test.rb b/test/unit/resources/iis_site_test.rb index 022300b9d..0ba97672c 100644 --- a/test/unit/resources/iis_site_test.rb +++ b/test/unit/resources/iis_site_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/iis_site' describe 'Inspec::Resources::IisSite' do it 'verify Default Web Site settings' do diff --git a/test/unit/resources/inetd_conf_test.rb b/test/unit/resources/inetd_conf_test.rb index 6ceb2e148..4827274e3 100644 --- a/test/unit/resources/inetd_conf_test.rb +++ b/test/unit/resources/inetd_conf_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/inetd_conf' describe 'Inspec::Resources::InetdConf' do it 'verify limits.conf config parsing' do diff --git a/test/unit/resources/ini_test.rb b/test/unit/resources/ini_test.rb index 1a1d4cdce..3964300be 100644 --- a/test/unit/resources/ini_test.rb +++ b/test/unit/resources/ini_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/ini' describe 'Inspec::Resources::Ini' do diff --git a/test/unit/resources/interface_test.rb b/test/unit/resources/interface_test.rb index b8e80b0a9..ae3d1bff5 100644 --- a/test/unit/resources/interface_test.rb +++ b/test/unit/resources/interface_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/interface' describe 'Inspec::Resources::Interface' do diff --git a/test/unit/resources/iptables_test.rb b/test/unit/resources/iptables_test.rb index a2936dea7..a6cbd3e99 100644 --- a/test/unit/resources/iptables_test.rb +++ b/test/unit/resources/iptables_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/iptables' describe 'Inspec::Resources::Iptables' do diff --git a/test/unit/resources/json_test.rb b/test/unit/resources/json_test.rb index c86d33c8e..54e986f12 100644 --- a/test/unit/resources/json_test.rb +++ b/test/unit/resources/json_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/json' describe 'Inspec::Resources::JSON' do describe 'when loading a valid json' do diff --git a/test/unit/resources/kernel_module_test.rb b/test/unit/resources/kernel_module_test.rb index aa1274c08..f78706a42 100644 --- a/test/unit/resources/kernel_module_test.rb +++ b/test/unit/resources/kernel_module_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/kernel_module' describe 'Inspec::Resources::KernelModule' do diff --git a/test/unit/resources/kernel_parameter_test.rb b/test/unit/resources/kernel_parameter_test.rb index 996424232..5cd5b4e55 100644 --- a/test/unit/resources/kernel_parameter_test.rb +++ b/test/unit/resources/kernel_parameter_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/kernel_parameter' describe 'Inspec::Resources::KernelParameter' do it 'verify kernel_parameter parsing' do diff --git a/test/unit/resources/key_rsa_test.rb b/test/unit/resources/key_rsa_test.rb index 9a97221a0..7c3341218 100644 --- a/test/unit/resources/key_rsa_test.rb +++ b/test/unit/resources/key_rsa_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/key_rsa' describe 'Inspec::Resources::RsaKey' do let (:resource_key) { load_resource('key_rsa', 'test_certificate.rsa.key.pem')} diff --git a/test/unit/resources/ksh_test.rb b/test/unit/resources/ksh_test.rb index d65598800..89fc881a7 100644 --- a/test/unit/resources/ksh_test.rb +++ b/test/unit/resources/ksh_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/ksh' describe Inspec::Resources::Ksh do let(:x) { rand.to_s } diff --git a/test/unit/resources/limits_conf_test.rb b/test/unit/resources/limits_conf_test.rb index 117a1df82..b3fd7603f 100644 --- a/test/unit/resources/limits_conf_test.rb +++ b/test/unit/resources/limits_conf_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/limits_conf' describe 'Inspec::Resources::LimitsConf' do it 'verify limits.conf config parsing' do diff --git a/test/unit/resources/login_def_test.rb b/test/unit/resources/login_def_test.rb index 446fcf6a3..d59f70217 100644 --- a/test/unit/resources/login_def_test.rb +++ b/test/unit/resources/login_def_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/login_defs' # TODO: rename file describe 'Inspec::Resources::LoginDef' do it 'verify login.def config parsing' do diff --git a/test/unit/resources/mount_test.rb b/test/unit/resources/mount_test.rb index bfe10f4a9..3de04c16a 100644 --- a/test/unit/resources/mount_test.rb +++ b/test/unit/resources/mount_test.rb @@ -1,6 +1,8 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/file' # TODO: rename this test file? +require 'inspec/resources/mount' describe Inspec::Resources::FileResource do let(:root_resource) { load_resource('mount', '/') } diff --git a/test/unit/resources/mssql_session_test.rb b/test/unit/resources/mssql_session_test.rb index bd81d401a..940b24970 100644 --- a/test/unit/resources/mssql_session_test.rb +++ b/test/unit/resources/mssql_session_test.rb @@ -1,5 +1,7 @@ require 'helper' +require 'inspec/resource' +require 'inspec/resources/mssql_session' describe 'Inspec::Resources::MssqlSession' do it 'verify default mssql_session configuration' do diff --git a/test/unit/resources/mysql_conf_test.rb b/test/unit/resources/mysql_conf_test.rb index dfbcb1c92..998b6bb71 100644 --- a/test/unit/resources/mysql_conf_test.rb +++ b/test/unit/resources/mysql_conf_test.rb @@ -1,5 +1,7 @@ require 'helper' +require 'inspec/resource' +require 'inspec/resources/mysql_conf' describe 'Inspec::Resources::MysqlConf' do it 'verify mysql.conf config parsing' do diff --git a/test/unit/resources/mysql_session_test.rb b/test/unit/resources/mysql_session_test.rb index 7647cb87e..0ddecb1a9 100644 --- a/test/unit/resources/mysql_session_test.rb +++ b/test/unit/resources/mysql_session_test.rb @@ -1,5 +1,7 @@ require 'helper' +require 'inspec/resource' +require 'inspec/resources/mysql_session' describe 'Inspec::Resources::MysqlSession' do it 'verify mysql_session escaped login details with single quotes correctly' do diff --git a/test/unit/resources/nginx_conf_test.rb b/test/unit/resources/nginx_conf_test.rb index dec954e76..a40abf94e 100644 --- a/test/unit/resources/nginx_conf_test.rb +++ b/test/unit/resources/nginx_conf_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/nginx_conf' describe 'Inspec::Resources::NginxConf' do # None of these tests currently work correctly on windows. See the diff --git a/test/unit/resources/nginx_test.rb b/test/unit/resources/nginx_test.rb index b8bd25c93..703b90b21 100644 --- a/test/unit/resources/nginx_test.rb +++ b/test/unit/resources/nginx_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/nginx' describe 'Inspec::Resources::Nginx' do describe 'NGINX Methods' do diff --git a/test/unit/resources/npm_test.rb b/test/unit/resources/npm_test.rb index c10a2acce..be8c3d7f6 100644 --- a/test/unit/resources/npm_test.rb +++ b/test/unit/resources/npm_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/npm' describe 'Inspec::Resources::Npm' do it 'verify npm package detail parsing' do diff --git a/test/unit/resources/ntp_conf_test.rb b/test/unit/resources/ntp_conf_test.rb index 51b4c1f95..9ac98bd68 100644 --- a/test/unit/resources/ntp_conf_test.rb +++ b/test/unit/resources/ntp_conf_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/ntp_conf' describe 'Inspec::Resources::NtpConf' do it 'verify ntp config parsing' do diff --git a/test/unit/resources/oneget_test.rb b/test/unit/resources/oneget_test.rb index 1d44bbcca..dad344527 100644 --- a/test/unit/resources/oneget_test.rb +++ b/test/unit/resources/oneget_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/oneget' describe 'Inspec::Resources::OneGet' do diff --git a/test/unit/resources/oracledb_session_test.rb b/test/unit/resources/oracledb_session_test.rb index 884549c65..828f6827d 100644 --- a/test/unit/resources/oracledb_session_test.rb +++ b/test/unit/resources/oracledb_session_test.rb @@ -1,5 +1,7 @@ require 'helper' +require 'inspec/resource' +require 'inspec/resources/oracledb_session' describe 'Inspec::Resources::OracledbSession' do it 'verify oracledb_session configuration' do diff --git a/test/unit/resources/os_env_test.rb b/test/unit/resources/os_env_test.rb index 9c4c46781..550c56c9f 100644 --- a/test/unit/resources/os_env_test.rb +++ b/test/unit/resources/os_env_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/os_env' describe 'Inspec::Resources::OsEnv' do it 'verify env parsing' do diff --git a/test/unit/resources/os_test.rb b/test/unit/resources/os_test.rb index e0052df6c..98435c7f3 100644 --- a/test/unit/resources/os_test.rb +++ b/test/unit/resources/os_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/os' describe 'Inspec::Resources::Os' do it 'verify os parsing on CentOS' do diff --git a/test/unit/resources/package_test.rb b/test/unit/resources/package_test.rb index 2a246553d..85aeec3b3 100644 --- a/test/unit/resources/package_test.rb +++ b/test/unit/resources/package_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/package' describe 'Inspec::Resources::Package' do # arch linux diff --git a/test/unit/resources/packages_test.rb b/test/unit/resources/packages_test.rb index 34d3ba6c3..c65879ff8 100644 --- a/test/unit/resources/packages_test.rb +++ b/test/unit/resources/packages_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/packages' describe 'Inspec::Resources::Packages' do it 'verify packages resource' do diff --git a/test/unit/resources/parse_config_test.rb b/test/unit/resources/parse_config_test.rb index f7108f2f4..a1090332e 100644 --- a/test/unit/resources/parse_config_test.rb +++ b/test/unit/resources/parse_config_test.rb @@ -1,5 +1,6 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/parse_config' describe 'Inspec::Resources::ParseConfig' do diff --git a/test/unit/resources/passwd_test.rb b/test/unit/resources/passwd_test.rb index 2c38c7885..574b9fb6d 100644 --- a/test/unit/resources/passwd_test.rb +++ b/test/unit/resources/passwd_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/passwd' describe 'Inspec::Resources::Passwd' do let(:passwd) { load_resource('passwd') } diff --git a/test/unit/resources/pip_test.rb b/test/unit/resources/pip_test.rb index d0b6101cd..7ce878430 100644 --- a/test/unit/resources/pip_test.rb +++ b/test/unit/resources/pip_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/pip' describe 'Inspec::Resources::Pip' do it 'verify pip package detail parsing' do diff --git a/test/unit/resources/platform_test.rb b/test/unit/resources/platform_test.rb index 5e752dbff..f040bbaa0 100644 --- a/test/unit/resources/platform_test.rb +++ b/test/unit/resources/platform_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/platform' describe 'Inspec::Resources::Platform' do let(:resource) { resource = MockLoader.new(:ubuntu1504).load_resource('platform') } diff --git a/test/unit/resources/port_linuxports_test.rb b/test/unit/resources/port_linuxports_test.rb index 6721b60f5..25a2e9f25 100644 --- a/test/unit/resources/port_linuxports_test.rb +++ b/test/unit/resources/port_linuxports_test.rb @@ -1,5 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/port' +require 'inspec/utils/parser' class TestLinuxPorts < Minitest::Test def setup diff --git a/test/unit/resources/port_test.rb b/test/unit/resources/port_test.rb index ee70ddf65..15f423e16 100644 --- a/test/unit/resources/port_test.rb +++ b/test/unit/resources/port_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/port' describe 'Inspec::Resources::Port' do it 'verify port on Ubuntu 14.04' do diff --git a/test/unit/resources/postgres_conf_test.rb b/test/unit/resources/postgres_conf_test.rb index 315bbbabc..4d9e9b280 100644 --- a/test/unit/resources/postgres_conf_test.rb +++ b/test/unit/resources/postgres_conf_test.rb @@ -1,5 +1,7 @@ require 'helper' +require 'inspec/resource' +require 'inspec/resources/postgres_conf' describe 'Inspec::Resources::Postgres' do it 'verify postgresql.conf config parsing of a simple key value' do diff --git a/test/unit/resources/postgres_hba_conf_test.rb b/test/unit/resources/postgres_hba_conf_test.rb index 5c8966a12..dfde6e106 100644 --- a/test/unit/resources/postgres_hba_conf_test.rb +++ b/test/unit/resources/postgres_hba_conf_test.rb @@ -2,6 +2,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/postgres_hba_conf' describe 'Inspec::Resources::PGHbaConf' do describe 'PGHbaConf Paramaters' do diff --git a/test/unit/resources/postgres_ident_conf_test.rb b/test/unit/resources/postgres_ident_conf_test.rb index f9afa9dec..4deee8bff 100644 --- a/test/unit/resources/postgres_ident_conf_test.rb +++ b/test/unit/resources/postgres_ident_conf_test.rb @@ -1,6 +1,8 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/postgres_ident_conf' +require 'inspec/resources/directory' describe 'Inspec::Resources::PGIdentConf' do describe 'PGIdentConf Paramaters' do diff --git a/test/unit/resources/postgres_session_test.rb b/test/unit/resources/postgres_session_test.rb index 5a1e999d2..964627a1d 100644 --- a/test/unit/resources/postgres_session_test.rb +++ b/test/unit/resources/postgres_session_test.rb @@ -1,5 +1,7 @@ require 'helper' +require 'inspec/resource' +require 'inspec/resources/postgres_session' describe 'Inspec::Resources::PostgresSession' do it 'verify postgres_session create_psql_cmd with a basic query' do diff --git a/test/unit/resources/powershell_test.rb b/test/unit/resources/powershell_test.rb index 8c7bf0617..e2b65bda4 100644 --- a/test/unit/resources/powershell_test.rb +++ b/test/unit/resources/powershell_test.rb @@ -1,8 +1,9 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/powershell' -describe 'Inspec::Resources::PowershellScript' do +describe 'Inspec::Resources::Powershell' do let(:base64_command) { # Encoded version of `$ProgressPreference='SilentlyContinue';Get-Help` 'JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwA' \ diff --git a/test/unit/resources/processes_test.rb b/test/unit/resources/processes_test.rb index 92b6da18e..ccbd26783 100644 --- a/test/unit/resources/processes_test.rb +++ b/test/unit/resources/processes_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/processes' describe 'Inspec::Resources::Processes' do it 'handles empty process results' do diff --git a/test/unit/resources/rabbitmq_conf_test.rb b/test/unit/resources/rabbitmq_conf_test.rb index eaa38d2f5..d9f17b511 100644 --- a/test/unit/resources/rabbitmq_conf_test.rb +++ b/test/unit/resources/rabbitmq_conf_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/rabbitmq_config' describe 'Inspec::Resources::RabbitmqConf' do diff --git a/test/unit/resources/registry_key_test.rb b/test/unit/resources/registry_key_test.rb index 08530d6b0..fcf8e2ad2 100644 --- a/test/unit/resources/registry_key_test.rb +++ b/test/unit/resources/registry_key_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/registry_key' describe 'Inspec::Resources::RegistryKey' do it 'read reg key with human readable name' do diff --git a/test/unit/resources/security_identifier_test.rb b/test/unit/resources/security_identifier_test.rb index 8f229cc3e..a1a6712c2 100644 --- a/test/unit/resources/security_identifier_test.rb +++ b/test/unit/resources/security_identifier_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/security_identifier' describe 'Inspec::Resources::SecurityIdentifier' do it 'returns a SID for an existing user' do diff --git a/test/unit/resources/security_policy_test.rb b/test/unit/resources/security_policy_test.rb index 3746fe695..bc81e0052 100644 --- a/test/unit/resources/security_policy_test.rb +++ b/test/unit/resources/security_policy_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/security_policy' describe 'Inspec::Resources::SecurityPolicy' do it 'verify processes resource' do diff --git a/test/unit/resources/service_test.rb b/test/unit/resources/service_test.rb index f773bf242..f28837711 100644 --- a/test/unit/resources/service_test.rb +++ b/test/unit/resources/service_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/service' require 'hashie' describe 'Inspec::Resources::Service' do diff --git a/test/unit/resources/shadow_test.rb b/test/unit/resources/shadow_test.rb index dc6082689..9b524f0d0 100644 --- a/test/unit/resources/shadow_test.rb +++ b/test/unit/resources/shadow_test.rb @@ -1,6 +1,6 @@ - require 'helper' require 'inspec/resource' +require 'inspec/resources/shadow' describe 'Inspec::Resources::Shadow' do let(:shadow) { load_resource('shadow') } diff --git a/test/unit/resources/ssh_conf_test.rb b/test/unit/resources/ssh_conf_test.rb index 71d622701..52de9d781 100644 --- a/test/unit/resources/ssh_conf_test.rb +++ b/test/unit/resources/ssh_conf_test.rb @@ -1,8 +1,9 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/ssh_config' -describe 'Inspec::Resources::SshConf' do +describe 'Inspec::Resources::SshConfig' do describe 'ssh_config' do it 'check ssh config parsing' do diff --git a/test/unit/resources/ssl_test.rb b/test/unit/resources/ssl_test.rb index db638d489..490b656e0 100644 --- a/test/unit/resources/ssl_test.rb +++ b/test/unit/resources/ssl_test.rb @@ -1,6 +1,7 @@ - require 'helper' require 'inspec/resource' +require 'inspec/resources/ssl' +require 'sslshake' describe 'Inspec::Resources::SSL' do it 'verify cipher enabled' do diff --git a/test/unit/resources/sys_info_test.rb b/test/unit/resources/sys_info_test.rb index eb30f6e50..3d01cfe17 100644 --- a/test/unit/resources/sys_info_test.rb +++ b/test/unit/resources/sys_info_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/sys_info' describe 'Inspec::Resources::SysInfo' do describe 'sys_info' do diff --git a/test/unit/resources/toml_test.rb b/test/unit/resources/toml_test.rb index 4d2963960..c2f671349 100644 --- a/test/unit/resources/toml_test.rb +++ b/test/unit/resources/toml_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/toml' describe 'Inspec::Resources::TOML' do describe 'when loading valid TOML' do diff --git a/test/unit/resources/user_test.rb b/test/unit/resources/user_test.rb index c92b8f713..7a389649e 100644 --- a/test/unit/resources/user_test.rb +++ b/test/unit/resources/user_test.rb @@ -1,6 +1,8 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/users' +require 'inspec/resources/command' describe 'Inspec::Resources::User' do diff --git a/test/unit/resources/vbscript_test.rb b/test/unit/resources/vbscript_test.rb index 0b2598f16..e638ec600 100644 --- a/test/unit/resources/vbscript_test.rb +++ b/test/unit/resources/vbscript_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/vbscript' describe 'Inspec::Resources::VbScript' do diff --git a/test/unit/resources/virtualization_test.rb b/test/unit/resources/virtualization_test.rb index 4a657a725..1ee9b98f0 100644 --- a/test/unit/resources/virtualization_test.rb +++ b/test/unit/resources/virtualization_test.rb @@ -1,6 +1,8 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/file' +require 'inspec/resources/virtualization' describe 'Inspec::Resources::Virtualization' do def mock_proc(mocked_files) @@ -14,6 +16,7 @@ describe 'Inspec::Resources::Virtualization' do it 'fails the resource if OS is not Linux' do mocked_files = [] mock_loader = MockLoader.new(:windows) + mock_loader.backend.stub :file, mock_proc(mocked_files) do mock_resource = mock_loader.load_resource('virtualization') mock_resource.resource_failed?.must_equal true diff --git a/test/unit/resources/windows_feature_test.rb b/test/unit/resources/windows_feature_test.rb index 00b0a1a85..8622f8bd1 100644 --- a/test/unit/resources/windows_feature_test.rb +++ b/test/unit/resources/windows_feature_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/windows_feature' describe 'Inspec::Resources::WindowsFeature' do it 'can retrieve feature info using PowerShell' do diff --git a/test/unit/resources/windows_hotfix_test.rb b/test/unit/resources/windows_hotfix_test.rb index d909ac900..003e4be8e 100644 --- a/test/unit/resources/windows_hotfix_test.rb +++ b/test/unit/resources/windows_hotfix_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/windows_hotfix' describe 'Inspec::Resources::WindowsHotfix' do diff --git a/test/unit/resources/windows_task_test.rb b/test/unit/resources/windows_task_test.rb index 06984cf41..cc2345659 100644 --- a/test/unit/resources/windows_task_test.rb +++ b/test/unit/resources/windows_task_test.rb @@ -1,5 +1,6 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/windows_task' describe 'Inspec::Resources::WindowsTasks' do it 'verify parsing a windows task that does not exist' do diff --git a/test/unit/resources/wmi_test.rb b/test/unit/resources/wmi_test.rb index 9cb16da7c..926d25e36 100644 --- a/test/unit/resources/wmi_test.rb +++ b/test/unit/resources/wmi_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/wmi' describe 'Inspec::Resources::WMI' do diff --git a/test/unit/resources/x509_certificate_test.rb b/test/unit/resources/x509_certificate_test.rb index 7450dc4da..053a3f8a8 100644 --- a/test/unit/resources/x509_certificate_test.rb +++ b/test/unit/resources/x509_certificate_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/x509_certificate' describe 'Inspec::Resources::X509Certificate' do let (:resource_cert) { diff --git a/test/unit/resources/xinetd_test.rb b/test/unit/resources/xinetd_conf_test.rb similarity index 98% rename from test/unit/resources/xinetd_test.rb rename to test/unit/resources/xinetd_conf_test.rb index e0369b621..8295352ae 100644 --- a/test/unit/resources/xinetd_test.rb +++ b/test/unit/resources/xinetd_conf_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/xinetd_conf' describe 'Inspec::Resources::XinetdConf' do let(:resource) { load_resource('xinetd_conf') } diff --git a/test/unit/resources/xml_test.rb b/test/unit/resources/xml_test.rb index b50f50049..f469b352c 100644 --- a/test/unit/resources/xml_test.rb +++ b/test/unit/resources/xml_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/xml' require 'rexml/document' describe 'Inspec::Resources::XML' do diff --git a/test/unit/resources/yaml_test.rb b/test/unit/resources/yaml_test.rb index 38fe8623d..1e6b294eb 100644 --- a/test/unit/resources/yaml_test.rb +++ b/test/unit/resources/yaml_test.rb @@ -1,6 +1,9 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/yaml' +require 'inspec/resource' +require 'inspec/resources/yaml' describe 'Inspec::Resources::YAML' do describe 'when loading a valid yaml' do diff --git a/test/unit/resources/yum_test.rb b/test/unit/resources/yum_test.rb index 79874ad24..7bcf54a00 100644 --- a/test/unit/resources/yum_test.rb +++ b/test/unit/resources/yum_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/yum' describe 'Inspec::Resources::YumRepo' do it 'get repository details' do diff --git a/test/unit/resources/zfs_dataset_test.rb b/test/unit/resources/zfs_dataset_test.rb index 748bacde7..dc8292156 100644 --- a/test/unit/resources/zfs_dataset_test.rb +++ b/test/unit/resources/zfs_dataset_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/zfs_dataset' describe Inspec::Resources::ZfsDataset do let(:loader) { MockLoader.new(:freebsd10) } diff --git a/test/unit/resources/zfs_pool_test.rb b/test/unit/resources/zfs_pool_test.rb index e853df8a4..233012ee1 100644 --- a/test/unit/resources/zfs_pool_test.rb +++ b/test/unit/resources/zfs_pool_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'inspec/resource' +require 'inspec/resources/zfs_pool' describe Inspec::Resources::ZfsPool do let(:loader) { MockLoader.new(:freebsd10) } diff --git a/test/unit/runner_test.rb b/test/unit/runner_test.rb index d452c6540..9199e6772 100644 --- a/test/unit/runner_test.rb +++ b/test/unit/runner_test.rb @@ -2,6 +2,7 @@ require 'helper' require 'inspec/secrets' +require 'inspec/runner' describe Inspec::Runner do let(:runner) { Inspec::Runner.new({ command_runner: :generic }) } diff --git a/test/unit/utils/bsd_mount_parser_test.rb b/test/unit/utils/bsd_mount_parser_test.rb index 23e85ade1..c0d780024 100644 --- a/test/unit/utils/bsd_mount_parser_test.rb +++ b/test/unit/utils/bsd_mount_parser_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/utils/parser' describe BsdMountParser do let (:parser) { Class.new() { include BsdMountParser }.new } diff --git a/test/unit/utils/database_helpers_test.rb b/test/unit/utils/database_helpers_test.rb index b4a2207f2..b69e0b92c 100644 --- a/test/unit/utils/database_helpers_test.rb +++ b/test/unit/utils/database_helpers_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/utils/database_helpers' describe DatabaseHelper do describe DatabaseHelper::SQLColumn do diff --git a/test/unit/utils/filter_array_test.rb b/test/unit/utils/filter_array_test.rb index 16e3266a6..a4136b2c2 100644 --- a/test/unit/utils/filter_array_test.rb +++ b/test/unit/utils/filter_array_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/utils/filter_array' describe FilterArray do let (:data) {[ diff --git a/test/unit/utils/find_files_test.rb b/test/unit/utils/find_files_test.rb index 07f4e27b1..cb731f98d 100644 --- a/test/unit/utils/find_files_test.rb +++ b/test/unit/utils/find_files_test.rb @@ -1,5 +1,7 @@ - require 'helper' +require 'inspec/utils/find_files' +require 'inspec/resources/command' + describe FindFiles do let (:helper) do diff --git a/test/unit/utils/object_traversal_test.rb b/test/unit/utils/object_traversal_test.rb index 7f89da43f..6f4992ed5 100644 --- a/test/unit/utils/object_traversal_test.rb +++ b/test/unit/utils/object_traversal_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/utils/object_traversal' class Tester include ObjectTraverser diff --git a/test/unit/utils/passwd_parser_test.rb b/test/unit/utils/passwd_parser_test.rb index 710259dab..49723d9a4 100644 --- a/test/unit/utils/passwd_parser_test.rb +++ b/test/unit/utils/passwd_parser_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/utils/parser' describe PasswdParser do let (:parser) { Class.new() { include PasswdParser }.new } diff --git a/test/unit/utils/simpleconfig_test.rb b/test/unit/utils/simpleconfig_test.rb index fe3f598b9..689e0b01e 100644 --- a/test/unit/utils/simpleconfig_test.rb +++ b/test/unit/utils/simpleconfig_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/utils/simpleconfig' describe 'SimpleConfig Default Parser' do it 'should parse an empty string' do diff --git a/test/unit/utils/solaris_netstat_parser_test.rb b/test/unit/utils/solaris_netstat_parser_test.rb index fce9cf0a2..64566eecd 100644 --- a/test/unit/utils/solaris_netstat_parser_test.rb +++ b/test/unit/utils/solaris_netstat_parser_test.rb @@ -1,5 +1,5 @@ - require 'helper' +require 'inspec/utils/parser' describe SolarisNetstatParser do let (:parser) { Class.new() { include SolarisNetstatParser }.new }