Commit graph

2360 commits

Author SHA1 Message Date
Sonu Saha
6ee21986bb
Backport-6410: Dependent profiles fix for any scheme of version used in profiles (#6471)
* CFINSPEC-580 Dependent profiles fix for any scheme of version used in profiles (#6410)

* Dependent profiles fix for any scheme of version used in profiles

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Dependent profile fix when version is blank in dependent profiles

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* LINT: Fix lint offense

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* Remove tests for enhanced outcomes and resource_ids

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* Add missing changes for test fixtures

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Co-authored-by: Nikita Mathur <Nik08@users.noreply.github.com>
2023-10-11 09:07:52 -04:00
Sonu Saha
7926e906d8
REMOVE: Remove resource_id, we do not support in inspec-4 (#6774)
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
2023-10-09 12:30:33 -04:00
Nikita Mathur
8e6395e037
BACKPORT 6262: Prevent negative status from crashing launchd service resource (#6751)
* Prevent negative status from crashing launchd service resource (#6262)

Signed-off-by: dtheyer <davidheyer2016@gmail.com>

Signed-off-by: dtheyer <davidheyer2016@gmail.com>

* Add missing resource_id for service resource

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* Rebase with inspec-4 to get hab pipeline changes

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

---------

Signed-off-by: dtheyer <davidheyer2016@gmail.com>
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Co-authored-by: dtheyer <davidheyer2016@gmail.com>
Co-authored-by: Sonu Saha <sonu.saha@progress.com>
2023-10-09 10:27:28 -04:00
Nikita Mathur
1fd3b273b8
Backport 6351: Upgraded mock Ubuntu fixture to latest LTS version (#6457)
* Upgraded mock ubuntu test from 20.04 to 22.04

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Revert resource_id introduction and update test;
We do not support resource id in inspec-4

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
Co-authored-by: Sonu Saha <sonu.saha@progress.com>
2023-10-04 16:22:09 -04:00
Nikita Mathur
ffca66096f
CHEF-642 Fix for inspec exec fails with git fetcher if current directory does not have .git directory (#6626) (#6750)
* Functional Test to verify git fetcher able to work in a directory where git is not initialized or does not contain the .git directory



* Fix: If git branch, tag or reference information is not given it should clone the repo and checkout the default HEAD



* Remove the logic to find default branch in case of branch, tag or ref is not provided as it's not required logically as we will be cloning the and checkout the default HEAD



* This is a temporary change to make verify test working on this PR. Revert once the work is done for the git fetcher fix



* Unit Test: Fix unit test



* Verifies the git url before creating cache_key, if given relative path does not exist make sure it deletes the cache directory created to copy the cloned repo. It raises error if any git command fails



* Reverted verify git repo url call from cache_key as cache_key and shifted that to resolve_ref which is already raising the error in case of git ls remote command fails



* Unit test to cover the changes done for resolve_ref when branch, tag or ref is not given and
unit test for invalid git repo



---------

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>
Co-authored-by: Vasundhara Jagdale <vasundhara.jagdale@chef.io>
2023-10-01 20:29:51 +05:30
Nikita Mathur
bd53153287
Backport 6741: Changed params usage in inspec archive to skip evaluation (#6742)
* Using metadata to fetch basic info as name and version required in archive

Signed-off-by: Nik08 <nikita.mathur@progress.com>

* Typo fixes

Signed-off-by: Nik08 <nikita.mathur@progress.com>

---------

Signed-off-by: Nik08 <nikita.mathur@progress.com>
2023-09-30 20:36:41 +05:30
Vasundhara Jagdale
96750dea83
Fix env smoke test by updating ERB.new in inspec env; add additional test (#6342) (#6740)
* Failing test for Ruby 3.1 - ERB.new call options changed



* Fix for Ruby 3.1 by using named params to ERB.new



* Restrict test to non-windows systems



* Restrict test to non-windows systems

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2023-09-30 15:32:38 +05:30
Clinton Wolfe
a5e29a842f
CHEF-6422 Modify inspec archive to not check or export by default (#6659) (#6720)
* make profile check optional



* Clarify error message when making inspec check optional



* Add test fixture profile that emits evaluation markers on stderr



* Make export to inspec.json optional, not enabled by default



* Add test confirming non-evaluative archive



* Fix failing plugin search test, failing since we published a new test gem



---------

Signed-off-by: Sathish <sbabu@progress.com>
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Sathish Babu <80091550+sathish-progress@users.noreply.github.com>
2023-09-30 02:35:52 -04:00
Nikita Mathur
fa1d9354e7
Use Ruby 3.1 for InSpec 4; Drop EOL 2.7 (#6713)
* Verify pipeline tests upgraded to ruby 3.1

Signed-off-by: Nik08 <nikita.mathur@progress.com>

* Removed unused test fixtures of older ruby version

Signed-off-by: Nik08 <nikita.mathur@progress.com>

* Updates test fixtures from ruby 2.7 to ruby 3.0 & 3.1

Signed-off-by: Nik08 <nikita.mathur@progress.com>

* Habitat package upgrade to ruby 31

Signed-off-by: Nik08 <nikita.mathur@progress.com>

* Upgraded omnibus ruby version to ruby 3.1

Signed-off-by: Nik08 <nikita.mathur@progress.com>

* Update ruby gem version in expeditor verify

Signed-off-by: Nik08 <nikita.mathur@progress.com>

* Update ruby gem version to ruby 3.3.3 in expeditor verify

Signed-off-by: Nik08 <nikita.mathur@progress.com>

* add ruby test 3.1 in verify pipeline (#5892)

* add ruby test 3.1 in verify pipeline

Signed-off-by: jayashri garud <jgarud@msystechnologies.com>

* updating rubygem to 3.3.3

Signed-off-by: jayashri garud <jgarud@msystechnologies.com>

* Test fixture plugin files for ABI 3.1.0

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Use kwargs to match new calling style for ERB in ruby 2.7 and 3.0

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Allow Date and Time data types, needed for waivers, since safe load is now the default for YAML

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Use Time.parse, not Time.new since the rules tightened for what you can pass the constructor for waiver dates

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Add ruby platform debug message to test parallel output

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Conditionalize permitted_classes in inputs yaml_load for <= 3.1.x only

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* In ruby 3.1.0 net/pop3 is no more a default gem and that will require us to add it in Gemfile so trying with the byebug gem which we are bundling already

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* CFINSPEC-166 Updated url fetcher to handle Net::OpenTimeout Exception on Windows

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Inputs test fix as fixed in vasundhara/ruby-3-support

Signed-off-by: Nik08 <nikita.mathur@progress.com>

---------

Signed-off-by: Nik08 <nikita.mathur@progress.com>
Co-authored-by: jayashrig158 <61735743+jayashrig158@users.noreply.github.com>
Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Vasu1105 <vasundhara.jagdale@chef.io>
2023-09-29 19:14:27 -04:00
Nikita Mathur
a214c3fdc4
YAML reporter test fix (#6563) (#6715)
* Fix for yaml reporter data, not matching empty values with spaces



* Additional comment to document affecting fields



---------

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2023-09-29 14:21:59 +05:30
Sonu Saha
265e2a5db6
Fix Windows CI by not installing html-proofer for Ruby < 3.0 (#6496)
* Resolve html-proofer issue for Ruby 2.7

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* Update test to pass on windows
the tests are taken care on main

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

* LINT: Add newline after guard clause

Signed-off-by: Sonu Saha <sonu.saha@progress.com>

---------

Signed-off-by: Sonu Saha <sonu.saha@progress.com>
2023-04-04 09:59:43 -04:00
Vasundhara Jagdale
9ffca7b353
Backport #6257 inspec-4 (#6281)
* Oracle DB session resource compatibility with AIX-Cshell

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

* Fixes in oracledb session unit test using oracle_query_string

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>

Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
Co-authored-by: Nikita Mathur <nikita.mathur@chef.io>
2022-10-20 14:09:55 -04:00
Sathish Babu
0aa626bb27
resolves inspec/inspec#6042 (#6043) (#6282)
Signed-off-by: Marijus Ravickas <marijus.ravickas@gmail.com>

Signed-off-by: Marijus Ravickas <marijus.ravickas@gmail.com>

Signed-off-by: Marijus Ravickas <marijus.ravickas@gmail.com>
Co-authored-by: Marijus Ravickas <marijus.ravickas@gmail.com>
2022-10-20 14:09:31 -04:00
Nikita Mathur
6f963048a0 Pinning minitest to 5.15.0 to fix build issue
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-06-27 17:42:21 -04:00
Nikita Mathur
7668329aa5 Test case added for verifying running of same profile with different versions
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-06-27 17:42:18 -04:00
Clinton Wolfe
655e28cad9
Merge pull request #6131 from inspec/vasundhara/fix-test-failures-on-inspec-4-branch
Backport-6123 test failure fixes.
2022-06-27 16:26:31 -04:00
Vasu1105
a1115a6385 Fixes azure connection test
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-09 10:47:04 +05:30
Sonu Saha
07626cb5c0 CFINSPEC-291: Add windows test for process without path
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
2022-06-08 17:34:52 -04:00
Sonu Saha
a48758b040 CFINSPEC-291: Remove byebugs and noise
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
2022-06-08 17:34:52 -04:00
Sonu Saha
4b0cf9003f CFINSPEC-291: Fix test according to changes introduced in processes
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
2022-06-08 17:34:52 -04:00
Vasu1105
33624303f9 CFINSPEC-250: Fix for inspec json command does not populate the attribues/inputs for the profile
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-05-12 10:52:34 -04:00
Sonu Saha
91dbc80061 Issue-5809: Fix for service resource on amazon linux
Commented out unit test for Amazon 1 Linux

Signed-off-by: Sonu Saha <sonu.saha@progress.com>
2022-04-27 21:03:53 -04:00
Vasu1105
75381f547d CFINSPEC-181: Fix unable to upload inspec compliance profile using to Chef Automate.
Add --with-cookstyle option to inspec check command to disable cookstyle check as default

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-04-18 17:50:52 -04:00
Clinton Wolfe
814259f3a4
Merge pull request #5943 from inspec/cw/backport-oracle-empty-query-fix-inspec-4
Backport Oracle session resource fix when empty results and zero rows
2022-03-23 14:03:23 -04:00
Nikita Mathur
f5950f1e5e Oracle session resource fix when empty results and zero rows
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-03-23 10:59:34 -04:00
Vasu1105
fe344e98ea CFINSPEC-154: Updates postgres_session resource to raise exception only in case of connection and authentication error and allow any errors in query to be fetched using output property(keeping earlier behaviour).
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-23 10:53:04 -04:00
Sathish
6451f844ae fix style
Signed-off-by: Sathish <sbabu@progress.com>
2022-03-11 14:49:44 -05:00
Sathish
01811074e8 remove unused args
Signed-off-by: Sathish <sbabu@progress.com>
2022-03-11 14:49:44 -05:00
Sathish
4098fc2f93 add self to the local instance method
Signed-off-by: Sathish <sbabu@progress.com>
2022-03-11 14:49:44 -05:00
Clinton Wolfe
db85994b42 Add tests for lazy_instance
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2022-03-11 14:49:44 -05:00
Will Dower
d0e13b48f7 changed array style at chefstyle's request
Signed-off-by: Will Dower <wdower@mitre.org>
2022-03-10 15:50:21 -05:00
Will Dower
d00ce2c194 updated docs for resource
Signed-off-by: Will Dower <wdower@mitre.org>
2022-03-10 15:49:39 -05:00
Will Dower
513b743ce6 add
Signed-off-by: Will Dower <wdower@mitre.org>
2022-03-10 15:48:54 -05:00
Daniel Tingstrom
ebea7f9771 Fix boolean methods to include a '?'
Signed-off-by: Daniel Tingstrom <dtingstrom@mitre.org>
2022-03-10 15:45:12 -05:00
Daniel Tingstrom
3b1c85076c Update firewalld resource to include more properties
Signed-off-by: Daniel Tingstrom <dtingstrom@mitre.org>
2022-03-10 15:45:12 -05:00
Vasu1105
1dc1c29dde Fix lint
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-10 14:28:02 -05:00
Vasu1105
f283dfba26 Skip the test on Windows uuid generation using helper method in test generates blank string on Windows due to which it fails
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-10 14:27:47 -05:00
Vasu1105
52da5ea4ee Skip aws test as it looking for credentials.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-10 14:27:35 -05:00
Vasu1105
a35e3ba17f CFINSPEC-68: Fix aws test
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-10 14:27:24 -05:00
Vasu1105
e291f09bc1 CFINSPEC-68 Fix test
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-10 14:27:08 -05:00
Nikita Mathur
f609a3b7a9 cassandra unit test fix for windows
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-03-03 09:39:53 -05:00
Clinton Wolfe
a9960f9b81
Merge pull request #5829 from inspec/nm/streaming-reporters
CFINSPEC-9 Added support for streaming reporters
2022-02-09 04:19:39 -05:00
Clinton Wolfe
6d04576331
Merge pull request #5828 from inspec/vasundhara/fix_sestatus_command_for_amazon_linux
CFINSPEC-30 Fix sestatus command not found error on Amazon Linux 2
2022-02-09 04:10:31 -05:00
Clinton Wolfe
c065e923c3
Merge pull request #5782 from inspec/nm/kernel-params
CFINSPEC-3 Added kernel_parameters resource
2022-02-09 03:52:01 -05:00
Vasu1105
0d7f2c11fd Updated the condition to only verify the amazon linux os.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-02-08 14:04:22 +05:30
Clinton Wolfe
042e813623 Configure SimpleCov to no longer use at_exit hack; use JSON reporter
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2022-02-06 22:09:38 -05:00
Nikita Mathur
edddb92f76 Basic test case added for streaming reporter plugin type
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-02-04 17:28:09 +05:30
Clinton Wolfe
9d671d3d37 Revert "Remove unused coveralls hooks from test helper"
This reverts commit c61e70b75b.
2022-02-03 11:54:31 -05:00
Clinton Wolfe
cd4f0b59a0
Merge pull request #5816 from inspec/vasundhara/allow-core-resource-inheritance
CFINSPEC-15 Allows inheritance of core resource into the custom resource.
2022-02-01 16:11:44 -05:00
Vasu1105
e26ef71a6b adds test for core resource iheritance in custom resource
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-02-01 15:16:12 +05:30