Commit graph

69 commits

Author SHA1 Message Date
Clinton Wolfe
77297cfef0
Merge pull request #5578 from elsnepal/aliyun3
Add aliyun3 support to service resource
2021-08-23 22:49:28 -04:00
Clinton Wolfe
dcf49ad510
Merge pull request #5601 from inspec/nm/bug-apache-conf
Fix apache_conf issue when Server Root is not present in configuration
2021-08-17 21:00:38 -04:00
Clinton Wolfe
e1f63cc7a5
Merge pull request #5592 from inspec/vasundhara/add_OPA_support
Add support for OPA: add resource opa_cli and opa_api
2021-07-27 22:47:23 -04:00
Nikita Mathur
aa888cf909 Build fix - virtulization test was failing
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-07-22 13:32:23 +05:30
Nikita Mathur
82db157c06 Apache conf doc changes for server root requirement and review changes
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-07-19 17:56:13 +05:30
Vasu1105
6ed14dc7de Fix lint
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-07-19 15:01:31 +05:30
Vasu1105
f0ca02a1c5 Adds unit test for opa_api and opa_cli resource
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-07-19 14:44:47 +05:30
Nikita Mathur
1e8363587e Test case to test apache_conf when server root is not configured
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-07-19 14:41:29 +05:30
Vasu1105
6bfc2fad2f Fixed failing specs
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-07-01 15:28:58 +05:30
Ashish Nepal
80b00794d5 add aliyun3 support 2021-06-26 20:30:57 +01:00
Vasu1105
da00e359aa Add mongodb_conf resource to InSpec
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-06-14 18:17:05 +05:30
Vasu1105
da75f0ce33 Removed old ubuntu version from mock_loader file as it's not getting used and added new version of Ubuntu in mock_loader file.
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-05-17 11:28:39 +05:30
Vasu1105
7990b31f5f Updated test to mock the newly added command
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-05-17 11:12:27 +05:30
Kannan Ramakrishnan
d1831a318c Lint errors handled. Signed-off-by: @kannanr <kannaa.ram@gmail.com> 2021-05-15 17:48:19 +05:30
Kannan Ramakrishnan
19c624cf38 Support zfs_pool and zfs_dataset resources on Linux. Handled #5075. Signed-off-by: @kannanr <kannaa.ram@gmail.com> 2021-05-15 12:18:39 +05:30
Vasu1105
a09fb159d3 Fix lintstyle
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-04-22 12:53:08 +05:30
Vasu1105
76dca7f97c Adds policy property, unit test and documentation for modules and booleans
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-04-22 11:40:32 +05:30
Vasu1105
58e30cfa81 Review comments fixed
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-04-21 11:43:03 +05:30
Vasu1105
c963b2ac14 fix linting
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-04-21 11:43:02 +05:30
Vasu1105
cbe7e8c03f Add selinux resource with basic features support
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-04-21 11:43:02 +05:30
Yoshi Yamaguchi
68aa7ca14b Change test to be consistent with the main implementation
Signed-off-by: Yoshi Yamaguchi <yoshifumi@google.com>
2021-03-19 17:37:06 +09:00
Clinton Wolfe
cdfb325ca3 Apply chefstyle -a, and manually remove duplicate requires
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-12-21 13:25:04 -05:00
Nick Schwaderer
c766519485
Merge pull request #5302 from yarick/yt/wildcart_support_platform_name
Added platform-name wildcard support
2020-12-03 13:17:02 +00:00
Alex Pop
9438c81a0f Fix mock sha256
Signed-off-by: Alex Pop <apop@chef.io>
2020-12-02 09:29:16 +00:00
superyarick
e7e196334a Merge remote-tracking branch 'upstream/master' into yt/wildcart_support_platform_name
Signed-off-by: superyarick <yarick@yarick.net>
2020-12-01 18:29:44 -05:00
Lance Albertson
a6cff007ed Fix Windows escaping of Windows package names
This resolves #5235 and supersedes #5238.

Instead of using `-match` use `-like` when querying the Windows registry. This
completely removes the problem of trying to clean the string for a regex and
just let's Powershell do that with `-like`.

I confirmed this works with the use case of having a package name such as
`Microsoft Visual C++ 2015-2019 Redistributable (x86) - 14.28.29325` work as-is
without any modification.

Signed-off-by: Lance Albertson <lance@osuosl.org>
2020-11-30 18:02:50 -08:00
superyarick
c653ce343a added platform-name wildcard support
added unit test for platform-name wildcard
added doc for release wildcard
added doc for platform-name wildcard

Signed-off-by: superyarick <yarick@yarick.net>
2020-11-08 15:24:43 -05:00
Raphael Geissert
b2e62b5b2f Run ps with an ulimited width on linux
On some systems the output of ps may be truncated, which may prevent
profiles from working as intended.

Some implementations specifically mention that the output width is
undefined "(it may be 80, unlimited, determined by the TERM variable,
and so on)".

This fixes #5226.

