25 Commits
Author SHA1 Message Date
Castulo Martinez 81d616b605 Be consistent in bundle-add/remove error messages
The operations have different command result output styles. Also,
in particular bundle-remove error is a bit redundant.

This commit changes the messages displayed by the bundle-add and
bundle-remove functions so they have consistent messages for their
corresponding operations.

Fixes #475
2018-06-13 14:47:36 -07:00
Matthew Johnson 58f80eb5b5 tests: fix tests for bundle-add fullfile downloads
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-06-12 13:28:02 -07:00
Castulo Martinez f49fb714fe Fixing typo in remove bundle message
When 1 or more bundles fail to be removed from the system a message
was being displayed, a message that looked like this:
"1 bundle(s) of 2 failed to remove"

This commit changes that message so it uses pasive voice, like this:
"1 bundle(s) of 2 failed to be removed"
2018-06-08 10:49:21 -07:00
Castulo Martinez 71a2a4cb0e Refactor bundle-remove to handle multiple bundles
The current remove_bundle() function was designed to only be called
once, but for multiple bundle removals, it is currently called
multiple times.

This commit refactors this function so the bundle removal code can
handle multiple bundles at once.

Fixes #449
2018-06-08 10:49:21 -07:00
Icarus Sparry e52ba1e7df Change contentsize in Manifest.MoM to 0
The previous value - 13,805,671,819 is bogus, and we want to be able
to test if the value is reasonable.

Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2018-03-19 14:42:22 -07:00
Arzhan Kinzhalin feadea96b6 Implement fallback CApath support.
A colon-separated list of alternative CApath options can be passed to
swupd-client at the configuration time using --with-fallback-capaths
option.

In runtime, fallback CApath support is implemented as part of the
connectivity check. The implementation will try the default (built into
curl) and then will iterate through the list in the order they were
specified. It is done only once on the first call.

The code is reorganized to keep the connectivity check inside curl
wrapper:

* Deleted check_network implementation from version.c
* Removed have_network global (globals.c)
* Scoped swupd_curl_test_resume to curl.c
* Change use of check_network to swupd_curl_check_network

Also:

* Fixed an issue where SSL was only enabled if a URL was matching the
  content URL
2017-10-02 11:30:48 -07:00
Matthew Johnson c83c4ce78f Add functional tests for bundle-list --has-deps
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-08-31 09:50:50 -07:00
Matthew Johnson ee06e85931 Add --has-dep argument to bundle list
The --has-dep=BUNDLE argument will display a tree representing all
installed bundles that recursively include BUNDLE.

One may pass the --all argument as well to list the dependency tree for
BUNDLE including all installable bundles available on the server.

**Example output without --all:**

Installed bundles that have os-installer as a dependency:
format:
 # * is-required-by
 #   |-- is-required-by
 # * is-also-required-by
 # ...

  * mixer
    |-- os-clr-on-clr

**Example output with --all:**

Attempting to download version string to memory
All installable and installed bundles that have os-installer as a dependency:
format:
 # * is-required-by
 #   |-- is-required-by
 # * is-also-required-by
 # ...

  * clr-devops
  * mixer
    |-- os-clr-on-clr
        |-- os-clr-on-clr-dev
    |-- clr-devops
    |-- os-clr-on-clr-dev

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-08-31 09:50:50 -07:00
Matthew Johnson 6108f50bb9 Print bundle dependencies when failing to remove
A bundle will fail to be removed from the filesystem when other bundles
require that bundle as a dependency. Print a list of each of these
bundles along with the error message.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-08-31 09:50:50 -07:00
Matthew Johnson ae011954f4 Add status checks for test swupd commands
Adds status checks for each swupd command called in the functional
tests. At this point several of these tests fail due to some successful
commands returning error statuses.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-08-10 15:33:59 -07:00
Matthew Johnson 6f52e62854 Fix typo in clr_bundle_rm.c
succesfully -> successfully

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-08-07 14:23:30 -07:00
Jaime A. Garcia 6a8d36763b Accept multiple bundles at bundle-remove
This is a wrapper around remove_bundle()
to add consistency for bundle-remove
subcommand respect bundle-add that accepts
one or more bundles to be removed.

This must not be the optimal implementation
but it works fine and gives a better user
usage experience.
2017-04-04 11:50:21 -07:00
Patrick McCarty bce9fb436f test: remove unused .signed files
These files have never been used by the functional tests, so remove them
from the tree.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-01-31 12:39:09 -08:00
Tudor Marcu a565cd0304 Update tests for mandatory signature verification
With mandatory signature verification being enabled, the tests will have
to generate a certificate and sign their Manifest.MoMs to properly run the
swupd operations.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-12-20 16:13:55 -08:00
Patrick McCarty 2b6db84fe3 Check bundle-remove exit status instead of checking output
The bundle-remove subcommand returns a unique error code for invalid
usage, so check that instead. This also avoids the need to track
bundle-remove --help output, or ignore it.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-11-03 09:32:36 -07:00
Patrick McCarty 0ca1975ed5 Convert all functional tests to the new interface
This commit adds "lines-checked" files for every test that checks
swupd-client output and removes the old bash-array-style checks from
the test scripts.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-11-02 21:02:46 -07:00
Patrick McCarty 3e0fff6a47 Ignore signature verification errors in functional tests
Because signature verification is a feature that we need separate
testing for, and swupd's output may print a verification error (or not)
depending on how swupd was built, add a helper function to remove the
verification error message when swupd is built with verification
enabled. If verification is not enabled, swupd will not print any
message, and the function is a no-op.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-06-27 11:56:01 -07:00
Patrick McCarty a384265d88 Refactor test cases; update bundle manifest hashes
This commit expands the swupd BATS library to encapsulate more of the
boilerplate steps in the test cases.

Additionally, bundle manifest hashes needed updating now that swupd is
emitting warnings (and later on, errors). Better to be prepared for the
switch to errors on mismatches.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-06-22 16:12:38 -07:00
William Douglas 6fc6d6113d Enforce includes hierarchy with bundle-remove
Don't allow bundle-remove to remove bundles that are included by other
currently installed bundles.
2016-05-13 10:39:22 -07:00
William Douglas 55540d4896 Ensure bundle-remove gets one bundle argument
Instead of only checking if bundle-remove has at least one bundle
argument and ignoring additional ones, check that there is exactly one
argument passed to bundle-remove instead.
2016-05-02 21:50:16 +00:00
William Douglas a52eeb42cb Move functional tests to use the BATS framework 2016-04-26 22:15:04 +00:00
Patrick McCarty 8dc4cb8e18 Fix a bundle-remove test that failed to load manifests
The Manifest.os-core was present, but the compressed version was not.
Fix the issue by providing the compressed version.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-04-04 22:33:41 -07:00
Patrick McCarty 5407e70e44 Use formatstaging for functional tests
Since a numeric format now requires a config file, and aligning the
client format with the test format is a maintenance problem, use the
"staging" format for all tests.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-04-04 11:42:25 -07:00
Patrick McCarty 97047688c3 Add functional tests for boot file handling fixes
The following tests are added here:

- Add a boot file via 'bundle-add' (failed before the previous commit).

- Remove a boot file via 'bundle-remove'.

- Add a boot file via 'update'.

- Detect a boot file hash mismatch via 'verify' (failed before the
  previous commit).

- Fix a boot file with incorrect hash via 'verify --fix' (failed before
  the previous commit).

- Ignore a boot file during 'verify --fix' if marked deleted (failed
  before the previous commit).

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-03-10 11:43:31 -08:00
Patrick McCarty c42f8a3aa1 Initial commit
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-02-24 09:34:13 -08:00