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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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.
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.
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)..
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>
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>