48 Commits
Author SHA1 Message Date
Mark D Horn 7e277776a9 controller: Add post-image YAML hook
Fixes: #531

Add new hook to be called after image generation is completed.

Update base image test to use post-image hook

This is useful for image manipulation such as compression, format
modification, etc.
2020-02-27 15:00:31 -08:00
ZVNexus 6272de6a21 Initial F2FS support for CLR Installer.
Signed-off-by: Alexander Koskovich <zvnexus@outlook.com>
2020-02-27 11:03:25 -08:00
Alexander Koskovich d3cdbc25a1 Typo in YAML scripts
Also capitalize/end with period.
2020-02-12 18:55:13 -08:00
Mark D Horn f65cd665ba ISO: Add metadata to ISO images
Add the publisher and the application/image type to the ISO.
- ApplicationId set to 'server' by default, 'desktop' if any
  bundles are included which contain the name 'desktop.
  - ApplicationId can be overridden via the YAML file
- Publisher only set if included in YAML file

Add new test coverage.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2020-02-05 16:51:06 -08:00
Mark D Horn 767ffb8040 Fix test case variable case
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-12-11 12:55:19 -08:00
Mark D Horn b9970047f9 Allow skipping swupd configuration file copy
Fixes: #600

Only copy the swupd configuration files from the host to the target
by default when running the interactive installer (gui or tui).
Otherwise, observe the setting from the configuration YAML or the
command line (highest) argument.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-12-11 10:47:05 -08:00
Mark D Horn 2afeff5721 model: Warning on extra kernels for json to yaml
When converting an ister JSON configuration file to a
clr-installer YAML configuration file, we want to ensure
a single kernel is set. Additional kernel result in a
warning as ISO mainly due to ISO generation limitation
in the code.

Add new coverage test for multiple kernels.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-11-19 18:18:05 -08:00
Mark D Horn b80f568c70 args: Drop auto test coverage
Much of the new networking retry code is difficult to
test/emulate in a test environment -- as such, reducing requirement.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-11-06 13:09:44 -08:00
Mark D Horn 137ad30917 test: Add new image generation test
This is a baseline test to know we can install to an image.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-10-30 11:05:23 -06:00
Mark D Horn e4f9e947b4 utils: Add new tests to coverage
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-10-11 14:06:01 -07:00
John Akre 3aeef56341 test: reduced args coverage
The Offline and OfflineSet fields were added to args, but test coverage
only exists for Offline. Typically fields like OfflineSet are untested,
so reducing the coverage.

Signed-off-by: John Akre <john.w.akre@intel.com>
2019-09-23 16:08:10 -07:00
Mark D Horn a34f01c7d0 test: reduced storage coverage
We've added new functionality to storage which is only
exercised on media when running as root, so dropping
the basic coverage value for storage.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-12 19:20:47 -07:00
Mark D Horn a2216162f0 test: Add model test for new code
No easy way to test all of the error conditions of
Marshaling and Unmarshaling, so dropping the coverage by 1%

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-09-12 19:20:47 -07:00
Mark D Horn e99fc7a80f tests: telemetrics update for release 2.2.0
New version of telemetrics-client now has built-in defaults for all
values and the released configuration file is now all comments as
a template. Updating to new configuration file release for checks.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-07-15 13:53:11 -07:00
Mark D Horn 14dc9c080a tests: Update coverage numbers
Add new files and bring baseline up to current values.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-05-29 18:11:52 -07:00
Mark D Horn dedda923e7 tests: update coverage for replacement encryption
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-05-08 13:31:49 -07:00
Mark D Horn 1bfa2cbe8a swupd: Filter bundles which will be installed
Remove any bundles the installer will always install from
the list of optional bundles selectable by the user.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-29 18:18:33 -07:00
Mark D Horn efc7335fbc coverage: reduce required swupd coverage
We added the new function to speed up the builds, but
didn't EOL the old code yet. Need to reduce coverage
for now, but we should do a code clean-up and update
coverage later this quarter.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-26 17:47:54 -07:00
Brian J Lovin 9c7820f3c3 swupd: Add verifyOnly flag to swupd.Verify()
When building an initrd it's convenient to only install the 'os-core'
bundle, because any extra bundles are not required and bloat
intird.

This commit adds an option to only run the 'verify' command and not
install the extra bundles listed as 'core-bundles'.

Approved to reduce coverage for swupd library.

Signed-off-by: Brian J Lovin <brian.j.lovin@intel.com>
2019-04-19 15:06:47 -07:00
Mark D Horn 3945c9aeb2 network: Add support for Network Manager
Now check for which service is handling wired network interfaces.
Needed by the TUI which still handles static IP configurations for
wired connections.

TODO: Once NetworkManager is the new OS default, we can explore
configuring wireless interfaces via the TUI as well.

TODO: Consider change the other systemctl calls to use new dbus.

Dropping coverage requirement for this build

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-04-19 10:57:15 -07:00
Reagan Lopez f61d7092ab Add support for ister json config
- The new -j flag detects ister json config format and converts it to yaml
- The existing -c flag also detects ister json config format, converts it to yaml
  and continues as usual
- Handles the ister "rest" option for physical targets
- Handles multiple targets

Signed-off-by: Reagan Lopez <reagan.lopez@intel.com>
2019-03-05 13:55:44 -08:00
Mark D Horn 6a27623a82 New telemetry defaults
Update the latest release telemetry configuration file
and update the post install hook with the new default
and new maximum.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-03-04 14:28:41 -08:00
Mark D Horn e5e6aa2b71 Lower coverage for model
We add an if statement to the model for the VirtualBox change
which is slightly lowering the coverage number. We won't be
able to add a VB test case, so lowering the default coverage.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2019-01-28 18:40:46 -08:00
Mark D Horn 17894ff6e0 Add date/time stamp to configuration file
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-12-07 22:24:58 -08:00
Mark D Horn 037d4991ef Improve Test Coverage for new features
Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-11-29 12:35:26 -08:00
Mark D Horn 64451ee854 Check for root early
Change the timing where we check for the root user.

