The linter found staticcheck and errorcheck issues. Deferred statements now use join to combine any new error with an existing one, preventing error information from being lost. Other minor error checks, like for printing text and flushing data have also been addressed.
This commit adds an ability to use HTTP headers for config-reference,
ca-reference and file-contents structures. This can be useful when a
remote server requires authentication and we have to provide a token
in the header.
Do some cleanup of the tests. Remove bits that were meant to mimic
Container Linux's disk layout. Make the root partition smaller.
Runs about 25% faster now.
Fix use of size/start instead of sizeMiB/startMiB. Fix partition table
to have an empty space before/after partition 9 instead of another
partition. This was causing the test to fail (negative test, ignition
incorrectly succeeded) since it was looking to verify partition 9 was as
large as possible/started at the begining on the largest available
block. With a partition before/after this was actually true, now with
blank space before/after it is not and Ignition fails corrects.
- Tests whether a proxy is used when set
- Tests that we error when connectivity to a proxy fails
- Tests to make sure no proxy is honored
Signed-off-by: Dale Ragan <dale.ragan@sap.com>
Bumps the import path to be `github.com/coreos/ignition/v2`, this is
required to be able to import the v2 of Ignition alongside v0 in other
repositories.
Filesystem entries should not use symlinks that are defined in the
config. These will fail or give the wrong results anyway.
Add unit tests for this.
Remove tests that used to fail that now fail at validation time.
- Make storage.files.append a list of FileContents not a bool
- First create the file specified by contents, then append all contents
in append in the order they are specified
- Appended chunks now cannot change uid/gid/mode
- Remove tests that no longer apply
Add ForceFileCreationNoOverwrite() which tests that Ignition fails if
a file already exists where one has been requested to be written,
without "overwrite": true in the Ignition config.
Tests functionality to fix #604.
Update all the blackbox tests to use the new filesystem semantics. Also
remove some ones for the "oem://" URL scheme since we're going to remove
that as well.
Drop the networkd section from spec 3.0. networkd is not as widespread
as systemd and everything done in this section can be accomplished in
the files section.
Fixes #638
Verify that the last element of fs entries' paths is not followed when
resolving paths.
Test that we dont overwrite dead links when overwrite is false.
Add tests to ensure relative and absolute symlinks are resolved
correctly as if they were rooted in their filesystem when on the root
filesystem. Ensure symlinks trying to leave the specified filesystem
fail for non-root filesystems.
Some tests are the same as others, only differing
by the config version. BB tests are being
registered as all compatible config versions
and therefore not removing these tests will lead
to the execution of identical tests.
Updated test structs to include a ConfigMinVersion and removed
all versions in test.Config. These changes make writing BB tests
less painful.
The Golang HTTP server automatically logs to stdout if no error logger
is present. This causes TLS handshake errors to be spewed out during
negative test runs. Adds a custom logger to the negative tests
HTTPServer which uses an `ioutil.Discard` writer.