Signed-off-by: Raphael Geissert <atomo64@gmail.com>
2020-09-02 08:34:11 +02:00
Felipe Zipitria
d2ae7a7fbf
fix(osfamily): use corresponding family or name for bsd/freebsd
Signed-off-by: Felipe Zipitria <fzipitria@perceptyx.com>
2020-07-22 08:43:25 -03:00
Bryan McLellan
dada8ea074 Add the generic 'darwin' to the service resource
macOS 11 Big Sur will be released later this year. Current beta versions
return 10.16 as the version, but the product name has changed from 'Mac
OS X' to 'macOS'. Train probably needs to be modified to deprecate
'mac_os_x' as a platform in favor of 'macos' but that would be a
significant downstream change. Train does fall back to 'darwin' on macOS
10.16, so by adding darwin to the list of platform names for the service
resource we are able to work around this for the moment.

This is the only location where mac_os_x is currently being used in
InSpec. Because we're in a case statement on platform rather than the
more generic platform family, we can't simply remove mac_os_x in favor
of darwin.

Signed-off-by: Bryan McLellan <btm@loftninjas.org>
2020-07-02 09:36:27 -04:00
Clinton Wolfe
d9007588a6 Add an heuristic-based IP lookup property
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-18 15:37:19 -04:00
Clinton Wolfe
52468e470e Barebones plural interfaces resource
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-18 15:37:19 -04:00
Clinton Wolfe
a4000d6912 Adds support for interface on BSD and MacOS
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-18 15:37:19 -04:00
Ryan Davis
cc1393bb9a
Merge pull request #4822 from PiQuer/master
make command.exist? POSIX conform
2020-01-31 16:41:27 -08:00
Raimar Sandner
fa2f2c2caa make command.exist? POSIX conform
With the current implementation, on a Linux system without bash
command.exist? always returns false. 'sh -c' is guaranteed to exist on a
POSIX-conform system [1] whereas 'bash -c' only works if bash is
actually installed.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html

Obvious fix.
2020-01-19 00:05:33 +01:00
Michael Lihs
edd93eea81 Add support for yocto linux in service resource
Signed-off-by: Michael Lihs <michael.lihs@thoughtworks.com>
2020-01-18 01:26:16 +01:00
Ryan Davis
313f3462ca Cache MockLoader.connection.
Speeds up test/unit/profile/profile_context_test from 7-8s to 0.5s.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-12-31 15:27:12 -08:00
Felipe Zipitria
bff3fa960d
Add suport for freebsd package resource
Signed-off-by: Felipe Zipitria <fzipitria@perceptyx.com>
2019-12-17 08:39:43 -03:00
Mendy Baitelman
6baf0f8a1c Fix tests
Signed-off-by: Mendy Baitelman <mendy@baitelman.com>
2019-11-14 21:22:07 -08:00
Clinton Wolfe
1db2941a9e
Fix for invocation when calling npm under sudo (#4548)
Fix for invocation when calling npm under sudo
2019-11-12 16:01:07 -05:00
Ryan Davis
b1c2af209b Corresponding fixes for the move from test/unit/mock to test/fixtures.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-11-08 19:20:12 -08:00
Clinton Wolfe
f85de31292 Update test mock file to match invocation
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-11-07 15:39:08 -05:00
Miah Johnson
de4139aff8
Merge pull request #4568 from ramereth/yum-el8-support
Improve testing for yum.repo in CentOS 8
2019-10-31 14:13:05 -07:00
Miah Johnson
44579ab4b3
Merge pull request #4637 from inspec/mj/3921
Fix filesystem resource when device has long name
2019-10-24 13:24:23 -07:00
Lance Albertson
dab91a321a Improve testing for yum.repo in CentOS 8
The output for ``yum -v repolist all`` changes slightly in CentOS 8. There are
two specific changes:

1. EL8 is no longer trailing the repo name with release version and arch (i.e.
   base instead of base/7/x86)
2. EL8 no longer adds a trailing newline on the last repo and instead has a line
   with ``Total packages:``. This means the repo listed last will never show up.

A fix was introduced in #4566 however the tests still use CentOS 7 yum output
instead of dnf repolist output. One issue was still discovered where it was
including the ``Total packages`` line in the last repository. This includes a
regex for to work around that and fixes for the tests.

Signed-off-by: Lance Albertson <lance@osuosl.org>
2019-10-24 08:22:42 -07:00
Miah Johnson
8e31367b51 Use new mock loader, update the command name
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-10-23 21:42:10 -07:00
Ryan Davis
8d51d878f6 Fixed users resource when "Last password change" is "never".
Extended quick_resource to have platform methods and a new string
command mock. The named resource to mock may now be a symbol.

Added a new test that shows how to use quick_resource with multiple commands.

Fixes #4629.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-10-23 16:49:49 -07:00
Ryan Davis
fe34eb7869 Moved quick_resource and Fake helpers to test/helpers/resources.rb
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-10-16 16:54:07 -07:00
Ryan Davis
fc8ea79ad0 Fixed parsing yum output on centos8.
* Renamed and added extra test data to distinguish between centos 7 & centos 8.
* Renamed and added extra tests to cover centos 8.
* Fixed missing repo data by checking at the end if we were still in parse mode.

Fixes #4517

Signed-off-by: Ryan Davis <zenspider@chef.io>
Cc: Miah Johnson <miah@chia-pet.org>
2019-10-16 16:54:07 -07:00
Ryan Davis
f5bbfe5fac
Merge pull request #4365 from inspec/zenspider/the-need-for-speed
Make inspec much faster for most commands.
2019-09-09 18:02:10 -07:00