41 Commits

Author SHA1 Message Date
Patrick McCarty 8ac1869adf Call checkrenamed() with correct arguments
Some of the renames tests omitted the leading forward slash for the two
function arguments, so add them here.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-04-19 11:15:26 -07:00
Patrick McCarty fde00265e2 test: fix some typos in checkrenamed()
Due to these typos being present, several tests were passing that should
not have been.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-04-19 11:15:26 -07:00
Matthew Johnson 5aa1bf9188 Also clean renamed-to files by unsetting the rename bit
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-12-05 12:21:35 -08:00
Matthew Johnson 010131eb85 Fix ghosted-file deprecation
Ghosted files were only being deprecated over format bumps. Move the
format-bump-check logic out to the calling function to allow ghosted
files to be removed on every build. Also assign the is_ghosted flag when
adding "deleted" files from the old manifest so that the file will
actually be removed.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-11-28 13:39:38 -08:00
Matthew Johnson 6d3121cdc6 Add test cases for orphaned renames
* test that renames from old manifests persist
* test that renamed-to deleted is handled properly with the renamed-from
  becoming deleted.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-11-27 17:22:50 -08:00
Matthew Johnson 599ce7cb77 Add functional test for ghosting files
Adds ability to create test files with custom content to swupdlib.bash
as well.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-11-21 14:06:14 -08:00
Matthew Johnson 14cef226d1 Add test for orphaned rename removal
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-11-21 14:03:45 -08:00
Matthew Johnson cb9fe9f208 Improve debuginfo ban test
Improve the test for banning debuginfo via server.ini by first creating
an update without the ban followed by an update with the ban to make
sure the debuginfo is being properly pruned from the manifest.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-09-21 09:17:24 -07:00
Matthew Johnson 0fe32ce8fb Allow configuration to ban debuginfo from manifests
Use server.ini to optionally ban debuginfo from the manifests at
configurable paths.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-09-15 15:56:02 -07:00
Matthew Johnson 31aec4684f Create staged and delta directories with 700 permissions
These directories were previously created with 750 permissions, which
caused a new check in swupd-client to remove them in order to correct
the permissions to 700. Create them the right way in the first place.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-09-15 10:43:42 -07:00
Matthew Johnson 350bb54fdf Add functional test for contentsize fix
Add functional test to check manifest contentsize across versions and
includes.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-08-18 10:13:11 -07:00
Matthew Johnson 925a5203f4 Add functional test for format bump actions field
Adds a functional test to check for the

actions:	update

line in the Manifest.MoM for the new format.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2017-07-28 23:13:21 -07:00
Patrick McCarty a0c7025a9b Add basic check for format number validity
Because the intention is for swupd format numbers to either remain the
same between LAST_VER and current, or to increase as part of a format
bump, this leaves the remaining undesirable case.

Add a basic check to make sure the format never decreases, and add a
functional test.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-07-24 15:00:39 -07:00
Icarus Sparry 37f84501eb Additional tests for renames
Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-05-09 16:43:19 -07:00
Icarus Sparry 850e6b9a92 Allow running only a single test
If the environment variable RUN_JUST_ONE is set then skip any test
which is not numerically equal to it.

Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-05-09 16:43:19 -07:00
Icarus Sparry ce594a6529 Helper routine to generate files with content
Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-05-09 16:43:19 -07:00
Icarus Sparry cfb0406b2e Fix creating test files in subdirectories
Allow the filenames to contain directory names

Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-05-09 16:43:19 -07:00
Patrick McCarty 15c045de8d Avoid duplicate includes lines in manifests
There is no need for duplicate includes to exist in manifest headers, so
search the includes lists first before adding a new entry.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-04-11 11:53:21 -07:00
Patrick McCarty c69a5d87bf Add functional test for subtraction of deleted files
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-04-07 10:47:29 -07:00
Patrick McCarty adb8241a83 test: add one more test for symlink dereferences + deltas
In the event that a symlink target changes between two versions, and the
files the symlink points to also change and would create a delta, do not
create a delta between the symlinks. The real delta is between the
underlying files the symlinks point to, which is created separately.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-04-04 11:45:43 -07:00
Patrick McCarty c963ce9aa6 test: add test for delta file presence/absence
For the F->L and L->F type changes, make sure that there are no delta
files created between the dereferenced symlink on one end and the
regular file on the other.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-04-04 11:45:43 -07:00
Patrick McCarty 04a1bdfd16 test: support custom file names for delta tests
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-04-04 11:45:43 -07:00
Patrick McCarty 963e8117b4 Skip some tests if run as root
Three functional tests depend on the effective UID being non-zero
(non-root), so skip the tests if running as root.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-12-01 11:15:46 -08:00
Patrick McCarty 57292a5a03 Add functional test for state file tagging
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-12-01 11:05:36 -08:00
Patrick McCarty 30b46b9027 Update for new noship dir location
The bundle-chroot-builder changed the location where it stores bundle
includes metadata, so swupd-server needs to read from the new location.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-09-29 13:40:12 -07:00
Tudor Marcu 076a76fc4e Update for latest.version name change
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-09-29 11:21:43 -07:00
Auke Kok 7758a6bb77 Document and ship bundle status string.
This patch extracts the [STATUS] field from our bundle information
metadata, and stores it in groups.ini. From there we put the contents
of this string verbatim into the manifest.

