Commit graph

5342 commits

Author SHA1 Message Date
Nikita Mathur
c79c89836c Fix for dependent profiles with same name but different version to run and display
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-06-27 17:45:02 -04:00
jayashrig158
542b9cc246 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>
2022-06-14 16:07:08 +05:30
Nikita Mathur
6eb5df2e49 Skip parallel exec tests on windows
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-06-14 15:17:02 +05:30
Nikita Mathur
d8fd959af5 Fix test cases in inspec parallel tests
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2022-06-14 13:46:34 +05:30
Nikita Mathur
f04a31d822
CFINSPEC-120 inspec parallel feature (#5975)
* Initial commit - Inspec parallel setup

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

* Added dry run option functionality and renamed subcommand

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

* Runner logic parsing options file and executing cmds

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

* Validation logic changes for dry run and run commands

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

* Validator bug fix when using options like --sudo with no value

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

* initial commit for using default options

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

* Logic to not parse empty lines and comments and some cleanup

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

* Functional test cases added

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

* Test cases fix and bug fix in validator

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

* Add logic to append default options passed from cli

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

* Add test for default options and extend options-file-1.txt

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

* Add comments in options-file-2 and 3

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

* Bug fix and some refactoring

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

* Changes from pair programming

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

* Fixed incorrect line no used in dry run validation & added verbose option

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

* Initial code with parallel gem setup

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

* Error handling and some changes in parallel running result

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

* Working spawn and fork implementation; no pipes or error handling

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

* CFINSPEC-143 Child status reporter plugin

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

* Read status from children using pipes; Windows implementation is likely broken

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

* Linting

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

* Removed parallel gem and it's code usage

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

* Erb templating and option file as shell/powershell option added

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

* Added missing raise error in content reading logic

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

* Adding for the sake of keeping bash file syntax correct

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

* Switch to select() polling, enabling Windows support; also add a terrible hack to the child-status reporter

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

* Move child-status reporter into inspec-parallel plugin to reduce pollution

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

* Rename a bunch of things, remove some instance variables, always validate, and use Inspec::UI exit codes

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

* Rework validation to be Thor-based; add logic to inject child-status reporter

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

* Linting

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

* Refactor parent UI to make it object oriented

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

* Add a prototype 'status' super-reporter

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

* Improve status UI edge cases, add info to output, make default

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

* Error handling added when running bash instead of system check

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

* Daemon run for background process in unix system for parallel runs

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

* Added logic to cleanup daemon process'

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

* Review changes for background command name and windows handling

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

* Error raised with error handling class for options file

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

* Fix to not intialise ui when background run is opted

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

* typo fix in child reporter append logic in validator

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

* Changes to trap control c and exit gracefully

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

* Moved ctl c handling code to command class

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

* Linter fixes

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

* Error and runner logging added

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

* ERB pid option to use child process id for generating result output

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

* Renamed 38125 to Process.pid for clear notation

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

* Log path option added for inspec parallel

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

* Adjust ERB eval

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

* STDERR logging added

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

* Fix of --bg with ui

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

* Deleting log files if empty and status super reporter to show done

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

* Docs for InSpec Parallel

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

* Doc Review

Signed-off-by: Deepa Kumaraswamy <dkumaras@progress.com>

* Grammar corrections

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

Co-authored-by: Sonu Saha <sonu.saha@progress.com>
Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
Co-authored-by: Deepa Kumaraswamy <dkumaras@progress.com>
2022-06-13 13:58:41 -04:00
Clinton Wolfe
873b2e1bcf Manual version bump
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2022-06-13 13:47:17 -04:00
Chef Expeditor
79d3a6e342 Bump version to 5.18.3 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2022-06-10 20:43:59 +00:00
Chef Expeditor
07107cdcd1 Bump version to 5.18.2 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2022-06-09 11:40:22 +00:00
Vasu1105
62405e261d Fixed Lint/DuplicateMethods: Method Inspec::Resources::Service#resource_id is defined at both
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-09 16:19:59 +05:30
Chef Expeditor
7da11de098 Bump version to 5.18.1 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2022-06-08 21:33:00 +00:00
Clinton Wolfe
29ef063833
Merge pull request #6100 from inspec/ss/fix-processes-on-windows
CFINSPEC-291: Fix `processes` resource to consider processes without `path` on Windows
2022-06-08 17:32:00 -04:00
Chef Expeditor
406636f22a Bump version to 5.18.0 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2022-06-08 21:08:29 +00:00
Clinton Wolfe
610e7aacea
Merge pull request #5995 from inspec/vasundhara/sign-profile-binary-format
CFINSPEC-167: Profile Signing Rollup
2022-06-08 17:07:27 -04:00
Chef Expeditor
625bb9b0e0 Bump version to 5.17.18 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2022-06-08 20:19:21 +00:00
Chef Expeditor
293d8e76de Bump version to 5.17.17 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2022-06-08 20:16:48 +00:00
Chef Expeditor
980fabf35c Bump version to 5.17.16 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2022-06-08 20:14:48 +00:00
Clinton Wolfe
6385ea9f74
Merge pull request #6126 from inspec/vasundhara/group_2_resource_id
Adds resource_id to group 2  resources
2022-06-08 16:14:45 -04:00
Clinton Wolfe
b0c1373d64
Merge pull request #6119 from inspec/vasundhara/group_1_resource_id_fix
CFINSPEC-262 - Handle resource_id in error situation
2022-06-08 16:13:38 -04:00
Clinton Wolfe
1d0118df86
Merge pull request #6118 from inspec/ss/fix-resource_id-nil-case
Handle resource_id in error situations
2022-06-08 16:12:41 -04:00
Chef Expeditor
27ec207255 Bump version to 5.17.15 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2022-06-08 20:12:31 +00:00
Clinton Wolfe
dd258e3926
Merge pull request #6115 from inspec/nm/add-resource-id-group-10
CFINSPEC 271 Group10 - Added resource_id in resources
2022-06-08 16:11:42 -04:00
Clinton Wolfe
37eee62150
Merge pull request #6112 from inspec/vasundhara/group12_add_resource_id
CFINSPEC-273 Adds resource_id group 12
2022-06-08 16:10:41 -04:00
Chef Expeditor
19900b7be5 Bump version to 5.17.14 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2022-06-08 20:10:26 +00:00
Clinton Wolfe
00b396b8fe
Merge pull request #6111 from inspec/vasundhara/group9_resource_ids
CFINSPEC-270 Adds resource_id group9
2022-06-08 16:09:15 -04:00
Chef Expeditor
83d58dddae Bump version to 5.17.13 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2022-06-08 20:08:04 +00:00
Clinton Wolfe
0ae8f52c19
Merge pull request #6110 from inspec/ss/add-resource-ids-group-11
CFINSPEC-272: resource_ids group 11
2022-06-08 16:07:42 -04:00
Clinton Wolfe
092cf8090f
Merge pull request #6109 from inspec/nm/add-resource-id-group-4
CFINSPEC-265  Group 4 - Added resource_id in resources
2022-06-08 16:06:50 -04:00
Chef Expeditor
a5695c7d21 Bump version to 5.17.12 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2022-06-08 20:05:12 +00:00
Clinton Wolfe
3f9b234160
Merge pull request #6108 from inspec/nm/add-resource-id-group-3
CFINSPEC-264 Group 3 - Added resource_id in resources
2022-06-08 16:05:09 -04:00
Clinton Wolfe
9076dd6626
Merge pull request #6107 from inspec/vasundhara/group8_resource_ids
CFINSPEC-269 Adds resource_id group 8
2022-06-08 16:03:56 -04:00
Clinton Wolfe
39744335c5
Merge pull request #6106 from inspec/ss/add-resource-ids-group-13
CFINSPEC-274: resource_ids group 13
2022-06-08 16:02:16 -04:00
Chef Expeditor
b0070eaa0d Bump version to 5.17.11 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2022-06-08 20:02:02 +00:00
Vasu1105
24f1fb18b6 CFINSPEC-263 Adds resource_id for cron resource and unit test for the same
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 14:58:46 +05:30
Vasu1105
78d1eb61be CFINSPEC-263 Adds resource_id to chocolatey_package, chrony_conf, command, cpan, cran, csv, dh_params resource and unit test for the same.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 14:58:24 +05:30
Vasu1105
55ecbc4f21 CFINSPEC-262 - Handle resource_id in error situation
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 13:54:47 +05:30
Vasu1105
7f581f083d CFINSPEC-273 Adds resource_id to user, vbscript, virtualization, windows_feature, windows_firewall, windows_firewall_rule, windows_hotfix, windows_task and unit test for the same.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 13:53:25 +05:30
Vasu1105
1b0eaf765f CFINSPEC-270 Adds resource_id to os, os_env, package, parse_config, parse_config_file, pip, platform, postfix_conf, postgres_conf, postgres_session resource and unit test for the same
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 13:52:40 +05:30
Vasu1105
5d47334735 CFINSPEC-269 Adds resource_id for npm, ntp_conf, oneget, opa_api, opa_cli resource and unit test for the same
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 13:52:16 +05:30
Vasu1105
14d5be2d20 CFINSPEC-268 Adds resource_id for ibmdb2_conf, ibmdb2_session, nginx, nginx_conf, noop and unit test for the same. Updated resource_id generation for mount and mysql_conf resource.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 13:46:54 +05:30
Vasu1105
d2ebb270f4 CFINSPEC-268 Adds resource_id to mongodb_conf, mongodb_session, mount, mssql_session, mysql_conf resource and unit test for the same.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 13:46:54 +05:30
Vasu1105
1b546526c3 Fix linting error
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 12:27:43 +05:30
Vasu1105
8f995a3c8f CFINSPEC-340 Handle inspec exec to work with change in the headers and fixes the failing test
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 11:10:34 +05:30
Vasu1105
5bdc877951 Fix the other database resource for the argument errpr
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 10:43:41 +05:30
Vasu1105
c91d1e858d Fix for error in the verify pipeline for Windows test
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 10:43:41 +05:30
Vasu1105
04d93db068 CFINSPEC-340 Adds usage header line in the signed profile
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-06-08 10:35:16 +05:30
Chef Expeditor
a136554c97 Bump version to 5.17.10 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2022-06-08 04:57:19 +00:00
Sonu Saha
868e3b3528 CFINSPEC-272: Handle case of nil or error resource_id
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
2022-06-06 13:03:20 +05:30
Sonu Saha
51d3717885 CFINSPEC-274: Handle case of nil or error resource_id
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
2022-06-06 11:58:43 +05:30
Sonu Saha
94a2c10cff Handle case of nil resource_id
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
2022-06-06 11:49:33 +05:30
Sonu Saha
97d34e9d1c CFINSPEC-272: Handle case of nil resource_id: sybase_conf
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
2022-06-06 10:22:57 +05:30