1
0
mirror of https://github.com/coreos/ignition.git synced 2026-02-07 03:47:55 +01:00
Commit Graph

63 Commits

Author SHA1 Message Date
yasminvalim
de452c404c fix: Handle unchecked error returns across the codebase and other linter issues
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.
2025-07-28 19:12:25 -03:00
Madhu Pillai
1f51620654 tests: update for new experimental spec 2024-10-14 15:33:52 +02:00
Steven Presti
62786092a2 tests/*/luks: add blackbox tests for luks
Fixes #1554
2024-06-13 16:37:48 -04:00
Benjamin Gilbert
af5ff516a6 tests: update for new experimental spec 2023-02-20 03:09:50 -05:00
Benjamin Gilbert
7814b85b5a Replace io/ioutil
It was deprecated in Go 1.16 and its functions moved elsewhere.
2022-08-09 19:04:31 -04:00
Jonathan Lebon
8f520621ee tree: update for stable v3.3.0 and new v3.4.0-experimental 2021-06-24 10:24:02 -04:00
Sohan Kunkerkar
4626200238 tests/*: verify deletion of block device w/o creating a FS 2021-05-05 09:18:31 -04:00
Sohan Kunkerkar
8fa7bf9864 *: fix errcheck warnings 2020-12-19 16:03:09 -05:00
Sohan Kunkerkar
548c250ce7 *: fix gosimple warnings
Fixes part of https://github.com/coreos/ignition/issues/1121
2020-12-07 18:14:58 -05:00
Stephen Lowrie
653fbe3e84 tests: update for spec stabilization 2020-09-28 23:33:14 -05:00
Sohan Kunkerkar
aeaae9a5bb tests/*: add test for resizing an existing partition 2020-09-15 14:58:40 -04:00
Sohan Kunkerkar
ba63698b56 Moving tls public/private keys into a separate package 2020-05-14 22:26:01 -04:00
Sohan Kunkerkar
693bae5d53 Add cabundle tests 2020-05-14 20:07:25 -04:00
Benjamin Gilbert
b5c21272bb tests: stabilize spec 3.1.0
Following instructions in development.md.
2020-05-03 01:44:34 -04:00
Benjamin Gilbert
cb0e8127b2 tests: bump invalid 2.x experimental version to match spec2x branch 2020-05-03 01:41:18 -04:00
Sohan Kunkerkar
61dbbd06f9 Add SHA-256 support for file verification 2020-04-29 11:21:07 -04:00
Mike Fedosin
dbdf013a10 Allow to specify HTTP headers for fetching configs and files
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.
2020-03-24 17:33:39 +01:00
Andrew Jeddeloh
d3e511392c tests: remove unused partitions, dead code
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.
2019-11-11 11:38:14 -08:00
Ignaz Forster
c0ababe90f Add test cases for file system mount options 2019-11-06 20:53:22 +01:00
Andrew Jeddeloh
e4539794be tests: fix bb tests for size/start 0
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.
2019-09-24 20:25:10 +02:00
Andrew Jeddeloh
d1563835bd tests/*: rename bb tests
Use dots and avoid non-alphanumeric characters. Try to group tests.
2019-05-02 13:05:53 -07:00
Andrew Jeddeloh
994142605a tests: add test for matching links 2019-04-24 14:21:29 -07:00
Dale Ragan
3bcd81de23 tests: Initial positive/negative tests
- 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>
2019-04-11 09:43:03 -07:00
Stephen Lowrie
bb6182a393 *: bump import path
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.
2019-04-09 12:40:08 -05:00
Andrew Jeddeloh
d3057d650c tests: don't fail on 3.1.0-experimental
Fail on 3.2.0-experimental instead
2019-04-04 15:13:20 -07:00
Andrew Jeddeloh
266bdd5738 config: validate fs entries dont use symlinks
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.
2019-03-29 15:21:42 -07:00
Andrew Jeddeloh
50d71e2f31 Merge pull request #778 from ajeddeloh/remove-size-start
Remove partition size and start
2019-03-29 14:47:41 -07:00
Andrew Jeddeloh
541e70eb20 tests: add test for file conflicts
Add a test to ensure we fail if two files' paths both resolve to the
same path after symlink resolution.
2019-03-28 14:57:50 -07:00
Andrew Jeddeloh
d52356d54f tests: change partitioning bb to use MiB
Change all the partitioning tests to use the startMiB/sizeMiB fields
instead of the deprecated start/size fields.
2019-03-28 13:04:01 -07:00
Andrew Jeddeloh
ca84f7ee8e *: stablize spec 3.0.0
Make 3.0.0-experimental into 3.0.0.
2019-03-25 14:38:23 -07:00
Andrew Jeddeloh
29090d2e15 tests: add bb test for invalid merged configs
Add blackbox test for failing when two configs get merged to create an
invalid one.
2019-03-25 11:54:25 -07:00
Andrew Jeddeloh
2fee724f92 config/v3_0_exp: rename config.append to merge
We aren't appending configs, we're merging them. Update the field name
to reflect that.
2019-03-22 09:51:51 -07:00
Andrew Jeddeloh
d66de83b95 config/v3_0_exp/types: rework storage.files.append
- 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
2019-03-19 11:47:03 -07:00
Robert Fairley
9b4b1ff559 tests/negative/files: add ForceFileCreationNoOverwrite
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.
2019-03-12 11:29:17 -04:00
Andrew Jeddeloh
2d487c4620 tests: move failing tests to negative
Some tests were written with the expectation they would fail with 3.0.0.
Move those to be negative tests.
2019-02-28 14:06:54 -08:00
Andrew Jeddeloh
45a8bd66d7 tests: add bb test for mounting with sylminks 2019-02-28 08:26:14 -08:00
Stephen Lowrie
0c088d6de7 *: drop OEM URI support
Fixes #647
2019-02-25 09:33:38 -06:00
Andrew Jeddeloh
50e53ca3f0 tests/*: update bb tests for new fs semantics
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.
2019-02-22 10:39:30 -08:00
Stephen Lowrie
e7e7aa2172 *: drop networkd section
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
2019-01-11 14:03:00 -06:00
Andrew Jeddeloh
36725699aa tests: update all versions to 3.0.0-experimental 2019-01-03 12:53:25 -08:00
Andrew Jeddeloh
91bab0c10f tests: add bb test for symlink resolution
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.
2018-12-05 16:08:11 -08:00
Andrew Jeddeloh
a065ced7a0 tests: update to include 2.4.0-experimental 2018-11-27 13:56:03 -08:00
Andrew Jeddeloh
fd88a0cb32 tests: add bb tests for symlink resolution
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.
2018-11-01 10:42:27 -07:00
rahuls0720
17a4fd60ee tests/bb: update configMinVersion to lowest compatible version 2018-08-13 13:42:50 -07:00
rahuls0720
5c9d58fa12 bb/tests: remove repetitive tests + update test structs
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.
2018-08-03 10:47:20 -07:00
Andrew Jeddeloh
4241d1c84d tests: add more tests for partitioning 2018-05-31 13:34:14 -07:00
Andrew Jeddeloh
24cb6dd2eb tests: move negative filesystems tests to own pkg
All the negative storage tests are for filesystems. Rename the package
before it becomes too big.
2018-05-15 11:24:22 -07:00
Derek Gonyeo
d3f7a1006b Merge pull request #510 from dgonyeo/2.2.0
Mark Ignition spec 2.2.0 as stable, create new 2.3.0-experimental spec
2018-02-08 16:22:49 -08:00
Stephen Lowrie
d67ad812a8 tests/negative/security/tls: disable tls handshake error logging
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.
2018-02-07 14:34:44 -08:00
Derek Gonyeo
70f583144e tests: check correct config versions are accepted, incorrect are not 2018-02-06 14:44:43 -08:00