Commit Graph
18 Commits
Author SHA1 Message Date
Castulo Martinez c8ecede8ae Avoid running heuristics/scripts with 3rd-party
Heuristics and post-update scripts that apply to upstream bundles don't
apply to bundles installed from 3rd-party repositories. This commit
enables/disables these actions on demand so 3rd-party bundles are
installed correctly.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-11-27 14:56:10 -08:00
Otavio Pontes d175af3fd5 test: Don't conflict config tests with other tests
Always save the config file in another directory so we won't have
problems on running the config tests in parallel. Before this patch
if you run the config tests in parallel with any other tests you could
end up having false-negatives.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-11-12 13:15:24 -08:00
Karthik Prabhu Vinod 4af2023020 Fix Download to Downloading
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2019-09-24 14:34:13 -07:00
Otavio Pontes d895218082 verify: Remove whitespace before ...
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-09-24 10:17:54 -07:00
Karthik Prabhu Vinod 74bcdd2fe4 Progress bar for manifest download
This ensures we have a callback function
for full_file curl download. The function
implements a spinner for progress

Fixes #1060

Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@intel.com>
2019-09-23 10:36:50 -07:00
Otavio Pontes 0696de4435 curl: Initialize curl as needed
Instead of initializing curl library on start, initialize it only when needed.
The advantage of this approach is that we can run some commands offline, if
there's no file to download.

Fixes #801
Fixes #895
Fixes #277

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-08-20 10:48:20 -07:00
Otavio Pontes 0968948389 test: Rename the name of the distro for tests
We don't need to have a real distribution name for tests. Use a swupd
specific value.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-07-19 14:20:00 -07:00
Castulo Martinez e0256bee24 Make "diagnose --picky" a superset of "diagnose"
Running "swupd diagnose --picky" result in only identifying the extra
files in the system, but doesn't run the other standard checks that a
"swupd diagnose" do. "swupd diagnose --picky" should do everything
"swupd diagnose" does plus searching for the extra files.

This commit fixes the issue by making diagnose --picky a superset of
diagnose. The commit also makes some changes in the output of --picky so
it is consistent with the rest of the diagnose output.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-07-19 10:46:20 -07:00
Brandon Hong b09bdddabe Update testcases to reflect new info format
Signed-off-by: Brandon Hong <brandon.hong@intel.com>
2019-07-19 10:10:10 -07:00
Otavio Pontes 0a84e15aac test: Don't run config file tests on developers machine
config file tests require one special configuration on build time, so
skiping this unless we are running on travis.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-07-18 14:56:32 -07:00
Castulo Martinez c2a4763ff3 Adding configuration file parser for swupd
swupd has many flags that can be used for fine tunning its
functionality. In some cases users may want to include a flag with every
swupd command they run.

This commit gives the ability to provide swupd flags via options in a
configuration file that swupd will read before running the command.

The configuration file is an INI style file tha  can include sections
so users can specify options that should only apply to a specific
command. The biggest advantage of this is to be able to fine tune the
flags that should apply for each command.

For example a user could set a global flag that would apply to every
swupd command, and then turn that flag off for a specific command by
unsetting it in the command's section.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-06-28 13:06:11 -07:00
Castulo Martinez 43ba5def2a Require a force flag to continue with insecure URL
Currently users can set content and version urls based on http or https
protocols. This pose a security risk if users decide to use http.

This commit blocks swupd from working with http unless is specifically
allowed by using the --allow-insecure-http flag.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-06-27 14:48:50 -07:00
Castulo Martinez 67e4e8dda9 Autocompletion for --debug and --quiet
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-03-28 13:05:36 -07:00
Castulo Martinez c545a02378 Use logger to print all messages in screen
swupd prints some messages to stdout and others to stderr, this makes
the code somewhat confusing and also it creates a mess regarding which
messages go where. Messages are usually printed using fprintf() and
printf().

This commit replaces all calls to printf and fprintf with one of the
functions that are part of the logger. This will bring many advantages
to the code:
 - readability, it is straightforward to identify where a message needs
to go based on the name of the logger functions.
 - consistency, the output will go to either stderr or stdout depending
on the type of message being printed.
 - the format of the messages will also be consistent, so for example,
if the message is an error the message will automatically include the
"Error: " label in the beginning of the message, this way we avoid
having things like "ERROR:", "error - ", etc...

Closes #864
Closes #294
Closes #489
Closes #433

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-03-25 16:07:40 -07:00
Otavio Pontes 3798a7efe3 test: Swupd-search test was incorrect
And it fails when using current version of swupd-search.

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-03-06 09:44:20 -08:00
Otavio Pontes 78f93d11ea modules: Take swupd-inspector out of swupd
We needed on sample for external binaries, but as now we have swupd-search we
can take swupd inspector out.

Also move local search to list of external modules and fix all related tests

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-03-05 16:55:49 -08:00
Otavio Pontes 085b520050 Add swupd-inspector command into swupd
Use a binary launcher to load swupd-inspector and execute that
when swupd inspector is run.

Closes #826

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-02-22 09:36:39 -08:00
Castulo Martinez cf8f81ccb4 Test for configurable download retries
This commit adds the tests to validate the configurable retries
for sync downloads.

It also moves the tests for autocompletion from their own "completion"
directory to a more general "usability" directory so we can add more
tests in that directory in the future.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-02-01 12:30:45 -08:00