We skipped file names just based on their ending without checking if
it is a symlink. This prevented container with a name ending in .0 or
.1 to be uninstalled.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #1166
Approved by: peterbaouoft
A unit test for rm_add_files_to_host is added. The basic/expected
functionality of that function is tested by the new test
Other functions in rpm_host_install are mostly covered
by the integration test already, and thus not tested here
Closes: #1155
Approved by: giuseppe
A 'high-level' unit test is added that covers basic functionality
check for refactored function '_handle_system_package_files'.
Closes: #1155
Approved by: giuseppe
This commit refactors the writing info part from 'do_checkout'
into a function.
Also, because of the above action, two of the local variables
'installed_files_template' and 'rename_files' are also removed
Other than those, an extra error case was added to the except list.
A unit test is added for future regression
Closes: #1155
Approved by: giuseppe
This commit refactors the "rename file value substitution" code
section in '_do_checkout' function
There should not be any functional impact with this commit
A unit test is added for future regression
Closes: #1155
Approved by: giuseppe
This commit contains small refactoring of getting manifest
attributes and refactoring of the "tempfile cleaning during
upgrade" code section in '_do_checkout'
Also, 'has_container_service' local variable is genereated in the
function instead of being passed in as a parameter. This is done
because in the future refactoring we might want to elminate the
usage of local variables related to manifest completly.
A unit test is added to verify getting manifest attribute works
as expected
Closes: #1155
Approved by: giuseppe
This commit contains refactoring for write config in '_do_checkout' function,
this refactoring also removes the duplication of writing config in 'run_once'
There should not be functional impact with this commit.
A unit test is added for future regression
Closes: #1160
Approved by: giuseppe
In _do_checkout, we refactor the part for getting rootfs location
into a function.
A todo comment( refactoring 'missing image layer check') is also added
in this commit based on discussions on irc
A unit test is added for future regression
Closes: #1154
Approved by: giuseppe
This is regression from https://github.com/projectatomic/atomic/pull/1152.
It appears that 'self' is no longer used when '_resolve_remote_path' is moved into
'_get_remote_location'. Thus, '_get_remote_location' is made to be static
Closes: #1154
Approved by: giuseppe
Made a new class to track all the refactored functions' unit tests
(for future usage)
Added a unit test to test the functionality of the factored out
_get_remote_location function.
Closes: #1152
Approved by: giuseppe
Since we allow to customize the runtime to use, there is no hard
requirement for bwrap-oci anymore.
Also add the same check for system containers, let's error immediately
if the specified runtime is not present.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #1141
Approved by: baude
Store the checksum of files copied to the host, so that on an update or
an uninstall we can skip the files that have a mismatch in the
checksum.
This reflects in the --system-package=no case what the rpm backend
already does.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #1131
Approved by: ashcrow
it can be used by privileged containers to add all the capabilities
known to the host. It prevents hard coding the list in the
config.json.template file so that the same image can be used on
different kernel versions where there can be different capabilities
supported.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #1119
Approved by: ashcrow
Split the pipeline in two so that we check that there's something to
unmount before doing it. This is needed now because the new CI
infrastructure provisions a true uninitialized block device that doesn't
need to be unmounted, so the `grep` would fail (because of the
`pipefail` option). Previously, `/dev/vdb` was actually itself a
pre-formatted ext4 partition and thus was automounted.
This should now catch both the old CI style (in case local developers
were mirroring that setup), as well as more conventional partitioning
schemes.
I dropped the `-r` since we *know* at that point that there is at least
one entry to unmount.
Closes: #1106
Approved by: rhatdan
Fix test failures after updating papr to test with f26 atomic/cloud
images instead of f25, with the following changes:
1. Remove dependency on docker hub tester image. Instead, mimic
what ostree/rpm-ostree does and use a recursive .papr.sh script
to install the necessary packages to the base f26 image in the
fedora registry. This fixes tests on the atomic host since python3.6
is being used, and prevents future tests from testing the wrong
version. (Note this is slightly slower due to having to install
packages during the test rather than using a pre-built image).
2. Fix some pylint errors, and mask others for now
3. Fix failing integration tests due to inter-test interference
4. Remove unnecessary deepcopy in container filter
5. Add compatibility for both c-s-s and d-s-s in storage
6. Update expected sha256 values for dockertar test
Remaining issues:
1. test_storage should possibly be reworked. The current test
setup is conflicting with the new default of overlay as a driver.
For now, the test for generated d-s-s is disabled.
2. some storage commands are still using "docker-storage-setup"
instead of "container-storage-setup". There is a backward
compatible check in place that should be reworked in the future
3. some masked pylint errors should be further investigated
4. keep the dockerfile for the project atomic tester image for now
(bump to 26), since its a little easier and faster to set up with
Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>
Closes: #1076
Approved by: baude
move the filter inside the Python script since the
"images -f" can include other results and make the comparison fail only
if the difference between the two sizes is > 1%.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #1047
Approved by: TomasTomecek
Issue #1021 requested we add the NAME field to the containers list command,
so that debugging container failures would be easier.
Closes: #1024
Approved by: baude
The atomic.conf file is now tested to validate it is valid YAML. The two
cases checked are:
- The file contents in it's shipped state
- The file contents with examples uncommented
An example has no space between the hash and the start of the example:
#example: value
While a comment is expected to have a space:
# I am a comment
Closes: #1009
Approved by: giuseppe
A bug was reported in issue #1022 where if the atomic install data failed,
the installation data was still written allowing the user to proceed
with an atomic run.
Disabling test_install.sh until i can follow up with Thomas.
Closes: #1025
Approved by: baude
When image is being referenced by a container,
_mark_used function should mark image as being
used if the image id is found inside the information of
containers.
In this case, the image id for containers should be
referenced as container.image instead of container.id
Some tests are added for future regression.
Closes: #1030
Approved by: baude
There were two primary cases where a secondary atomic run with a command
would trigger an exception. The first was reported in
https://github.com/projectatomic/atomic/issues/1006. Basically it can
be summarized as:
```
atomic run registry.fedoraproject.org/fedora:25 date # works fine
atomic run registry.fedoraproject.org/fedora:26 date # tries to run in the existing f25 container
```
The second case is as simple as:
```
atomic run registry.fedoraproject.org/fedora:25 date # works fine
atomic run registry.fedoraproject.org/fedora:25 date # fails
```
This fails because atomic starts the stopped f25 container and then attempts a docker exec. The
exec fails because the 'date' command is short-lived and the container exits prior to the exec
being run.
We now catch those exceptions and notify the user. We added a `--replace` option to run where
atomic will now delete the container in question and re-run it from the correct image.
Closes: #1019
Approved by: baude
Add tests to check that the tags are being properly displayed,
and remove duplicate ostree image tagging tests that are in
test_system_container_images.sh
Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>
Closes: #1017
Approved by: baude
When atomic containers list --json ... is used the result should always
be valid json. In the event there are no containers returned an empty
json list is expected.
Closes: #1016
Approved by: baude
The atomic tag function was not working correctly for docker images
in the dockerd. Also, when attempting to tag an image from one
backend into another, we didn't handle the error correctly. This should
not work.
Add integration tests for tagging invalid images, dockerd, and ostree.
This should fix BZ #1454656.
Closes: #1014
Approved by: baude
test_storage.sh is erroring on centos_atomic with the following:
error: /dev/vdb: probing initialization failed: Device or resource
busy
A few quick attempts to fix it were made, but ended up failing.
Disabling (by appending an underscore) the test until it can be
investigate further.
Closes: #1007
Approved by: baude
Ideally atomic will be able to run multiple container
runtimes. In and effort to do so, we must have a concept
of a global registries configuration file which will allow
us to pull images with atomic and skopeo. The tooling
that parses the global configuration file is:
https://github.com/projectatomic/registries
This is step one in the implementation of this tooling
and direction.
Closes: #1003
Approved by: rhatdan