Fixes: 171

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-11-28 19:38:06 -08:00
Mark D Horn 0d59e8c105 Dump contents of coverage file on fail
Sometimes we get coverage reported as an empty string.
This can happen if there is a run time error during execution.

Now dump the contents of the newly generated coverage file
if there is a decrease.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-11-09 09:43:18 -08:00
Mark D Horn c7c13a14fb Drop model coverage target
We added new checks to the main install flow which does not
have test coverage.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-10-23 10:03:34 -07:00
Leandro Dorileo 281a3bd923 check-coverage: print all decreased coverage
With this change we check all the tests decreased and print them
all instead of printing the first and exiting.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-17 16:11:24 -07:00
Leandro Dorileo 82beb2e89b user: add ssh-keys configuration
Add the user's ssh-keys configuration support as well as the required
bits to creathe the authorized_keys file.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-17 12:36:56 -07:00
Leandro Dorileo 557a637749 check-coverage: improve error handling and notification
One of the steps check-coverage does is running "make check" and
writing it to a temporary file. This patch improves this step by
detecting the failure and better notifying the user it has failed,
also we show the result to the user if that's the case. Also remove
the left over temporary file case it fails.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-16 14:16:46 -07:00
Leandro Dorileo 4a538fc6e8 updated code coverage
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 16:46:40 -07:00
Leandro Dorileo d9d8e10566 model: add test for mixed block devices config
A alias can be used for a single partition only, this test makes
sure we test the case.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 16:46:40 -07:00
Leandro Dorileo 0a52b8e030 model: add test for kernel validation
Kernel configuration is mandatory. This test makes sure we cover that.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-09 16:46:40 -07:00
Leandro Dorileo e28d08b800 updated code coverage
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-02 14:16:42 -07:00
Leandro Dorileo 76d871ee11 tests: make valid minimal a minimal test again
I started increasing the minimal test but it's minimal for a reason -
to be minimal.

This patch moves the pre and post hook tests to their own test file.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-02 10:04:10 -07:00
Leandro Dorileo 63b6dba299 Add required bits to make image and install a target system into it.
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-02 10:04:10 -07:00
Leandro Dorileo b1334c2648 storage: add block-devices alias support
With this the user can add alias block devices and use these alias
to expand target media's Name values, i.e:

block-devices: [
   {name: "target", file: "/dev/sda"}
]

targetMedia:
- name: ${target}
  type: disk
  ...

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-10-02 10:04:10 -07:00
Leandro Dorileo a26b5415a1 model: add Version field
The mass-installer use case for image generation requires to specify
the target system version. This patch allows the configuration of
an arbitrary version.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-27 14:50:33 -07:00
Leandro Dorileo a58c12d5d9 post-install: add post-install hooks support
Introduce the initial support to post-install hooks. The code also
expands a set of pre-defined variables, for now the only exposed
variable is the chrootDir (the directory where the target system is
mounted).

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-27 14:32:50 -07:00
Leandro Dorileo 187d9bdd7b updated code coverage
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-26 14:33:21 -07:00
Leandro Dorileo f19841287c local-travis: add a travis "emulation"
This patch introduces the local-travis, an small util program locally
emulate the remote travis execution. The program will read the travis
yaml file and execute the tasks.

The program is not intended to be manually executed but wrapped by
"make check-coverage". The program uses the env var TRAVIS_CONF to
know where to find the travis yaml file (the makefile will have it all
set for you).

We also use the http_proxy, https_proxy and no_proxy if they are set.
If we're executing a docker command that supports -e flag then these
variables are also handled.

The check-coverage.sh script will also auto update the coverage database
and commit the changes if it detects a coverage increase. In order to
do that check-coverage will only update the database if there's no
unstaged changes in the tree and if it's being executed with
make check-coverage.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-26 14:33:21 -07:00
Leandro Dorileo 4b5eacba1f model: add a minimal valid test
Introduce a minimal valid test, it shows the use of only the required
fields - specially for storage/media configurations.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-26 14:33:07 -07:00
Leandro Dorileo b4172c5621 check-coverage: it must be ran as a non root user
Also reduced the coverage for a couple of tests, we need to improve
local tests before updating the expected coverage file.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-25 09:56:40 -07:00
Leandro Dorileo b26135157b tests: fix descriptors without kernel config
Now the kernel configuration is mandatory, with that the tests will
break if no kernel configuration is provided.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-25 09:56:40 -07:00
Leandro Dorileo 43b3008ffb check-coverage: fix coverage operator
The coverage comparison was using the "<" operator and failing
whenever the coverage had increased. This patch changes the operator
to use test's -lt operator.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-25 09:56:40 -07:00
Leandro Dorileo 5c1b69c8d4 testsuite: prepare to enable check-coverage.sh on CI
This patch fixes the tests coverage regressions and add a small fix
to the script where it doesn't remove the temporary coverage report
file if it fails. Now it can be enabled on the CI and avoid adding
new testsuite regressions.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-09-19 15:56:54 -07:00
Mark D Horn e84bb0e403 First Open Source push of code base
This is code is still alpha. The Text-based User Interface is
undergoing a resign of the layout before beta.

Signed-off-by: Mark D Horn <mark.d.horn@intel.com>
2018-08-13 14:14:30 -07:00