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>
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>
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.
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>
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>
* 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>
Removes pre-loading and registration of resources by adding
method_missing to a couple key areas.
This still drops the ball in some areas, but it is a start.
Pass the first argument of the opts array instead of the whole array which
confuses the SimpleConfig parser. Also added a test which verifies this fixes
the issue.
In addition, change the base_name to something that matches other resource base
names.
Signed-off-by: Lance Albertson <lance@osuosl.org>
When using `schtasks` a list is returned if the task has multiple
triggers. This merges that list with the last item taking precedence.
This is how `Get-ScheduledTask` behaves.
Initially, I was going to rewrite this resource to use
`Get-ScheduledTask` but the original author purposely did not do this
so that PowerShell v3 would be supported. We only support PowerShell
v5, but I don't want to break any current users and this change didn't
seem to controversial to me.
If it gives us trouble, I recommend rewriting it to use
`Get-ScheduledTask`.
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
This should resolve#1011 which provides an ip6tables resource to test IPv6
iptables rules. This is essentially a copy of the iptables resource with a few
renames.
In addition, I've pulled in the integration tests for iptables into ip6tables
and enabled it on docker so that it properly gets tested regularly. The test
cookbook recipe has been updated to support all of the current platforms that
are being tested.
Signed-off-by: Lance Albertson <lance@osuosl.org>
This fixes `nginx_conf.params` when:
- Given an empty file
- Given a file with only comments
- Given a file that has an include for a file that:
- Is empty
- Has all lines commented out
This also fixes a test where a missing file is actually empty
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
This was the next most expensive require in the analysis.
Also rearranged the way that ui handled tables to be lazy.
```
% SLOW=1 time rake test:functional
before: Finished in 681.514579s, 0.5136 runs/s, 2.9919 assertions/s.
after : Finished in 642.655918s, 0.5446 runs/s, 3.1728 assertions/s.
```
Signed-off-by: Ryan Davis <zenspider@chef.io>
Sometime during the 2.x's, `at_exit` changed its ordering. As a result,
a lot of things that were stacking `at_exit`'s broke. This is one of
those since both simplecov and minitest do their thing via `at_exit`.
This switches to simplecov w/ no defaults on, then replicates their
simplecov/defaults.rb with our own.
I'm going to try to get that entire file back upstream but it can live
here for now.
Signed-off-by: Ryan Davis <zenspider@chef.io>