Quick and Easy server testing/validation
Full Changelog: https://github.com/goss-org/goss/compare/v0.4.4...v0.4.6
Full Changelog: https://github.com/goss-org/goss/compare/v0.4.3...v0.4.4
Full Changelog: https://github.com/goss-org/goss/compare/v0.4.2...v0.4.3
Full Changelog: https://github.com/goss-org/goss/compare/v0.4.1...v0.4.2
Full Changelog: https://github.com/goss-org/goss/compare/v0.4.0...v0.4.1
Thanks to all the contributors who have helped with this.
Summary:
echo "3"
is less than 5.v4 introduced the ability to compare different types and more advanced string matching. See matchers section in the manual for more information.
For example:
command:
echo_test:
# command that outputs JSON, but this could be anything, http response, command output, etc
exec: |
echo '{"string_value": "15"}'
exit-status: 0
stdout:
# advanced string parsing
gjson:
# extract "string_value"
string_value:
and:
# The value is numerically <= 20 (auto type conversion)
- le: 20
# The value is numerically 15
- 15
# Equal does a strict check, the types have to match, hence string_value is "15" but not 15
- equal: "15"
- not: {equal: 15}
This conversion also allows treating an io.Reader (memory efficient line-by-line parsing) as a whole string (when compared with a string). This has the benefit of showing the full command output, which was a long-requested feature. For example:
$ cat goss.yaml
command:
echo_test:
exec: |
echo 'hello world'
exit-status: 0
stdout: |
goodbye world
$ goss v
.F
Failures/Skipped:
Command: echo_test: stdout:
Expected
"hello world\n"
to equal
"goodbye world\n"
Total Duration: 0.001s
Count: 2, Failed: 1, Skipped: 0
file.Contains
-> file.Contents
-qf "%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}
), this opens the door for proper rpm version comparison in the futureuser.Groups
) duplicate entries will raise an error if they don't exist in the system.In goss 3.X this would succeed:
user:
xxx:
exists: true
groups:
- foo
- wheel
- wheel
Now it will throw an error unless groups actually contain 2 copies of "wheel" in its response array from the system.
You can mimic the old behavior by modifying the test as follows:
user:
xxx:
exists: true
groups:
and:
- contain-element: foo
- contain-element: wheel
- contain-element: wheel
For example, this no longer works:
command:
echo "123":
exit-status: 0
stdout:
- 123
New way:
command:
echo "123":
exit-status: 0
stdout:
- "123"
-o include_raw
will show the non-transformed valueequal
matcher added to do strict type comparison (e.x. string to string)contain-substring
have-patterns
- This mimics the existing default behavior of file contents and command outputcontain-elements
- checks that an array value matches a set of matcherscat -E /proc/<PID>/comm
to avoid whitespace issues (closes #762)matcher.as-reader
this allows the matcher string to behave as an io.Reader output. Can be useful for testingjson_online
output format, use: goss v -f json -o oneline
vfs-opts
support (#826)Special thanks to @matsuo for fixing the darwin/windows alpha release process
Summary:
echo "3"
is less than 5.vfs-opts
(#826)
mount.opts
breaking change when upgrading from v0.3.Xv4 introduced the ability to compare different types and more advanced string matching. See matchers section in the manual for more information.
For example:
command:
echo_test:
# command that outputs JSON, but this could be anything, http response, command output, etc
exec: |
echo '{"string_value": "15"}'
exit-status: 0
stdout:
# advanced string parsing
gjson:
# extract "string_value"
string_value:
and:
# The value is numerically <= 20 (auto type conversion)
- le: 20
# The value is numerically 15
- 15
# Equal does a strict check, the types have to match, hence string_value is "15" but not 15
- equal: "15"
- not: {equal: 15}
This conversion also allows treating an io.Reader (memory efficient line-by-line parsing) as a whole string (when compared with a string). This has the benefit of showing the full command output, which was a long-requested feature. For example:
$ cat goss.yaml
command:
echo_test:
exec: |
echo 'hello world'
exit-status: 0
stdout: |
goodbye world
$ goss v
.F
Failures/Skipped:
Command: echo_test: stdout:
Expected
"hello world\n"
to equal
"goodbye world\n"
Total Duration: 0.001s
Count: 2, Failed: 1, Skipped: 0
file.Contains
-> file.Contents
-qf "%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}
), this opens the door for proper rpm version comparison in the futureuser.Groups
) duplicate entries will raise an error if they don't exist in the system.In goss 3.X this would succeed:
user:
xxx:
exists: true
groups:
- foo
- wheel
- wheel
Now it will throw an error unless groups actually contain 2 copies of "wheel" in its response array from the system.
You can mimic the old behavior by modifying the test as follows:
user:
xxx:
exists: true
groups:
and:
- contain-element: foo
- contain-element: wheel
- contain-element: wheel
For example, this no longer works:
command:
echo "123":
exit-status: 0
stdout:
- 123
New way:
command:
echo "123":
exit-status: 0
stdout:
- "123"
-o include_raw
will show the non-transformed valueequal
matcher added to do strict type comparison (e.x. string to string)contain-substring
have-patterns
- This mimics the existing default behavior of file contents and command outputcontain-elements
- checks that an array value matches a set of matcherscat -E /proc/<PID>/comm
to avoid whitespace issues (closes #762)matcher.as-reader
this allows the matcher string to behave as an io.Reader output. Can be useful for testingjson_online
output format, use: goss v -f json -o oneline
Summary:
echo "3"
is less than 5.vfs-opts
(#826)
mount.opts
breaking change when upgrading from v0.3.Xv4 introduced the ability to compare different types and more advanced string matching. See matchers section in the manual for more information.
For example:
command:
echo_test:
# command that outputs JSON, but this could be anything, http response, command output, etc
exec: |
echo '{"string_value": "15"}'
exit-status: 0
stdout:
# advanced string parsing
gjson:
# extract "string_value"
string_value:
and:
# The value is numerically <= 20 (auto type conversion)
- le: 20
# The value is numerically 15
- 15
# Equal does a strict check, the types have to match, hence string_value is "15" but not 15
- equal: "15"
- not: {equal: 15}
This conversion also allows treating an io.Reader (memory efficient line-by-line parsing) as a whole string (when compared with a string). This has the benefit of showing the full command output, which was a long-requested feature. For example:
$ cat goss.yaml
command:
echo_test:
exec: |
echo 'hello world'
exit-status: 0
stdout: |
goodbye world
$ goss v
.F
Failures/Skipped:
Command: echo_test: stdout:
Expected
"hello world\n"
to equal
"goodbye world\n"
Total Duration: 0.001s
Count: 2, Failed: 1, Skipped: 0
file.Contains
-> file.Contents
-qf "%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}
), this opens the door for proper rpm version comparison in the futureuser.Groups
) duplicate entries will raise an error if they don't exist in the system.In goss 3.X this would succeed:
user:
xxx:
exists: true
groups:
- foo
- wheel
- wheel
Now it will throw an error unless groups actually contain 2 copies of "wheel" in its response array from the system.
You can mimic the old behavior by modifying the test as follows:
user:
xxx:
exists: true
groups:
and:
- contain-element: foo
- contain-element: wheel
- contain-element: wheel
For example, this no longer works:
command:
echo "123":
exit-status: 0
stdout:
- 123
New way:
command:
echo "123":
exit-status: 0
stdout:
- "123"
-o include_raw
will show the non-transformed valueequal
matcher added to do strict type comparison (e.x. string to string)contain-substring
have-patterns
- This mimics the existing default behavior of file contents and command outputcontain-elements
- checks that an array value matches a set of matcherscat -E /proc/<PID>/comm
to avoid whitespace issues (closes #762)matcher.as-reader
this allows the matcher string to behave as an io.Reader output. Can be useful for testingjson_online
output format, use: goss v -f json -o oneline
Summary:
echo "3"
is less than 5.v4 introduced the ability to compare different types and more advanced string matching. See matchers section in manual for more information.
For example:
command:
echo_test:
# command that outputs JSON, but this could be anything, http response, command output, etc
exec: |
echo '{"string_value": "15"}'
exit-status: 0
stdout:
# advanced string parsing
gjson:
# extract "string_value"
string_value:
and:
# The value is numerically <= 20 (auto type conversion)
- le: 20
# The value is numerically 15
- 15
# Equal does a strict check, the types have to match, hence string_value is "15" but not 15
- equal: "15"
- not: {equal: 15}
This conversion also allows treating an io.Reader (memory efficient line-by-line parsing) as a whole string (when compared with a string). This has the benefit of showing the full command output, which was a long-requested feature. For example:
$ cat goss.yaml
command:
echo_test:
exec: |
echo 'hello world'
exit-status: 0
stdout: |
goodbye world
$ goss v
.F
Failures/Skipped:
Command: echo_test: stdout:
Expected
"hello world\n"
to equal
"goodbye world\n"
Total Duration: 0.001s
Count: 2, Failed: 1, Skipped: 0
file.Contains
-> file.Contents
-qf "%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}
), this opens the door for proper rpm version comparison in the futureuser.Groups
) duplicate entries will raise an error if they don't exist in the system.In goss 3.X this would succeed:
user:
xxx:
exists: true
groups:
- foo
- wheel
- wheel
Now it will throw an error unless groups actually contain 2 copies of "wheel" in its response array from the system.
You can mimic the old behavior by modifying the test as follows:
user:
xxx:
exists: true
groups:
and:
- contain-element: foo
- contain-element: wheel
- contain-element: wheel
For example, this no longer works:
command:
echo "123":
exit-status: 0
stdout:
- 123
New way:
command:
echo "123":
exit-status: 0
stdout:
- "123"
-o include_raw
will show the non-transformed valueequal
matcher added to do strict type comparison (e.x. string to string)contain-substring
have-patterns
- This mimics the existing default behavior of file contents and command outputcontain-elements
- checks that an array value matches a set of matcherscat -E /proc/<PID>/comm
to avoid whitespace issues (closes #762)matcher.as-reader
this allows the matcher string to behave as an io.Reader output. Can be useful for testingjson_online
output format, use: goss v -f json -o oneline
Many thanks to all the contributors on this release!
dgoss
- Add support for podman
as the container backend (#748)http
- add proxy support (#589)http
- add method
and request-body
, allowing testing POST, PUT, etc.. (#647)file
- add sha512
support (#652)dcgoss
- add support for passing CLI flags to docker-compose (#662)silent
output format (#656)serve
can now negotiate response's content-type via accept request header (#609) doc
dgoss
- Fix bug when GOSS_FILE is set and goss_wait.yaml is used (#645)http
- Host header works correctly as a request-header (#565)dgoss
- Honor ${GOSS_FILE} when copying back from container to host (#579)dgoss
- Collect the logs regardless of GOSS_FILE_STRATEGY (#582)http
Changed attribute header
-> headers
to be more consistentjson
output now supports -o pretty
and behaves like json_oneline
. json_oneline
will be deprecated in the futureaddr
- Add local-address
config attribute (#344)dns
- Modify server
attribute to support optional port server:port
(#378)dgoss
- docker logs
routed to stderr to not interfere with test output (#359)dgoss
- Allow retaining container logs $CONTAINER_LOG_OUTPUT
(#519)dgoss
- Allow overriding default goss file name using $GOSS_FILE
(#454)semver-constraint
matcher (#508)extras/
folder. kubectl wrapper to test containers in Kubernetes (#465)request-header
and response header
attributes added to http test (#496 / #498)usage
attribute to mount test (#503)toUpper
and toLower
function to templates (#505)exec
on command test no longer clutters command ID/test output (#495)exec
attribute to command testskip
attribute to all testsextras/
folder--format-options,-o
flag doc
--format nagios_verbose
becomes --format nagios -o verbose
:z
mount flag--format json_oneline
output #265service.override
file for upstrat (#245)have-key-with-value
gomega matcher--format silent
output (#216)regexMatch
function to templates (#219)have-key
function (#224)getent
for file owner/group lookup when uid/gid not in /etc/passwd (#210)getEnv
and readFile
functions to templates doc
--color
flag to force color modegoss render
now has a -d
debug flag to aid in template debugginggoss validate
and goss render
now support --vars
to provide template vars