We don't interpret, encode or convert the contents of the [STATUS]
field in the manifest. Instead, we just strip non-alphanumeric
characters and pass the contents on. This leaves it entirely to the
client to parse and interpret the value of this field in the manifest.

If the bundle file, or the groups.ini file omits any status, nothing
is output to the Manifest file.
2016-09-29 10:45:03 -07:00
Tudor Marcu 4940d0cf83 Fix functional test for server changes
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-08-22 02:47:16 -07:00
Patrick McCarty 8af939c817 Update functional test to check for delta manifests in packs
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-05-17 15:59:14 -07:00
Patrick McCarty d45304c8b7 Add functional test for blacklisted file names
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-04-29 16:39:11 -07:00
Patrick McCarty 2b4e9eb3c9 test: quote echo strings to protect against shell interpretation
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-04-29 16:39:08 -07:00
Patrick McCarty 64e65bca92 Run functional tests in separate directories
To more easily implement tests, analyze test results, etc, store each
test in a separate directory and dump all logs and the web-dir content
there as well.

The test suite can be run with 'make check', as before, but now tests
can be run individually by directly invoking the appropriate test.bats
file (at toplevel, or within the test directory).

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-04-10 21:03:06 -07:00
Patrick McCarty b954d924f4 Update functional test suite for recent changes
For swupd_create_update, the required -F option needed to be added for
several tests, and the option parsing order changed.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-04-04 18:57:22 -07:00
William Douglas 9b05b06a9b Fix manifests not detecting include changes
When deciding if a new manifest should be generated for a new version,
the included manifests were not being used to detect a manifest
change. This caused manifests that had new includes: lines in the new
version to not be generated resulting in files from the included
manifest to be missed when adding/updating that bundle.

The fix was to compare includes: lines from the current and previous
manifest versions for differences and generate new manifests when that
was the case. In order to compare manifests duplicate includes: lines
are not allowed and previously os-core could be added multiple times to
a manifest because it was always added. This change also added detection
for os-core before automatically adding it to a bundle.
2016-03-31 18:45:33 +00:00
William Douglas 9c920d65e8 Don't bump versions for deleted files
In Manifest.full, previously a file being deleted from a bundle caused
the version of the file in Manifest.full to increase incorrectly.
2016-03-29 20:06:57 +00:00
William Douglas 825dc6c75f Add functional tests to validate includes work
Check that os-core is subtracked correctly and that $bundle-includes
files are correctly subtracked as well. Also include testing for new
bundles being subtracked.
2016-03-24 21:17:56 +00:00
William Douglas 79e8a12b75 Populate the manifest->includes list
Using the $bundle-includes files for building submanifests from
directories and previous manifest files includes: sections, create the
manifest->includes list as the names of submanifests included in the
submanifest being instantiated.

This needs to then be processed into a list of pointers to the other
submanifests themselves once all other manifests have been
instantiated before use with functions that operate on the includes list
(subtract_manifest and write_manifest for now)..
2016-03-24 21:17:56 +00:00
Patrick McCarty 5ba47aa150 test: add basic checks to ensure packs have been created
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-03-17 12:22:33 -07:00
Patrick McCarty 5acb4c394c test: set latest.version to new value in the latest test
The latest.version file should generally be updated after the most
recent build completes, so bump it to 10 after the build completes for
version 10 in this test.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-03-08 22:37:56 -08:00
Patrick McCarty 6ba28bc7a9 Add a functional test that creates delta packs
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-03-08 22:23:59 -08:00
Patrick McCarty e653bdd50a Add initial functional test suite
The test suite uses BATS to emit TAP and the Automake TAP driver to
consume the output.

Most of the tests are basic, and full-run.bats creates a minimal update
using autogenerated chroot content.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-03-08 21:28:15 -08:00