inspec/test
Vasundhara Jagdale 95c17d4e7f
CHEF-3849: InSpec should exit quickly and clearly if waiver file is malformed/corrupt (#6644)
* Functional test for malformed waiver file

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Raise error for malformed yaml content and exit

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Updates functional test for malformed yaml waiver file and for empty waiver file

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Raises error in case of missing required parameters in waiver file

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Update functional test for missing parameters, extra parameters or column without headers in waiver file

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Fix linting

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Fix warning and error messages

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Updates nil and false check for yaml data and adds additional empty check.

Co-authored-by: Sathish Babu <80091550+sathish-progress@users.noreply.github.com>
Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Adds more generic message as this yaml reader is now getting used by other functionalities like waiver file

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Fixed test description to reflect correct use case

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Fix validate headers was not validating the required parametes for all the data fields as it was not called inside the loop where we are iterating over the data and fetching the headers.

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Updates the test files for the use case to missing parameters and extra parameters

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Updates code to better handle errors and warnings related to missing required parameters and extra parameters in waivers file in all format i.e (yaml, json and csv).

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Updated functional test to capture the updated error and warning messages for waiver file validation

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Fix linting

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Deleted fixture file which is not required

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Refactor: Renamed method validate_headers to reflect whats it's doing and instead of return data in array it will now return the data in hash

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

---------

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>
Co-authored-by: Sathish Babu <80091550+sathish-progress@users.noreply.github.com>
2023-09-12 10:36:40 -04:00
..
artifact CFINSPEC-533: Fix undefined method 'summary' for Gem::SourceFetchProblem (NoMethodError) when airgapped (#6337) (#6434) 2023-02-24 17:47:19 +05:30
fixtures CHEF-3849: InSpec should exit quickly and clearly if waiver file is malformed/corrupt (#6644) 2023-09-12 10:36:40 -04:00
functional CHEF-3849: InSpec should exit quickly and clearly if waiver file is malformed/corrupt (#6644) 2023-09-12 10:36:40 -04:00
helpers Add nftables resources (#6499) (#44) 2023-05-17 20:45:57 -04:00
integration Removed aws and azure resources, unit and integration tests 2022-03-10 19:24:52 +05:30
kitchen Add nftables resources (#6499) (#44) 2023-05-17 20:45:57 -04:00
unit CHEF-642 Fix for inspec exec fails with git fetcher if current directory does not have .git directory (#6626) 2023-08-31 20:06:24 +05:30
helper.rb UNIT_TESTS: update yaml reporter test for Ruby 3+ 2022-05-09 10:15:15 +03:00